@forsion/unit 2.12.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +223 -0
- package/README.md +101 -0
- package/backendWorker.mjs +273 -0
- package/main.mjs +3434 -0
- package/package.json +26 -0
- package/release.json +11 -0
- package/web/assets/ArtificialView-B4ESD4iK.js +1 -0
- package/web/assets/AutomationBuilder-sxWdUa0L.js +1 -0
- package/web/assets/CalendarConfigView-cCfo_EvZ.js +1 -0
- package/web/assets/CalendarView-wgLapctk.js +1 -0
- package/web/assets/CapabilityMenu-BQBsM638.js +1 -0
- package/web/assets/CapabilityMenu-CTIzmTJB.css +1 -0
- package/web/assets/ChatView-BIUk0OJd.css +1 -0
- package/web/assets/ChatView-C-jCJnyS.js +47 -0
- package/web/assets/CheckboxInput-BsaoUHZ0.js +1 -0
- package/web/assets/Chrome-CwFiDmre.js +1 -0
- package/web/assets/CodeView-j065KtVh.js +15 -0
- package/web/assets/DancingScript-Bold-latin-CWNX0RqN.woff2 +0 -0
- package/web/assets/DashboardGridView-Ck3LKkOb.css +1 -0
- package/web/assets/DashboardGridView-DXqe0vPd.js +17 -0
- package/web/assets/EventCard-BmDQkEj9.js +1 -0
- package/web/assets/ExcalidrawCanvas-4uYrLYin.css +1 -0
- package/web/assets/ExcalidrawCanvas-C3egkikA.js +1 -0
- package/web/assets/FloatingToc-CENybkAA.js +1 -0
- package/web/assets/HomepageView-BNabJQfP.css +1 -0
- package/web/assets/HomepageView-CRdhjLXu.js +1 -0
- package/web/assets/ImageStudioPanels-Dke7xf8E.js +3 -0
- package/web/assets/ImageStudioView-g38V8gaj.js +1 -0
- package/web/assets/InlineFiles-C_hjvn3u.js +1 -0
- package/web/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
- package/web/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
- package/web/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
- package/web/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
- package/web/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
- package/web/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
- package/web/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
- package/web/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
- package/web/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
- package/web/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
- package/web/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
- package/web/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
- package/web/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
- package/web/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
- package/web/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
- package/web/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
- package/web/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
- package/web/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
- package/web/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
- package/web/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
- package/web/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
- package/web/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
- package/web/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
- package/web/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
- package/web/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
- package/web/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
- package/web/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
- package/web/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
- package/web/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
- package/web/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
- package/web/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
- package/web/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
- package/web/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
- package/web/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
- package/web/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
- package/web/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
- package/web/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
- package/web/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
- package/web/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
- package/web/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
- package/web/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
- package/web/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
- package/web/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
- package/web/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
- package/web/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
- package/web/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
- package/web/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
- package/web/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
- package/web/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
- package/web/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
- package/web/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
- package/web/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
- package/web/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
- package/web/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
- package/web/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
- package/web/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
- package/web/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
- package/web/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
- package/web/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
- package/web/assets/MarkdownBlock-DIjYEhTK.js +56 -0
- package/web/assets/ModelPill-BPlgovPo.js +1 -0
- package/web/assets/ModelPill-CzdNh7Mt.css +1 -0
- package/web/assets/MuseLibraryView-CenyTTim.js +2 -0
- package/web/assets/MuseView-d-iBk3sc.js +6 -0
- package/web/assets/PageHistoryPanel-CR-k1AM7.js +2 -0
- package/web/assets/PageHistoryPanel-DFjh0pWs.css +1 -0
- package/web/assets/PdfAnnotator-CGzC_o1Q.css +1 -0
- package/web/assets/PdfAnnotator-D79ip27w.js +560 -0
- package/web/assets/ProductView-u2aezVsl.js +1 -0
- package/web/assets/RightPanel-C3OJTIqT.js +4 -0
- package/web/assets/RunLocationPicker-BNcZ7KKF.css +1 -0
- package/web/assets/RunLocationPicker-CTYXUH2z.js +34 -0
- package/web/assets/SidebarRow-BuSkKH5q.js +9 -0
- package/web/assets/SidebarRow-CsWEqPKX.css +1 -0
- package/web/assets/SketchCard-D87GADyG.js +437 -0
- package/web/assets/StudioGuestSurface-BijU_EEb.js +1 -0
- package/web/assets/TodoListView-DPPVpPUn.js +1 -0
- package/web/assets/Tooltip-DY4ISA-e.js +1 -0
- package/web/assets/UnifiedPage-CKNtVD_n.js +57 -0
- package/web/assets/UnifiedPage-DX_sTpyZ.css +1 -0
- package/web/assets/amadeus-manual.en-DWaN2fPs.js +3515 -0
- package/web/assets/amadeus-manual.zh--7D5TS8X.js +3515 -0
- package/web/assets/apl-B4CMkyY2.js +1 -0
- package/web/assets/appStore-Dg9WALEA.js +3080 -0
- package/web/assets/appStore-Di8LXuJ9.css +1 -0
- package/web/assets/approvalText-Cy2UAUAQ.js +2 -0
- package/web/assets/arrow-up-right-CpQs92mu.js +1 -0
- package/web/assets/artificial-BzLFkChP.css +1 -0
- package/web/assets/asciiarmor-Df11BRmG.js +1 -0
- package/web/assets/asn1-EdZsLKOL.js +1 -0
- package/web/assets/asterisk-B-8jnY81.js +1 -0
- package/web/assets/astryxBridge-BZhaZPs4.js +70 -0
- package/web/assets/astryxBridge-CF_hpqC2.css +1 -0
- package/web/assets/automationListSource-DP5xZBxo.js +1 -0
- package/web/assets/brainfuck-C4LP7Hcl.js +1 -0
- package/web/assets/calendarNavStore-C7fGRpoH.js +1 -0
- package/web/assets/canvasPrefs-BeG4oEgP.js +1 -0
- package/web/assets/chatBoxSurface-zvcyfrxE.js +1 -0
- package/web/assets/circle-question-mark-WL3vbp-Z.js +1 -0
- package/web/assets/circle-x-D7s-M5sB.js +1 -0
- package/web/assets/client-BSKpsyAw.js +9 -0
- package/web/assets/clike-B9uivgTg.js +1 -0
- package/web/assets/clojure-BMjYHr_A.js +1 -0
- package/web/assets/cmake-BQqOBYOt.js +1 -0
- package/web/assets/cobol-CWcv1MsR.js +1 -0
- package/web/assets/code-xml-BALV9u_c.js +1 -0
- package/web/assets/codeStudioStore-C2mWfm32.js +22 -0
- package/web/assets/coffeescript-S37ZYGWr.js +1 -0
- package/web/assets/commonlisp-DBKNyK5s.js +1 -0
- package/web/assets/create-4xUyKtAF.js +14 -0
- package/web/assets/create-BgE3edmZ.css +1 -0
- package/web/assets/crystal-SjHAIU92.js +1 -0
- package/web/assets/css-BnMrqG3P.js +1 -0
- package/web/assets/cursor-editorTextHighlight-kG3uUOwL.svg +8 -0
- package/web/assets/cypher-C_CwsFkJ.js +1 -0
- package/web/assets/d-pRatUO7H.js +1 -0
- package/web/assets/dashboardSurface-CFTH5z4c.js +1 -0
- package/web/assets/deskCapture-Df701U8L.js +1 -0
- package/web/assets/diff-DbItnlRl.js +1 -0
- package/web/assets/diff2html-BV-zCH4d.js +111 -0
- package/web/assets/dockerfile-BKs6k2Af.js +1 -0
- package/web/assets/docx-preview-DW4IyU_Q.js +22 -0
- package/web/assets/dtd-DF_7sFjM.js +1 -0
- package/web/assets/dylan-DwRh75JA.js +1 -0
- package/web/assets/ebnf-CDyGwa7X.js +1 -0
- package/web/assets/ecl-Cabwm37j.js +1 -0
- package/web/assets/eiffel-CnydiIhH.js +1 -0
- package/web/assets/ellipsis-r1EcXsFq.js +1 -0
- package/web/assets/elm-vLlmbW-K.js +1 -0
- package/web/assets/emoji-DGaxpCIu.js +1 -0
- package/web/assets/erlang-BNw1qcRV.js +1 -0
- package/web/assets/factor-kuTfRLto.js +1 -0
- package/web/assets/fcl-Kvtd6kyn.js +1 -0
- package/web/assets/floatingTocSurface-C6RJ6i41.js +1 -0
- package/web/assets/foldActions-B7KByFdN.js +1 -0
- package/web/assets/folder-DlxnPmWY.js +1 -0
- package/web/assets/folder-plus-D1TDb7k9.js +1 -0
- package/web/assets/forsion-logo-dark-DnB9JTdv.svg +5 -0
- package/web/assets/forsion-logo-light-DhkEeB4V.svg +11 -0
- package/web/assets/forth-Ffai-XNe.js +1 -0
- package/web/assets/fortran-DYz_wnZ1.js +1 -0
- package/web/assets/frame-_xBVYe3P.js +1 -0
- package/web/assets/gas-Bneqetm1.js +1 -0
- package/web/assets/gestures-CkW1Kfs9.js +1 -0
- package/web/assets/gherkin-heZmZLOM.js +1 -0
- package/web/assets/groovy-D9Dt4D0W.js +1 -0
- package/web/assets/hack2gate-dark-Dx2RtDRI.jpg +0 -0
- package/web/assets/hack2gate-light-DRKq9tyS.jpg +0 -0
- package/web/assets/hand-Crrw-nSn.js +1 -0
- package/web/assets/hard-drive-BbyVSbfP.js +1 -0
- package/web/assets/haskell-Cw1EW3IL.js +1 -0
- package/web/assets/haxe-H-WmDvRZ.js +1 -0
- package/web/assets/http-DBlCnlav.js +1 -0
- package/web/assets/i18n-D-eU58uw.css +1 -0
- package/web/assets/i18n.generated-Bbsz16cl.js +15 -0
- package/web/assets/idl-BEugSyMb.js +1 -0
- package/web/assets/imageStudio-BqbNOvpu.css +1 -0
- package/web/assets/imageStudio-C_Rs630L.js +2 -0
- package/web/assets/index--drOLtq7.js +1 -0
- package/web/assets/index-BCZZVJ_w.js +1 -0
- package/web/assets/index-BCubCwdT.js +1 -0
- package/web/assets/index-BRW82CsP.js +6 -0
- package/web/assets/index-BYsdKR_1.js +1 -0
- package/web/assets/index-Brik2pf9.js +1 -0
- package/web/assets/index-C6GJulug.js +13 -0
- package/web/assets/index-C7U6T-k8.js +1 -0
- package/web/assets/index-CF4RV4mh.js +298 -0
- package/web/assets/index-CflzrdSt.js +1 -0
- package/web/assets/index-Cmr7gVZQ.js +1 -0
- package/web/assets/index-CqyM6tQ0.js +1 -0
- package/web/assets/index-CzM-C2Sd.js +1 -0
- package/web/assets/index-Czu_bbDM.js +1 -0
- package/web/assets/index-D1f_JwPH.js +1 -0
- package/web/assets/index-DKhyDkGB.js +7 -0
- package/web/assets/index-DUWR2nZi.js +1 -0
- package/web/assets/index-DZfZTksa.js +1 -0
- package/web/assets/index-Dg9oixs4.js +1 -0
- package/web/assets/index-DjzSBM0U.js +2 -0
- package/web/assets/index-KL5Rj9kP.js +1 -0
- package/web/assets/index-OHi69jDq.js +3 -0
- package/web/assets/index-SZ5waGAq.js +1 -0
- package/web/assets/index-gPSbFSUn.js +1 -0
- package/web/assets/index-tAXBa_fN.js +1 -0
- package/web/assets/invitePage-lLQ-e0pj.js +19 -0
- package/web/assets/ipc-DQOD2UKk.js +1 -0
- package/web/assets/javascript-iXu5QeM3.js +1 -0
- package/web/assets/jszip.min-DZxV9uZ_.js +2 -0
- package/web/assets/julia-DuME0IfC.js +1 -0
- package/web/assets/layout-grid-B_pjJwz4.js +1 -0
- package/web/assets/linkFollow-C0_3k_PC.js +8 -0
- package/web/assets/list-tree-DkAJYEXd.js +1 -0
- package/web/assets/listFold-BsOVn9UZ.js +1 -0
- package/web/assets/livescript-BwQOo05w.js +1 -0
- package/web/assets/lock-BnGHxjeE.js +1 -0
- package/web/assets/log-out-DBuMeqik.js +1 -0
- package/web/assets/lua-VAEuO923.js +1 -0
- package/web/assets/main-Dki8NlsT.js +21 -0
- package/web/assets/main-NgUPPqDn.css +1 -0
- package/web/assets/markdownEditorSurface-B4PeUzed.js +3 -0
- package/web/assets/markdownEditorSurface-Bql20IAf.css +1 -0
- package/web/assets/mathematica-DTrFuWx2.js +1 -0
- package/web/assets/mbox-CNhZ1qSd.js +1 -0
- package/web/assets/mdMarkStore-CsKl7C8O.js +2 -0
- package/web/assets/mdMarks-Bq7Hl-4C.js +1 -0
- package/web/assets/message-square-plus-BiAZAvcw.js +1 -0
- package/web/assets/messages-BH5MfQdZ.js +1 -0
- package/web/assets/minus-Cyv1YzOU.js +1 -0
- package/web/assets/mirc-CjQqDB4T.js +1 -0
- package/web/assets/mllike-CXdrOF99.js +1 -0
- package/web/assets/mobileEntry-Bd_nKr0D.js +13 -0
- package/web/assets/mobileEntry-DS1vohuL.css +1 -0
- package/web/assets/modelica-Dc1JOy9r.js +1 -0
- package/web/assets/mscgen-BA5vi2Kp.js +1 -0
- package/web/assets/mumps-BT43cFF4.js +1 -0
- package/web/assets/nativeDownload-D-f1_L2S.js +1 -0
- package/web/assets/nginx-DdIZxoE0.js +1 -0
- package/web/assets/nsis-LdVXkNf5.js +1 -0
- package/web/assets/ntriples-BfvgReVJ.js +1 -0
- package/web/assets/octave-Ck1zUtKM.js +1 -0
- package/web/assets/oz-BzwKVEFT.js +1 -0
- package/web/assets/pageChrome-C9_azUYW.js +1 -0
- package/web/assets/pageChrome-xLNdFaSg.css +1 -0
- package/web/assets/pageTree-CZH2J6cc.js +7 -0
- package/web/assets/panel-left-rOc8As0s.js +1 -0
- package/web/assets/pascal--L3eBynH.js +1 -0
- package/web/assets/pdf-C2_sJa3b.js +57 -0
- package/web/assets/pdf.worker.min-CGb3BKV9.js +1 -0
- package/web/assets/pdf.worker.min-Dr1KORA9.mjs +31 -0
- package/web/assets/pen-line-m6_HvWZ9.js +1 -0
- package/web/assets/pen-tool-lkmBqliH.js +1 -0
- package/web/assets/pencil-Cvk91P_Z.js +1 -0
- package/web/assets/perl-CdXCOZ3F.js +1 -0
- package/web/assets/pig-CevX1Tat.js +1 -0
- package/web/assets/pluginExt-Byb64tQO.js +1 -0
- package/web/assets/powershell-CFHJl5sT.js +1 -0
- package/web/assets/properties-C78fOPTZ.js +1 -0
- package/web/assets/protobuf-ChK-085T.js +1 -0
- package/web/assets/pug-DeIclll2.js +1 -0
- package/web/assets/puppet-DMA9R1ak.js +1 -0
- package/web/assets/python-BuPzkPfP.js +1 -0
- package/web/assets/q-pXgVlZs6.js +1 -0
- package/web/assets/r-B6wPVr8A.js +1 -0
- package/web/assets/redo-2-DSi54z4e.js +1 -0
- package/web/assets/rotate-ccw-CUlnplr0.js +1 -0
- package/web/assets/rpm-CTu-6PCP.js +1 -0
- package/web/assets/ruby-B2Rjki9n.js +1 -0
- package/web/assets/sas-B4kiWyti.js +1 -0
- package/web/assets/scheme-C41bIUwD.js +1 -0
- package/web/assets/sharePage-MM6UpPJ9.js +2 -0
- package/web/assets/shareViewer-CDZ8lTdy.js +345 -0
- package/web/assets/shareViewer-DLVrwanO.css +1 -0
- package/web/assets/shell-CjFT_Tl9.js +1 -0
- package/web/assets/sieve-C3Gn_uJK.js +1 -0
- package/web/assets/simple-mode-GW_nhZxv.js +1 -0
- package/web/assets/smalltalk-CnHTOXQT.js +1 -0
- package/web/assets/solr-DehyRSwq.js +1 -0
- package/web/assets/sparql-DkYu6x3z.js +1 -0
- package/web/assets/spreadsheet-BCZA_wO0.js +1 -0
- package/web/assets/sql-D0XecflT.js +1 -0
- package/web/assets/star-CwDiGyUW.js +1 -0
- package/web/assets/stex-C3f8Ysf7.js +1 -0
- package/web/assets/sticky-note-BIuPUSOU.js +1 -0
- package/web/assets/stylus-B533Al4x.js +1 -0
- package/web/assets/swift-BzpIVaGY.js +1 -0
- package/web/assets/tableSurface-CDNa0QFp.css +1 -0
- package/web/assets/tableSurface-Y_JBQsuz.js +1 -0
- package/web/assets/tcl-DVfN8rqt.js +1 -0
- package/web/assets/terminal-DIXogYJY.js +1 -0
- package/web/assets/terminalView-B3aZSsrQ.js +12 -0
- package/web/assets/terminalView-DFuMZ0ql.css +1 -0
- package/web/assets/textile-CnDTJFAw.js +1 -0
- package/web/assets/theme-DfEi_DND.css +1 -0
- package/web/assets/theme-OMpAfNto.css +1 -0
- package/web/assets/tiddlywiki-DO-Gjzrf.js +1 -0
- package/web/assets/tiki-DGYXhP31.js +1 -0
- package/web/assets/toml-Bm5Em-hy.js +1 -0
- package/web/assets/troff-wAsdV37c.js +1 -0
- package/web/assets/ttcn-CfJYG6tj.js +1 -0
- package/web/assets/ttcn-cfg-B9xdYoR4.js +1 -0
- package/web/assets/turtle-B1tBg_DP.js +1 -0
- package/web/assets/type-Cqoabh7H.js +1 -0
- package/web/assets/undo-2-tUKCv5Gs.js +1 -0
- package/web/assets/unitAccount-D8lVwaaT.js +1 -0
- package/web/assets/unitBridge-D547ublk.js +1 -0
- package/web/assets/unitCloudTransport-BVF6lVp4.js +1 -0
- package/web/assets/unitOwnerAccess-BfnEjsZb.js +1 -0
- package/web/assets/unitShim-DxetRgmP.js +5 -0
- package/web/assets/upload-BbeAsMuD.js +1 -0
- package/web/assets/userSpaces-DyyAn7vj.js +1 -0
- package/web/assets/vb-CmGdzxic.js +1 -0
- package/web/assets/vbscript-BuJXcnF6.js +1 -0
- package/web/assets/velocity-D8B20fx6.js +1 -0
- package/web/assets/verilog-C6RDOZhf.js +1 -0
- package/web/assets/vhdl-lSbBsy5d.js +1 -0
- package/web/assets/viewportLock-C4SX-9PO.js +103 -0
- package/web/assets/viewportLock-DYSe7Jsn.css +1 -0
- package/web/assets/waves-horizontal-B8ZpHQ5H.js +1 -0
- package/web/assets/webidl-ZXfAyPTL.js +1 -0
- package/web/assets/workflow-DuoVRSSX.js +1 -0
- package/web/assets/xlsx-CNerDvZX.js +105 -0
- package/web/assets/xquery-DzFWVndE.js +1 -0
- package/web/assets/yacas-BJ4BC0dw.js +1 -0
- package/web/assets/z80-Hz9HOZM7.js +1 -0
- package/web/assets/zoom-in-hr5bRpDL.js +1 -0
- package/web/excalidraw/excalidraw.css +1 -0
- package/web/excalidraw/excalidraw.js +579 -0
- package/web/excalidraw/fonts/Assistant/Assistant-Bold.woff2 +0 -0
- package/web/excalidraw/fonts/Assistant/Assistant-Medium.woff2 +0 -0
- package/web/excalidraw/fonts/Assistant/Assistant-Regular.woff2 +0 -0
- package/web/excalidraw/fonts/Assistant/Assistant-SemiBold.woff2 +0 -0
- package/web/excalidraw/fonts/Cascadia/CascadiaCode-Regular.woff2 +0 -0
- package/web/excalidraw/fonts/ComicShanns/ComicShanns-Regular-279a7b317d12eb88de06167bd672b4b4.woff2 +0 -0
- package/web/excalidraw/fonts/ComicShanns/ComicShanns-Regular-6e066e8de2ac57ea9283adb9c24d7f0c.woff2 +0 -0
- package/web/excalidraw/fonts/ComicShanns/ComicShanns-Regular-dc6a8806fa96795d7b3be5026f989a17.woff2 +0 -0
- package/web/excalidraw/fonts/ComicShanns/ComicShanns-Regular-fcb0fc02dcbee4c9846b3e2508668039.woff2 +0 -0
- package/web/excalidraw/fonts/Excalifont/Excalifont-Regular-349fac6ca4700ffec595a7150a0d1e1d.woff2 +0 -0
- package/web/excalidraw/fonts/Excalifont/Excalifont-Regular-3f2c5db56cc93c5a6873b1361d730c16.woff2 +0 -0
- package/web/excalidraw/fonts/Excalifont/Excalifont-Regular-41b173a47b57366892116a575a43e2b6.woff2 +0 -0
- package/web/excalidraw/fonts/Excalifont/Excalifont-Regular-623ccf21b21ef6b3a0d87738f77eb071.woff2 +0 -0
- package/web/excalidraw/fonts/Excalifont/Excalifont-Regular-a88b72a24fb54c9f94e3b5fdaa7481c9.woff2 +0 -0
- package/web/excalidraw/fonts/Excalifont/Excalifont-Regular-b9dcf9d2e50a1eaf42fc664b50a3fd0d.woff2 +0 -0
- package/web/excalidraw/fonts/Excalifont/Excalifont-Regular-be310b9bcd4f1a43f571c46df7809174.woff2 +0 -0
- package/web/excalidraw/fonts/Liberation/LiberationSans-Regular.woff2 +0 -0
- package/web/excalidraw/fonts/Lilita/Lilita-Regular-i7dPIFZ9Zz-WBtRtedDbYE98RXi4EwSsbg.woff2 +0 -0
- package/web/excalidraw/fonts/Lilita/Lilita-Regular-i7dPIFZ9Zz-WBtRtedDbYEF8RXi4EwQ.woff2 +0 -0
- package/web/excalidraw/fonts/Nunito/Nunito-Regular-XRXI3I6Li01BKofiOc5wtlZ2di8HDIkhdTA3j6zbXWjgevT5.woff2 +0 -0
- package/web/excalidraw/fonts/Nunito/Nunito-Regular-XRXI3I6Li01BKofiOc5wtlZ2di8HDIkhdTQ3j6zbXWjgeg.woff2 +0 -0
- package/web/excalidraw/fonts/Nunito/Nunito-Regular-XRXI3I6Li01BKofiOc5wtlZ2di8HDIkhdTk3j6zbXWjgevT5.woff2 +0 -0
- package/web/excalidraw/fonts/Nunito/Nunito-Regular-XRXI3I6Li01BKofiOc5wtlZ2di8HDIkhdTo3j6zbXWjgevT5.woff2 +0 -0
- package/web/excalidraw/fonts/Nunito/Nunito-Regular-XRXI3I6Li01BKofiOc5wtlZ2di8HDIkhdTs3j6zbXWjgevT5.woff2 +0 -0
- package/web/excalidraw/fonts/Virgil/Virgil-Regular.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-019d66dcad46dc156b162d267f981c20.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-04b718e5623574919c8b0dea5f301444.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-069e77aac84590e2e991d0a0176d34f2.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-06c77b8c66e51ed6c63ccb502dd8b8af.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-08e0dc436ad0ad61ba5558db0674d762.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-093b9ef39a46ceae95a1df18a0a3a326.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-095c169f3314805276f603a362766abd.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-09850c4077f3fffe707905872e0e2460.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-0986d134c05864f5025962eef9f994a0.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-0b5d723fdc4e249c140f0909e87d03b4.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-0f626226ba1272e832aea87bafd9720e.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-0f7fb1e0d5015bb1371343153ecf7ce3.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-0fa55a080fcd0f9dc2e0b0058b793df8.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-0facdf1ea213ba40261022f5d5ed4493.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-10a7ae9a371830a80c3d844acf1c02d7.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-112c051027b2d766c19a519f6ee1f4f7.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-11c345711937f0ba4b8f7b6b919c8440.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-12b52b58eb3df36804b9a654ec9ee194.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-13ae07ed2e272d26d59bc0691cd7117a.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-13d2887ec8ee73c43acdabc52a05af7b.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-145aa02cdd91946e67dc934e1acffe75.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-15dc6d811c9cd078f9086a740d5a1038.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-173945821411c09f70c95f98d590e697.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-1b611157cd46bb184d4fa4dae2d6a2b8.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-1e6fd68f1f3902ce48ce8c69df385622.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-1ee544f0f1dac422545c505baa788992.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-1fdc0c67ed57263a80fd108c1f6ccf24.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-203b0e569e3b14aac86a003dc3fa523e.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-20cc1bbf50e7efb442756cb605672c1f.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-20e7bf72fa05de9adf7dbcc7bf51dde6.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-21430ee05a1248901da8d0de08744d47.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-23686f7f29da6e8008c36dd3a80c83d6.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-23ad2d71b280f00b1363b95b7bea94eb.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-23f228f3999c01983860012330e4be08.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-24476a126f129212beb33f66853ea151.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-24a21c1e4449222e8d1898d69ff3a404.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-25b7f38e18f035f96cb5e547bd2bd08c.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-29cec36cd205b211da97acabaa62f055.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-2a26d20a23b00898ce82f09d2ee47c3f.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-2adbc89c11e65905393d3dfc468b9d5b.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-2b7441d46298788ac94e610ffcc709b6.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-2b77e8ebfb2367ab2662396a60e7d320.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-2cf96d082d35ea3d8106851223ad0d16.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-2d43040e86ff03ba677f6f9c04cd0805.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-2e33e8dc771ef5e1d9127d60a6b73679.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-33432927cd87d40cfe393c7482bf221f.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-353f33792a8f60dc69323ddf635a269e.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-36925dfe329a45086cbb7fc5c20d45ac.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-3717077e38f98d89eae729b6c14e56dc.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-3756e81d3e149cf6099163ee79944fec.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-395c35dd584b56b0789f58a0559beaf1.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-3c9de2ae0ea4bc91a510942dfa4be8d2.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-3cc70dbb64df5b21f1326cc24dee2195.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-3e1f8f654357353bf0e04ba5c34b5f7f.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-3e63ed8162808a9e425ed80a8bc79114.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-3eaa538115d76932653c21d8dc28f207.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-4095eb84ef3874e2600247bee0b04026.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-41521fade99856108931b4768b1b2648.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-450da755d5bcb70906e1295e559b9602.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-452225341522a7942f0f6aab1a5c91a3.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-4535823663ad81405188a528d8f2b1a2.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-4806e761d750087c2d734fc64596eaff.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-4a0fdb40036e87b40aa08dd30584cb85.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-4a38cc3e9cf104e69ba246d37f8cf135.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-4aca6a43e59aceee2166b0c7e4e85ef1.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-4bfaa8ffa64c5ee560aa2daba7c9cbd3.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-4dc6d5f188d5c96d44815cd1e81aa885.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-4ddc14ed3eb0c3e46364317dfc0144a3.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-4ee10ae43505e2e0bc62656ced49c0fa.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-4f50e5136e136527280bc902c5817561.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-51502f1206be09c565f1547c406e9558.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-51a0e808bbc8361236ac521a119758a3.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-52a84a22fd1369bffeaf21da2d6158dc.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-5330a2119a716e4e7224ed108b085dac.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-543fa46ace099a7099dad69123399400.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-544fc28abe2c5c30e62383fd4dac255f.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-54acdfc2166ad7fcbd074f75fd4a56ba.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-5572b3513ba8df57a3d5d7303ee6b11b.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-56467a5c8840c4d23a60b2f935114848.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-56a32a7689abd0326e57c10c6c069bb4.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-57862b464a55b18c7bf234ce22907d73.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-583d166e56ba0de4b77eabb47ef67839.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-5882ffa04f32584d26109137e2da4352.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-58fd02350d0bc52cf1ca3bb32ce9766e.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-5935a5775af3d5c6307ac667bd9ae74e.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-59e9ff77b0efaf684bc09274fb6908c9.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-5a1ce3117cfe90c48e8fb4a9a00f694d.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-5a45d991244d4c7140217e1e5f5ca4f4.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-5a7fac4b8b23a6e4e5ba0c9bf1756c91.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-5b0ed6971aaab9c8ad563230bd5471a7.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-5d2898fbc097a7e24c6f38d80587621e.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-603aefd23e350ba7eb124273e3c9bcf1.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-60a3089806700d379f11827ee9843b6b.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-60a41c7e1c68f22424e6d22df544bc82.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-642b26e2e5f5fb780b51b593dbc8c851.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-66493ba5a8367f2928812f446f47b56a.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-670ba603758d94268e8606f240a42e12.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-671a2c20b1eb9e4ef8a192833940e319.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-684d65f1793cac449dde5d59cb3c47fb.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-69c09cc5fa3e55c74fc4821f76909cc3.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-6ae5b42180ad70b971c91e7eefb8eba2.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-6e092f71c1e634059ada0e52abadce67.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-6f3256af8454371776bc46670d33cc65.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-6fe5c5973cc06f74b2387a631ea36b88.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-70c2eb8d64e71a42a834eb857ea9df51.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-70e811fd7994e61f408c923de6ddd078.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-7197d6fda6cba7c3874c53d6381ca239.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-72252d73220fa3cd856677888cee1635.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-72536a3d71b694a0d53dd90ddceae41e.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-726303e0774b4e678bff8c2deb6ca603.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-733171b4ffcd17ea1fe1c0ba627173bf.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-739bc1a567439c7cffcd1614644593d2.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-73e309718fd16cea44b4d54a33581811.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-7494dc504ae00ee9cd0505f990f88c5d.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-74e2263a91439c25b91d5132ce9f4d62.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-761d05e3cd968cf574166867998ef06a.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-7718fe60986d8b42b1be9c5ace5ccf25.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-774d4f764a1299da5d28ec2f2ffe0d69.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-79d494361ae093b69e74ee9dbe65bfd4.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-79f007c1c6d07557120982951ea67998.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-7a07ddc0f0c0f5f4a9bad6ee3dda66b5.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-7ab2bed91166a9dca83a5ebfbe2a7f38.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-7ccce86603f80a099ddb0cb21d4ae3e3.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-7e4bde7e9c7f84cd34d8a845e384c746.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-7e929f262f30c8ee78bf398150b1a7cd.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-7eb9fffd1aa890d07d0f88cc82e6cfe4.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-7f855356ab893b0d2b9c1c83b8116f0e.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-829615148e6357d826b9242eb7fbbd1e.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-866fa7613df6b3fd272bcfd4530c0bb9.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-87599f94b6cc129d505b375798d0d751.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-8c2f33cee3993174f7e87c28e4bf42ee.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-8d3bcabb847b56243b16afe62adaaf21.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-8de5b863cb50dfefdd07cb11c774d579.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-8e9f97f01034820170065b2921b4fb5e.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-8f476c4c99813d57cbe6eca4727388ad.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-903bb6865f3452e2fda42e3a25547bc5.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-91ddb2969bf2d31ba02ad82998d1314c.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-938d90c10ff8c20386af7f242c05d6b0.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-93fc8f28a33234bcadf1527cafabd502.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-95429962233afd82db1c27df1500a28c.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-9544732d2e62d1a429674f8ee41b5d3a.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-9592bfc861f07bcb8d75c196b370e548.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-95bfd249da4902577b4b7d76ebdd0b44.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-968cffdc8ee679da094e77ebf50f58ef.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-97f7f48ce90c9429bf32ae51469db74d.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-982b630266d87db93d2539affb1275c6.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-98f2ad84457de7f3740d9920b8fa8667.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-99a16ef6a64934d5781933dbd9c46b2e.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-9cfb2a77a4e45025105ad29a1748b90d.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-9d81066dd2b337c938df6e90380a00dc.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-9eb5a99df4e76ac3363453ac9ca288b1.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-a004ddfcb26e67bd6e678c8ed19e25ce.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-a0ca5df4258213d7fc9fce80f65ce760.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-a1f916d6039285c4ffb900cd654e418f.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-a203b91dad570bf05a58c3c3ddb529bf.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-a365e82ed54697a52f27adcea1315fe8.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-a4c34be6d42152e64b0df90bc4607f64.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-a7accba310e821da5505f71c03b76bdb.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-aa0d470430e6391eca720c7cfa44446f.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-aa5c9ca6cf4fba00433b7aa3fa10671a.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-ac9ceb44437becc3e9c4dbfebab7fc2d.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-b1220a3c61f85cc0408deedb4c5f57a2.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-b358f7a51ece39a3247942b1feabdb29.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-b57aaedfd8ebdf3931f25119dc6a5eb2.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-b5c1596551c256e0e9cf02028595b092.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-b6d128682ee29e471486354d486a1b90.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-b6fd38ca30869792244804b04bc058da.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-b7d203b051eff504ff59ddca7576b6a9.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-b96d9226ce77ec94ceca043d712182e6.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-ba3de316d63c7e339987b16f41a0b879.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-bafff7a14c27403dcc6cf1432e8ea836.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-bd77e3c7f9e0b072d96af37f73d1aa32.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-be549ab72f0719d606a5c01e2c0219b6.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-c16ed9740b85badf16e86ea782a3062f.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-c1f94158256bb1f3bf665b053d895af9.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-c40533fdf4cc57177b12803598af7e59.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-c4a687ac4f0c2766eefc9f77ed99cddf.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-c69f61a4ab18d0488c8d1fc12e7028e8.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-c8b71798409ccc126ee264a00aadcf21.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-c99eda15fc26a2941579560f76c3a5cf.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-cb17fc3db95f6d139afc9d31a8e93293.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-cbaaefaaf326668277aa24dfa93c4d28.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-cd145ce4a0ea18469358df53c207bc1b.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-cdbce89e82cc1ab53a2decbf5819278f.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-ce4884f96f11589608b76b726a755803.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-cf2cc71752631e579e35b0e423bf2638.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-cf6ff4e0f491ca0cf3038187a997b9b4.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-cfb211578629b7e8153b37240de6a9d5.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-d0cf73942fea1c74edbdf0b3011f4656.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-d2666cbed13462c5dc36fa2f15c202ca.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-d3716376641d615e2995605b29bca7b6.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-dac48066b5883d8b4551fc584f0c2a3e.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-dbea1af6dcd9860be40c3d18254338f5.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-e11567fd2accf9957cd0d3c2be937d87.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-e2ead7ea7da0437f085f42ffc05f8d13.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-e3fcf5180fd466c8915c4e8069491054.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-e480d9c614742d05f0e78f274f1e69e6.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-e4bca6cfa53e499cae0a6be4894a90e9.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-e51ef413167c6e14e0c0fdcc585f2fc9.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-e5f453bb04da18eed01675eeebd88bf8.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-e656f091b9dc4709722c9f4b84d3c797.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-ec181b795ac1fb5a50d700b6e996d745.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-ee8bae97908d5147b423f77ad0d3c1bb.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-f0f13b5c60e0af5553bd359f5513be1b.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-f2b54d4e7be0eaefe1c2c56836fa5368.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-f56414bf9bced67990def8660e306759.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-f5d079153c99a25b9be5b8583c4cc8a7.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-f6032fc06eb20480f096199713f70885.woff2 +0 -0
- package/web/excalidraw/fonts/Xiaolai/Xiaolai-Regular-f8ee5d36068a42b51d0e4a1116cfcec1.woff2 +0 -0
- package/web/fonts/LICENSE-_fontsource-variable_inter.txt +93 -0
- package/web/fonts/LICENSE-_fontsource-variable_jetbrains-mono.txt +93 -0
- package/web/fonts/LICENSE-_fontsource_lxgw-wenkai.txt +94 -0
- package/web/fonts/LICENSE-_fontsource_noto-sans-sc.txt +93 -0
- package/web/fonts/files/inter-cyrillic-ext-wght-normal.woff2 +0 -0
- package/web/fonts/files/inter-cyrillic-wght-normal.woff2 +0 -0
- package/web/fonts/files/inter-greek-ext-wght-normal.woff2 +0 -0
- package/web/fonts/files/inter-greek-wght-normal.woff2 +0 -0
- package/web/fonts/files/inter-latin-ext-wght-normal.woff2 +0 -0
- package/web/fonts/files/inter-latin-wght-normal.woff2 +0 -0
- package/web/fonts/files/inter-vietnamese-wght-normal.woff2 +0 -0
- package/web/fonts/files/jetbrains-mono-cyrillic-ext-wght-normal.woff2 +0 -0
- package/web/fonts/files/jetbrains-mono-cyrillic-wght-normal.woff2 +0 -0
- package/web/fonts/files/jetbrains-mono-greek-wght-normal.woff2 +0 -0
- package/web/fonts/files/jetbrains-mono-latin-ext-wght-normal.woff2 +0 -0
- package/web/fonts/files/jetbrains-mono-latin-wght-normal.woff2 +0 -0
- package/web/fonts/files/jetbrains-mono-vietnamese-wght-normal.woff2 +0 -0
- package/web/fonts/files/lxgw-wenkai-latin-500-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-100-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-100-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-101-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-101-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-102-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-102-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-103-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-103-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-104-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-104-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-105-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-105-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-106-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-106-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-107-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-107-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-108-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-108-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-109-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-109-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-110-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-110-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-111-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-111-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-112-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-112-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-113-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-113-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-114-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-114-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-115-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-115-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-116-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-116-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-117-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-117-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-118-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-118-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-119-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-119-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-21-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-21-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-22-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-22-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-23-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-23-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-24-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-24-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-25-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-25-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-26-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-26-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-27-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-27-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-28-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-28-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-29-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-29-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-30-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-30-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-31-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-31-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-32-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-32-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-33-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-33-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-34-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-34-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-35-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-35-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-36-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-36-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-37-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-37-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-38-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-38-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-39-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-39-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-4-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-4-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-40-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-40-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-41-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-41-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-42-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-42-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-43-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-43-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-44-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-44-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-45-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-45-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-46-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-46-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-47-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-47-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-48-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-48-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-49-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-49-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-5-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-5-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-50-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-50-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-51-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-51-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-52-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-52-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-53-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-53-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-54-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-54-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-55-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-55-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-56-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-56-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-57-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-57-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-58-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-58-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-59-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-59-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-6-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-6-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-60-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-60-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-61-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-61-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-62-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-62-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-63-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-63-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-64-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-64-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-65-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-65-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-66-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-66-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-67-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-67-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-68-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-68-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-69-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-69-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-70-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-70-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-71-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-71-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-72-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-72-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-73-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-73-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-74-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-74-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-75-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-75-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-76-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-76-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-77-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-77-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-78-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-78-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-79-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-79-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-80-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-80-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-81-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-81-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-82-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-82-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-83-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-83-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-84-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-84-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-85-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-85-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-86-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-86-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-87-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-87-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-88-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-88-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-89-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-89-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-90-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-90-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-91-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-91-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-97-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-97-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-98-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-98-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-99-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-99-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-cyrillic-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-cyrillic-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-latin-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-latin-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-latin-ext-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-latin-ext-700-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-vietnamese-400-normal.woff2 +0 -0
- package/web/fonts/files/noto-sans-sc-vietnamese-700-normal.woff2 +0 -0
- package/web/fonts/fonts.css +2163 -0
- package/web/index.html +266 -0
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
var oi=h=>{throw TypeError(h)};var Ss=(h,t,e)=>t.has(h)||oi("Cannot "+e);var lt=(h,t,e)=>(Ss(h,t,"read from private field"),e?e.call(h):t.get(h)),Ut=(h,t,e)=>t.has(h)?oi("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(h):t.set(h,e),Ct=(h,t,e,s)=>(Ss(h,t,"write to private field"),s?s.call(h,e):t.set(h,e),e),Ht=(h,t,e)=>(Ss(h,t,"access private method"),e);var li=(h,t,e,s)=>({set _(i){Ct(h,t,i,e)},get _(){return lt(h,t,s)}});var gn={9306(h,t,e){var s=e(4901),i=e(6823),n=TypeError;h.exports=function(r){if(s(r))return r;throw new n(i(r)+" is not a function")}},3506(h,t,e){var s=e(3925),i=String,n=TypeError;h.exports=function(r){if(s(r))return r;throw new n("Can't set "+i(r)+" as a prototype")}},7080(h,t,e){var s=e(4402).has;h.exports=function(i){return s(i),i}},3463(h){var t=TypeError;h.exports=function(e){if(typeof e=="string")return e;throw new t("Argument is not a string")}},4328(h,t,e){var s=e(4995),i=new s.WeakMap,n=s.set,r=s.remove;h.exports=function(a){return n(i,a,1),r(i,a),a}},6557(h,t,e){var s=e(4995).has;h.exports=function(i){return s(i),i}},6469(h,t,e){var s=e(608),i=e(2360),n=e(4913).f,r=s("unscopables"),a=Array.prototype;a[r]===void 0&&n(a,r,{configurable:!0,value:i(null)}),h.exports=function(o){a[r][o]=!0}},679(h,t,e){var s=e(1625),i=TypeError;h.exports=function(n,r){if(s(r,n))return n;throw new i("Incorrect invocation")}},3972(h,t,e){var s=e(34),i=String,n=TypeError;h.exports=function(r){if(r===void 0||s(r))return r;throw new n(i(r)+" is not an object or undefined")}},8551(h,t,e){var s=e(34),i=String,n=TypeError;h.exports=function(r){if(s(r))return r;throw new n(i(r)+" is not an object")}},4154(h,t,e){var s=e(6955),i=TypeError;h.exports=function(n){if(s(n)==="Uint8Array")return n;throw new i("Argument is not an Uint8Array")}},7811(h){h.exports=typeof ArrayBuffer<"u"&&typeof DataView<"u"},7394(h,t,e){var s=e(4576),i=e(6706),n=e(2195),r=s.ArrayBuffer,a=s.TypeError;h.exports=r&&i(r.prototype,"byteLength","get")||function(o){if(n(o)!=="ArrayBuffer")throw new a("ArrayBuffer expected");return o.byteLength}},3238(h,t,e){var s=e(4576),i=e(7811),n=e(7394),r=s.DataView;h.exports=function(a){if(!i||n(a)!==0)return!1;try{return new r(a),!1}catch{return!0}}},5169(h,t,e){var s=e(3238),i=TypeError;h.exports=function(n){if(s(n))throw new i("ArrayBuffer is detached");return n}},5636(h,t,e){var s=e(4576),i=e(9504),n=e(6706),r=e(7696),a=e(5169),o=e(7394),l=e(4483),c=e(1548),d=s.structuredClone,u=s.ArrayBuffer,f=s.DataView,g=Math.max,p=Math.min,m=u.prototype,v=f.prototype,y=i(m.slice),b=n(m,"resizable","get"),w=n(m,"maxByteLength","get"),A=i(v.getInt8),S=i(v.setInt8);h.exports=(c||l)&&function(E,C,x){var P=o(E),T=C===void 0?P:r(C),k=!b||!b(E),R;if(a(E),c&&(E=d(E,{transfer:[E]}),P===T&&(x||k)))return E;if(P>=T&&(!x||k))R=y(E,0,T);else{var D=x&&!k&&w?{maxByteLength:g(T,w(E))}:void 0;R=new u(T,D);for(var W=new f(E),M=new f(R),O=p(T,P),_=0;_<O;_++)S(M,_,A(W,_))}return c||l(E),R}},4644(h,t,e){var s=e(7811),i=e(3724),n=e(4576),r=e(4901),a=e(34),o=e(9297),l=e(6955),c=e(6823),d=e(6699),u=e(6840),f=e(2106),g=e(1625),p=e(2787),m=e(2967),v=e(608),y=e(3392),b=e(1181),w=b.enforce,A=b.get,S=n.Int8Array,E=S&&S.prototype,C=n.Uint8ClampedArray,x=C&&C.prototype,P=S&&p(S),T=E&&p(E),k=Object.prototype,R=n.TypeError,D=v("toStringTag"),W=y("TYPED_ARRAY_TAG"),M="TypedArrayConstructor",O=s&&!!m&&l(n.opera)!=="Opera",_=!1,j,tt,et,Q={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},G={BigInt64Array:8,BigUint64Array:8},q=function(X){if(!a(X))return!1;var rt=l(X);return rt==="DataView"||o(Q,rt)||o(G,rt)},at=function($){var X=p($);if(a(X)){var rt=A(X);return rt&&o(rt,M)?rt[M]:at(X)}},L=function($){if(!a($))return!1;var X=l($);return o(Q,X)||o(G,X)},I=function($){if(L($))return $;throw new R("Target is not a typed array")},N=function($){if(r($)&&(!m||g(P,$)))return $;throw new R(c($)+" is not a typed array constructor")},U=function($,X,rt,wt){if(i){if(rt)for(var bt in Q){var gt=n[bt];if(gt&&o(gt.prototype,$))try{delete gt.prototype[$]}catch{try{gt.prototype[$]=X}catch{}}}(!T[$]||rt)&&u(T,$,rt?X:O&&E[$]||X,wt)}},Z=function($,X,rt){var wt,bt;if(i){if(m){if(rt){for(wt in Q)if(bt=n[wt],bt&&o(bt,$))try{delete bt[$]}catch{}}if(!P[$]||rt)try{return u(P,$,rt?X:O&&P[$]||X)}catch{}else return}for(wt in Q)bt=n[wt],bt&&(!bt[$]||rt)&&u(bt,$,X)}};for(j in Q)tt=n[j],et=tt&&tt.prototype,et?w(et)[M]=tt:O=!1;for(j in G)tt=n[j],et=tt&&tt.prototype,et&&(w(et)[M]=tt);if((!O||!r(P)||P===Function.prototype)&&(P=function(){throw new R("Incorrect invocation")},O))for(j in Q)n[j]&&m(n[j],P);if((!O||!T||T===k)&&(T=P.prototype,O))for(j in Q)n[j]&&m(n[j].prototype,T);if(O&&p(x)!==T&&m(x,T),i&&!o(T,D)){_=!0,f(T,D,{configurable:!0,get:function(){return a(this)?this[W]:void 0}});for(j in Q)n[j]&&d(n[j].prototype,W,j)}h.exports={NATIVE_ARRAY_BUFFER_VIEWS:O,TYPED_ARRAY_TAG:_&&W,aTypedArray:I,aTypedArrayConstructor:N,exportTypedArrayMethod:U,exportTypedArrayStaticMethod:Z,getTypedArrayConstructor:at,isView:q,isTypedArray:L,TypedArray:P,TypedArrayPrototype:T}},5370(h,t,e){var s=e(6198);h.exports=function(i,n,r){for(var a=0,o=arguments.length>2?r:s(n),l=new i(o);o>a;)l[a]=n[a++];return l}},9617(h,t,e){var s=e(5397),i=e(5610),n=e(6198),r=function(a){return function(o,l,c){var d=s(o),u=n(d);if(u===0)return!a&&-1;var f=i(c,u),g;if(a&&l!==l){for(;u>f;)if(g=d[f++],g!==g)return!0}else for(;u>f;f++)if((a||f in d)&&d[f]===l)return a||f||0;return!a&&-1}};h.exports={includes:r(!0),indexOf:r(!1)}},4527(h,t,e){var s=e(3724),i=e(4376),n=TypeError,r=Object.getOwnPropertyDescriptor,a=s&&!(function(){if(this!==void 0)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(o){return o instanceof TypeError}})();h.exports=a?function(o,l){if(i(o)&&!r(o,"length").writable)throw new n("Cannot set read only .length");return o.length=l}:function(o,l){return o.length=l}},7680(h,t,e){var s=e(9504);h.exports=s([].slice)},2804(h){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",e=t+"+/",s=t+"-_",i=function(n){for(var r={},a=0;a<64;a++)r[n.charAt(a)]=a;return r};h.exports={i2c:e,c2i:i(e),i2cUrl:s,c2iUrl:i(s)}},6319(h,t,e){var s=e(8551),i=e(9539);h.exports=function(n,r,a,o){try{return o?r(s(a)[0],a[1]):r(a)}catch(l){i(n,"throw",l)}}},2195(h,t,e){var s=e(9504),i=s({}.toString),n=s("".slice);h.exports=function(r){return n(i(r),8,-1)}},6955(h,t,e){var s=e(2140),i=e(4901),n=e(2195),r=e(608),a=r("toStringTag"),o=Object,l=n((function(){return arguments})())==="Arguments",c=function(d,u){try{return d[u]}catch{}};h.exports=s?n:function(d){var u,f,g;return d===void 0?"Undefined":d===null?"Null":typeof(f=c(u=o(d),a))=="string"?f:l?n(u):(g=n(u))==="Object"&&i(u.callee)?"Arguments":g}},7740(h,t,e){var s=e(9297),i=e(5031),n=e(7347),r=e(4913);h.exports=function(a,o,l){for(var c=i(o),d=r.f,u=n.f,f=0;f<c.length;f++){var g=c[f];!s(a,g)&&!(l&&s(l,g))&&d(a,g,u(o,g))}}},2211(h,t,e){var s=e(9039);h.exports=!s(function(){function i(){}return i.prototype.constructor=null,Object.getPrototypeOf(new i)!==i.prototype})},2529(h){h.exports=function(t,e){return{value:t,done:e}}},6699(h,t,e){var s=e(3724),i=e(4913),n=e(6980);h.exports=s?function(r,a,o){return i.f(r,a,n(1,o))}:function(r,a,o){return r[a]=o,r}},6980(h){h.exports=function(t,e){return{enumerable:!(t&1),configurable:!(t&2),writable:!(t&4),value:e}}},4659(h,t,e){var s=e(3724),i=e(4913),n=e(6980);h.exports=function(r,a,o){s?i.f(r,a,n(0,o)):r[a]=o}},2106(h,t,e){var s=e(283),i=e(4913);h.exports=function(n,r,a){return a.get&&s(a.get,r,{getter:!0}),a.set&&s(a.set,r,{setter:!0}),i.f(n,r,a)}},6840(h,t,e){var s=e(4901),i=e(4913),n=e(283),r=e(9433);h.exports=function(a,o,l,c){c||(c={});var d=c.enumerable,u=c.name!==void 0?c.name:o;if(s(l)&&n(l,u,c),c.global)d?a[o]=l:r(o,l);else{try{c.unsafe?a[o]&&(d=!0):delete a[o]}catch{}d?a[o]=l:i.f(a,o,{value:l,enumerable:!1,configurable:!c.nonConfigurable,writable:!c.nonWritable})}return a}},6279(h,t,e){var s=e(6840);h.exports=function(i,n,r){for(var a in n)s(i,a,n[a],r);return i}},9433(h,t,e){var s=e(4576),i=Object.defineProperty;h.exports=function(n,r){try{i(s,n,{value:r,configurable:!0,writable:!0})}catch{s[n]=r}return r}},3724(h,t,e){var s=e(9039);h.exports=!s(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7})},4483(h,t,e){var s=e(4576),i=e(9429),n=e(1548),r=s.structuredClone,a=s.ArrayBuffer,o=s.MessageChannel,l=!1,c,d,u,f;if(n)l=function(g){r(g,{transfer:[g]})};else if(a)try{o||(c=i("worker_threads"),c&&(o=c.MessageChannel)),o&&(d=new o,u=new a(2),f=function(g){d.port1.postMessage(null,[g])},u.byteLength===2&&(f(u),u.byteLength===0&&(l=f)))}catch{}h.exports=l},4055(h,t,e){var s=e(4576),i=e(34),n=s.document,r=i(n)&&i(n.createElement);h.exports=function(a){return r?n.createElement(a):{}}},6837(h){var t=TypeError,e=9007199254740991;h.exports=function(s){if(s>e)throw new t("Maximum allowed index exceeded");return s}},5002(h){h.exports={IndexSizeError:{s:"INDEX_SIZE_ERR",c:1,m:1},DOMStringSizeError:{s:"DOMSTRING_SIZE_ERR",c:2,m:0},HierarchyRequestError:{s:"HIERARCHY_REQUEST_ERR",c:3,m:1},WrongDocumentError:{s:"WRONG_DOCUMENT_ERR",c:4,m:1},InvalidCharacterError:{s:"INVALID_CHARACTER_ERR",c:5,m:1},NoDataAllowedError:{s:"NO_DATA_ALLOWED_ERR",c:6,m:0},NoModificationAllowedError:{s:"NO_MODIFICATION_ALLOWED_ERR",c:7,m:1},NotFoundError:{s:"NOT_FOUND_ERR",c:8,m:1},NotSupportedError:{s:"NOT_SUPPORTED_ERR",c:9,m:1},InUseAttributeError:{s:"INUSE_ATTRIBUTE_ERR",c:10,m:1},InvalidStateError:{s:"INVALID_STATE_ERR",c:11,m:1},SyntaxError:{s:"SYNTAX_ERR",c:12,m:1},InvalidModificationError:{s:"INVALID_MODIFICATION_ERR",c:13,m:1},NamespaceError:{s:"NAMESPACE_ERR",c:14,m:1},InvalidAccessError:{s:"INVALID_ACCESS_ERR",c:15,m:1},ValidationError:{s:"VALIDATION_ERR",c:16,m:0},TypeMismatchError:{s:"TYPE_MISMATCH_ERR",c:17,m:1},SecurityError:{s:"SECURITY_ERR",c:18,m:1},NetworkError:{s:"NETWORK_ERR",c:19,m:1},AbortError:{s:"ABORT_ERR",c:20,m:1},URLMismatchError:{s:"URL_MISMATCH_ERR",c:21,m:1},QuotaExceededError:{s:"QUOTA_EXCEEDED_ERR",c:22,m:1},TimeoutError:{s:"TIMEOUT_ERR",c:23,m:1},InvalidNodeTypeError:{s:"INVALID_NODE_TYPE_ERR",c:24,m:1},DataCloneError:{s:"DATA_CLONE_ERR",c:25,m:1}}},8727(h){h.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},6193(h,t,e){var s=e(4215);h.exports=s==="NODE"},2839(h,t,e){var s=e(4576),i=s.navigator,n=i&&i.userAgent;h.exports=n?String(n):""},9519(h,t,e){var s=e(4576),i=e(2839),n=s.process,r=s.Deno,a=n&&n.versions||r&&r.version,o=a&&a.v8,l,c;o&&(l=o.split("."),c=l[0]>0&&l[0]<4?1:+(l[0]+l[1])),!c&&i&&(l=i.match(/Edge\/(\d+)/),(!l||l[1]>=74)&&(l=i.match(/Chrome\/(\d+)/),l&&(c=+l[1]))),h.exports=c},4215(h,t,e){var s=e(4576),i=e(2839),n=e(2195),r=function(a){return i.slice(0,a.length)===a};h.exports=(function(){return r("Bun/")?"BUN":r("Cloudflare-Workers")?"CLOUDFLARE":r("Deno/")?"DENO":r("Node.js/")?"NODE":s.Bun&&typeof Bun.version=="string"?"BUN":s.Deno&&typeof Deno.version=="object"?"DENO":n(s.process)==="process"?"NODE":s.window&&s.document?"BROWSER":"REST"})()},8574(h,t,e){var s=e(9504),i=Error,n=s("".replace),r=(function(l){return String(new i(l).stack)})("zxcasd"),a=/\n\s*at [^:]*:[^\n]*/,o=a.test(r);h.exports=function(l,c){if(o&&typeof l=="string"&&!i.prepareStackTrace)for(;c--;)l=n(l,a,"");return l}},6518(h,t,e){var s=e(4576),i=e(7347).f,n=e(6699),r=e(6840),a=e(9433),o=e(7740),l=e(2796);h.exports=function(c,d){var u=c.target,f=c.global,g=c.stat,p,m,v,y,b,w;if(f?m=s:g?m=s[u]||a(u,{}):m=s[u]&&s[u].prototype,m)for(v in d){if(b=d[v],c.dontCallGetSet?(w=i(m,v),y=w&&w.value):y=m[v],p=l(f?v:u+(g?".":"#")+v,c.forced),!p&&y!==void 0){if(typeof b==typeof y)continue;o(b,y)}(c.sham||y&&y.sham)&&n(b,"sham",!0),r(m,v,b,c)}}},9039(h){h.exports=function(t){try{return!!t()}catch{return!0}}},8745(h,t,e){var s=e(616),i=Function.prototype,n=i.apply,r=i.call;h.exports=typeof Reflect=="object"&&Reflect.apply||(s?r.bind(n):function(){return r.apply(n,arguments)})},6080(h,t,e){var s=e(7476),i=e(9306),n=e(616),r=s(s.bind);h.exports=function(a,o){return i(a),o===void 0?a:n?r(a,o):function(){return a.apply(o,arguments)}}},616(h,t,e){var s=e(9039);h.exports=!s(function(){var i=(function(){}).bind();return typeof i!="function"||i.hasOwnProperty("prototype")})},9565(h,t,e){var s=e(616),i=Function.prototype.call;h.exports=s?i.bind(i):function(){return i.apply(i,arguments)}},350(h,t,e){var s=e(3724),i=e(9297),n=Function.prototype,r=s&&Object.getOwnPropertyDescriptor,a=i(n,"name"),o=a&&(function(){}).name==="something",l=a&&(!s||s&&r(n,"name").configurable);h.exports={EXISTS:a,PROPER:o,CONFIGURABLE:l}},6706(h,t,e){var s=e(9504),i=e(9306);h.exports=function(n,r,a){try{return s(i(Object.getOwnPropertyDescriptor(n,r)[a]))}catch{}}},7476(h,t,e){var s=e(2195),i=e(9504);h.exports=function(n){if(s(n)==="Function")return i(n)}},9504(h,t,e){var s=e(616),i=Function.prototype,n=i.call,r=s&&i.bind.bind(n,n);h.exports=s?r:function(a){return function(){return n.apply(a,arguments)}}},944(h){var t=TypeError;h.exports=function(e){var s=e&&e.alphabet;if(s===void 0||s==="base64"||s==="base64url")return s||"base64";throw new t("Incorrect `alphabet` option")}},9429(h,t,e){var s=e(4576),i=e(6193);h.exports=function(n){if(i){try{return s.process.getBuiltinModule(n)}catch{}try{return Function('return require("'+n+'")')()}catch{}}}},7751(h,t,e){var s=e(4576),i=e(4901),n=function(r){return i(r)?r:void 0};h.exports=function(r,a){return arguments.length<2?n(s[r]):s[r]&&s[r][a]}},1767(h){h.exports=function(t){return{iterator:t,next:t.next,done:!1}}},8646(h,t,e){var s=e(9565),i=e(8551),n=e(1767),r=e(851);h.exports=function(a,o){(!o||typeof a!="string")&&i(a);var l=r(a);return n(i(l!==void 0?s(l,a):a))}},851(h,t,e){var s=e(6955),i=e(5966),n=e(4117),r=e(6269),a=e(608),o=a("iterator");h.exports=function(l){if(!n(l))return i(l,o)||i(l,"@@iterator")||r[s(l)]}},81(h,t,e){var s=e(9565),i=e(9306),n=e(8551),r=e(6823),a=e(851),o=TypeError;h.exports=function(l,c){var d=arguments.length<2?a(l):c;if(i(d))return n(s(d,l));throw new o(r(l)+" is not iterable")}},5966(h,t,e){var s=e(9306),i=e(4117);h.exports=function(n,r){var a=n[r];return i(a)?void 0:s(a)}},3789(h,t,e){var s=e(9306),i=e(8551),n=e(9565),r=e(1291),a=e(1767),o="Invalid size",l=RangeError,c=TypeError,d=Math.max,u=function(f,g){this.set=f,this.size=d(g,0),this.has=s(f.has),this.keys=s(f.keys)};u.prototype={getIterator:function(){return a(i(n(this.keys,this.set)))},includes:function(f){return n(this.has,this.set,f)}},h.exports=function(f){i(f);var g=+f.size;if(g!==g)throw new c(o);var p=r(g);if(p<0)throw new l(o);return new u(f,p)}},4576(h){var t=function(e){return e&&e.Math===Math&&e};h.exports=t(typeof globalThis=="object"&&globalThis)||t(typeof window=="object"&&window)||t(typeof self=="object"&&self)||t(typeof global=="object"&&global)||t(typeof this=="object"&&this)||(function(){return this})()||Function("return this")()},9297(h,t,e){var s=e(9504),i=e(8981),n=s({}.hasOwnProperty);h.exports=Object.hasOwn||function(a,o){return n(i(a),o)}},421(h){h.exports={}},397(h,t,e){var s=e(7751);h.exports=s("document","documentElement")},5917(h,t,e){var s=e(3724),i=e(9039),n=e(4055);h.exports=!s&&!i(function(){return Object.defineProperty(n("div"),"a",{get:function(){return 7}}).a!==7})},7055(h,t,e){var s=e(9504),i=e(9039),n=e(2195),r=Object,a=s("".split);h.exports=i(function(){return!r("z").propertyIsEnumerable(0)})?function(o){return n(o)==="String"?a(o,""):r(o)}:r},3167(h,t,e){var s=e(4901),i=e(34),n=e(2967);h.exports=function(r,a,o){var l,c;return n&&s(l=a.constructor)&&l!==o&&i(c=l.prototype)&&c!==o.prototype&&n(r,c),r}},3706(h,t,e){var s=e(9504),i=e(4901),n=e(7629),r=s(Function.toString);i(n.inspectSource)||(n.inspectSource=function(a){return r(a)}),h.exports=n.inspectSource},1181(h,t,e){var s=e(8622),i=e(4576),n=e(34),r=e(6699),a=e(9297),o=e(7629),l=e(6119),c=e(421),d="Object already initialized",u=i.TypeError,f=i.WeakMap,g,p,m,v=function(A){return m(A)?p(A):g(A,{})},y=function(A){return function(S){var E;if(!n(S)||(E=p(S)).type!==A)throw new u("Incompatible receiver, "+A+" required");return E}};if(s||o.state){var b=o.state||(o.state=new f);b.get=b.get,b.has=b.has,b.set=b.set,g=function(A,S){if(b.has(A))throw new u(d);return S.facade=A,b.set(A,S),S},p=function(A){return b.get(A)||{}},m=function(A){return b.has(A)}}else{var w=l("state");c[w]=!0,g=function(A,S){if(a(A,w))throw new u(d);return S.facade=A,r(A,w,S),S},p=function(A){return a(A,w)?A[w]:{}},m=function(A){return a(A,w)}}h.exports={set:g,get:p,has:m,enforce:v,getterFor:y}},4209(h,t,e){var s=e(608),i=e(6269),n=s("iterator"),r=Array.prototype;h.exports=function(a){return a!==void 0&&(i.Array===a||r[n]===a)}},4376(h,t,e){var s=e(2195);h.exports=Array.isArray||function(n){return s(n)==="Array"}},1108(h,t,e){var s=e(6955);h.exports=function(i){var n=s(i);return n==="BigInt64Array"||n==="BigUint64Array"}},4901(h){var t=typeof document=="object"&&document.all;h.exports=typeof t>"u"&&t!==void 0?function(e){return typeof e=="function"||e===t}:function(e){return typeof e=="function"}},2796(h,t,e){var s=e(9039),i=e(4901),n=/#|\.prototype\./,r=function(d,u){var f=o[a(d)];return f===c?!0:f===l?!1:i(u)?s(u):!!u},a=r.normalize=function(d){return String(d).replace(n,".").toLowerCase()},o=r.data={},l=r.NATIVE="N",c=r.POLYFILL="P";h.exports=r},4117(h){h.exports=function(t){return t==null}},34(h,t,e){var s=e(4901);h.exports=function(i){return typeof i=="object"?i!==null:s(i)}},3925(h,t,e){var s=e(34);h.exports=function(i){return s(i)||i===null}},6395(h){h.exports=!1},5810(h,t,e){var s=e(34),i=e(1181).get;h.exports=function(r){if(!s(r))return!1;var a=i(r);return!!a&&a.type==="RawJSON"}},757(h,t,e){var s=e(7751),i=e(4901),n=e(1625),r=e(7040),a=Object;h.exports=r?function(o){return typeof o=="symbol"}:function(o){var l=s("Symbol");return i(l)&&n(l.prototype,a(o))}},507(h,t,e){var s=e(9565);h.exports=function(i,n,r){for(var a=r?i:i.iterator,o=i.next,l,c;!(l=s(o,a)).done;)if(c=n(l.value),c!==void 0)return c}},2652(h,t,e){var s=e(6080),i=e(9565),n=e(8551),r=e(6823),a=e(4209),o=e(6198),l=e(1625),c=e(81),d=e(851),u=e(9539),f=TypeError,g=function(m,v){this.stopped=m,this.result=v},p=g.prototype;h.exports=function(m,v,y){var b=y&&y.that,w=!!(y&&y.AS_ENTRIES),A=!!(y&&y.IS_RECORD),S=!!(y&&y.IS_ITERATOR),E=!!(y&&y.INTERRUPTED),C=s(v,b),x,P,T,k,R,D,W,M=function(j){var tt=x;return x=void 0,tt&&u(tt,"normal"),new g(!0,j)},O=function(j){return w?(n(j),E?C(j[0],j[1],M):C(j[0],j[1])):E?C(j,M):C(j)};if(A)x=m.iterator;else if(S)x=m;else{if(P=d(m),!P)throw new f(r(m)+" is not iterable");if(a(P)){for(T=0,k=o(m);k>T;T++)if(R=O(m[T]),R&&l(p,R))return R;return new g(!1)}x=c(m,P)}for(D=A?m.next:x.next;!(W=i(D,x)).done;){var _=W.value;try{R=O(_)}catch(j){if(x)u(x,"throw",j);else throw j}if(typeof R=="object"&&R&&l(p,R))return R}return new g(!1)}},1385(h,t,e){var s=e(9539);h.exports=function(i,n,r){for(var a=i.length-1;a>=0;a--)if(i[a]!==void 0)try{r=s(i[a].iterator,n,r)}catch(o){n="throw",r=o}if(n==="throw")throw r;return r}},9539(h,t,e){var s=e(9565),i=e(8551),n=e(5966);h.exports=function(r,a,o){var l,c;i(r);try{if(l=n(r,"return"),!l){if(a==="throw")throw o;return o}l=s(l,r)}catch(d){c=!0,l=d}if(a==="throw")throw o;if(c)throw l;return i(l),o}},9462(h,t,e){var s=e(9565),i=e(2360),n=e(6699),r=e(6279),a=e(608),o=e(1181),l=e(5966),c=e(7657).IteratorPrototype,d=e(2529),u=e(9539),f=e(1385),g=a("toStringTag"),p="IteratorHelper",m="WrapForValidIterator",v="normal",y="throw",b=o.set,w=function(E){var C=o.getterFor(E?m:p);return r(i(c),{next:function(){var P=C(this);if(E)return P.nextHandler();if(P.done)return d(void 0,!0);try{var T=P.nextHandler();return P.returnHandlerResult?T:d(T,P.done)}catch(k){throw P.done=!0,k}},return:function(){var x=C(this),P=x.iterator,T=x.done;if(x.done=!0,E){var k=l(P,"return");return k?s(k,P):d(void 0,!0)}if(T)return d(void 0,!0);if(x.inner)try{u(x.inner.iterator,v)}catch(R){return u(P,y,R)}if(x.openIters)try{f(x.openIters,v)}catch(R){if(P)return u(P,y,R);throw R}return P&&u(P,v),d(void 0,!0)}})},A=w(!0),S=w(!1);n(S,g,"Iterator Helper"),h.exports=function(E,C,x){var P=function(k,R){R?(R.iterator=k.iterator,R.next=k.next):R=k,R.type=C?m:p,R.returnHandlerResult=!!x,R.nextHandler=E,R.counter=0,R.done=!1,b(this,R)};return P.prototype=C?A:S,P}},684(h){h.exports=function(t,e){var s=typeof Iterator=="function"&&Iterator.prototype[t];if(s)try{s.call({next:null},e).next()}catch{return!0}}},4549(h,t,e){var s=e(4576);h.exports=function(i,n){var r=s.Iterator,a=r&&r.prototype,o=a&&a[i],l=!1;if(o)try{o.call({next:function(){return{done:!0}},return:function(){l=!0}},-1)}catch(c){c instanceof n||(l=!1)}if(!l)return o}},7657(h,t,e){var s=e(9039),i=e(4901),n=e(34),r=e(2360),a=e(2787),o=e(6840),l=e(608),c=e(6395),d=l("iterator"),u=!1,f,g,p;[].keys&&(p=[].keys(),"next"in p?(g=a(a(p)),g!==Object.prototype&&(f=g)):u=!0);var m=!n(f)||s(function(){var v={};return f[d].call(v)!==v});m?f={}:c&&(f=r(f)),i(f[d])||o(f,d,function(){return this}),h.exports={IteratorPrototype:f,BUGGY_SAFARI_ITERATORS:u}},6269(h){h.exports={}},6198(h,t,e){var s=e(8014);h.exports=function(i){return s(i.length)}},283(h,t,e){var s=e(9504),i=e(9039),n=e(4901),r=e(9297),a=e(3724),o=e(350).CONFIGURABLE,l=e(3706),c=e(1181),d=c.enforce,u=c.get,f=String,g=Object.defineProperty,p=s("".slice),m=s("".replace),v=s([].join),y=a&&!i(function(){return g(function(){},"length",{value:8}).length!==8}),b=String(String).split("String"),w=h.exports=function(A,S,E){p(f(S),0,7)==="Symbol("&&(S="["+m(f(S),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),E&&E.getter&&(S="get "+S),E&&E.setter&&(S="set "+S),(!r(A,"name")||o&&A.name!==S)&&(a?g(A,"name",{value:S,configurable:!0}):A.name=S),y&&E&&r(E,"arity")&&A.length!==E.arity&&g(A,"length",{value:E.arity});try{E&&r(E,"constructor")&&E.constructor?a&&g(A,"prototype",{writable:!1}):A.prototype&&(A.prototype=void 0)}catch{}var C=d(A);return r(C,"source")||(C.source=v(b,typeof S=="string"?S:"")),A};Function.prototype.toString=w(function(){return n(this)&&u(this).source||l(this)},"toString")},2248(h,t,e){var s=e(9504),i=Map.prototype;h.exports={Map,set:s(i.set),get:s(i.get),has:s(i.has),remove:s(i.delete),proto:i}},741(h){var t=Math.ceil,e=Math.floor;h.exports=Math.trunc||function(i){var n=+i;return(n>0?e:t)(n)}},7819(h,t,e){var s=e(9039);h.exports=!s(function(){var i="9007199254740993",n=JSON.rawJSON(i);return!JSON.isRawJSON(n)||JSON.stringify(n)!==i})},6043(h,t,e){var s=e(9306),i=TypeError,n=function(r){var a,o;this.promise=new r(function(l,c){if(a!==void 0||o!==void 0)throw new i("Bad Promise constructor");a=l,o=c}),this.resolve=s(a),this.reject=s(o)};h.exports.f=function(r){return new n(r)}},2603(h,t,e){var s=e(655);h.exports=function(i,n){return i===void 0?arguments.length<2?"":n:s(i)}},4149(h){var t=RangeError;h.exports=function(e){if(e===e)return e;throw new t("NaN is not allowed")}},2360(h,t,e){var s=e(8551),i=e(6801),n=e(8727),r=e(421),a=e(397),o=e(4055),l=e(6119),c=">",d="<",u="prototype",f="script",g=l("IE_PROTO"),p=function(){},m=function(A){return d+f+c+A+d+"/"+f+c},v=function(A){A.write(m("")),A.close();var S=A.parentWindow.Object;return A=null,S},y=function(){var A=o("iframe"),S="java"+f+":",E;return A.style.display="none",a.appendChild(A),A.src=String(S),E=A.contentWindow.document,E.open(),E.write(m("document.F=Object")),E.close(),E.F},b,w=function(){try{b=new ActiveXObject("htmlfile")}catch{}w=typeof document<"u"?document.domain&&b?v(b):y():v(b);for(var A=n.length;A--;)delete w[u][n[A]];return w()};r[g]=!0,h.exports=Object.create||function(S,E){var C;return S!==null?(p[u]=s(S),C=new p,p[u]=null,C[g]=S):C=w(),E===void 0?C:i.f(C,E)}},6801(h,t,e){var s=e(3724),i=e(8686),n=e(4913),r=e(8551),a=e(5397),o=e(1072);t.f=s&&!i?Object.defineProperties:function(c,d){r(c);for(var u=a(d),f=o(d),g=f.length,p=0,m;g>p;)n.f(c,m=f[p++],u[m]);return c}},4913(h,t,e){var s=e(3724),i=e(5917),n=e(8686),r=e(8551),a=e(6969),o=TypeError,l=Object.defineProperty,c=Object.getOwnPropertyDescriptor,d="enumerable",u="configurable",f="writable";t.f=s?n?function(p,m,v){if(r(p),m=a(m),r(v),typeof p=="function"&&m==="prototype"&&"value"in v&&f in v&&!v[f]){var y=c(p,m);y&&y[f]&&(p[m]=v.value,v={configurable:u in v?v[u]:y[u],enumerable:d in v?v[d]:y[d],writable:!1})}return l(p,m,v)}:l:function(p,m,v){if(r(p),m=a(m),r(v),i)try{return l(p,m,v)}catch{}if("get"in v||"set"in v)throw new o("Accessors not supported");return"value"in v&&(p[m]=v.value),p}},7347(h,t,e){var s=e(3724),i=e(9565),n=e(8773),r=e(6980),a=e(5397),o=e(6969),l=e(9297),c=e(5917),d=Object.getOwnPropertyDescriptor;t.f=s?d:function(f,g){if(f=a(f),g=o(g),c)try{return d(f,g)}catch{}if(l(f,g))return r(!i(n.f,f,g),f[g])}},8480(h,t,e){var s=e(1828),i=e(8727),n=i.concat("length","prototype");t.f=Object.getOwnPropertyNames||function(a){return s(a,n)}},3717(h,t){t.f=Object.getOwnPropertySymbols},2787(h,t,e){var s=e(9297),i=e(4901),n=e(8981),r=e(6119),a=e(2211),o=r("IE_PROTO"),l=Object,c=l.prototype;h.exports=a?l.getPrototypeOf:function(d){var u=n(d);if(s(u,o))return u[o];var f=u.constructor;return i(f)&&u instanceof f?f.prototype:u instanceof l?c:null}},1625(h,t,e){var s=e(9504);h.exports=s({}.isPrototypeOf)},1828(h,t,e){var s=e(9504),i=e(9297),n=e(5397),r=e(9617).indexOf,a=e(421),o=s([].push);h.exports=function(l,c){var d=n(l),u=0,f=[],g;for(g in d)!i(a,g)&&i(d,g)&&o(f,g);for(;c.length>u;)i(d,g=c[u++])&&(~r(f,g)||o(f,g));return f}},1072(h,t,e){var s=e(1828),i=e(8727);h.exports=Object.keys||function(r){return s(r,i)}},8773(h,t){var e={}.propertyIsEnumerable,s=Object.getOwnPropertyDescriptor,i=s&&!e.call({1:2},1);t.f=i?function(r){var a=s(this,r);return!!a&&a.enumerable}:e},2967(h,t,e){var s=e(6706),i=e(34),n=e(7750),r=e(3506);h.exports=Object.setPrototypeOf||("__proto__"in{}?(function(){var a=!1,o={},l;try{l=s(Object.prototype,"__proto__","set"),l(o,[]),a=o instanceof Array}catch{}return function(d,u){return n(d),r(u),i(d)&&(a?l(d,u):d.__proto__=u),d}})():void 0)},4270(h,t,e){var s=e(9565),i=e(4901),n=e(34),r=TypeError;h.exports=function(a,o){var l,c;if(o==="string"&&i(l=a.toString)&&!n(c=s(l,a))||i(l=a.valueOf)&&!n(c=s(l,a))||o!=="string"&&i(l=a.toString)&&!n(c=s(l,a)))return c;throw new r("Can't convert object to primitive value")}},5031(h,t,e){var s=e(7751),i=e(9504),n=e(8480),r=e(3717),a=e(8551),o=i([].concat);h.exports=s("Reflect","ownKeys")||function(c){var d=n.f(a(c)),u=r.f;return u?o(d,u(c)):d}},8235(h,t,e){var s=e(9504),i=e(9297),n=SyntaxError,r=parseInt,a=String.fromCharCode,o=s("".charAt),l=s("".slice),c=s(/./.exec),d={'\\"':'"',"\\\\":"\\","\\/":"/","\\b":"\b","\\f":"\f","\\n":`
|
|
2
|
+
`,"\\r":"\r","\\t":" "},u=/^[\da-f]{4}$/i,f=/^[\u0000-\u001F]$/;h.exports=function(g,p){for(var m=!0,v="";p<g.length;){var y=o(g,p);if(y==="\\"){var b=l(g,p,p+2);if(i(d,b))v+=d[b],p+=2;else if(b==="\\u"){p+=2;var w=l(g,p,p+4);if(!c(u,w))throw new n("Bad Unicode escape at: "+p);v+=a(r(w,16)),p+=4}else throw new n('Unknown escape sequence: "'+b+'"')}else if(y==='"'){m=!1,p++;break}else{if(c(f,y))throw new n("Bad control character in string literal at: "+p);v+=y,p++}}if(m)throw new n("Unterminated string at: "+p);return{value:v,end:p}}},1103(h){h.exports=function(t){try{return{error:!1,value:t()}}catch(e){return{error:!0,value:e}}}},7750(h,t,e){var s=e(4117),i=TypeError;h.exports=function(n){if(s(n))throw new i("Can't call method on "+n);return n}},9286(h,t,e){var s=e(4402),i=e(8469),n=s.Set,r=s.add;h.exports=function(a){var o=new n;return i(a,function(l){r(o,l)}),o}},3440(h,t,e){var s=e(7080),i=e(4402),n=e(9286),r=e(5170),a=e(3789),o=e(8469),l=e(507),c=i.has,d=i.remove;h.exports=function(f){var g=s(this),p=a(f),m=n(g);return r(m)<=p.size?o(m,function(v){p.includes(v)&&d(m,v)}):l(p.getIterator(),function(v){c(m,v)&&d(m,v)}),m}},4402(h,t,e){var s=e(9504),i=Set.prototype;h.exports={Set,add:s(i.add),has:s(i.has),remove:s(i.delete),proto:i}},8750(h,t,e){var s=e(7080),i=e(4402),n=e(5170),r=e(3789),a=e(8469),o=e(507),l=i.Set,c=i.add,d=i.has;h.exports=function(f){var g=s(this),p=r(f),m=new l;return n(g)>p.size?o(p.getIterator(),function(v){d(g,v)&&c(m,v)}):a(g,function(v){p.includes(v)&&c(m,v)}),m}},4449(h,t,e){var s=e(7080),i=e(4402).has,n=e(5170),r=e(3789),a=e(8469),o=e(507),l=e(9539);h.exports=function(d){var u=s(this),f=r(d);if(n(u)<=f.size)return a(u,function(p){if(f.includes(p))return!1},!0)!==!1;var g=f.getIterator();return o(g,function(p){if(i(u,p))return l(g.iterator,"normal",!1)})!==!1}},3838(h,t,e){var s=e(7080),i=e(5170),n=e(8469),r=e(3789);h.exports=function(o){var l=s(this),c=r(o);return i(l)>c.size?!1:n(l,function(d){if(!c.includes(d))return!1},!0)!==!1}},8527(h,t,e){var s=e(7080),i=e(4402).has,n=e(5170),r=e(3789),a=e(507),o=e(9539);h.exports=function(c){var d=s(this),u=r(c);if(n(d)<u.size)return!1;var f=u.getIterator();return a(f,function(g){if(!i(d,g))return o(f.iterator,"normal",!1)})!==!1}},8469(h,t,e){var s=e(9504),i=e(507),n=e(4402),r=n.Set,a=n.proto,o=s(a.forEach),l=s(a.keys),c=l(new r).next;h.exports=function(d,u,f){return f?i({iterator:l(d),next:c},u):o(d,u)}},4916(h,t,e){var s=e(7751),i=function(r){return{size:r,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}},n=function(r){return{size:r,has:function(){return!0},keys:function(){throw new Error("e")}}};h.exports=function(r,a){var o=s("Set");try{new o()[r](i(0));try{return new o()[r](i(-1)),!1}catch{if(!a)return!0;try{return new o()[r](n(-1/0)),!1}catch{var l=new o([1,2]);return a(l[r](n(1/0)))}}}catch{return!1}}},9835(h){h.exports=function(t){try{var e=new Set,s={size:0,has:function(){return!0},keys:function(){return Object.defineProperty({},"next",{get:function(){return e.clear(),e.add(4),function(){return{done:!0}}}})}},i=e[t](s);return i.size===1&&i.values().next().value===4}catch{return!1}}},5170(h,t,e){var s=e(6706),i=e(4402);h.exports=s(i.proto,"size","get")||function(n){return n.size}},3650(h,t,e){var s=e(7080),i=e(4402),n=e(9286),r=e(3789),a=e(507),o=i.add,l=i.has,c=i.remove;h.exports=function(u){var f=s(this),g=r(u).getIterator(),p=n(f);return a(g,function(m){l(f,m)?c(p,m):o(p,m)}),p}},4204(h,t,e){var s=e(7080),i=e(4402).add,n=e(9286),r=e(3789),a=e(507);h.exports=function(l){var c=s(this),d=r(l).getIterator(),u=n(c);return a(d,function(f){i(u,f)}),u}},6119(h,t,e){var s=e(5745),i=e(3392),n=s("keys");h.exports=function(r){return n[r]||(n[r]=i(r))}},7629(h,t,e){var s=e(6395),i=e(4576),n=e(9433),r="__core-js_shared__",a=h.exports=i[r]||n(r,{});(a.versions||(a.versions=[])).push({version:"3.49.0",mode:s?"pure":"global",copyright:"© 2013–2025 Denis Pushkarev (zloirock.ru), 2025–2026 CoreJS Company (core-js.io). All rights reserved.",license:"https://github.com/zloirock/core-js/blob/v3.49.0/LICENSE",source:"https://github.com/zloirock/core-js"})},5745(h,t,e){var s=e(7629);h.exports=function(i,n){return s[i]||(s[i]=n||{})}},1548(h,t,e){var s=e(4576),i=e(9039),n=e(9519),r=e(4215),a=s.structuredClone;h.exports=!!a&&!i(function(){if(r==="DENO"&&n>92||r==="NODE"&&n>94||r==="BROWSER"&&n>97)return!1;var o=new ArrayBuffer(8),l=a(o,{transfer:[o]});return o.byteLength!==0||l.byteLength!==8})},4495(h,t,e){var s=e(9519),i=e(9039),n=e(4576),r=n.String;h.exports=!!Object.getOwnPropertySymbols&&!i(function(){var a=Symbol("symbol detection");return!r(a)||!(Object(a)instanceof Symbol)||!Symbol.sham&&s&&s<41})},5610(h,t,e){var s=e(1291),i=Math.max,n=Math.min;h.exports=function(r,a){var o=s(r);return o<0?i(o+a,0):n(o,a)}},5854(h,t,e){var s=e(2777),i=TypeError;h.exports=function(n){var r=s(n,"number");if(typeof r=="number")throw new i("Can't convert number to bigint");return BigInt(r)}},7696(h,t,e){var s=e(1291),i=e(8014),n=RangeError;h.exports=function(r){if(r===void 0)return 0;var a=s(r),o=i(a);if(a!==o)throw new n("Wrong length or index");return o}},5397(h,t,e){var s=e(7055),i=e(7750);h.exports=function(n){return s(i(n))}},1291(h,t,e){var s=e(741);h.exports=function(i){var n=+i;return n!==n||n===0?0:s(n)}},8014(h,t,e){var s=e(1291),i=Math.min;h.exports=function(n){var r=s(n);return r>0?i(r,9007199254740991):0}},8981(h,t,e){var s=e(7750),i=Object;h.exports=function(n){return i(s(n))}},9590(h,t,e){var s=e(1291),i=RangeError;h.exports=function(n){var r=s(n);if(r<0)throw new i("The argument can't be less than 0");return r}},2777(h,t,e){var s=e(9565),i=e(34),n=e(757),r=e(5966),a=e(4270),o=e(608),l=TypeError,c=o("toPrimitive");h.exports=function(d,u){if(!i(d)||n(d))return d;var f=r(d,c),g;if(f){if(u===void 0&&(u="default"),g=s(f,d,u),!i(g)||n(g))return g;throw new l("Can't convert object to primitive value")}return u===void 0&&(u="number"),a(d,u)}},6969(h,t,e){var s=e(2777),i=e(757);h.exports=function(n){var r=s(n,"string");return i(r)?r:r+""}},2140(h,t,e){var s=e(608),i=s("toStringTag"),n={};n[i]="z",h.exports=String(n)==="[object z]"},655(h,t,e){var s=e(6955),i=String;h.exports=function(n){if(s(n)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return i(n)}},6823(h){var t=String;h.exports=function(e){try{return t(e)}catch{return"Object"}}},3392(h,t,e){var s=e(9504),i=0,n=Math.random(),r=s(1.1.toString);h.exports=function(a){return"Symbol("+(a===void 0?"":a)+")_"+r(++i+n,36)}},9143(h,t,e){var s=e(4576),i=e(9504),n=e(3972),r=e(3463),a=e(9297),o=e(2804),l=e(944),c=e(5169),d=o.c2i,u=o.c2iUrl,f=s.SyntaxError,g=s.TypeError,p=i("".charAt),m=function(b,w){for(var A=b.length;w<A;w++){var S=p(b,w);if(S!==" "&&S!==" "&&S!==`
|
|
3
|
+
`&&S!=="\f"&&S!=="\r")break}return w},v=function(b,w,A){var S=b.length;S<4&&(b+=S===2?"AA":"A");var E=(w[p(b,0)]<<18)+(w[p(b,1)]<<12)+(w[p(b,2)]<<6)+w[p(b,3)],C=[E>>16&255,E>>8&255,E&255];if(S===2){if(A&&C[1]!==0)throw new f("Extra bits");return[C[0]]}if(S===3){if(A&&C[2]!==0)throw new f("Extra bits");return[C[0],C[1]]}return C},y=function(b,w,A){for(var S=w.length,E=0;E<S;E++)b[A+E]=w[E];return A+S};h.exports=function(b,w,A,S){r(b),n(w);var E=l(w)==="base64"?d:u,C=w?w.lastChunkHandling:void 0;if(C===void 0&&(C="loose"),C!=="loose"&&C!=="strict"&&C!=="stop-before-partial")throw new g("Incorrect `lastChunkHandling` option");A&&c(A.buffer);var x=b.length,P=A||[],T=0,k=0,R="",D=0;if(S)for(;;){if(D=m(b,D),D===x){if(R.length>0){if(C==="stop-before-partial")break;if(C==="loose"){if(R.length===1)throw new f("Malformed padding: exactly one additional character");T=y(P,v(R,E,!1),T)}else throw new f("Missing padding")}k=x;break}var W=p(b,D);if(++D,W==="="){if(R.length<2)throw new f("Padding is too early");if(D=m(b,D),R.length===2){if(D===x){if(C==="stop-before-partial")break;throw new f("Malformed padding: only one =")}p(b,D)==="="&&(++D,D=m(b,D))}if(D<x)throw new f("Unexpected character after padding");T=y(P,v(R,E,C==="strict"),T),k=x;break}if(!a(E,W))throw new f("Unexpected character");var M=S-T;if(M===1&&R.length===2||M===2&&R.length===3||(R+=W,R.length===4&&(T=y(P,v(R,E,!1),T),R="",k=D,T===S)))break}return{bytes:P,read:k,written:T}}},2303(h,t,e){var s=e(4576),i=e(9504),n=s.Uint8Array,r=s.SyntaxError,a=Math.min,o=i("".match);h.exports=function(l,c){var d=l.length;if(d%2!==0)throw new r("String should be an even number of characters");for(var u=c?a(c.length,d/2):d/2,f=c||new n(u),g=o(l,/.{2}/g),p=0;p<u;p++){var m=+("0x"+g[p]+"0");if(m!==m)throw new r("String should only contain hex characters");f[p]=m>>4}return{bytes:f,read:p<<1}}},7416(h,t,e){var s=e(9039),i=e(608),n=e(3724),r=e(6395),a=i("iterator");h.exports=!s(function(){var o=new URL("b?a=1&b=2&c=3","https://a"),l=o.searchParams,c=new URLSearchParams("a=1&a=2&b=3"),d="";return o.pathname="c%20d",l.forEach(function(u,f){l.delete("b"),d+=f+u}),c.delete("a",2),c.delete("b",void 0),r&&(!o.toJSON||!c.has("a",1)||c.has("a",2)||!c.has("a",void 0)||c.has("b"))||!l.size&&(r||!n)||!l.sort||o.href!=="https://a/c%20d?a=1&c=3"||l.get("c")!=="3"||String(new URLSearchParams("?a=1"))!=="a=1"||!l[a]||new URL("https://a@b").username!=="a"||new URLSearchParams(new URLSearchParams("a=b")).get("a")!=="b"||new URL("https://тест").host!=="xn--e1aybc"||new URL("https://a#б").hash!=="#%D0%B1"||d!=="a1c3"||new URL("https://x",void 0).host!=="x"})},7040(h,t,e){var s=e(4495);h.exports=s&&!Symbol.sham&&typeof Symbol.iterator=="symbol"},8686(h,t,e){var s=e(3724),i=e(9039);h.exports=s&&i(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42})},2812(h){var t=TypeError;h.exports=function(e,s){if(e<s)throw new t("Not enough arguments");return e}},8622(h,t,e){var s=e(4576),i=e(4901),n=s.WeakMap;h.exports=i(n)&&/native code/.test(String(n))},4995(h,t,e){var s=e(9504),i=WeakMap.prototype;h.exports={WeakMap,set:s(i.set),get:s(i.get),has:s(i.has),remove:s(i.delete)}},608(h,t,e){var s=e(4576),i=e(5745),n=e(9297),r=e(3392),a=e(4495),o=e(7040),l=s.Symbol,c=i("wks"),d=o?l.for||l:l&&l.withoutSetter||r;h.exports=function(u){return n(c,u)||(c[u]=a&&n(l,u)?l[u]:d("Symbol."+u)),c[u]}},6573(h,t,e){var s=e(3724),i=e(2106),n=e(3238),r=ArrayBuffer.prototype;s&&!("detached"in r)&&i(r,"detached",{configurable:!0,get:function(){return n(this)}})},7936(h,t,e){var s=e(6518),i=e(5636);i&&s({target:"ArrayBuffer",proto:!0},{transferToFixedLength:function(){return i(this,arguments.length?arguments[0]:void 0,!1)}})},8100(h,t,e){var s=e(6518),i=e(5636);i&&s({target:"ArrayBuffer",proto:!0},{transfer:function(){return i(this,arguments.length?arguments[0]:void 0,!0)}})},4423(h,t,e){var s=e(6518),i=e(9617).includes,n=e(9039),r=e(6469),a=n(function(){return!Array(1).includes()}),o=n(function(){return[,1].includes(void 0,1)});s({target:"Array",proto:!0,forced:a||o},{includes:function(c){return i(this,c,arguments.length>1?arguments[1]:void 0)}}),r("includes")},4114(h,t,e){var s=e(6518),i=e(8981),n=e(6198),r=e(4527),a=e(6837),o=e(9039),l=o(function(){return[].push.call({length:4294967296},1)!==4294967297}),c=function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(u){return u instanceof TypeError}},d=l||!c();s({target:"Array",proto:!0,arity:1,forced:d},{push:function(f){var g=i(this),p=n(g),m=arguments.length;a(p+m);for(var v=0;v<m;v++)g[p]=arguments[v],p++;return r(g,p),p}})},8111(h,t,e){var s=e(6518),i=e(4576),n=e(679),r=e(8551),a=e(4901),o=e(2787),l=e(2106),c=e(4659),d=e(9039),u=e(9297),f=e(608),g=e(7657).IteratorPrototype,p=e(3724),m=e(6395),v="constructor",y="Iterator",b=f("toStringTag"),w=TypeError,A=i[y],S=m||!a(A)||A.prototype!==g||!d(function(){A({})}),E=function(){if(n(this,g),o(this)===g)throw new w("Abstract class Iterator not directly constructable")},C=function(x,P){p?l(g,x,{configurable:!0,get:function(){return P},set:function(T){if(r(this),this===g)throw new w("You can't redefine this property");u(this,x)?this[x]=T:c(this,x,T)}}):g[x]=P};u(g,b)||C(b,y),(S||!u(g,v)||g[v]===Object)&&C(v,E),E.prototype=g,s({global:!0,constructor:!0,forced:S},{Iterator:E})},9314(h,t,e){var s=e(6518),i=e(9565),n=e(8551),r=e(1767),a=e(4149),o=e(9590),l=e(9539),c=e(9462),d=e(684),u=e(4549),f=e(6395),g=!f&&!d("drop",0),p=!f&&!g&&u("drop",RangeError),m=f||g||p,v=c(function(){for(var y=this.iterator,b=this.next,w,A;this.remaining;)if(this.remaining--,w=n(i(b,y)),A=this.done=!!w.done,A)return;if(w=n(i(b,y)),A=this.done=!!w.done,!A)return w.value});s({target:"Iterator",proto:!0,real:!0,forced:m},{drop:function(b){n(this);var w;try{w=o(a(+b))}catch(A){l(this,"throw",A)}return p?i(p,this,w):new v(r(this),{remaining:w})}})},1148(h,t,e){var s=e(6518),i=e(9565),n=e(2652),r=e(9306),a=e(8551),o=e(1767),l=e(9539),c=e(4549),d=c("every",TypeError);s({target:"Iterator",proto:!0,real:!0,forced:d},{every:function(f){a(this);try{r(f)}catch(m){l(this,"throw",m)}if(d)return i(d,this,f);var g=o(this),p=0;return!n(g,function(m,v){if(!f(m,p++))return v()},{IS_RECORD:!0,INTERRUPTED:!0}).stopped}})},2489(h,t,e){var s=e(6518),i=e(9565),n=e(9306),r=e(8551),a=e(1767),o=e(9462),l=e(6319),c=e(6395),d=e(9539),u=e(684),f=e(4549),g=!c&&!u("filter",function(){}),p=!c&&!g&&f("filter",TypeError),m=c||g||p,v=o(function(){for(var y=this.iterator,b=this.predicate,w=this.next,A,S,E;;){if(A=r(i(w,y)),S=this.done=!!A.done,S)return;if(E=A.value,l(y,b,[E,this.counter++],!0))return E}});s({target:"Iterator",proto:!0,real:!0,forced:m},{filter:function(b){r(this);try{n(b)}catch(w){d(this,"throw",w)}return p?i(p,this,b):new v(a(this),{predicate:b})}})},116(h,t,e){var s=e(6518),i=e(9565),n=e(2652),r=e(9306),a=e(8551),o=e(1767),l=e(9539),c=e(4549),d=c("find",TypeError);s({target:"Iterator",proto:!0,real:!0,forced:d},{find:function(f){a(this);try{r(f)}catch(m){l(this,"throw",m)}if(d)return i(d,this,f);var g=o(this),p=0;return n(g,function(m,v){if(f(m,p++))return v(m)},{IS_RECORD:!0,INTERRUPTED:!0}).result}})},531(h,t,e){var s=e(6518),i=e(9565),n=e(9306),r=e(8551),a=e(1767),o=e(8646),l=e(9462),c=e(9539),d=e(6395),u=e(684),f=e(4549);function g(){try{var b=Iterator.prototype.flatMap.call(new Map([[4,5]]).entries(),function(w){return w});b.next(),b.return()}catch{return!0}}var p=!d&&!u("flatMap",function(){}),m=!d&&!p&&f("flatMap",TypeError),v=d||p||m||g(),y=l(function(){for(var b=this.iterator,w=this.mapper,A,S;;){if(S=this.inner)try{if(A=r(i(S.next,S.iterator)),!A.done)return A.value;this.inner=null}catch(E){c(b,"throw",E)}if(A=r(i(this.next,b)),this.done=!!A.done)return;try{this.inner=o(w(A.value,this.counter++),!1)}catch(E){c(b,"throw",E)}}});s({target:"Iterator",proto:!0,real:!0,forced:v},{flatMap:function(w){r(this);try{n(w)}catch(A){c(this,"throw",A)}return m?i(m,this,w):new y(a(this),{mapper:w,inner:null})}})},7588(h,t,e){var s=e(6518),i=e(9565),n=e(2652),r=e(9306),a=e(8551),o=e(1767),l=e(9539),c=e(4549),d=c("forEach",TypeError);s({target:"Iterator",proto:!0,real:!0,forced:d},{forEach:function(f){a(this);try{r(f)}catch(m){l(this,"throw",m)}if(d)return i(d,this,f);var g=o(this),p=0;n(g,function(m){f(m,p++)},{IS_RECORD:!0})}})},1701(h,t,e){var s=e(6518),i=e(9565),n=e(9306),r=e(8551),a=e(1767),o=e(9462),l=e(6319),c=e(9539),d=e(684),u=e(4549),f=e(6395),g=!f&&!d("map",function(){}),p=!f&&!g&&u("map",TypeError),m=f||g||p,v=o(function(){var y=this.iterator,b=r(i(this.next,y)),w=this.done=!!b.done;if(!w)return l(y,this.mapper,[b.value,this.counter++],!0)});s({target:"Iterator",proto:!0,real:!0,forced:m},{map:function(b){r(this);try{n(b)}catch(w){c(this,"throw",w)}return p?i(p,this,b):new v(a(this),{mapper:b})}})},3579(h,t,e){var s=e(6518),i=e(9565),n=e(2652),r=e(9306),a=e(8551),o=e(1767),l=e(9539),c=e(4549),d=c("some",TypeError);s({target:"Iterator",proto:!0,real:!0,forced:d},{some:function(f){a(this);try{r(f)}catch(m){l(this,"throw",m)}if(d)return i(d,this,f);var g=o(this),p=0;return n(g,function(m,v){if(f(m,p++))return v()},{IS_RECORD:!0,INTERRUPTED:!0}).stopped}})},4972(h,t,e){var s=e(6518),i=e(9565),n=e(8551),r=e(1767),a=e(4149),o=e(9590),l=e(9462),c=e(9539),d=e(684),u=e(4549),f=e(6395),g=!f&&!d("take",1),p=!f&&!g&&u("take",RangeError),m=f||g||p,v=l(function(){var y=this.iterator;if(!this.remaining--)return this.done=!0,c(y,"normal",void 0);var b=n(i(this.next,y)),w=this.done=!!b.done;if(!w)return b.value});s({target:"Iterator",proto:!0,real:!0,forced:m},{take:function(b){n(this);var w;try{w=o(a(+b))}catch(A){c(this,"throw",A)}return p?i(p,this,w):new v(r(this),{remaining:w})}})},9112(h,t,e){var s=e(6518),i=e(3724),n=e(4576),r=e(7751),a=e(9504),o=e(9565),l=e(4901),c=e(34),d=e(4376),u=e(9297),f=e(655),g=e(6198),p=e(4659),m=e(9039),v=e(8235),y=e(4495),b=n.JSON,w=n.Number,A=n.SyntaxError,S=b&&b.parse,E=r("Object","keys"),C=Object.getOwnPropertyDescriptor,x=a("".charAt),P=a("".slice),T=a(/./.exec),k=a([].push),R=/^\d$/,D=/^[1-9]$/,W=/^[\d-]$/,M=/^[\t\n\r ]$/,O=0,_=1,j=function(L,I){L=f(L);var N=new G(L,0),U=N.parse(),Z=U.value,$=N.skip(M,U.end);if($<L.length)throw new A('Unexpected extra character: "'+x(L,$)+'" after the parsed data at: '+$);return l(I)?tt({"":Z},"",I,U):Z},tt=function(L,I,N,U){var Z=L[I],$=U&&Z===U.value,X=$&&typeof U.source=="string"?{source:U.source}:{},rt,wt,bt,gt,Wt;if(c(Z)){var se=d(Z),Ge=$?U.nodes:se?[]:{};if(se)for(rt=Ge.length,bt=g(Z),gt=0;gt<bt;gt++)et(Z,gt,tt(Z,""+gt,N,gt<rt?Ge[gt]:void 0));else for(wt=E(Z),bt=g(wt),gt=0;gt<bt;gt++)Wt=wt[gt],et(Z,Wt,tt(Z,Wt,N,u(Ge,Wt)?Ge[Wt]:void 0))}return o(N,L,I,Z,X)},et=function(L,I,N){if(i){var U=C(L,I);if(U&&!U.configurable)return}N===void 0?delete L[I]:p(L,I,N)},Q=function(L,I,N,U){this.value=L,this.end=I,this.source=N,this.nodes=U},G=function(L,I){this.source=L,this.index=I};G.prototype={fork:function(L){return new G(this.source,L)},parse:function(){var L=this.source,I=this.skip(M,this.index),N=this.fork(I),U=x(L,I);if(T(W,U))return N.number();switch(U){case"{":return N.object();case"[":return N.array();case'"':return N.string();case"t":return N.keyword(!0);case"f":return N.keyword(!1);case"n":return N.keyword(null)}throw new A('Unexpected character: "'+U+'" at: '+I)},node:function(L,I,N,U,Z){return new Q(I,U,L?null:P(this.source,N,U),Z)},object:function(){for(var L=this.source,I=this.index+1,N=!1,U={},Z={},$=!1;I<L.length;){if(I=this.until(['"',"}"],I),x(L,I)==="}"&&!N){I++,$=!0;break}var X=this.fork(I).string(),rt=X.value;I=X.end,I=this.until([":"],I)+1,I=this.skip(M,I),X=this.fork(I).parse(),p(Z,rt,X),p(U,rt,X.value),I=this.until([",","}"],X.end);var wt=x(L,I);if(wt===",")N=!0,I++;else if(wt==="}"){I++,$=!0;break}}if(!$)throw new A("Unterminated object at: "+I);return this.node(_,U,this.index,I,Z)},array:function(){for(var L=this.source,I=this.index+1,N=!1,U=[],Z=[],$=!1;I<L.length;){if(I=this.skip(M,I),x(L,I)==="]"&&!N){I++,$=!0;break}var X=this.fork(I).parse();if(k(Z,X),k(U,X.value),I=this.until([",","]"],X.end),x(L,I)===",")N=!0,I++;else if(x(L,I)==="]"){I++,$=!0;break}}if(!$)throw new A("Unterminated array at: "+I);return this.node(_,U,this.index,I,Z)},string:function(){var L=this.index,I=v(this.source,this.index+1);return this.node(O,I.value,L,I.end)},number:function(){var L=this.source,I=this.index,N=I;if(x(L,N)==="-"&&N++,x(L,N)==="0")N++;else if(T(D,x(L,N)))N=this.skip(R,N+1);else throw new A("Failed to parse number at: "+N);if(x(L,N)==="."){var U=N+1;if(N=this.skip(R,U),U===N)throw new A("Failed to parse number's fraction at: "+N)}if(x(L,N)==="e"||x(L,N)==="E"){N++,(x(L,N)==="+"||x(L,N)==="-")&&N++;var Z=N;if(N=this.skip(R,N),Z===N)throw new A("Failed to parse number's exponent value at: "+N)}return this.node(O,w(P(L,I,N)),I,N)},keyword:function(L){var I=""+L,N=this.index,U=N+I.length;if(P(this.source,N,U)!==I)throw new A("Failed to parse value at: "+N);return this.node(O,L,N,U)},skip:function(L,I){for(var N=this.source;I<N.length&&T(L,x(N,I));I++);return I},until:function(L,I){I=this.skip(M,I);for(var N=x(this.source,I),U=0;U<L.length;U++)if(L[U]===N)return I;throw new A('Unexpected character: "'+N+'" at: '+I)}};var q=m(function(){var L="9007199254740993",I;return S(L,function(N,U,Z){I=Z.source}),I!==L}),at=y&&!m(function(){return 1/S("-0 ")!==-1/0});s({target:"JSON",stat:!0,forced:q},{parse:function(I,N){return at&&!l(N)?S(I):j(I,N)}})},3110(h,t,e){var s=e(6518),i=e(7751),n=e(8745),r=e(9565),a=e(9504),o=e(9039),l=e(4376),c=e(4901),d=e(5810),u=e(757),f=e(2195),g=e(655),p=e(7680),m=e(8235),v=e(3392),y=e(4495),b=e(7819),w=String,A=i("JSON","stringify"),S=a(/./.exec),E=a("".charAt),C=a("".charCodeAt),x=a("".replace),P=a("".slice),T=a([].push),k=a(1.1.toString),R=/[\uD800-\uDFFF]/g,D=/^[\uD800-\uDBFF]$/,W=/^[\uDC00-\uDFFF]$/,M=v(),O=M.length,_=!y||o(function(){var G=i("Symbol")("stringify detection");return A([G])!=="[null]"||A({a:G})!=="{}"||A(Object(G))!=="{}"}),j=o(function(){return A("\uDF06\uD834")!=='"\\udf06\\ud834"'||A("\uDEAD")!=='"\\udead"'}),tt=_?function(G,q){var at=p(arguments),L=Q(q);if(!(!c(L)&&(G===void 0||u(G))))return at[1]=function(I,N){if(c(L)&&(N=r(L,this,w(I),N)),!u(N))return N},n(A,null,at)}:A,et=function(G,q,at){var L=E(at,q-1),I=E(at,q+1);return S(D,G)&&!S(W,I)||S(W,G)&&!S(D,L)?"\\u"+k(C(G,0),16):G},Q=function(G){if(c(G))return G;if(l(G)){for(var q=G.length,at=[],L=0;L<q;L++){var I=G[L];typeof I=="string"?T(at,I):(typeof I=="number"||f(I)==="Number"||f(I)==="String")&&T(at,g(I))}var N=at.length,U=!0;return function(Z,$){if(U)return U=!1,$;if(l(this))return $;for(var X=0;X<N;X++)if(at[X]===Z)return $}}};A&&s({target:"JSON",stat:!0,arity:3,forced:_||j||!b},{stringify:function(q,at,L){var I=Q(at),N=[],U=tt(q,function(gt,Wt){var se=c(I)?r(I,this,w(gt),Wt):Wt;return!b&&d(se)?M+(T(N,se.rawJSON)-1):se},L);if(typeof U!="string"||(j&&(U=x(U,R,et)),b))return U;for(var Z="",$=U.length,X=0;X<$;X++){var rt=E(U,X);if(rt==='"'){var wt=m(U,++X).end-1,bt=P(U,X,wt);Z+=P(bt,0,O)===M?N[P(bt,O)]:'"'+bt+'"',X=wt}else Z+=rt}return Z}})},2731(h,t,e){var s=e(6518),i=e(9306),n=e(2248),r=e(6395),a=n.get,o=n.has,l=n.set;s({target:"Map",proto:!0,real:!0,forced:r},{getOrInsertComputed:function(d,u){var f=o(this,d);if(i(u),f)return a(this,d);d===0&&1/d===-1/0&&(d=0);var g=u(d);return l(this,d,g),g}})},5367(h,t,e){var s=e(6518),i=e(2248),n=e(6395),r=i.get,a=i.has,o=i.set;s({target:"Map",proto:!0,real:!0,forced:n},{getOrInsert:function(c,d){return a(this,c)?r(this,c):(o(this,c,d),d)}})},3068(h,t,e){var s=e(6518),i=e(9504),n=e(2652),r=RangeError,a=TypeError,o=1/0,l=NaN,c=Math.abs,d=Math.pow,u=i([].push),f=d(2,1023),g=d(2,53)-1,p=Number.MAX_VALUE,m=d(2,971),v={},y={},b={},w={},A={},S=function(E,C){var x=E+C,P=C-(x-E);return{hi:x,lo:P}};s({target:"Math",stat:!0},{sumPrecise:function(C){var x=[],P=0,T=w;switch(n(C,function(L){if(++P>g)throw new r("Maximum allowed index exceeded");if(typeof L!="number")throw new a("Value is not a number");T!==v&&(L!==L?T=v:L===o?T=T===y?v:b:L===-o?T=T===b?v:y:(L!==0||1/L===o)&&(T===w||T===A)&&(T=A,u(x,L)))}),T){case v:return l;case y:return-o;case b:return o;case w:return-0}for(var k=[],R=0,D,W,M,O,_,j,tt=0;tt<x.length;tt++){D=x[tt];for(var et=0,Q=0;Q<k.length;Q++){if(W=k[Q],c(D)<c(W)&&(j=D,D=W,W=j),M=S(D,W),O=M.hi,_=M.lo,c(O)===o){var G=O===o?1:-1;R+=G,D=D-G*f-G*f,c(D)<c(W)&&(j=D,D=W,W=j),M=S(D,W),O=M.hi,_=M.lo}_!==0&&(k[et++]=_),D=O}k.length=et,D!==0&&u(k,D)}var q=k.length-1;if(O=0,_=0,R!==0){var at=q>=0?k[q]:0;if(q--,c(R)>1||R>0&&at>0||R<0&&at<0)return R>0?o:-o;if(M=S(R*f,at/2),O=M.hi,_=M.lo,_*=2,c(2*O)===o)return O>0?O===f&&_===-(m/2)&&q>=0&&k[q]<0?p:o:O===-f&&_===m/2&&q>=0&&k[q]>0?-p:-o;_!==0&&(k[++q]=_,_=0),O*=2}for(;q>=0&&(M=S(O,k[q--]),O=M.hi,_=M.lo,_===0););return q>=0&&(_<0&&k[q]<0||_>0&&k[q]>0)&&(W=_*2,D=O+W,W===D-O&&(O=D)),O}})},1689(h,t,e){var s=e(6518),i=e(4576),n=e(8745),r=e(7680),a=e(6043),o=e(9306),l=e(1103),c=i.Promise,d=!1,u=!c||!c.try||l(function(){c.try(function(f){d=f===8},8)}).error||!d;s({target:"Promise",stat:!0,forced:u},{try:function(f){var g=arguments.length>1?r(arguments,1):[],p=a.f(this),m=l(function(){return n(o(f),void 0,g)});return(m.error?p.reject:p.resolve)(m.value),p.promise}})},4628(h,t,e){var s=e(6518),i=e(6043);s({target:"Promise",stat:!0},{withResolvers:function(){var r=i.f(this);return{promise:r.promise,resolve:r.resolve,reject:r.reject}}})},7642(h,t,e){var s=e(6518),i=e(3440),n=e(9039),r=e(4916),a=!r("difference",function(l){return l.size===0}),o=a||n(function(){var l={size:1,has:function(){return!0},keys:function(){var d=0;return{next:function(){var u=d++>1;return c.has(1)&&c.clear(),{done:u,value:2}}}}},c=new Set([1,2,3,4]);return c.difference(l).size!==3});s({target:"Set",proto:!0,real:!0,forced:o},{difference:i})},8004(h,t,e){var s=e(6518),i=e(9039),n=e(8750),r=e(4916),a=!r("intersection",function(o){return o.size===2&&o.has(1)&&o.has(2)})||i(function(){return String(Array.from(new Set([1,2,3]).intersection(new Set([3,2]))))!=="3,2"});s({target:"Set",proto:!0,real:!0,forced:a},{intersection:n})},3853(h,t,e){var s=e(6518),i=e(4449),n=e(4916),r=!n("isDisjointFrom",function(a){return!a});s({target:"Set",proto:!0,real:!0,forced:r},{isDisjointFrom:i})},5876(h,t,e){var s=e(6518),i=e(3838),n=e(4916),r=!n("isSubsetOf",function(a){return a});s({target:"Set",proto:!0,real:!0,forced:r},{isSubsetOf:i})},2475(h,t,e){var s=e(6518),i=e(8527),n=e(4916),r=!n("isSupersetOf",function(a){return!a});s({target:"Set",proto:!0,real:!0,forced:r},{isSupersetOf:i})},5024(h,t,e){var s=e(6518),i=e(3650),n=e(9835),r=e(4916),a=!r("symmetricDifference")||!n("symmetricDifference");s({target:"Set",proto:!0,real:!0,forced:a},{symmetricDifference:i})},1698(h,t,e){var s=e(6518),i=e(4204),n=e(9835),r=e(4916),a=!r("union")||!n("union");s({target:"Set",proto:!0,real:!0,forced:a},{union:i})},9577(h,t,e){var s=e(4644),i=e(1108),n=e(6198),r=e(1291),a=e(5854),o=s.aTypedArray,l=s.getTypedArrayConstructor,c=s.exportTypedArrayMethod,d=RangeError,u=(function(){try{new Int8Array(1).with(2,{valueOf:function(){throw 8}})}catch(g){return g===8}})(),f=u&&(function(){try{new Int8Array(1).with(-.5,1)}catch{return!0}})();c("with",function(g,p){var m=o(this),v=n(m),y=r(g),b=y<0?v+y:y,w=i(m)?a(p):+p;if(b>=v||b<0)throw new d("Incorrect index");for(var A=new(l(m))(v),S=0;S<v;S++)A[S]=S===b?w:m[S];return A},!u||f)},5213(h,t,e){var s=e(6518),i=e(4576),n=e(5370),r=e(9143),a=i.Uint8Array,o=!a||!a.fromBase64||!(function(){try{a.fromBase64("a");return}catch{}try{a.fromBase64("",null)}catch{return!0}})();a&&s({target:"Uint8Array",stat:!0,forced:o},{fromBase64:function(c){var d=r(c,arguments.length>1?arguments[1]:void 0,null,9007199254740991);return n(a,d.bytes)}})},6632(h,t,e){var s=e(6518),i=e(4576),n=e(9143),r=e(4154),a=i.Uint8Array,o=!a||!a.prototype.setFromBase64||!(function(){var l=new a([255,255,255,255,255]);try{l.setFromBase64("",null);return}catch{}try{l.setFromBase64("a");return}catch{}try{l.setFromBase64("MjYyZg===")}catch{return l[0]===50&&l[1]===54&&l[2]===50&&l[3]===255&&l[4]===255}})();a&&s({target:"Uint8Array",proto:!0,forced:o},{setFromBase64:function(c){r(this);var d=n(c,arguments.length>1?arguments[1]:void 0,this,this.length);return{read:d.read,written:d.written}}})},4226(h,t,e){var s=e(6518),i=e(4576),n=e(3463),r=e(4154),a=e(5169),o=e(2303);function l(){try{var c=new ArrayBuffer(16,{maxByteLength:1024});new Uint8Array(c).setFromHex("cafed00d")}catch{return!0}}i.Uint8Array&&s({target:"Uint8Array",proto:!0,forced:l()},{setFromHex:function(d){r(this),n(d),a(this.buffer);var u=o(d,this).read;return{read:u,written:u/2}}})},9486(h,t,e){var s=e(6518),i=e(4576),n=e(9504),r=e(3972),a=e(4154),o=e(5169),l=e(2804),c=e(944),d=l.i2c,u=l.i2cUrl,f=n("".charAt),g=i.Uint8Array,p=!g||!g.prototype.toBase64||!(function(){try{var m=new g;m.toBase64(null)}catch{return!0}})();g&&s({target:"Uint8Array",proto:!0,forced:p},{toBase64:function(){var v=a(this),y=arguments.length?r(arguments[0]):void 0,b=c(y)==="base64"?d:u,w=!!y&&!!y.omitPadding;o(this.buffer);for(var A="",S=0,E=v.length,C,x=function(P){return f(b,C>>6*P&63)};S+2<E;S+=3)C=(v[S]<<16)+(v[S+1]<<8)+v[S+2],A+=x(3)+x(2)+x(1)+x(0);return S+2===E?(C=(v[S]<<16)+(v[S+1]<<8),A+=x(3)+x(2)+x(1)+(w?"":"=")):S+1===E&&(C=v[S]<<16,A+=x(3)+x(2)+(w?"":"==")),A}})},456(h,t,e){var s=e(6518),i=e(4576),n=e(9504),r=e(4154),a=e(5169),o=n(1.1.toString),l=n([].join),c=Array,d=i.Uint8Array,u=!d||!d.prototype.toHex||!(function(){try{var f=new d([255,255,255,255,255,255,255,255]);return f.toHex()==="ffffffffffffffff"}catch{return!1}})();d&&s({target:"Uint8Array",proto:!0,forced:u},{toHex:function(){r(this),a(this.buffer);for(var g=c(this.length),p=0,m=this.length;p<m;p++){var v=o(this[p],16);g[p]=v.length===1?"0"+v:v}return l(g,"")}})},9452(h,t,e){var s=e(6518),i=e(9306),n=e(6557),r=e(4328),a=e(4995),o=e(6395),l=a.get,c=a.has,d=a.set,u=o||!(function(){try{WeakMap.prototype.getOrInsertComputed&&new WeakMap().getOrInsertComputed(1,function(){throw 1})}catch(f){return f instanceof TypeError}})();s({target:"WeakMap",proto:!0,real:!0,forced:u},{getOrInsertComputed:function(g,p){if(o||n(this),r(g),i(p),c(this,g))return l(this,g);var m=p(g);return d(this,g,m),m}})},8454(h,t,e){var s=e(6518),i=e(4995),n=e(6395),r=i.get,a=i.has,o=i.set;s({target:"WeakMap",proto:!0,real:!0,forced:n},{getOrInsert:function(c,d){return a(this,c)?r(this,c):(o(this,c,d),d)}})},4979(h,t,e){var s=e(6518),i=e(4576),n=e(7751),r=e(6980),a=e(4913).f,o=e(9297),l=e(679),c=e(3167),d=e(2603),u=e(5002),f=e(8574),g=e(3724),p=e(6395),m="DOMException",v=n("Error"),y=n(m),b=function(){l(this,w);var M=arguments.length,O=d(M<1?void 0:arguments[0]),_=d(M<2?void 0:arguments[1],"Error"),j=new y(O,_),tt=new v(O);return tt.name=m,a(j,"stack",r(1,f(tt.stack,1))),c(j,this,b),j},w=b.prototype=y.prototype,A="stack"in new v(m),S="stack"in new y(1,2),E=y&&g&&Object.getOwnPropertyDescriptor(i,m),C=!!E&&!(E.writable&&E.configurable),x=A&&!C&&!S;s({global:!0,constructor:!0,forced:p||x},{DOMException:x?b:y});var P=n(m),T=P.prototype;if(T.constructor!==P){p||a(T,"constructor",r(1,P));for(var k in u)if(o(u,k)){var R=u[k],D=R.s;o(P,D)||a(P,D,r(6,R.c))}}},4603(h,t,e){var s=e(6840),i=e(9504),n=e(655),r=e(2812),a=URLSearchParams,o=a.prototype,l=i(o.append),c=i(o.delete),d=i(o.forEach),u=i([].push),f=new a("a=1&a=2&b=3");f.delete("a",1),f.delete("b",void 0),f+""!="a=2"&&s(o,"delete",function(g){var p=arguments.length,m=p<2?void 0:arguments[1];if(p&&m===void 0)return c(this,g);var v=[];d(this,function(E,C){u(v,{key:C,value:E})}),r(p,1);for(var y=n(g),b=n(m),w=0,A=v.length,S;w<A;)S=v[w],c(this,S.key),w++;for(w=0;w<A;)S=v[w++],S.key===y&&S.value===b||l(this,S.key,S.value)},{enumerable:!0,unsafe:!0})},7566(h,t,e){var s=e(6840),i=e(9504),n=e(655),r=e(2812),a=URLSearchParams,o=a.prototype,l=i(o.getAll),c=i(o.has),d=new a("a=1");(d.has("a",2)||!d.has("a",void 0))&&s(o,"has",function(f){var g=arguments.length,p=g<2?void 0:arguments[1];if(g&&p===void 0)return c(this,f);var m=l(this,f);r(g,1);for(var v=n(p),y=0;y<m.length;)if(m[y++]===v)return!0;return!1},{enumerable:!0,unsafe:!0})},8721(h,t,e){var s=e(3724),i=e(9504),n=e(2106),r=URLSearchParams.prototype,a=i(r.forEach);s&&!("size"in r)&&n(r,"size",{get:function(){var l=0;return a(this,function(){l++}),l},configurable:!0,enumerable:!0})},5781(h,t,e){var s=e(6518),i=e(7751),n=e(2812),r=e(655),a=e(7416),o=i("URL");s({target:"URL",stat:!0,forced:!a},{parse:function(c){var d=n(arguments.length,1),u=r(c),f=d<2||arguments[1]===void 0?void 0:r(arguments[1]);try{return new o(u,f)}catch{return null}}})}},hi={};function V(h){var t=hi[h];if(t!==void 0)return t.exports;var e=hi[h]={exports:{}};return gn[h].call(e.exports,e,e.exports,V),e.exports}V.d=(h,t)=>{for(var e in t)V.o(t,e)&&!V.o(h,e)&&Object.defineProperty(h,e,{enumerable:!0,get:t[e]})};V.o=(h,t)=>Object.prototype.hasOwnProperty.call(h,t);V(4423);V(4114);V(6573);V(8100);V(7936);V(5367);V(2731);V(9577);V(6632);V(4226);V(9486);V(456);V(5781);const Mt=typeof process=="object"&&process+""=="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&process.type!=="browser"),Qt=[1/0,1/0,-1/0,-1/0],ne=new Float32Array(Qt),Rs=[.001,0,0,.001,0,0],Es=1.35,Rt={ANY:1,DISPLAY:2,PRINT:4,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,IS_EDITING:128,OPLIST:256},Zt={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},Fe="pdfjs_internal_editor_",Y={DISABLE:-1,NONE:0,FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15,POPUP:16,SIGNATURE:101,COMMENT:102},J={RESIZE:1,CREATE:2,FREETEXT_SIZE:11,FREETEXT_COLOR:12,FREETEXT_OPACITY:13,INK_COLOR:21,INK_THICKNESS:22,INK_OPACITY:23,INK_COLOR_AND_OPACITY:24,HIGHLIGHT_COLOR:31,HIGHLIGHT_THICKNESS:32,HIGHLIGHT_FREE:33,HIGHLIGHT_SHOW_ALL:34,DRAW_STEP:41},mn={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},At={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4},Ze={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},vt={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},pe={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5},os={ERRORS:0,WARNINGS:1,INFOS:5},Kt={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotation:80,endAnnotation:81,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91,setStrokeTransparent:92,setFillTransparent:93,rawFillPath:94},Ee={moveTo:0,lineTo:1,curveTo:2,quadraticCurveTo:3,closePath:4},vn={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};let ls=os.WARNINGS;function yn(h){Number.isInteger(h)&&(ls=h)}function bn(){return ls}function hs(h){ls>=os.INFOS&&console.info(`Info: ${h}`)}function z(h){ls>=os.WARNINGS&&console.warn(`Warning: ${h}`)}function nt(h){throw new Error(h)}function dt(h,t){h||nt(t)}function An(h){switch(h?.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function Ui(h,t=null,e=null){if(!h)return null;if(e&&typeof h=="string"&&(e.addDefaultProtocol&&h.startsWith("www.")&&h.match(/\./g)?.length>=2&&(h=`http://${h}`),e.tryConvertEncoding))try{h=xn(h)}catch{}const s=t?URL.parse(h,t):URL.parse(h);return An(s)?s:null}function Hi(h,t,e=!1){const s=URL.parse(h);return s?(s.hash=t,s.href):e&&Ui(h,"http://example.com")?h.split("#",1)[0]+`${t?`#${t}`:""}`:""}function Os(h){return h.substring(h.lastIndexOf("/")+1)}function K(h,t,e,s=!1){return Object.defineProperty(h,t,{value:e,enumerable:!s,configurable:!0,writable:!1}),e}const de=(function(){function t(e,s){this.message=e,this.name=s}return t.prototype=new Error,t.constructor=t,t})();class ci extends de{constructor(t,e){super(t,"PasswordException"),this.code=e}}class xs extends de{constructor(t,e){super(t,"UnknownErrorException"),this.details=e}}class Ms extends de{constructor(t){super(t,"InvalidPDFException")}}class ss extends de{constructor(t,e,s){super(t,"ResponseException"),this.status=e,this.missing=s}}class wn extends de{constructor(t){super(t,"FormatError")}}class te extends de{constructor(t){super(t,"AbortException")}}function Sn(h){(typeof h!="object"||h?.length===void 0)&&nt("Invalid argument for bytesToString");const t=h.length,e=8192;if(t<e)return String.fromCharCode.apply(null,h);const s=[];for(let i=0;i<t;i+=e){const n=Math.min(i+e,t),r=h.subarray(i,n);s.push(String.fromCharCode.apply(null,r))}return s.join("")}function cs(h){typeof h!="string"&&nt("Invalid argument for stringToBytes");const t=h.length,e=new Uint8Array(t);for(let s=0;s<t;++s)e[s]=h.charCodeAt(s)&255;return e}function En(){const h=new Uint8Array(4);return h[0]=1,new Uint32Array(h.buffer,0,1)[0]===1}class yt{static get isLittleEndian(){return K(this,"isLittleEndian",En())}static get isOffscreenCanvasSupported(){return K(this,"isOffscreenCanvasSupported",typeof OffscreenCanvas<"u")}static get isImageDecoderSupported(){return K(this,"isImageDecoderSupported",typeof ImageDecoder<"u")}static get isFloat16ArraySupported(){return K(this,"isFloat16ArraySupported",typeof Float16Array<"u")}static get isSanitizerSupported(){return K(this,"isSanitizerSupported",typeof Sanitizer<"u")}static get platform(){const{platform:t,userAgent:e}=navigator;return K(this,"platform",{isAndroid:e.includes("Android"),isLinux:t.includes("Linux"),isMac:t.includes("Mac"),isWindows:t.includes("Win"),isFirefox:e.includes("Firefox")})}static get isCSSRoundSupported(){return K(this,"isCSSRoundSupported",globalThis.CSS?.supports?.("width: round(1.5px, 1px)"))}static get isAlphaColorInputSupported(){return K(this,"isAlphaColorInputSupported",(()=>{if(typeof document>"u")return!1;const t=document.createElement("input");return t.type="color",t.setAttribute("alpha",""),t.value="#ff000080",t.value!=="#ff0000"})())}}class F{static get hexNums(){return K(this,"hexNums",Array.from(Array(256).keys(),t=>t.toString(16).padStart(2,"0")))}static makeHexColor(t,e,s){return`#${this.hexNums[t]}${this.hexNums[e]}${this.hexNums[s]}`}static domMatrixToTransform(t){return[t.a,t.b,t.c,t.d,t.e,t.f]}static scaleMinMax(t,e){let s;t[0]?(t[0]<0&&(s=e[0],e[0]=e[2],e[2]=s),e[0]*=t[0],e[2]*=t[0],t[3]<0&&(s=e[1],e[1]=e[3],e[3]=s),e[1]*=t[3],e[3]*=t[3]):(s=e[0],e[0]=e[1],e[1]=s,s=e[2],e[2]=e[3],e[3]=s,t[1]<0&&(s=e[1],e[1]=e[3],e[3]=s),e[1]*=t[1],e[3]*=t[1],t[2]<0&&(s=e[0],e[0]=e[2],e[2]=s),e[0]*=t[2],e[2]*=t[2]),e[0]+=t[4],e[1]+=t[5],e[2]+=t[4],e[3]+=t[5]}static transform(t,e){return[t[0]*e[0]+t[2]*e[1],t[1]*e[0]+t[3]*e[1],t[0]*e[2]+t[2]*e[3],t[1]*e[2]+t[3]*e[3],t[0]*e[4]+t[2]*e[5]+t[4],t[1]*e[4]+t[3]*e[5]+t[5]]}static multiplyByDOMMatrix(t,e){return[t[0]*e.a+t[2]*e.b,t[1]*e.a+t[3]*e.b,t[0]*e.c+t[2]*e.d,t[1]*e.c+t[3]*e.d,t[0]*e.e+t[2]*e.f+t[4],t[1]*e.e+t[3]*e.f+t[5]]}static applyTransform(t,e,s=0){const i=t[s],n=t[s+1];t[s]=i*e[0]+n*e[2]+e[4],t[s+1]=i*e[1]+n*e[3]+e[5]}static applyTransformToBezier(t,e,s=0){const i=e[0],n=e[1],r=e[2],a=e[3],o=e[4],l=e[5];for(let c=0;c<6;c+=2){const d=t[s+c],u=t[s+c+1];t[s+c]=d*i+u*r+o,t[s+c+1]=d*n+u*a+l}}static applyInverseTransform(t,e){const s=t[0],i=t[1],n=e[0]*e[3]-e[1]*e[2];t[0]=(s*e[3]-i*e[2]+e[2]*e[5]-e[4]*e[3])/n,t[1]=(-s*e[1]+i*e[0]+e[4]*e[1]-e[5]*e[0])/n}static axialAlignedBoundingBox(t,e,s){const i=e[0],n=e[1],r=e[2],a=e[3],o=e[4],l=e[5],c=t[0],d=t[1],u=t[2],f=t[3];let g=i*c+o,p=g,m=i*u+o,v=m,y=a*d+l,b=y,w=a*f+l,A=w;if(n!==0||r!==0){const S=n*c,E=n*u,C=r*d,x=r*f;g+=C,v+=C,m+=x,p+=x,y+=S,A+=S,w+=E,b+=E}s[0]=Math.min(s[0],g,m,p,v),s[1]=Math.min(s[1],y,w,b,A),s[2]=Math.max(s[2],g,m,p,v),s[3]=Math.max(s[3],y,w,b,A)}static inverseTransform(t){const e=t[0]*t[3]-t[1]*t[2];return[t[3]/e,-t[1]/e,-t[2]/e,t[0]/e,(t[2]*t[5]-t[4]*t[3])/e,(t[4]*t[1]-t[5]*t[0])/e]}static singularValueDecompose2dScale(t,e){const s=t[0],i=t[1],n=t[2],r=t[3],a=s**2+i**2,o=s*n+i*r,l=n**2+r**2,c=(a+l)/2,d=Math.sqrt(c**2-(a*l-o**2));e[0]=Math.sqrt(c+d||1),e[1]=Math.sqrt(c-d||1)}static normalizeRect(t){const e=t.slice(0);return t[0]>t[2]&&(e[0]=t[2],e[2]=t[0]),t[1]>t[3]&&(e[1]=t[3],e[3]=t[1]),e}static intersect(t,e){const s=Math.max(Math.min(t[0],t[2]),Math.min(e[0],e[2])),i=Math.min(Math.max(t[0],t[2]),Math.max(e[0],e[2]));if(s>i)return null;const n=Math.max(Math.min(t[1],t[3]),Math.min(e[1],e[3])),r=Math.min(Math.max(t[1],t[3]),Math.max(e[1],e[3]));return n>r?null:[s,n,i,r]}static pointBoundingBox(t,e,s){s[0]=Math.min(s[0],t),s[1]=Math.min(s[1],e),s[2]=Math.max(s[2],t),s[3]=Math.max(s[3],e)}static rectBoundingBox(t,e,s,i,n){n[0]=Math.min(n[0],t,s),n[1]=Math.min(n[1],e,i),n[2]=Math.max(n[2],t,s),n[3]=Math.max(n[3],e,i)}static#t(t,e,s,i,n,r,a,o,l,c){if(l<=0||l>=1)return;const d=1-l,u=l*l,f=u*l,g=d*(d*(d*t+3*l*e)+3*u*s)+f*i,p=d*(d*(d*n+3*l*r)+3*u*a)+f*o;c[0]=Math.min(c[0],g),c[1]=Math.min(c[1],p),c[2]=Math.max(c[2],g),c[3]=Math.max(c[3],p)}static#e(t,e,s,i,n,r,a,o,l,c,d,u){if(Math.abs(l)<1e-12){Math.abs(c)>=1e-12&&this.#t(t,e,s,i,n,r,a,o,-d/c,u);return}const f=c**2-4*d*l;if(f<0)return;const g=Math.sqrt(f),p=2*l;this.#t(t,e,s,i,n,r,a,o,(-c+g)/p,u),this.#t(t,e,s,i,n,r,a,o,(-c-g)/p,u)}static bezierBoundingBox(t,e,s,i,n,r,a,o,l){l[0]=Math.min(l[0],t,a),l[1]=Math.min(l[1],e,o),l[2]=Math.max(l[2],t,a),l[3]=Math.max(l[3],e,o),this.#e(t,s,n,a,e,i,r,o,3*(-t+3*(s-n)+a),6*(t-2*s+n),3*(s-t),l),this.#e(t,s,n,a,e,i,r,o,3*(-e+3*(i-r)+o),6*(e-2*i+r),3*(i-e),l)}}function xn(h){return decodeURIComponent(escape(h))}let Ts=null,di=null;function Tn(h){return Ts||(Ts=/([\u00a0\u00b5\u037e\u0eb3\u2000-\u200a\u202f\u2126\ufb00-\ufb04\ufb06\ufb20-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufba1\ufba4-\ufba9\ufbae-\ufbb1\ufbd3-\ufbdc\ufbde-\ufbe7\ufbea-\ufbf8\ufbfc-\ufbfd\ufc00-\ufc5d\ufc64-\ufcf1\ufcf5-\ufd3d\ufd88\ufdf4\ufdfa-\ufdfb\ufe71\ufe77\ufe79\ufe7b\ufe7d]+)|(\ufb05+)/gu,di=new Map([["ſt","ſt"]])),h.replaceAll(Ts,(t,e,s)=>e?e.normalize("NFKC"):di.get(s))}function $i(){if(typeof crypto.randomUUID=="function")return crypto.randomUUID();const h=new Uint8Array(32);return crypto.getRandomValues(h),Sn(h)}const ye="pdfjs_internal_id_";function Cn(h,t,e){if(!Array.isArray(e)||e.length<2)return!1;const[s,i,...n]=e;if(!h(s)&&!Number.isInteger(s)||!t(i))return!1;const r=n.length;let a=!0;switch(i.name){case"XYZ":if(r<2||r>3)return!1;break;case"Fit":case"FitB":return r===0;case"FitH":case"FitBH":case"FitV":case"FitBV":if(r>1)return!1;break;case"FitR":if(r!==4)return!1;a=!1;break;default:return!1}for(const o of n)if(!(typeof o=="number"||a&&o===null))return!1;return!0}const Gs=()=>[],zs=()=>new Map,Ds=()=>Object.create(null);typeof Blob.prototype.bytes!="function"&&(Blob.prototype.bytes=async function(){return new Uint8Array(await this.arrayBuffer())});typeof Response.prototype.bytes!="function"&&(Response.prototype.bytes=async function(){return new Uint8Array(await this.arrayBuffer())});typeof AbortSignal.any!="function"&&(AbortSignal.any=function(h){const t=new AbortController,{signal:e}=t;for(const s of h)if(s.aborted)return t.abort(s.reason),e;for(const s of h)s.addEventListener("abort",()=>{t.abort(s.reason)},{signal:e});return e});V(8111);V(1701);V(4603);V(7566);V(8721);function ht(h,t,e){return Math.min(Math.max(h,t),e)}class Le{static textContent(t){const e=[],s={items:e,styles:Object.create(null)};function i(n){if(!n)return;let r=null;const a=n.name;if(a==="#text")r=n.value;else if(Le.shouldBuildText(a))n?.attributes?.textContent?r=n.attributes.textContent:n.value&&(r=n.value);else return;if(r!==null&&e.push({str:r}),!!n.children)for(const o of n.children)i(o)}return i(t),s}static shouldBuildText(t){return!(t==="textarea"||t==="input"||t==="option"||t==="select")}}class ji{static setupStorage(t,e,s,i,n){const r=i.getValue(e,{value:null});switch(s.name){case"textarea":if(r.value!==null&&(t.textContent=r.value),n==="print")break;t.addEventListener("input",a=>{i.setValue(e,{value:a.target.value})});break;case"input":if(s.attributes.type==="radio"||s.attributes.type==="checkbox"){if(r.value===s.attributes.xfaOn?t.setAttribute("checked",!0):r.value===s.attributes.xfaOff&&t.removeAttribute("checked"),n==="print")break;t.addEventListener("change",a=>{i.setValue(e,{value:a.target.checked?a.target.getAttribute("xfaOn"):a.target.getAttribute("xfaOff")})})}else{if(r.value!==null&&t.setAttribute("value",r.value),n==="print")break;t.addEventListener("input",a=>{i.setValue(e,{value:a.target.value})})}break;case"select":if(r.value!==null){t.setAttribute("value",r.value);for(const a of s.children)a.attributes.value===r.value?a.attributes.selected=!0:Object.hasOwn(a.attributes,"selected")&&delete a.attributes.selected}t.addEventListener("input",a=>{const o=a.target.options,l=o.selectedIndex===-1?"":o[o.selectedIndex].value;i.setValue(e,{value:l})});break}}static setAttributes({html:t,element:e,storage:s=null,intent:i,linkService:n}){const{attributes:r}=e,a=t instanceof HTMLAnchorElement;r.type==="radio"&&(r.name=`${r.name}-${i}`);for(const[o,l]of Object.entries(r))if(l!=null)switch(o){case"class":l.length&&t.setAttribute(o,l.join(" "));break;case"dataId":break;case"id":t.setAttribute("data-element-id",l);break;case"style":Object.assign(t.style,l);break;case"textContent":t.textContent=l;break;default:(!a||o!=="href"&&o!=="newWindow")&&t.setAttribute(o,l)}a&&n.addLinkAttributes(t,r.href,r.newWindow),s&&r.dataId&&this.setupStorage(t,r.dataId,e,s)}static render(t){const e=t.annotationStorage,s=t.linkService,i=t.xfaHtml,n=t.intent||"display",r=document.createElement(i.name);i.attributes&&this.setAttributes({html:r,element:i,intent:n,linkService:s});const a=n!=="richText",o=t.div;if(o.append(r),t.viewport){const d=`matrix(${t.viewport.transform.join(",")})`;o.style.transform=d}a&&o.setAttribute("class","xfaLayer xfaFont");const l=[];if(i.children.length===0){if(i.value){const d=document.createTextNode(i.value);r.append(d),a&&Le.shouldBuildText(i.name)&&l.push(d)}return{textDivs:l}}const c=[[i,-1,r]];for(;c.length>0;){const[d,u,f]=c.at(-1);if(u+1===d.children.length){c.pop();continue}const g=d.children[++c.at(-1)[1]];if(g===null)continue;const{name:p}=g;if(p==="#text"){const v=document.createTextNode(g.value);l.push(v),f.append(v);continue}const m=g?.attributes?.xmlns?document.createElementNS(g.attributes.xmlns,p):document.createElement(p);if(f.append(m),g.attributes&&this.setAttributes({html:m,element:g,storage:e,intent:n,linkService:s}),g.children?.length>0)c.push([g,-1,m]);else if(g.value){const v=document.createTextNode(g.value);a&&Le.shouldBuildText(p)&&l.push(v),m.append(v)}}for(const d of o.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))d.setAttribute("readOnly",!0);return{textDivs:l}}static update(t){const e=`matrix(${t.viewport.transform.join(",")})`;t.div.style.transform=e,t.div.hidden=!1}}const Xt="http://www.w3.org/2000/svg";class Se{static CSS=96;static PDF=72;static PDF_TO_CSS_UNITS=this.CSS/this.PDF}async function Vs(h,t="text"){if(Re(h,document.baseURI)){const e=await fetch(h);if(!e.ok)throw new Error(e.statusText);switch(t){case"blob":return e.blob();case"bytes":return e.bytes();case"json":return e.json()}return e.text()}return new Promise((e,s)=>{const i=new XMLHttpRequest;i.open("GET",h,!0),i.responseType=t==="bytes"?"arraybuffer":t,i.onreadystatechange=()=>{if(i.readyState===XMLHttpRequest.DONE){if(i.status===200||i.status===0){switch(t){case"bytes":e(new Uint8Array(i.response));return;case"blob":case"json":e(i.response);return}e(i.responseText);return}s(new Error(i.statusText))}},i.send(null)})}class Ue{constructor({viewBox:t,userUnit:e,scale:s,rotation:i,offsetX:n=0,offsetY:r=0,dontFlip:a=!1}){this.viewBox=t,this.userUnit=e,this.scale=s,this.rotation=i,this.offsetX=n,this.offsetY=r,s*=e;const o=(t[2]+t[0])/2,l=(t[3]+t[1])/2;let c,d,u,f;switch(i%=360,i<0&&(i+=360),i){case 180:c=-1,d=0,u=0,f=1;break;case 90:c=0,d=1,u=1,f=0;break;case 270:c=0,d=-1,u=-1,f=0;break;case 0:c=1,d=0,u=0,f=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}a&&(u=-u,f=-f);let g,p,m,v;c===0?(g=Math.abs(l-t[1])*s+n,p=Math.abs(o-t[0])*s+r,m=(t[3]-t[1])*s,v=(t[2]-t[0])*s):(g=Math.abs(o-t[0])*s+n,p=Math.abs(l-t[1])*s+r,m=(t[2]-t[0])*s,v=(t[3]-t[1])*s),this.transform=[c*s,d*s,u*s,f*s,g-c*s*o-u*s*l,p-d*s*o-f*s*l],this.width=m,this.height=v}get rawDims(){const t=this.viewBox;return K(this,"rawDims",{pageWidth:t[2]-t[0],pageHeight:t[3]-t[1],pageX:t[0],pageY:t[1]})}clone({scale:t=this.scale,rotation:e=this.rotation,offsetX:s=this.offsetX,offsetY:i=this.offsetY,dontFlip:n=!1}={}){return new Ue({viewBox:this.viewBox.slice(),userUnit:this.userUnit,scale:t,rotation:e,offsetX:s,offsetY:i,dontFlip:n})}convertToViewportPoint(t,e){const s=[t,e];return F.applyTransform(s,this.transform),s}convertToViewportRectangle(t){const e=[t[0],t[1]];F.applyTransform(e,this.transform);const s=[t[2],t[3]];return F.applyTransform(s,this.transform),[e[0],e[1],s[0],s[1]]}convertToPdfPoint(t,e){const s=[t,e];return F.applyInverseTransform(s,this.transform),s}}class Ws extends de{constructor(t,e=0){super(t,"RenderingCancelledException"),this.extraDelay=e}}function ds(h){const t=h.length;let e=0;for(;e<t&&h[e].trim()==="";)e++;return h.substring(e,e+5).toLowerCase()==="data:"}function Xs(h){return typeof h=="string"&&/\.pdf$/i.test(h)}function Pn(h){return[h]=h.split(/[#?]/,1),Os(h)}function In(h,t="document.pdf"){if(typeof h!="string")return t;if(ds(h))return z('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),t;const s=(a=>{try{return new URL(a)}catch{try{return new URL(decodeURIComponent(a))}catch{try{return new URL(a,"https://foo.bar")}catch{try{return new URL(decodeURIComponent(a),"https://foo.bar")}catch{return null}}}}})(h);if(!s)return t;const i=a=>{try{let o=decodeURIComponent(a);return o.includes("/")&&(o=Os(o),/^\.pdf$/i.test(o))?a:o}catch{return a}},n=/\.pdf$/i,r=Os(s.pathname);if(n.test(r))return i(r);if(s.searchParams.size>0){const a=l=>[...l].findLast(c=>n.test(c)),o=a(s.searchParams.values())??a(s.searchParams.keys());if(o)return i(o)}if(s.hash){const o=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i.exec(s.hash);if(o)return i(o[0])}return t}class ui{#t=new Map;times=[];time(t){this.#t.has(t)&&z(`Timer is already running for ${t}`),this.#t.set(t,Date.now())}timeEnd(t){this.#t.has(t)||z(`Timer has not been started for ${t}`),this.times.push({name:t,start:this.#t.get(t),end:Date.now()}),this.#t.delete(t)}toString(){const t=Math.max(...this.times.map(e=>e.name.length));return this.times.map(e=>`${e.name.padEnd(t)} ${e.end-e.start}ms
|
|
4
|
+
`).join("")}}function Re(h,t){const e=t?URL.parse(h,t):URL.parse(h);return/https?:/.test(e?.protocol??"")}function kt(h){h.preventDefault()}function ct(h){h.preventDefault(),h.stopPropagation()}function Rn(h){console.log("Deprecated API usage: "+h)}class Fs{static#t;static toDateObject(t){if(t instanceof Date)return t;if(!t||typeof t!="string")return null;this.#t||=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?");const e=this.#t.exec(t);if(!e)return null;const s=parseInt(e[1],10);let i=parseInt(e[2],10);i=i>=1&&i<=12?i-1:0;let n=parseInt(e[3],10);n=n>=1&&n<=31?n:1;let r=parseInt(e[4],10);r=r>=0&&r<=23?r:0;let a=parseInt(e[5],10);a=a>=0&&a<=59?a:0;let o=parseInt(e[6],10);o=o>=0&&o<=59?o:0;const l=e[7]||"Z";let c=parseInt(e[8],10);c=c>=0&&c<=23?c:0;let d=parseInt(e[9],10)||0;return d=d>=0&&d<=59?d:0,l==="-"?(r+=c,a+=d):l==="+"&&(r-=c,a-=d),new Date(Date.UTC(s,i,n,r,a,o))}}function On(h,{scale:t=1,rotation:e=0}){const{width:s,height:i}=h.attributes.style,n=[0,0,parseInt(s,10),parseInt(i,10)];return new Ue({viewBox:n,userUnit:1,scale:t,rotation:e})}function Ys(h){if(h.startsWith("#")){const e=h.slice(1);return[parseInt(e.slice(0,2),16),parseInt(e.slice(2,4),16),parseInt(e.slice(4,6),16),e.length>=8?parseInt(e.slice(6,8),16)/255:1]}if(h.startsWith("rgb(")){const[e,s,i]=h.slice(4,-1).split(",").map(n=>parseInt(n,10));return[e,s,i,1]}if(h.startsWith("rgba(")){const e=h.slice(5,-1).split(",");return[parseInt(e[0],10),parseInt(e[1],10),parseInt(e[2],10),parseFloat(e[3])]}const t=h.match(/^color\(srgb\s+([\d.]+)\s+([\d.]+)\s+([\d.]+)(?:\s*\/\s*([\d.]+|none))?\)$/);return t?[Math.round(parseFloat(t[1])*255),Math.round(parseFloat(t[2])*255),Math.round(parseFloat(t[3])*255),t[4]!==void 0&&t[4]!=="none"?parseFloat(t[4]):1]:null}function He(h){const t=Ys(h);return t?t.slice(0,3):(z(`Not a valid color format: "${h}"`),[0,0,0])}function Mn(h){const t=document.createElement("span");t.style.visibility="hidden",t.style.colorScheme="only light",document.body.append(t);for(const e of h.keys()){t.style.color=e;const s=window.getComputedStyle(t).color;h.set(e,He(s))}t.remove()}function ot(h){const{a:t,b:e,c:s,d:i,e:n,f:r}=h.getTransform();return[t,e,s,i,n,r]}function $t(h){const{a:t,b:e,c:s,d:i,e:n,f:r}=h.getTransform().invertSelf();return[t,e,s,i,n,r]}function he(h,t,e=!1,s=!0){if(t instanceof Ue){const{pageWidth:i,pageHeight:n}=t.rawDims,{style:r}=h,a=yt.isCSSRoundSupported,o=`var(--total-scale-factor) * ${i}px`,l=`var(--total-scale-factor) * ${n}px`,c=a?`round(down, ${o}, var(--scale-round-x))`:`calc(${o})`,d=a?`round(down, ${l}, var(--scale-round-y))`:`calc(${l})`;!e||t.rotation%180===0?(r.width=c,r.height=d):(r.width=d,r.height=c)}s&&h.setAttribute("data-main-rotation",t.rotation)}class Vt{constructor(){const{pixelRatio:t}=Vt;this.sx=t,this.sy=t}get scaled(){return this.sx!==1||this.sy!==1}get symmetric(){return this.sx===this.sy}limitCanvas(t,e,s,i,n=-1){let r=1/0,a=1/0,o=1/0;s=Vt.capPixels(s,n),s>0&&(r=Math.sqrt(s/(t*e))),i!==-1&&(a=i/t,o=i/e);const l=Math.min(r,a,o);return this.sx>l||this.sy>l?(this.sx=l,this.sy=l,!0):!1}static get pixelRatio(){return globalThis.devicePixelRatio||1}static capPixels(t,e){if(e>=0){const s=Math.ceil(window.screen.availWidth*window.screen.availHeight*this.pixelRatio**2*(1+e/100));return t>0?Math.min(t,s):s}return t}}const Ls=["image/apng","image/avif","image/bmp","image/gif","image/jpeg","image/png","image/svg+xml","image/webp","image/x-icon"];class Dn{static get isDarkMode(){return K(this,"isDarkMode",!!window?.matchMedia?.("(prefers-color-scheme: dark)").matches)}}class Fn{static get commentForegroundColor(){const t=document.createElement("span");t.classList.add("comment","sidebar");const{style:e}=t;e.width=e.height="0",e.display="none",e.color="var(--comment-fg-color)",document.body.append(t);const{color:s}=window.getComputedStyle(t);return t.remove(),K(this,"commentForegroundColor",He(s))}}function Ln(h,t){t=ht(t??1,0,1);const e=255*(1-t);return h.map(s=>Math.round(s*t+e))}function fi(h,t){const e=h[0]/255,s=h[1]/255,i=h[2]/255,n=Math.max(e,s,i),r=Math.min(e,s,i),a=(n+r)/2;if(n===r)t[0]=t[1]=0;else{const o=n-r;switch(t[1]=a<.5?o/(n+r):o/(2-n-r),n){case e:t[0]=((s-i)/o+(s<i?6:0))*60;break;case s:t[0]=((i-e)/o+2)*60;break;case i:t[0]=((e-s)/o+4)*60;break}}t[2]=a}function Ns(h,t){const e=h[0],s=h[1],i=h[2],n=(1-Math.abs(2*i-1))*s,r=n*(1-Math.abs(e/60%2-1)),a=i-n/2;switch(Math.floor(e/60)){case 0:t[0]=n+a,t[1]=r+a,t[2]=a;break;case 1:t[0]=r+a,t[1]=n+a,t[2]=a;break;case 2:t[0]=a,t[1]=n+a,t[2]=r+a;break;case 3:t[0]=a,t[1]=r+a,t[2]=n+a;break;case 4:t[0]=r+a,t[1]=a,t[2]=n+a;break;case 5:case 6:t[0]=n+a,t[1]=a,t[2]=r+a;break}}function pi(h){return h<=.03928?h/12.92:((h+.055)/1.055)**2.4}function gi(h,t,e){Ns(h,e),e.map(pi);const s=.2126*e[0]+.7152*e[1]+.0722*e[2];Ns(t,e),e.map(pi);const i=.2126*e[0]+.7152*e[1]+.0722*e[2];return s>i?(s+.05)/(i+.05):(i+.05)/(s+.05)}const mi=new Map;function Nn(h,t){const e=h[0]+h[1]*256+h[2]*65536+t[0]*16777216+t[1]*4294967296+t[2]*1099511627776;let s=mi.get(e);if(s)return s;const i=new Float32Array(9),n=i.subarray(0,3),r=i.subarray(3,6);fi(h,r);const a=i.subarray(6,9);fi(t,a);const o=a[2]<.5,l=o?12:4.5;if(r[2]=o?Math.sqrt(r[2]):1-Math.sqrt(1-r[2]),gi(r,a,n)<l){let c,d;o?(c=r[2],d=1):(c=0,d=r[2]);const u=.005;for(;d-c>u;){const f=r[2]=(c+d)/2;o===gi(r,a,n)<l?c=f:d=f}r[2]=o?d:c}return Ns(r,n),s=F.makeHexColor(Math.round(n[0]*255),Math.round(n[1]*255),Math.round(n[2]*255)),mi.set(e,s),s}function Gi({html:h,dir:t,className:e},s){const i=document.createDocumentFragment();if(typeof h=="string"){const n=document.createElement("p");n.dir=t||"auto";const r=h.split(/(?:\r\n?|\n)/);for(let a=0,o=r.length;a<o;++a){const l=r[a];n.append(document.createTextNode(l)),a<o-1&&n.append(document.createElement("br"))}i.append(n)}else ji.render({xfaHtml:h,div:i,intent:"richText"});i.firstElementChild.classList.add("richText",e),s.append(i)}function zi(h){const t=new Path2D;if(!h)return t;for(let e=0,s=h.length;e<s;)switch(h[e++]){case Ee.moveTo:t.moveTo(h[e++],h[e++]);break;case Ee.lineTo:t.lineTo(h[e++],h[e++]);break;case Ee.curveTo:t.bezierCurveTo(h[e++],h[e++],h[e++],h[e++],h[e++],h[e++]);break;case Ee.quadraticCurveTo:t.quadraticCurveTo(h[e++],h[e++],h[e++],h[e++]);break;case Ee.closePath:t.closePath();break;default:z(`Unrecognized drawing path operator: ${h[e-1]}`);break}return t}V(4972);V(4628);V(7642);V(8004);V(3853);V(5876);V(2475);V(5024);V(1698);V(8454);V(9452);V(4979);V(3579);V(3110);V(9314);V(1148);V(9112);class Oe{#t=null;#e=null;#s;#i=null;#n=null;#r=null;#a=null;#o=null;static#h=null;constructor(t){this.#s=t,Oe.#h||=Object.freeze({freetext:"pdfjs-editor-remove-freetext-button",highlight:"pdfjs-editor-remove-highlight-button",ink:"pdfjs-editor-remove-ink-button",stamp:"pdfjs-editor-remove-stamp-button",signature:"pdfjs-editor-remove-signature-button"})}render(){const t=this.#t=document.createElement("div");t.classList.add("editToolbar","hidden"),t.setAttribute("role","toolbar");const e=this.#s._uiManager._signal;e instanceof AbortSignal&&!e.aborted&&(t.addEventListener("contextmenu",kt,{signal:e}),t.addEventListener("pointerdown",Oe.#l,{signal:e}));const s=this.#i=document.createElement("div");s.className="buttons",t.append(s);const i=this.#s.toolbarPosition;if(i){const{style:n}=t,r=this.#s._uiManager.direction==="ltr"?1-i[0]:i[0];n.insetInlineEnd=`${100*r}%`,n.top=`calc(${100*i[1]}% + var(--editor-toolbar-vert-offset))`}return t}get div(){return this.#t}static#l(t){t.stopPropagation()}#u(t){this.#s._focusEventsAllowed=!1,ct(t)}#d(t){this.#s._focusEventsAllowed=!0,ct(t)}#f(t){const e=this.#s._uiManager._signal;return!(e instanceof AbortSignal)||e.aborted?!1:(t.addEventListener("focusin",this.#u.bind(this),{capture:!0,signal:e}),t.addEventListener("focusout",this.#d.bind(this),{capture:!0,signal:e}),t.addEventListener("contextmenu",kt,{signal:e}),!0)}hide(){this.#t.classList.add("hidden"),this.#e?.hideDropdown()}show(){this.#t.classList.remove("hidden"),this.#n?.shown(),this.#r?.shown()}addDeleteButton(){const{editorType:t,_uiManager:e}=this.#s,s=document.createElement("button");s.classList.add("basic","deleteButton"),s.tabIndex=0,s.setAttribute("data-l10n-id",Oe.#h[t]),this.#f(s)&&s.addEventListener("click",i=>{e.delete()},{signal:e._signal}),this.#i.append(s)}get#m(){const t=document.createElement("div");return t.className="divider",t}async addAltText(t){const e=await t.render();this.#f(e),this.#i.append(e,this.#m),this.#n=t}addComment(t,e=null){if(this.#r)return;const s=t.renderForToolbar();if(!s)return;this.#f(s);const i=this.#a=this.#m;e?(this.#i.insertBefore(s,e),this.#i.insertBefore(i,e)):this.#i.append(s,i),this.#r=t,t.toolbar=this}addColorPicker(t){if(this.#e)return;this.#e=t;const e=t.renderButton();this.#f(e),this.#i.append(e,this.#m)}async addEditSignatureButton(t){const e=this.#o=await t.renderEditButton(this.#s);this.#f(e),this.#i.append(e,this.#m)}removeButton(t){t==="comment"&&(this.#r?.removeToolbarCommentButton(),this.#r=null,this.#a?.remove(),this.#a=null)}async addButton(t,e){switch(t){case"colorPicker":e&&this.addColorPicker(e);break;case"altText":e&&await this.addAltText(e);break;case"editSignature":e&&await this.addEditSignatureButton(e);break;case"delete":this.addDeleteButton();break;case"comment":e&&this.addComment(e);break}}async addButtonBefore(t,e,s){if(!e&&t==="comment")return;const i=this.#i.querySelector(s);i&&t==="comment"&&this.addComment(e,i)}updateEditSignatureButton(t){this.#o&&(this.#o.title=t)}remove(){this.#t.remove(),this.#e?.destroy(),this.#e=null}}class kn{#t=null;#e=null;#s;constructor(t){this.#s=t}#i(){const t=this.#e=document.createElement("div");t.className="editToolbar",t.setAttribute("role","toolbar");const e=this.#s._signal;e instanceof AbortSignal&&!e.aborted&&t.addEventListener("contextmenu",kt,{signal:e});const s=this.#t=document.createElement("div");return s.className="buttons",t.append(s),this.#s.hasCommentManager()&&this.#r("commentButton","pdfjs-comment-floating-button","pdfjs-comment-floating-button-label",()=>{this.#s.commentSelection("floating_button")}),this.#r("highlightButton","pdfjs-highlight-floating-button1","pdfjs-highlight-floating-button-label",()=>{this.#s.highlightSelection("floating_button")}),t}#n(t,e){let s=0,i=0;for(const n of t){const r=n.y+n.height;if(r<s)continue;const a=n.x+(e?n.width:0);if(r>s){i=a,s=r;continue}e?a>i&&(i=a):a<i&&(i=a)}return[e?1-i:i,s]}show(t,e,s){const[i,n]=this.#n(e,s),{style:r}=this.#e||=this.#i();t.append(this.#e),r.insetInlineEnd=`${100*i}%`,r.top=`calc(${100*n}% + var(--editor-toolbar-vert-offset))`}hide(){this.#e.remove()}#r(t,e,s,i){const n=document.createElement("button");n.classList.add("basic",t),n.tabIndex=0,n.setAttribute("data-l10n-id",e);const r=document.createElement("span");n.append(r),r.className="visuallyHidden",r.setAttribute("data-l10n-id",s);const a=this.#s._signal;a instanceof AbortSignal&&!a.aborted&&(n.addEventListener("contextmenu",kt,{signal:a}),n.addEventListener("click",i,{signal:a})),this.#t.append(n)}}function Vi(h,t,e){for(const s of e)t.addEventListener(s,h[s].bind(h))}class it{static#t=NaN;static#e=null;static#s=NaN;static#i=null;static initializeAndAddPointerId(t){(it.#e||=new Set).add(t)}static setPointer(t,e){it.#t||=e,it.#i??=t}static setTimeStamp(t){it.#s=t}static isSamePointerId(t){return it.#t===t}static isSamePointerIdOrRemove(t){return it.#t===t?!0:(it.#e?.delete(t),!1)}static isSamePointerType(t){return it.#i===t}static isInitializedAndDifferentPointerType(t){return it.#i!==null&&!it.isSamePointerType(t)}static isSameTimeStamp(t){return it.#s===t}static isUsingMultiplePointers(){return it.#e?.size>=1}static clearPointerType(){it.#i=null}static clearPointerIds(){it.#t=NaN,it.#e=null}static clearTimeStamp(){it.#s=NaN}}class Bn{#t=0;get id(){return`${Fe}${this.#t++}`}}class Ks{#t=$i();#e=0;#s=null;static get _isSVGFittingCanvas(){const t='data:image/svg+xml;charset=UTF-8,<svg viewBox="0 0 1 1" width="1" height="1" xmlns="http://www.w3.org/2000/svg"><rect width="1" height="1" style="fill:red;"/></svg>',s=new OffscreenCanvas(1,3).getContext("2d",{willReadFrequently:!0}),i=new Image;i.src=t;const n=i.decode().then(()=>(s.drawImage(i,0,0,1,1,0,0,1,3),new Uint32Array(s.getImageData(0,0,1,1).data.buffer)[0]===0));return K(this,"_isSVGFittingCanvas",n)}async#i(t,e){this.#s||=new Map;let s=this.#s.get(t);if(s===null)return null;if(s?.bitmap)return s.refCounter+=1,s;try{s||={bitmap:null,id:`image_${this.#t}_${this.#e++}`,refCounter:0,isSvg:!1};let i;if(typeof e=="string"?(s.url=e,i=await Vs(e,"blob")):e instanceof File?i=s.file=e:e instanceof Blob&&(i=e),i.type==="image/svg+xml"){const n=Ks._isSVGFittingCanvas,r=new FileReader,a=new Image,o=new Promise((l,c)=>{a.onload=()=>{s.bitmap=a,s.isSvg=!0,l()},r.onload=async()=>{const d=s.svgUrl=r.result;a.src=await n?`${d}#svgView(preserveAspectRatio(none))`:d},a.onerror=r.onerror=c});r.readAsDataURL(i),await o}else s.bitmap=await createImageBitmap(i);s.refCounter=1}catch(i){z(i),s=null}return this.#s.set(t,s),s&&this.#s.set(s.id,s),s}async getFromFile(t){const{lastModified:e,name:s,size:i,type:n}=t;return this.#i(`${e}_${s}_${i}_${n}`,t)}async getFromUrl(t){return this.#i(t,t)}async getFromBlob(t,e){const s=await e;return this.#i(t,s)}async getFromId(t){this.#s||=new Map;const e=this.#s.get(t);if(!e)return null;if(e.bitmap)return e.refCounter+=1,e;if(e.file)return this.getFromFile(e.file);if(e.blobPromise){const{blobPromise:s}=e;return delete e.blobPromise,this.getFromBlob(e.id,s)}return this.getFromUrl(e.url)}getFromCanvas(t,e){this.#s||=new Map;let s=this.#s.get(t);if(s?.bitmap)return s.refCounter+=1,s;const i=new OffscreenCanvas(e.width,e.height);return i.getContext("2d").drawImage(e,0,0),s={bitmap:i.transferToImageBitmap(),id:`image_${this.#t}_${this.#e++}`,refCounter:1,isSvg:!1},this.#s.set(t,s),this.#s.set(s.id,s),s}getSvgUrl(t){const e=this.#s.get(t);return e?.isSvg?e.svgUrl:null}deleteId(t){this.#s||=new Map;const e=this.#s.get(t);if(!e||(e.refCounter-=1,e.refCounter!==0))return;const{bitmap:s}=e;if(!e.url&&!e.file){const i=new OffscreenCanvas(s.width,s.height);i.getContext("bitmaprenderer").transferFromImageBitmap(s),e.blobPromise=i.convertToBlob()}s.close?.(),e.bitmap=null}isValidId(t){return t.startsWith(`image_${this.#t}_`)}}class _n{#t=[];#e=!1;#s;#i=-1;constructor(t=128){this.#s=t}add({cmd:t,undo:e,post:s,mustExec:i,type:n=NaN,overwriteIfSameType:r=!1,keepUndo:a=!1}){if(i&&t(),this.#e)return;const o={cmd:t,undo:e,post:s,type:n};if(this.#i===-1){this.#t.length>0&&(this.#t.length=0),this.#i=0,this.#t.push(o);return}if(r&&this.#t[this.#i].type===n){a&&(o.undo=this.#t[this.#i].undo),this.#t[this.#i]=o;return}const l=this.#i+1;l===this.#s?this.#t.splice(0,1):(this.#i=l,l<this.#t.length&&this.#t.splice(l)),this.#t.push(o)}undo(){if(this.#i===-1)return;this.#e=!0;const{undo:t,post:e}=this.#t[this.#i];t(),e?.(),this.#e=!1,this.#i-=1}redo(){if(this.#i<this.#t.length-1){this.#i+=1,this.#e=!0;const{cmd:t,post:e}=this.#t[this.#i];t(),e?.(),this.#e=!1}}hasSomethingToUndo(){return this.#i!==-1}hasSomethingToRedo(){return this.#i<this.#t.length-1}cleanType(t){if(this.#i!==-1){for(let e=this.#i;e>=0;e--)if(this.#t[e].type!==t){this.#t.splice(e+1,this.#i-e),this.#i=e;return}this.#t.length=0,this.#i=-1}}destroy(){this.#t=null}}class $e{constructor(t){this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:e}=yt.platform;for(const[s,i,n={}]of t)for(const r of s){const a=r.startsWith("mac+");e&&a?(this.callbacks.set(r.slice(4),{callback:i,options:n}),this.allKeys.add(r.split("+").at(-1))):!e&&!a&&(this.callbacks.set(r,{callback:i,options:n}),this.allKeys.add(r.split("+").at(-1)))}}#t(t){t.altKey&&this.buffer.push("alt"),t.ctrlKey&&this.buffer.push("ctrl"),t.metaKey&&this.buffer.push("meta"),t.shiftKey&&this.buffer.push("shift"),this.buffer.push(t.key);const e=this.buffer.join("+");return this.buffer.length=0,e}exec(t,e){if(!this.allKeys.has(e.key))return;const s=this.callbacks.get(this.#t(e));if(!s)return;const{callback:i,options:{bubbles:n=!1,args:r=[],checker:a=null}}=s;a&&!a(t,e)||(i.bind(t,...r,e)(),n||ct(e))}}class Js{static _colorsMapping=new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]);get _colors(){const t=new Map([["CanvasText",null],["Canvas",null]]);return Mn(t),K(this,"_colors",t)}convert(t){const e=He(t);if(!window.matchMedia("(forced-colors: active)").matches)return e;for(const[s,i]of this._colors)if(i.every((n,r)=>n===e[r]))return Js._colorsMapping.get(s);return e}getHexCode(t){const e=this._colors.get(t);return e?F.makeHexColor(...e):t}}class ee{#t=new AbortController;#e=null;#s=null;#i=new Map;#n=new Map;#r=null;#a=null;#o=null;#h=null;#l=new _n;#u=null;#d=null;#f=null;#m=0;#g=new Set;#c=null;#p=null;#v=new Set;_editorUndoBar=null;#w=!1;#b=!1;#E=!1;#P=null;#y=null;#x=null;#S=null;#C=!1;#R=null;#O=new Bn;#I=!1;#F=!1;#L=!1;#D=null;#N=null;#B=null;#U=null;#V=null;#T=Y.NONE;#A=new Set;#k=null;#$=null;#G=null;#K=null;#X=null;#Y={isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1,hasSelectedText:!1};#_=[0,0];#z=null;#W=null;#q=null;#tt=null;#H=null;static TRANSLATE_SMALL=1;static TRANSLATE_BIG=10;static get _keyboardManager(){const t=ee.prototype,e=r=>r.#W.contains(document.activeElement)&&document.activeElement.tagName!=="BUTTON"&&r.hasSomethingToControl(),s=(r,{target:a})=>{if(a instanceof HTMLInputElement){const{type:o}=a;return o!=="text"&&o!=="number"}return!0},i=this.TRANSLATE_SMALL,n=this.TRANSLATE_BIG;return K(this,"_keyboardManager",new $e([[["ctrl+a","mac+meta+a"],t.selectAll,{checker:s}],[["ctrl+z","mac+meta+z"],t.undo,{checker:s}],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],t.redo,{checker:s}],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete","mac+Delete"],t.delete,{checker:s}],[["Enter","mac+Enter"],t.addNewEditorFromKeyboard,{checker:(r,{target:a})=>!(a instanceof HTMLButtonElement)&&r.#W.contains(a)&&!r.isEnterHandled}],[[" ","mac+ "],t.addNewEditorFromKeyboard,{checker:(r,{target:a})=>!(a instanceof HTMLButtonElement)&&r.#W.contains(document.activeElement)}],[["Escape","mac+Escape"],t.unselectAll],[["ArrowLeft","mac+ArrowLeft"],t.translateSelectedEditors,{args:[-i,0],checker:e}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t.translateSelectedEditors,{args:[-n,0],checker:e}],[["ArrowRight","mac+ArrowRight"],t.translateSelectedEditors,{args:[i,0],checker:e}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t.translateSelectedEditors,{args:[n,0],checker:e}],[["ArrowUp","mac+ArrowUp"],t.translateSelectedEditors,{args:[0,-i],checker:e}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t.translateSelectedEditors,{args:[0,-n],checker:e}],[["ArrowDown","mac+ArrowDown"],t.translateSelectedEditors,{args:[0,i],checker:e}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t.translateSelectedEditors,{args:[0,n],checker:e}]]))}constructor(t,e,s,i,n,r,a,o,l,c,d,u,f,g,p,m){const v=this._signal=this.#t.signal;this.#W=t,this.#q=e,this.#tt=s,this.#a=i,this.#u=n,this.#$=r,this.#X=o,this._eventBus=a,a._on("editingaction",this.onEditingAction.bind(this),{signal:v}),a._on("pagechanging",this.onPageChanging.bind(this),{signal:v}),a._on("scalechanging",this.onScaleChanging.bind(this),{signal:v}),a._on("rotationchanging",this.onRotationChanging.bind(this),{signal:v}),a._on("setpreference",this.onSetPreference.bind(this),{signal:v}),a._on("switchannotationeditorparams",y=>this.updateParams(y.type,y.value),{signal:v}),window.addEventListener("pointerdown",()=>{this.#F=!0},{capture:!0,signal:v}),window.addEventListener("pointerup",()=>{this.#F=!1},{capture:!0,signal:v}),window.addEventListener("beforeunload",this.#rt.bind(this),{capture:!0,signal:v}),this.#lt(),this.#pt(),this.#st(),this.#o=o.annotationStorage,this.#P=o.filterFactory,this.#G=l,this.#S=c||null,this.#w=d,this.#b=u,this.#E=f,this.#V=g||null,this.viewParameters={realScale:Se.PDF_TO_CSS_UNITS,rotation:0},this.isShiftKeyDown=!1,this._editorUndoBar=p||null,this._supportsPinchToZoom=m!==!1,n?.setSidebarUiManager(this)}destroy(){this.#H?.resolve(),this.#H=null,this.#t?.abort(),this.#t=null,this._signal=null;for(const t of this.#n.values())t.destroy();this.#n.clear(),this.#i.clear(),this.#v.clear(),this.#U?.clear(),this.#e=null,this.#A.clear(),this.#l.destroy(),this.#a?.destroy(),this.#u?.destroy(),this.#$?.destroy(),this.#R?.hide(),this.#R=null,this.#B?.destroy(),this.#B=null,this.#s=null,this.#y&&(clearTimeout(this.#y),this.#y=null),this.#z&&(clearTimeout(this.#z),this.#z=null),this._editorUndoBar?.destroy(),this.#X=null}combinedSignal(t){return AbortSignal.any([this._signal,t.signal])}get mlManager(){return this.#V}get useNewAltTextFlow(){return this.#b}get useNewAltTextWhenAddingImage(){return this.#E}get hcmFilter(){return K(this,"hcmFilter",this.#G?this.#P.addHCMFilter(this.#G.foreground,this.#G.background):"none")}get direction(){return K(this,"direction",getComputedStyle(this.#W).direction)}get _highlightColors(){return K(this,"_highlightColors",this.#S?new Map(this.#S.split(",").map(t=>(t=t.split("=").map(e=>e.trim()),t[1]=t[1].toUpperCase(),t))):null)}get highlightColors(){const{_highlightColors:t}=this;if(!t)return K(this,"highlightColors",null);const e=new Map,s=!!this.#G;for(const[i,n]of t){const r=i.endsWith("_HCM");if(s&&r){e.set(i.replace("_HCM",""),n);continue}!s&&!r&&e.set(i,n)}return K(this,"highlightColors",e)}get highlightColorNames(){return K(this,"highlightColorNames",this.highlightColors?new Map(Array.from(this.highlightColors,t=>t.reverse())):null)}getNonHCMColor(t){if(!this._highlightColors)return t;const e=this.highlightColorNames.get(t);return this._highlightColors.get(e)||t}getNonHCMColorName(t){return this.highlightColorNames.get(t)||t}setCurrentDrawingSession(t){t?(this.unselectAll(),this.disableUserSelect(!0)):this.disableUserSelect(!1),this.#f=t}setMainHighlightColorPicker(t){this.#B=t}editAltText(t,e=!1){this.#a?.editAltText(this,t,e)}hasCommentManager(){return!!this.#u}editComment(t,e,s,i){this.#u?.showDialog(this,t,e,s,i)}selectComment(t,e){this.#n.get(t)?.getEditorByUID(e)?.toggleComment(!0,!0)}updateComment(t){this.#u?.updateComment(t.getData())}updatePopupColor(t){this.#u?.updatePopupColor(t)}removeComment(t){this.#u?.removeComments([t.uid])}deleteComment(t,e){const s=()=>{t.comment=e},i=()=>{this._editorUndoBar?.show(s,"comment"),this.toggleComment(null),t.comment=null};this.addCommands({cmd:i,undo:s,mustExec:!0})}toggleComment(t,e,s=void 0){this.#u?.toggleCommentPopup(t,e,s)}makeCommentColor(t,e){return t&&this.#u?.makeCommentColor(t,e)||null}getCommentDialogElement(){return this.#u?.dialogElement||null}async waitForEditorsRendered(t){if(this.#n.has(t-1))return;const{resolve:e,promise:s}=Promise.withResolvers(),i=n=>{n.pageNumber===t&&(this._eventBus._off("editorsrendered",i),e())};this._eventBus.on("editorsrendered",i),await s}getSignature(t){this.#$?.getSignature({uiManager:this,editor:t})}get signatureManager(){return this.#$}switchToMode(t,e){this._eventBus.on("annotationeditormodechanged",e,{once:!0,signal:this._signal}),this._eventBus.dispatch("showannotationeditorui",{source:this,mode:t})}setPreference(t,e){this._eventBus.dispatch("setpreference",{source:this,name:t,value:e})}onSetPreference({name:t,value:e}){t==="enableNewAltTextWhenAddingImage"&&(this.#E=e)}onPageChanging({pageNumber:t}){this.#m=t-1}deletePage(t){for(const e of this.getEditors(t))e.remove();this.#n.delete(t),this.#m===t&&(this.#m=0)}focusMainContainer(){this.#W.focus()}findParent(t,e){for(const s of this.#n.values()){const{x:i,y:n,width:r,height:a}=s.div.getBoundingClientRect();if(t>=i&&t<=i+r&&e>=n&&e<=n+a)return s}return null}disableUserSelect(t=!1){this.#q.classList.toggle("noUserSelect",t)}addShouldRescale(t){this.#v.add(t)}removeShouldRescale(t){this.#v.delete(t)}onScaleChanging({scale:t}){this.commitOrRemove(),this.viewParameters.realScale=t*Se.PDF_TO_CSS_UNITS;for(const e of this.#v)e.onScaleChanging();this.#f?.onScaleChanging()}onRotationChanging({pagesRotation:t}){this.commitOrRemove(),this.viewParameters.rotation=t}#Z({anchorNode:t}){return t.nodeType===Node.TEXT_NODE?t.parentElement:t}#et(t){const{currentLayer:e}=this;if(e.hasTextLayer(t))return e;for(const s of this.#n.values())if(s.hasTextLayer(t))return s;return null}highlightSelection(t="",e=!1){const s=document.getSelection();if(!s||s.isCollapsed)return;const{anchorNode:i,anchorOffset:n,focusNode:r,focusOffset:a}=s,o=s.toString(),c=this.#Z(s).closest(".textLayer"),d=this.getSelectionBoxes(c);if(!d)return;s.empty();const u=this.#et(c),f=this.#T===Y.NONE,g=()=>{const p=u?.createAndAddNewEditor({x:0,y:0},!1,{methodOfCreation:t,boxes:d,anchorNode:i,anchorOffset:n,focusNode:r,focusOffset:a,text:o});f&&this.showAllEditors("highlight",!0,!0),e&&p?.editComment()};if(f){this.switchToMode(Y.HIGHLIGHT,g);return}g()}commentSelection(t=""){this.highlightSelection(t,!0)}#rt(t){this.commitOrRemove(),this.currentLayer?.endDrawingSession(!1)}#at(){const t=document.getSelection();if(!t||t.isCollapsed)return;const s=this.#Z(t).closest(".textLayer"),i=this.getSelectionBoxes(s);i&&(this.#R||=new kn(this),this.#R.show(s,i,this.direction==="ltr"))}getAndRemoveDataFromAnnotationStorage(t){if(!this.#o)return null;const e=`${Fe}${t}`,s=this.#o.getRawValue(e);return s&&this.#o.remove(e),s}addToAnnotationStorage(t){!t.isEmpty()&&this.#o&&!this.#o.has(t.id)&&this.#o.setValue(t.id,t)}a11yAlert(t,e=null){const s=this.#tt;s&&(s.setAttribute("data-l10n-id",t),e?s.setAttribute("data-l10n-args",JSON.stringify(e)):s.removeAttribute("data-l10n-args"))}#ot(){const t=document.getSelection();if(!t||t.isCollapsed){this.#k&&(this.#R?.hide(),this.#k=null,this.#M({hasSelectedText:!1}));return}const{anchorNode:e}=t;if(e===this.#k)return;const i=this.#Z(t).closest(".textLayer");if(!i){this.#k&&(this.#R?.hide(),this.#k=null,this.#M({hasSelectedText:!1}));return}if(this.#R?.hide(),this.#k=e,this.#M({hasSelectedText:!0}),!(this.#T!==Y.HIGHLIGHT&&this.#T!==Y.NONE)&&(this.#T===Y.HIGHLIGHT&&this.showAllEditors("highlight",!0,!0),this.#C=this.isShiftKeyDown,!this.isShiftKeyDown)){const n=this.#T===Y.HIGHLIGHT?this.#et(i):null;if(n?.toggleDrawing(),this.#F){const r=new AbortController,a=this.combinedSignal(r),o=l=>{l.type==="pointerup"&&l.button!==0||(r.abort(),n?.toggleDrawing(!0),l.type==="pointerup"&&this.#J("main_toolbar"))};window.addEventListener("pointerup",o,{signal:a}),window.addEventListener("blur",o,{signal:a})}else n?.toggleDrawing(!0),this.#J("main_toolbar")}}#J(t=""){this.#T===Y.HIGHLIGHT?this.highlightSelection(t):this.#w&&this.#at()}#lt(){document.addEventListener("selectionchange",this.#ot.bind(this),{signal:this._signal})}#ht(){if(this.#x)return;this.#x=new AbortController;const t=this.combinedSignal(this.#x);window.addEventListener("focus",this.focus.bind(this),{signal:t}),window.addEventListener("blur",this.blur.bind(this),{signal:t})}#ct(){this.#x?.abort(),this.#x=null}blur(){if(this.isShiftKeyDown=!1,this.#C&&(this.#C=!1,this.#J("main_toolbar")),!this.hasSelection)return;const{activeElement:t}=document;for(const e of this.#A)if(e.div.contains(t)){this.#N=[e,t],e._focusEventsAllowed=!1;break}}focus(){if(!this.#N)return;const[t,e]=this.#N;this.#N=null,e.addEventListener("focusin",()=>{t._focusEventsAllowed=!0},{once:!0,signal:this._signal}),e.focus()}#st(){if(this.#D)return;this.#D=new AbortController;const t=this.combinedSignal(this.#D);window.addEventListener("keydown",this.keydown.bind(this),{signal:t}),window.addEventListener("keyup",this.keyup.bind(this),{signal:t})}#dt(){this.#D?.abort(),this.#D=null}#ut(){if(this.#d)return;this.#d=new AbortController;const t=this.combinedSignal(this.#d);document.addEventListener("copy",this.copy.bind(this),{signal:t}),document.addEventListener("cut",this.cut.bind(this),{signal:t}),document.addEventListener("paste",this.paste.bind(this),{signal:t})}#ft(){this.#d?.abort(),this.#d=null}#pt(){const t=this._signal;document.addEventListener("dragover",this.dragOver.bind(this),{signal:t}),document.addEventListener("drop",this.drop.bind(this),{signal:t})}addEditListeners(){this.#st(),this.setEditingState(!0)}removeEditListeners(){this.#dt(),this.setEditingState(!1)}dragOver(t){for(const{type:e}of t.dataTransfer.items)for(const s of this.#p)if(s.isHandlingMimeForPasting(e)){t.dataTransfer.dropEffect="copy",t.preventDefault();return}}drop(t){for(const e of t.dataTransfer.items)for(const s of this.#p)if(s.isHandlingMimeForPasting(e.type)){s.paste(e,this.currentLayer),t.preventDefault();return}}copy(t){if(t.preventDefault(),this.#e?.commitOrRemove(),!this.hasSelection)return;const e=[];for(const s of this.#A){const i=s.serialize(!0);i&&e.push(i)}e.length!==0&&t.clipboardData.setData("application/pdfjs",JSON.stringify(e))}cut(t){this.copy(t),this.delete()}async paste(t){t.preventDefault();const{clipboardData:e}=t;for(const n of e.items)for(const r of this.#p)if(r.isHandlingMimeForPasting(n.type)){r.paste(n,this.currentLayer);return}let s=e.getData("application/pdfjs");if(!s)return;try{s=JSON.parse(s)}catch(n){z(`paste: "${n.message}".`);return}if(!Array.isArray(s))return;this.unselectAll();const i=this.currentLayer;try{const n=[];for(const o of s){const l=await i.deserialize(o);if(!l)return;n.push(l)}const r=()=>{for(const o of n)this.#it(o);this.#nt(n)},a=()=>{for(const o of n)o.remove()};this.addCommands({cmd:r,undo:a,mustExec:!0})}catch(n){z(`paste: "${n.message}".`)}}keydown(t){!this.isShiftKeyDown&&t.key==="Shift"&&(this.isShiftKeyDown=!0),this.#T!==Y.NONE&&!this.isEditorHandlingKeyboard&&ee._keyboardManager.exec(this,t)}keyup(t){this.isShiftKeyDown&&t.key==="Shift"&&(this.isShiftKeyDown=!1,this.#C&&(this.#C=!1,this.#J("main_toolbar")))}onEditingAction({name:t}){switch(t){case"undo":case"redo":case"delete":case"selectAll":this[t]();break;case"highlightSelection":this.highlightSelection("context_menu");break;case"commentSelection":this.commentSelection("context_menu");break}}updatePageIndex(t,e){for(const i of this.getEditors(t))i.pageIndex=e;const s=this.#r.get(t);s&&(s.pageIndex=e,this.#n.set(e,s),this.#I?s.enable():s.disable())}startUpdatePages(){this.#r=new Map(this.#n),this.#n.clear()}endUpdatePages(){this.#r=null}clonePage(t,e){for(const s of this.getEditors(t)){const i=s.serialize(s.mode!==Y.HIGHLIGHT);i&&(i.pageIndex=e,i.id=this.getId(),i.isClone=!0,delete i.popupRef,this.#o.setValue(i.id,i))}}findClonesForPage(t){const e=[],{pageIndex:s}=t;for(const[i,n]of this.#o)n.pageIndex===s&&n.isClone&&(this.#o.remove(i),e.push(t.deserialize(n).then(r=>{r&&(r.isClone=!0,t.addOrRebuild(r))})));return Promise.all(e)}#M(t){Object.entries(t).some(([s,i])=>this.#Y[s]!==i)&&(this._eventBus.dispatch("editingstateschanged",{source:this,details:Object.assign(this.#Y,t)}),this.#T===Y.HIGHLIGHT&&t.hasSelectedEditor===!1&&this.#j([[J.HIGHLIGHT_FREE,!0]]))}#j(t){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:t})}setEditingState(t){t?(this.#ht(),this.#ut(),this.#M({isEditing:this.#T!==Y.NONE,isEmpty:this.#Q(),hasSomethingToUndo:this.#l.hasSomethingToUndo(),hasSomethingToRedo:this.#l.hasSomethingToRedo(),hasSelectedEditor:!1})):(this.#ct(),this.#ft(),this.#M({isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(t){if(!this.#p){this.#p=t;for(const e of this.#p)this.#j(e.defaultPropertiesToUpdate)}}getId(){return this.#O.id}get currentLayer(){return this.#n.get(this.#m)}getLayer(t){return this.#n.get(t)}get currentPageIndex(){return this.#m}addLayer(t){this.#n.set(t.pageIndex,t),this.#I?t.enable():t.disable()}removeLayer(t){this.#n.delete(t.pageIndex)}async updateMode(t,e=null,s=!1,i=!1,n=!1,r=!1){if(this.#T!==t&&!(this.#H&&(await this.#H.promise,!this.#H))){if(this.#H=Promise.withResolvers(),this.#f?.commitOrRemove(),this.#T===Y.POPUP&&this.#u?.hideSidebar(),this.#u?.destroyPopup(),this.#T=t,t===Y.NONE){this.setEditingState(!1),this.#mt();for(const a of this.#i.values())a.hideStandaloneCommentButton();this._editorUndoBar?.hide(),this.toggleComment(null),this.#H.resolve();return}for(const a of this.#i.values())a.addStandaloneCommentButton();t===Y.SIGNATURE&&await this.#$?.loadSignatures(),s&&it.clearPointerType(),this.setEditingState(!0),await this.#gt(),this.unselectAll();for(const a of this.#n.values())a.updateMode(t);if(t===Y.POPUP){this.#s||=await this.#X.getAnnotationsByType(new Set(this.#p.map(l=>l._editorType)));const a=new Set,o=[];for(const l of this.#i.values()){const{annotationElementId:c,hasComment:d,deleted:u}=l;c&&a.add(c),d&&!u&&o.push(l.getData())}for(const l of this.#s){const{id:c,popupRef:d,contentsObj:u}=l;d&&u?.str&&!a.has(c)&&!this.#g.has(c)&&o.push(l)}this.#u?.showSidebar(o)}if(!e){i&&this.addNewEditorFromKeyboard(),this.#H.resolve();return}for(const a of this.#i.values())a.uid===e?(this.setSelected(a),r?a.editComment():n?a.enterInEditMode():a.focus()):a.unselect();this.#H.resolve()}}addNewEditorFromKeyboard(){this.currentLayer.canCreateNewEmptyEditor()&&this.currentLayer.addNewEditor()}updateToolbar(t){t.mode!==this.#T&&this._eventBus.dispatch("switchannotationeditormode",{source:this,...t})}updateParams(t,e){if(this.#p){switch(t){case J.CREATE:this.currentLayer.addNewEditor(e);return;case J.HIGHLIGHT_SHOW_ALL:this._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:{type:"highlight",action:"toggle_visibility"}}}),(this.#K||=new Map).set(t,e),this.showAllEditors("highlight",e);break}if(this.hasSelection)for(const s of this.#A)s.updateParams(t,e);else for(const s of this.#p)s.updateDefaultParams(t,e)}}showAllEditors(t,e,s=!1){for(const n of this.#i.values())n.editorType===t&&n.show(e);(this.#K?.get(J.HIGHLIGHT_SHOW_ALL)??!0)!==e&&this.#j([[J.HIGHLIGHT_SHOW_ALL,e]])}enableWaiting(t=!1){if(this.#L!==t){this.#L=t;for(const e of this.#n.values())t?e.disableClick():e.enableClick(),e.div.classList.toggle("waiting",t)}}async#gt(){if(!this.#I){this.#I=!0;const t=[];for(const e of this.#n.values())t.push(e.enable());await Promise.all(t);for(const e of this.#i.values())e.enable()}}#mt(){if(this.unselectAll(),this.#I){this.#I=!1;for(const t of this.#n.values())t.disable();for(const t of this.#i.values())t.disable()}}*getEditors(t){for(const e of this.#i.values())e.pageIndex===t&&(yield e)}getEditor(t){return this.#i.get(t)}addEditor(t){this.#i.set(t.id,t)}removeEditor(t){t.div.contains(document.activeElement)&&(this.#y&&clearTimeout(this.#y),this.#y=setTimeout(()=>{this.focusMainContainer(),this.#y=null},0)),this.#i.delete(t.id),t.annotationElementId&&this.#U?.delete(t.annotationElementId),this.unselect(t),(!t.annotationElementId||!this.#g.has(t.annotationElementId))&&this.#o?.remove(t.id)}addDeletedAnnotationElement(t){this.#g.add(t.annotationElementId),this.addChangedExistingAnnotation(t),t.deleted=!0}isDeletedAnnotationElement(t){return this.#g.has(t)}removeDeletedAnnotationElement(t){this.#g.delete(t.annotationElementId),this.removeChangedExistingAnnotation(t),t.deleted=!1}#it(t){const e=this.#n.get(t.pageIndex);e?e.addOrRebuild(t):(this.addEditor(t),this.addToAnnotationStorage(t))}setActiveEditor(t){this.#e!==t&&(this.#e=t,t&&this.#j(t.propertiesToUpdate))}get#vt(){let t=null;for(t of this.#A);return t}updateUI(t){this.#vt===t&&this.#j(t.propertiesToUpdate)}updateUIForDefaultProperties(t){this.#j(t.defaultPropertiesToUpdate)}toggleSelected(t){if(this.#A.has(t)){this.#A.delete(t),t.unselect(),this.#M({hasSelectedEditor:this.hasSelection});return}this.#A.add(t),t.select(),this.#j(t.propertiesToUpdate),this.#M({hasSelectedEditor:!0})}setSelected(t){this.updateToolbar({mode:t.mode,editId:t.uid}),this.#f?.commitOrRemove();for(const e of this.#A)e!==t&&e.unselect();this.#u?.destroyPopup(),this.#A.clear(),this.#A.add(t),t.select(),this.#j(t.propertiesToUpdate),this.#M({hasSelectedEditor:!0})}isSelected(t){return this.#A.has(t)}get firstSelectedEditor(){return this.#A.values().next().value}unselect(t){t.unselect(),this.#A.delete(t),this.#M({hasSelectedEditor:this.hasSelection})}get hasSelection(){return this.#A.size!==0}get isEnterHandled(){return this.#A.size===1&&this.firstSelectedEditor.isEnterHandled}undo(){this.#l.undo(),this.#M({hasSomethingToUndo:this.#l.hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:this.#Q()}),this._editorUndoBar?.hide()}redo(){this.#l.redo(),this.#M({hasSomethingToUndo:!0,hasSomethingToRedo:this.#l.hasSomethingToRedo(),isEmpty:this.#Q()})}addCommands(t){this.#l.add(t),this.#M({hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:this.#Q()})}cleanUndoStack(t){this.#l.cleanType(t)}#Q(){if(this.#i.size===0)return!0;if(this.#i.size===1)for(const t of this.#i.values())return t.isEmpty();return!1}delete(){this.commitOrRemove();const t=this.currentLayer?.endDrawingSession(!0);if(!this.hasSelection&&!t)return;const e=t?[t]:[...this.#A],s=()=>{this._editorUndoBar?.show(i,e.length===1?e[0].editorType:e.length);for(const n of e)n.remove()},i=()=>{for(const n of e)this.#it(n)};this.addCommands({cmd:s,undo:i,mustExec:!0})}commitOrRemove(){this.#e?.commitOrRemove()}hasSomethingToControl(){return this.#e||this.hasSelection}#nt(t){for(const e of this.#A)e.unselect();this.#A.clear();for(const e of t)e.isEmpty()||(this.#A.add(e),e.select());this.#M({hasSelectedEditor:this.hasSelection})}selectAll(){for(const t of this.#A)t.commit();this.#nt(this.#i.values())}unselectAll(){if(!(this.#e&&(this.#e.commitOrRemove(),this.#T!==Y.NONE))&&!this.#f?.commitOrRemove()&&(this.#u?.destroyPopup(),!!this.hasSelection)){for(const t of this.#A)t.unselect();this.#A.clear(),this.#M({hasSelectedEditor:!1})}}translateSelectedEditors(t,e,s=!1){if(s||this.commitOrRemove(),!this.hasSelection)return;this.#_[0]+=t,this.#_[1]+=e;const[i,n]=this.#_,r=[...this.#A],a=1e3;this.#z&&clearTimeout(this.#z),this.#z=setTimeout(()=>{this.#z=null,this.#_[0]=this.#_[1]=0,this.addCommands({cmd:()=>{for(const o of r)this.#i.has(o.id)&&(o.translateInPage(i,n),o.translationDone())},undo:()=>{for(const o of r)this.#i.has(o.id)&&(o.translateInPage(-i,-n),o.translationDone())},mustExec:!1})},a);for(const o of r)o.translateInPage(t,e),o.translationDone()}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),this.#c=new Map;for(const t of this.#A)this.#c.set(t,{savedX:t.x,savedY:t.y,savedPageIndex:t.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!this.#c)return!1;this.disableUserSelect(!1);const t=this.#c;this.#c=null;let e=!1;for(const[{x:i,y:n,pageIndex:r},a]of t)a.newX=i,a.newY=n,a.newPageIndex=r,e||=i!==a.savedX||n!==a.savedY||r!==a.savedPageIndex;if(!e)return!1;const s=(i,n,r,a)=>{if(this.#i.has(i.id)){const o=this.#n.get(a);o?i._setParentAndPosition(o,n,r):(i.pageIndex=a,i.x=n,i.y=r)}};return this.addCommands({cmd:()=>{for(const[i,{newX:n,newY:r,newPageIndex:a}]of t)s(i,n,r,a)},undo:()=>{for(const[i,{savedX:n,savedY:r,savedPageIndex:a}]of t)s(i,n,r,a)},mustExec:!0}),!0}dragSelectedEditors(t,e){if(this.#c)for(const s of this.#c.keys())s.drag(t,e)}rebuild(t){if(t.parent===null){const e=this.getLayer(t.pageIndex);e?(e.changeParent(t),e.addOrRebuild(t)):(this.addEditor(t),this.addToAnnotationStorage(t),t.rebuild())}else t.parent.addOrRebuild(t)}get isEditorHandlingKeyboard(){return this.getActive()?.shouldGetKeyboardEvents()||this.#A.size===1&&this.firstSelectedEditor.shouldGetKeyboardEvents()}isActive(t){return this.#e===t}getActive(){return this.#e}getMode(){return this.#T}isEditingMode(){return this.#T!==Y.NONE}get imageManager(){return K(this,"imageManager",new Ks)}getSelectionBoxes(t){if(!t)return null;const e=document.getSelection();for(let l=0,c=e.rangeCount;l<c;l++)if(!t.contains(e.getRangeAt(l).commonAncestorContainer))return null;const{x:s,y:i,width:n,height:r}=t.getBoundingClientRect();let a;switch(t.getAttribute("data-main-rotation")){case"90":a=(l,c,d,u)=>({x:(c-i)/r,y:1-(l+d-s)/n,width:u/r,height:d/n});break;case"180":a=(l,c,d,u)=>({x:1-(l+d-s)/n,y:1-(c+u-i)/r,width:d/n,height:u/r});break;case"270":a=(l,c,d,u)=>({x:1-(c+u-i)/r,y:(l-s)/n,width:u/r,height:d/n});break;default:a=(l,c,d,u)=>({x:(l-s)/n,y:(c-i)/r,width:d/n,height:u/r});break}const o=[];for(let l=0,c=e.rangeCount;l<c;l++){const d=e.getRangeAt(l);if(!d.collapsed)for(const{x:u,y:f,width:g,height:p}of d.getClientRects())g===0||p===0||o.push(a(u,f,g,p))}return o.length===0?null:o}addChangedExistingAnnotation({annotationElementId:t,id:e}){(this.#h||=new Map).set(t,e)}removeChangedExistingAnnotation({annotationElementId:t}){this.#h?.delete(t)}renderAnnotationElement(t){const e=this.#h?.get(t.data.id);if(!e)return;const s=this.#o.getRawValue(e);s&&(this.#T===Y.NONE&&!s.hasBeenModified||s.renderAnnotationElement(t))}setMissingCanvas(t,e,s){const i=this.#U?.get(t);i&&(i.setCanvas(e,s),this.#U.delete(t))}addMissingCanvas(t,e){(this.#U||=new Map).set(t,e)}}class zt{#t=null;#e=!1;#s=null;#i=null;#n=null;#r=null;#a=!1;#o=null;#h=null;#l=null;#u=null;#d=!1;static#f=null;static _l10n=null;constructor(t){this.#h=t,this.#d=t._uiManager.useNewAltTextFlow,zt.#f||=Object.freeze({added:"pdfjs-editor-new-alt-text-added-button","added-label":"pdfjs-editor-new-alt-text-added-button-label",missing:"pdfjs-editor-new-alt-text-missing-button","missing-label":"pdfjs-editor-new-alt-text-missing-button-label",review:"pdfjs-editor-new-alt-text-to-review-button","review-label":"pdfjs-editor-new-alt-text-to-review-button-label"})}static initialize(t){zt._l10n??=t}async render(){const t=this.#s=document.createElement("button");t.className="altText",t.tabIndex="0";const e=this.#i=document.createElement("span");t.append(e),this.#d?(t.classList.add("new"),t.setAttribute("data-l10n-id",zt.#f.missing),e.setAttribute("data-l10n-id",zt.#f["missing-label"])):(t.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button"),e.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button-label"));const s=this.#h._uiManager._signal;t.addEventListener("contextmenu",kt,{signal:s}),t.addEventListener("pointerdown",n=>n.stopPropagation(),{signal:s});const i=n=>{n.preventDefault(),this.#h._uiManager.editAltText(this.#h),this.#d&&this.#h._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_clicked",data:{label:this.#m}})};return t.addEventListener("click",i,{capture:!0,signal:s}),t.addEventListener("keydown",n=>{n.target===t&&n.key==="Enter"&&(this.#a=!0,i(n))},{signal:s}),await this.#g(),t}get#m(){return this.#t&&"added"||this.#t===null&&this.guessedText&&"review"||"missing"}finish(){this.#s&&(this.#s.focus({focusVisible:this.#a}),this.#a=!1)}isEmpty(){return this.#d?this.#t===null:!this.#t&&!this.#e}hasData(){return this.#d?this.#t!==null||!!this.#l:this.isEmpty()}get guessedText(){return this.#l}async setGuessedText(t){this.#t===null&&(this.#l=t,this.#u=await zt._l10n.get("pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer",{generatedAltText:t}),this.#g())}toggleAltTextBadge(t=!1){if(!this.#d||this.#t){this.#o?.remove(),this.#o=null;return}if(!this.#o){const e=this.#o=document.createElement("div");e.className="noAltTextBadge",this.#h.div.append(e)}this.#o.classList.toggle("hidden",!t)}serialize(t){let e=this.#t;return!t&&this.#l===e&&(e=this.#u),{altText:e,decorative:this.#e,guessedText:this.#l,textWithDisclaimer:this.#u}}get data(){return{altText:this.#t,decorative:this.#e}}set data({altText:t,decorative:e,guessedText:s,textWithDisclaimer:i,cancel:n=!1}){s&&(this.#l=s,this.#u=i),!(this.#t===t&&this.#e===e)&&(n||(this.#t=t,this.#e=e),this.#g())}toggle(t=!1){this.#s&&(!t&&this.#r&&(clearTimeout(this.#r),this.#r=null),this.#s.disabled=!t)}shown(){this.#h._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_displayed",data:{label:this.#m}})}destroy(){this.#s?.remove(),this.#s=null,this.#i=null,this.#n=null,this.#o?.remove(),this.#o=null}async#g(){const t=this.#s;if(!t)return;if(this.#d){if(t.classList.toggle("done",!!this.#t),t.setAttribute("data-l10n-id",zt.#f[this.#m]),this.#i?.setAttribute("data-l10n-id",zt.#f[`${this.#m}-label`]),!this.#t){this.#n?.remove();return}}else{if(!this.#t&&!this.#e){t.classList.remove("done"),this.#n?.remove();return}t.classList.add("done"),t.setAttribute("data-l10n-id","pdfjs-editor-alt-text-edit-button")}let e=this.#n;if(!e){this.#n=e=document.createElement("span"),e.className="tooltip",e.setAttribute("role","tooltip"),e.id=`alt-text-tooltip-${this.#h.id}`;const i=100,n=this.#h._uiManager._signal;n.addEventListener("abort",()=>{clearTimeout(this.#r),this.#r=null},{once:!0}),t.addEventListener("mouseenter",()=>{this.#r=setTimeout(()=>{this.#r=null,this.#n.classList.add("show"),this.#h._reportTelemetry({action:"alt_text_tooltip"})},i)},{signal:n}),t.addEventListener("mouseleave",()=>{this.#r&&(clearTimeout(this.#r),this.#r=null),this.#n?.classList.remove("show")},{signal:n})}this.#e?e.setAttribute("data-l10n-id","pdfjs-editor-alt-text-decorative-tooltip"):(e.removeAttribute("data-l10n-id"),e.textContent=this.#t),e.parentNode||t.append(e),this.#h.getElementForAltText()?.setAttribute("aria-describedby",e.id)}}class ze{#t=null;#e=null;#s=!1;#i=null;#n=null;#r=null;#a=null;#o=null;#h=!1;#l=null;constructor(t){this.#i=t}renderForToolbar(){const t=this.#e=document.createElement("button");return t.className="comment",this.#u(t,!1)}renderForStandalone(){const t=this.#t=document.createElement("button");t.className="annotationCommentButton";const e=this.#i.commentButtonPosition;if(e){const{style:s}=t;s.insetInlineEnd=`calc(${100*(this.#i._uiManager.direction==="ltr"?1-e[0]:e[0])}% - var(--comment-button-dim))`,s.top=`calc(${100*e[1]}% - var(--comment-button-dim))`;const i=this.#i.commentButtonColor;i&&(s.backgroundColor=i)}return this.#u(t,!0)}focusButton(){setTimeout(()=>{(this.#t??this.#e)?.focus()},0)}onUpdatedColor(){if(!this.#t)return;const t=this.#i.commentButtonColor;t&&(this.#t.style.backgroundColor=t),this.#i._uiManager.updatePopupColor(this.#i)}get commentButtonWidth(){return(this.#t?.getBoundingClientRect().width??0)/this.#i.parent.boundingClientRect.width}get commentPopupPositionInLayer(){if(this.#l)return this.#l;if(!this.#t)return null;const{x:t,y:e,height:s}=this.#t.getBoundingClientRect(),{x:i,y:n,width:r,height:a}=this.#i.parent.boundingClientRect;return[(t-i)/r,(e+s-n)/a]}set commentPopupPositionInLayer(t){this.#l=t}hasDefaultPopupPosition(){return this.#l===null}removeStandaloneCommentButton(){this.#t?.remove(),this.#t=null}removeToolbarCommentButton(){this.#e?.remove(),this.#e=null}setCommentButtonStates({selected:t,hasPopup:e}){this.#t&&(this.#t.classList.toggle("selected",t),this.#t.ariaExpanded=e)}#u(t,e){if(!this.#i._uiManager.hasCommentManager())return null;t.tabIndex="0",t.ariaHasPopup="dialog",e?(t.ariaControls="commentPopup",t.setAttribute("data-l10n-id","pdfjs-show-comment-button")):(t.ariaControlsElements=[this.#i._uiManager.getCommentDialogElement()],t.setAttribute("data-l10n-id","pdfjs-editor-add-comment-button"));const s=this.#i._uiManager._signal;if(!(s instanceof AbortSignal)||s.aborted)return t;t.addEventListener("contextmenu",kt,{signal:s}),e&&(t.addEventListener("focusin",n=>{this.#i._focusEventsAllowed=!1,ct(n)},{capture:!0,signal:s}),t.addEventListener("focusout",n=>{this.#i._focusEventsAllowed=!0,ct(n)},{capture:!0,signal:s})),t.addEventListener("pointerdown",n=>n.stopPropagation(),{signal:s});const i=n=>{n.preventDefault(),t===this.#e?this.edit():this.#i.toggleComment(!0)};return t.addEventListener("click",i,{capture:!0,signal:s}),t.addEventListener("keydown",n=>{n.target===t&&n.key==="Enter"&&(this.#s=!0,i(n))},{signal:s}),t.addEventListener("pointerenter",()=>{this.#i.toggleComment(!1,!0)},{signal:s}),t.addEventListener("pointerleave",()=>{this.#i.toggleComment(!1,!1)},{signal:s}),t}edit(t){const e=this.commentPopupPositionInLayer;let s,i;if(e)[s,i]=e;else{[s,i]=this.#i.commentButtonPosition;const{width:c,height:d,x:u,y:f}=this.#i;s=u+s*c,i=f+i*d}const n=this.#i.parent.boundingClientRect,{x:r,y:a,width:o,height:l}=n;this.#i._uiManager.editComment(this.#i,r+s*o,a+i*l,{...t,parentDimensions:n})}finish(){this.#e&&(this.#e.focus({focusVisible:this.#s}),this.#s=!1)}isDeleted(){return this.#h||this.#a===""}isEmpty(){return this.#a===null}hasBeenEdited(){return this.isDeleted()||this.#a!==this.#n}serialize(){return this.data}get data(){return{text:this.#a,richText:this.#r,date:this.#o,deleted:this.isDeleted()}}set data(t){if(t!==this.#a&&(this.#r=null),t===null){this.#a="",this.#h=!0;return}this.#a=t,this.#o=new Date,this.#h=!1}restoreData({text:t,richText:e,date:s}){this.#a=t,this.#r=e,this.#o=s,this.#h=!1}setInitialText(t,e=null){this.#n=t,this.data=t,this.#o=null,this.#r=e}shown(){}destroy(){this.#e?.remove(),this.#e=null,this.#t?.remove(),this.#t=null,this.#a="",this.#r=null,this.#o=null,this.#i=null,this.#s=!1,this.#h=!1}}class us{#t;#e=!1;#s=null;#i;#n;#r;#a;#o=null;#h;#l=null;#u;#d=null;constructor({container:t,isPinchingDisabled:e=null,isPinchingStopped:s=null,onPinchStart:i=null,onPinching:n=null,onPinchEnd:r=null,signal:a}){this.#t=t,this.#s=s,this.#i=e,this.#n=i,this.#r=n,this.#a=r,this.#u=new AbortController,this.#h=AbortSignal.any([a,this.#u.signal]),t.addEventListener("touchstart",this.#f.bind(this),{passive:!1,signal:this.#h})}get MIN_TOUCH_DISTANCE_TO_PINCH(){return 35/Vt.pixelRatio}#f(t){if(this.#i?.())return;if(t.touches.length===1){if(this.#o)return;const i=this.#o=new AbortController,n=AbortSignal.any([this.#h,i.signal]),r=this.#t,a={capture:!0,signal:n,passive:!1},o=l=>{l.pointerType==="touch"&&(this.#o?.abort(),this.#o=null)};r.addEventListener("pointerdown",l=>{l.pointerType==="touch"&&(ct(l),o(l))},a),r.addEventListener("pointerup",o,a),r.addEventListener("pointercancel",o,a);return}if(!this.#d){this.#d=new AbortController;const i=AbortSignal.any([this.#h,this.#d.signal]),n=this.#t,r={signal:i,capture:!1,passive:!1};n.addEventListener("touchmove",this.#m.bind(this),r);const a=this.#g.bind(this);n.addEventListener("touchend",a,r),n.addEventListener("touchcancel",a,r),r.capture=!0,n.addEventListener("pointerdown",ct,r),n.addEventListener("pointermove",ct,r),n.addEventListener("pointercancel",ct,r),n.addEventListener("pointerup",ct,r),this.#n?.()}if(ct(t),t.touches.length!==2||this.#s?.()){this.#l=null;return}let[e,s]=t.touches;e.identifier>s.identifier&&([e,s]=[s,e]),this.#l={touch0X:e.screenX,touch0Y:e.screenY,touch1X:s.screenX,touch1Y:s.screenY}}#m(t){if(!this.#l||t.touches.length!==2)return;ct(t);let[e,s]=t.touches;e.identifier>s.identifier&&([e,s]=[s,e]);const{screenX:i,screenY:n}=e,{screenX:r,screenY:a}=s,o=this.#l,{touch0X:l,touch0Y:c,touch1X:d,touch1Y:u}=o,f=d-l,g=u-c,p=r-i,m=a-n,v=Math.hypot(p,m)||1,y=Math.hypot(f,g)||1;if(!this.#e&&Math.abs(y-v)<=us.MIN_TOUCH_DISTANCE_TO_PINCH)return;if(o.touch0X=i,o.touch0Y=n,o.touch1X=r,o.touch1Y=a,!this.#e){this.#e=!0;return}const b=[(i+r)/2,(n+a)/2];this.#r?.(b,y,v)}#g(t){t.touches.length>=2||(this.#d&&(this.#d.abort(),this.#d=null,this.#a?.()),this.#l&&(ct(t),this.#l=null,this.#e=!1))}destroy(){this.#u?.abort(),this.#u=null,this.#o?.abort(),this.#o=null}}class H{#t=null;#e=null;#s=null;#i=null;#n=null;#r=!1;#a=null;#o="";#h=null;#l=null;#u=null;#d=null;#f=null;#m="";#g=!1;#c=null;#p=!1;#v=!1;#w=!1;#b=null;#E=0;#P=0;#y=null;#x=null;isSelected=!1;_isCopy=!1;_editToolbar=null;_initialOptions=Object.create(null);_initialData=null;_isVisible=!0;_uiManager=null;_focusEventsAllowed=!0;static _l10n=null;static _l10nResizer=null;#S=!1;#C=H._zIndex++;static _borderLineWidth=-1;static _colorManager=new Js;static _zIndex=1;static _telemetryTimeout=1e3;static get _resizerKeyboardManager(){const t=H.prototype._resizeWithKeyboard,e=ee.TRANSLATE_SMALL,s=ee.TRANSLATE_BIG;return K(this,"_resizerKeyboardManager",new $e([[["ArrowLeft","mac+ArrowLeft"],t,{args:[-e,0]}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t,{args:[-s,0]}],[["ArrowRight","mac+ArrowRight"],t,{args:[e,0]}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t,{args:[s,0]}],[["ArrowUp","mac+ArrowUp"],t,{args:[0,-e]}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t,{args:[0,-s]}],[["ArrowDown","mac+ArrowDown"],t,{args:[0,e]}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t,{args:[0,s]}],[["Escape","mac+Escape"],H.prototype._stopResizingWithKeyboard]]))}constructor(t){this.parent=t.parent,this.id=t.id,this.width=this.height=null,this.pageIndex=t.parent.pageIndex,this.name=t.name,this.div=null,this._uiManager=t.uiManager,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=t.isCentered,this._structTreeParentId=null,this.annotationElementId=t.annotationElementId||null,this.creationDate=t.creationDate||new Date,this.modificationDate=t.modificationDate||null,this.canAddComment=!0;const{rotation:e,rawDims:{pageWidth:s,pageHeight:i,pageX:n,pageY:r}}=this.parent.viewport;this.rotation=e,this.pageRotation=(360+e-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[s,i],this.pageTranslation=[n,r];const[a,o]=this.parentDimensions;this.x=t.x/a,this.y=t.y/o,this.isAttachedToDOM=!1,this.deleted=!1}updatePageIndex(t){this.pageIndex=t}get editorType(){return Object.getPrototypeOf(this).constructor._type}get mode(){return Object.getPrototypeOf(this).constructor._editorType}static get isDrawer(){return!1}static get _defaultLineColor(){return K(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(t){const e=new Un({id:t._uiManager.getId(),parent:t.parent,uiManager:t._uiManager});e.annotationElementId=t.annotationElementId,e.deleted=!0,e._uiManager.addToAnnotationStorage(e)}static initialize(t,e){if(H._l10n??=t,H._l10nResizer||=Object.freeze({topLeft:"pdfjs-editor-resizer-top-left",topMiddle:"pdfjs-editor-resizer-top-middle",topRight:"pdfjs-editor-resizer-top-right",middleRight:"pdfjs-editor-resizer-middle-right",bottomRight:"pdfjs-editor-resizer-bottom-right",bottomMiddle:"pdfjs-editor-resizer-bottom-middle",bottomLeft:"pdfjs-editor-resizer-bottom-left",middleLeft:"pdfjs-editor-resizer-middle-left"}),H._borderLineWidth!==-1)return;const s=getComputedStyle(document.documentElement);H._borderLineWidth=parseFloat(s.getPropertyValue("--outline-width"))||0}static updateDefaultParams(t,e){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(t){return!1}static paste(t,e){nt("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return this.#S}set _isDraggable(t){this.#S=t,this.div?.classList.toggle("draggable",t)}get uid(){return this.annotationElementId||this.id}get isEnterHandled(){return!0}center(){const[t,e]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*e/(t*2),this.y+=this.width*t/(e*2);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*e/(t*2),this.y-=this.width*t/(e*2);break;default:this.x-=this.width/2,this.y-=this.height/2;break}this.fixAndSetPosition()}addCommands(t){this._uiManager.addCommands(t)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=this.#C}setParent(t){t!==null?(this.pageIndex=t.pageIndex,this.pageDimensions=t.pageDimensions):(this.#_(),this.#d?.remove(),this.#d=null),this.parent=t}focusin(t){this._focusEventsAllowed&&(this.#g?this.#g=!1:this.parent.setSelected(this))}focusout(t){!this._focusEventsAllowed||!this.isAttachedToDOM||t.relatedTarget?.closest(`#${this.id}`)||(t.preventDefault(),this.parent?.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.isInEditMode()&&this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(t,e,s,i){const[n,r]=this.parentDimensions;[s,i]=this.screenToPageTranslation(s,i),this.x=(t+s)/n,this.y=(e+i)/r,this.fixAndSetPosition()}_moveAfterPaste(t,e){if(this.isClone){delete this.isClone;return}const[s,i]=this.parentDimensions;this.setAt(t*s,e*i,this.width*s,this.height*i),this._onTranslated()}#R([t,e],s,i){[s,i]=this.screenToPageTranslation(s,i),this.x+=s/t,this.y+=i/e,this._onTranslating(this.x,this.y),this.fixAndSetPosition()}translate(t,e){this.#R(this.parentDimensions,t,e)}translateInPage(t,e){this.#c||=[this.x,this.y,this.width,this.height],this.#R(this.pageDimensions,t,e),this.div.scrollIntoView({block:"nearest"})}translationDone(){this._onTranslated(this.x,this.y)}drag(t,e){this.#c||=[this.x,this.y,this.width,this.height];const{div:s,parentDimensions:[i,n]}=this;if(this.x+=t/i,this.y+=e/n,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){const{x:d,y:u}=this.div.getBoundingClientRect();this.parent.findNewParent(this,d,u)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:r,y:a}=this;const[o,l]=this.getBaseTranslation();r+=o,a+=l;const{style:c}=s;c.left=`${(100*r).toFixed(2)}%`,c.top=`${(100*a).toFixed(2)}%`,this._onTranslating(r,a),s.scrollIntoView({block:"nearest"})}_onTranslating(t,e){}_onTranslated(t,e){}get _hasBeenMoved(){return!!this.#c&&(this.#c[0]!==this.x||this.#c[1]!==this.y)}get _hasBeenResized(){return!!this.#c&&(this.#c[2]!==this.width||this.#c[3]!==this.height)}getBaseTranslation(){const[t,e]=this.parentDimensions,{_borderLineWidth:s}=H,i=s/t,n=s/e;switch(this.rotation){case 90:return[-i,n];case 180:return[i,n];case 270:return[i,-n];default:return[-i,-n]}}get _mustFixPosition(){return!0}fixAndSetPosition(t=this.rotation){const{div:{style:e},pageDimensions:[s,i]}=this;let{x:n,y:r,width:a,height:o}=this;if(a*=s,o*=i,n*=s,r*=i,this._mustFixPosition)switch(t){case 0:n=ht(n,0,s-a),r=ht(r,0,i-o);break;case 90:n=ht(n,0,s-o),r=ht(r,a,i);break;case 180:n=ht(n,a,s),r=ht(r,o,i);break;case 270:n=ht(n,o,s),r=ht(r,0,i-a);break}this.x=n/=s,this.y=r/=i;const[l,c]=this.getBaseTranslation();n+=l,r+=c,e.left=`${(100*n).toFixed(2)}%`,e.top=`${(100*r).toFixed(2)}%`,this.moveInDOM()}static#O(t,e,s){switch(s){case 90:return[e,-t];case 180:return[-t,-e];case 270:return[-e,t];default:return[t,e]}}screenToPageTranslation(t,e){return H.#O(t,e,this.parentRotation)}pageTranslationToScreen(t,e){return H.#O(t,e,360-this.parentRotation)}#I(t){switch(t){case 90:{const[e,s]=this.pageDimensions;return[0,-e/s,s/e,0]}case 180:return[-1,0,0,-1];case 270:{const[e,s]=this.pageDimensions;return[0,e/s,-s/e,0]}default:return[1,0,0,1]}}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){const{parentScale:t,pageDimensions:[e,s]}=this;return[e*t,s*t]}setDims(){const{div:{style:t},width:e,height:s}=this;t.width=`${(100*e).toFixed(2)}%`,t.height=`${(100*s).toFixed(2)}%`}getInitialTranslation(){return[0,0]}#F(){if(this.#h)return;this.#h=document.createElement("div"),this.#h.classList.add("resizers");const t=this._willKeepAspectRatio?["topLeft","topRight","bottomRight","bottomLeft"]:["topLeft","topMiddle","topRight","middleRight","bottomRight","bottomMiddle","bottomLeft","middleLeft"],e=this._uiManager._signal;for(const s of t){const i=document.createElement("div");this.#h.append(i),i.classList.add("resizer",s),i.setAttribute("data-resizer-name",s),i.addEventListener("pointerdown",this.#L.bind(this,s),{signal:e}),i.addEventListener("contextmenu",kt,{signal:e}),i.tabIndex=-1}this.div.prepend(this.#h)}#L(t,e){e.preventDefault();const{isMac:s}=yt.platform;if(e.button!==0||e.ctrlKey&&s)return;this.#s?.toggle(!1);const i=this._isDraggable;this._isDraggable=!1,this.#l=[e.screenX,e.screenY];const n=new AbortController,r=this._uiManager.combinedSignal(n);this.parent.togglePointerEvents(!1),window.addEventListener("pointermove",this.#B.bind(this,t),{passive:!0,capture:!0,signal:r}),window.addEventListener("touchmove",ct,{passive:!1,signal:r}),window.addEventListener("contextmenu",kt,{signal:r}),this.#u={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height};const a=this.parent.div.style.cursor,o=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(e.target).cursor;const l=()=>{n.abort(),this.parent.togglePointerEvents(!0),this.#s?.toggle(!0),this._isDraggable=i,this.parent.div.style.cursor=a,this.div.style.cursor=o,this.#N()};window.addEventListener("pointerup",l,{signal:r}),window.addEventListener("blur",l,{signal:r})}#D(t,e,s,i){this.width=s,this.height=i,this.x=t,this.y=e,this.setDims(),this.fixAndSetPosition(),this._onResized()}_onResized(){}#N(){if(!this.#u)return;const{savedX:t,savedY:e,savedWidth:s,savedHeight:i}=this.#u;this.#u=null;const n=this.x,r=this.y,a=this.width,o=this.height;n===t&&r===e&&a===s&&o===i||this.addCommands({cmd:this.#D.bind(this,n,r,a,o),undo:this.#D.bind(this,t,e,s,i),mustExec:!0})}static _round(t){return Math.round(t*1e4)/1e4}#B(t,e){const[s,i]=this.parentDimensions,n=this.x,r=this.y,a=this.width,o=this.height,l=H.MIN_SIZE/s,c=H.MIN_SIZE/i,d=this.#I(this.rotation),u=(M,O)=>[d[0]*M+d[2]*O,d[1]*M+d[3]*O],f=this.#I(360-this.rotation),g=(M,O)=>[f[0]*M+f[2]*O,f[1]*M+f[3]*O];let p,m,v=!1,y=!1;switch(t){case"topLeft":v=!0,p=(M,O)=>[0,0],m=(M,O)=>[M,O];break;case"topMiddle":p=(M,O)=>[M/2,0],m=(M,O)=>[M/2,O];break;case"topRight":v=!0,p=(M,O)=>[M,0],m=(M,O)=>[0,O];break;case"middleRight":y=!0,p=(M,O)=>[M,O/2],m=(M,O)=>[0,O/2];break;case"bottomRight":v=!0,p=(M,O)=>[M,O],m=(M,O)=>[0,0];break;case"bottomMiddle":p=(M,O)=>[M/2,O],m=(M,O)=>[M/2,0];break;case"bottomLeft":v=!0,p=(M,O)=>[0,O],m=(M,O)=>[M,0];break;case"middleLeft":y=!0,p=(M,O)=>[0,O/2],m=(M,O)=>[M,O/2];break}const b=p(a,o),w=m(a,o);let A=u(...w);const S=H._round(n+A[0]),E=H._round(r+A[1]);let C=1,x=1,P,T;if(e.fromKeyboard)({deltaX:P,deltaY:T}=e);else{const{screenX:M,screenY:O}=e,[_,j]=this.#l;[P,T]=this.screenToPageTranslation(M-_,O-j),this.#l[0]=M,this.#l[1]=O}if([P,T]=g(P/s,T/i),v){const M=Math.hypot(a,o);C=x=Math.max(Math.min(Math.hypot(w[0]-b[0]-P,w[1]-b[1]-T)/M,1/a,1/o),l/a,c/o)}else y?C=ht(Math.abs(w[0]-b[0]-P),l,1)/a:x=ht(Math.abs(w[1]-b[1]-T),c,1)/o;const k=H._round(a*C),R=H._round(o*x);A=u(...m(k,R));const D=S-A[0],W=E-A[1];this.#c||=[this.x,this.y,this.width,this.height],this.width=k,this.height=R,this.x=D,this.y=W,this.setDims(),this.fixAndSetPosition(),this._onResizing()}_onResizing(){}altTextFinish(){this.#s?.finish()}get toolbarButtons(){return null}async addEditToolbar(){if(this._editToolbar||this.#v)return this._editToolbar;this._editToolbar=new Oe(this),this.div.append(this._editToolbar.render());const{toolbarButtons:t}=this;if(t)for(const[e,s]of t)await this._editToolbar.addButton(e,s);return this.hasComment||this._editToolbar.addButton("comment",this.addCommentButton()),this._editToolbar.addButton("delete"),this._editToolbar}addCommentButtonInToolbar(){this._editToolbar?.addButtonBefore("comment",this.addCommentButton(),".deleteButton")}removeCommentButtonFromToolbar(){this._editToolbar?.removeButton("comment")}removeEditToolbar(){this._editToolbar?.remove(),this._editToolbar=null,this.#s?.destroy()}addContainer(t){const e=this._editToolbar?.div;e?e.before(t):this.div.append(t)}getClientDimensions(){return this.div.getBoundingClientRect()}createAltText(){return this.#s||(zt.initialize(H._l10n),this.#s=new zt(this),this.#t&&(this.#s.data=this.#t,this.#t=null)),this.#s}get altTextData(){return this.#s?.data}set altTextData(t){this.#s&&(this.#s.data=t)}get guessedAltText(){return this.#s?.guessedText}async setGuessedAltText(t){await this.#s?.setGuessedText(t)}serializeAltText(t){return this.#s?.serialize(t)}hasAltText(){return!!this.#s&&!this.#s.isEmpty()}hasAltTextData(){return this.#s?.hasData()??!1}focusCommentButton(){this.#i?.focusButton()}addCommentButton(){return this.canAddComment?this.#i||=new ze(this):null}addStandaloneCommentButton(){if(this._uiManager.hasCommentManager()){if(this.#n){this._uiManager.isEditingMode()&&this.#n.classList.remove("hidden");return}this.hasComment&&(this.#n=this.#i.renderForStandalone(),this.div.append(this.#n))}}removeStandaloneCommentButton(){this.#i.removeStandaloneCommentButton(),this.#n=null}hideStandaloneCommentButton(){this.#n?.classList.add("hidden")}get comment(){if(!this.#i)return null;const{data:{richText:t,text:e,date:s,deleted:i}}=this.#i;return{text:e,richText:t,date:s,deleted:i,color:this.getNonHCMColor(),opacity:this.opacity??1}}set comment(t){this.#i||=new ze(this),typeof t=="object"&&t!==null?this.#i.restoreData(t):this.#i.data=t,this.hasComment?(this.removeCommentButtonFromToolbar(),this.addStandaloneCommentButton(),this._uiManager.updateComment(this)):(this.addCommentButtonInToolbar(),this.removeStandaloneCommentButton(),this._uiManager.removeComment(this))}setCommentData({comment:t,popupRef:e,richText:s}){if(!e||(this.#i||=new ze(this),this.#i.setInitialText(t,s),!this.annotationElementId))return;const i=this._uiManager.getAndRemoveDataFromAnnotationStorage(this.annotationElementId);i&&this.updateFromAnnotationLayer(i)}get hasEditedComment(){return this.#i?.hasBeenEdited()}get hasDeletedComment(){return this.#i?.isDeleted()}get hasComment(){return!!this.#i&&!this.#i.isEmpty()&&!this.#i.isDeleted()}async editComment(t){this.#i||=new ze(this),this.#i.edit(t)}toggleComment(t,e=void 0){this.hasComment&&this._uiManager.toggleComment(this,t,e)}setSelectedCommentButton(t){this.#i.setSelectedButton(t)}addComment(t){if(this.hasEditedComment){const[,,,i]=t.rect,[n]=this.pageDimensions,[r]=this.pageTranslation,a=r+n+1,o=i-100,l=a+180;t.popup={contents:this.comment.text,deleted:this.comment.deleted,rect:[a,o,l,i]}}}updateFromAnnotationLayer({popup:{contents:t,deleted:e}}){this.#i.data=e?null:t}get parentBoundingClientRect(){return this.parent.boundingClientRect}render(){const t=this.div=document.createElement("div");t.setAttribute("data-editor-rotation",(360-this.rotation)%360),t.className=this.name,t.setAttribute("id",this.id),t.tabIndex=this.#r?-1:0,t.setAttribute("role","application"),this.defaultL10nId&&t.setAttribute("data-l10n-id",this.defaultL10nId),this._isVisible||t.classList.add("hidden"),this.setInForeground(),this.#$();const[e,s]=this.parentDimensions;this.parentRotation%180!==0&&(t.style.maxWidth=`${(100*s/e).toFixed(2)}%`,t.style.maxHeight=`${(100*e/s).toFixed(2)}%`);const[i,n]=this.getInitialTranslation();return this.translate(i,n),Vi(this,t,["keydown","pointerdown","dblclick"]),this.isResizable&&this._uiManager._supportsPinchToZoom&&(this.#x||=new us({container:t,isPinchingDisabled:()=>!this.isSelected,onPinchStart:this.#U.bind(this),onPinching:this.#V.bind(this),onPinchEnd:this.#T.bind(this),signal:this._uiManager._signal})),this.addStandaloneCommentButton(),this._uiManager._editorUndoBar?.hide(),t}#U(){this.#u={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height},this.#s?.toggle(!1),this.parent.togglePointerEvents(!1)}#V(t,e,s){let n=.7*(s/e)+1-.7;if(n===1)return;const r=this.#I(this.rotation),a=(S,E)=>[r[0]*S+r[2]*E,r[1]*S+r[3]*E],[o,l]=this.parentDimensions,c=this.x,d=this.y,u=this.width,f=this.height,g=H.MIN_SIZE/o,p=H.MIN_SIZE/l;n=Math.max(Math.min(n,1/u,1/f),g/u,p/f);const m=H._round(u*n),v=H._round(f*n);if(m===u&&v===f)return;this.#c||=[c,d,u,f];const y=a(u/2,f/2),b=H._round(c+y[0]),w=H._round(d+y[1]),A=a(m/2,v/2);this.x=b-A[0],this.y=w-A[1],this.width=m,this.height=v,this.setDims(),this.fixAndSetPosition(),this._onResizing()}#T(){this.#s?.toggle(!0),this.parent.togglePointerEvents(!0),this.#N()}pointerdown(t){const{isMac:e}=yt.platform;if(t.button!==0||t.ctrlKey&&e){t.preventDefault();return}if(this.#g=!0,this._isDraggable){this.#k(t);return}this.#A(t)}#A(t){const{isMac:e}=yt.platform;t.ctrlKey&&!e||t.shiftKey||t.metaKey&&e?this.parent.toggleSelected(this):this.parent.setSelected(this)}#k(t){const{isSelected:e}=this;this._uiManager.setUpDragSession();let s=!1;const i=new AbortController,n=this._uiManager.combinedSignal(i),r={capture:!0,passive:!1,signal:n},a=l=>{i.abort(),this.#a=null,this.#g=!1,this._uiManager.endDragSession()||this.#A(l),s&&this._onStopDragging()};e&&(this.#E=t.clientX,this.#P=t.clientY,this.#a=t.pointerId,this.#o=t.pointerType,window.addEventListener("pointermove",l=>{s||(s=!0,this._uiManager.toggleComment(this,!0,!1),this._onStartDragging());const{clientX:c,clientY:d,pointerId:u}=l;if(u!==this.#a){ct(l);return}const[f,g]=this.screenToPageTranslation(c-this.#E,d-this.#P);this.#E=c,this.#P=d,this._uiManager.dragSelectedEditors(f,g)},r),window.addEventListener("touchmove",ct,r),window.addEventListener("pointerdown",l=>{l.pointerType===this.#o&&(this.#x||l.isPrimary)&&a(l),ct(l)},r));const o=l=>{if(!this.#a||this.#a===l.pointerId){a(l);return}ct(l)};window.addEventListener("pointerup",o,{signal:n}),window.addEventListener("blur",o,{signal:n})}_onStartDragging(){}_onStopDragging(){}moveInDOM(){this.#b&&clearTimeout(this.#b),this.#b=setTimeout(()=>{this.#b=null,this.parent?.moveEditorInDOM(this)},0)}_setParentAndPosition(t,e,s){t.changeParent(this),this.x=e,this.y=s,this.fixAndSetPosition(),this._onTranslated()}getRect(t,e,s=this.rotation){const i=this.parentScale,[n,r]=this.pageDimensions,[a,o]=this.pageTranslation,l=t/i,c=e/i,d=this.x*n,u=this.y*r,f=this.width*n,g=this.height*r;switch(s){case 0:return[d+l+a,r-u-c-g+o,d+l+f+a,r-u-c+o];case 90:return[d+c+a,r-u+l+o,d+c+g+a,r-u+l+f+o];case 180:return[d-l-f+a,r-u+c+o,d-l+a,r-u+c+g+o];case 270:return[d-c-g+a,r-u-l-f+o,d-c+a,r-u-l+o];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(t,e){const[s,i,n,r]=t,a=n-s,o=r-i;switch(this.rotation){case 0:return[s,e-r,a,o];case 90:return[s,e-i,o,a];case 180:return[n,e-i,a,o];case 270:return[n,e-r,o,a];default:throw new Error("Invalid rotation")}}getPDFRect(){return this.getRect(0,0)}getNonHCMColor(){return this.color&&H._colorManager.convert(this._uiManager.getNonHCMColor(this.color))}onUpdatedColor(){this.#i?.onUpdatedColor()}getData(){const{comment:{text:t,color:e,date:s,opacity:i,deleted:n,richText:r},uid:a,pageIndex:o,creationDate:l,modificationDate:c}=this;return{id:a,pageIndex:o,rect:this.getPDFRect(),richText:r,contentsObj:{str:t},creationDate:l,modificationDate:s||c,popupRef:!n,color:e,opacity:i}}onceAdded(t){}isEmpty(){return!1}enableEditMode(){return this.isInEditMode()?!1:(this.parent.setEditingState(!1),this.#v=!0,!0)}disableEditMode(){return this.isInEditMode()?(this.parent.setEditingState(!0),this.#v=!1,!0):!1}isInEditMode(){return this.#v}shouldGetKeyboardEvents(){return this.#w}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}get isOnScreen(){const{top:t,left:e,bottom:s,right:i}=this.getClientDimensions(),{innerHeight:n,innerWidth:r}=window;return e<r&&i>0&&t<n&&s>0}#$(){if(this.#f||!this.div)return;this.#f=new AbortController;const t=this._uiManager.combinedSignal(this.#f);this.div.addEventListener("focusin",this.focusin.bind(this),{signal:t}),this.div.addEventListener("focusout",this.focusout.bind(this),{signal:t})}rebuild(){this.#$()}rotate(t){}resize(){}serializeDeleted(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex,popupRef:this._initialData?.popupRef||""}}serialize(t=!1,e=null){return{annotationType:this.mode,pageIndex:this.pageIndex,rect:this.getPDFRect(),rotation:this.rotation,structTreeParentId:this._structTreeParentId,popupRef:this._initialData?.popupRef||""}}static async deserialize(t,e,s){const i=new this.prototype.constructor({parent:e,id:s.getId(),uiManager:s,annotationElementId:t.annotationElementId,creationDate:t.creationDate,modificationDate:t.modificationDate});i.rotation=t.rotation,i.#t=t.accessibilityData,i._isCopy=t.isCopy||!1;const[n,r]=i.pageDimensions,[a,o,l,c]=i.getRectInCurrentCoords(t.rect,r);return i.x=a/n,i.y=o/r,i.width=l/n,i.height=c/r,i}get hasBeenModified(){return!!this.annotationElementId&&(this.deleted||this.serialize()!==null)}remove(){if(this.#f?.abort(),this.#f=null,this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),this.hideCommentPopup(),this.#b&&(clearTimeout(this.#b),this.#b=null),this.#_(),this.removeEditToolbar(),this.#y){for(const t of this.#y.values())clearTimeout(t);this.#y=null}this.parent=null,this.#x?.destroy(),this.#x=null,this.#d?.remove(),this.#d=null}get isResizable(){return!1}makeResizable(){this.isResizable&&(this.#F(),this.#h.classList.remove("hidden"))}get toolbarPosition(){return null}get commentButtonPosition(){return this._uiManager.direction==="ltr"?[1,0]:[0,0]}get commentButtonPositionInPage(){const{commentButtonPosition:[t,e]}=this,[s,i,n,r]=this.getPDFRect();return[H._round(s+(n-s)*t),H._round(i+(r-i)*(1-e))]}get commentButtonColor(){return this._uiManager.makeCommentColor(this.getNonHCMColor(),this.opacity)}get commentPopupPosition(){return this.#i.commentPopupPositionInLayer}set commentPopupPosition(t){this.#i.commentPopupPositionInLayer=t}hasDefaultPopupPosition(){return this.#i.hasDefaultPopupPosition()}get commentButtonWidth(){return this.#i.commentButtonWidth}get elementBeforePopup(){return this.div}setCommentButtonStates(t){this.#i?.setCommentButtonStates(t)}keydown(t){if(!this.isResizable||t.target!==this.div||t.key!=="Enter")return;this._uiManager.setSelected(this),this.#u={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height};const e=this.#h.children;if(!this.#e){this.#e=Array.from(e);const r=this.#G.bind(this),a=this.#K.bind(this),o=this._uiManager._signal;for(const l of this.#e){const c=l.getAttribute("data-resizer-name");l.setAttribute("role","spinbutton"),l.addEventListener("keydown",r,{signal:o}),l.addEventListener("blur",a,{signal:o}),l.addEventListener("focus",this.#X.bind(this,c),{signal:o}),l.setAttribute("data-l10n-id",H._l10nResizer[c])}}const s=this.#e[0];let i=0;for(const r of e){if(r===s)break;i++}const n=(360-this.rotation+this.parentRotation)%360/90*(this.#e.length/4);if(n!==i){if(n<i)for(let a=0;a<i-n;a++)this.#h.append(this.#h.firstElementChild);else if(n>i)for(let a=0;a<n-i;a++)this.#h.firstElementChild.before(this.#h.lastElementChild);let r=0;for(const a of e){const l=this.#e[r++].getAttribute("data-resizer-name");a.setAttribute("data-l10n-id",H._l10nResizer[l])}}this.#Y(0),this.#w=!0,this.#h.firstElementChild.focus({focusVisible:!0}),t.preventDefault(),t.stopImmediatePropagation()}#G(t){H._resizerKeyboardManager.exec(this,t)}#K(t){this.#w&&t.relatedTarget?.parentNode!==this.#h&&this.#_()}#X(t){this.#m=this.#w?t:""}#Y(t){if(this.#e)for(const e of this.#e)e.tabIndex=t}_resizeWithKeyboard(t,e){this.#w&&this.#B(this.#m,{deltaX:t,deltaY:e,fromKeyboard:!0})}#_(){this.#w=!1,this.#Y(-1),this.#N()}_stopResizingWithKeyboard(){this.#_(),this.div.focus()}select(){if(this.isSelected&&this._editToolbar){this._editToolbar.show();return}if(this.isSelected=!0,this.makeResizable(),this.div?.classList.add("selectedEditor"),!this._editToolbar){this.addEditToolbar().then(()=>{this.div?.classList.contains("selectedEditor")&&this._editToolbar?.show()});return}this._editToolbar?.show(),this.#s?.toggleAltTextBadge(!1)}focus(){this.div&&!this.div.contains(document.activeElement)&&setTimeout(()=>this.div?.focus({preventScroll:!0}),0)}unselect(){this.isSelected&&(this.isSelected=!1,this.#h?.classList.add("hidden"),this.div?.classList.remove("selectedEditor"),this.div?.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus({preventScroll:!0}),this._editToolbar?.hide(),this.#s?.toggleAltTextBadge(!0),this.hideCommentPopup())}hideCommentPopup(){this.hasComment&&this._uiManager.toggleComment(null)}updateParams(t,e){}disableEditing(){}enableEditing(){}get canChangeContent(){return!1}enterInEditMode(){this.canChangeContent&&(this.enableEditMode(),this.div.focus())}dblclick(t){t.target.nodeName!=="BUTTON"&&(this.enterInEditMode(),this.parent.updateToolbar({mode:this.constructor._editorType,editId:this.uid}))}getElementForAltText(){return this.div}get contentDiv(){return this.div}get isEditing(){return this.#p}set isEditing(t){this.#p=t,this.parent&&(t?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}static get MIN_SIZE(){return 16}static canCreateNewEmptyEditor(){return!0}get telemetryInitialData(){return{action:"added"}}get telemetryFinalData(){return null}_reportTelemetry(t,e=!1){if(e){this.#y||=new Map;const{action:s}=t;let i=this.#y.get(s);i&&clearTimeout(i),i=setTimeout(()=>{this._reportTelemetry(t),this.#y.delete(s),this.#y.size===0&&(this.#y=null)},H._telemetryTimeout),this.#y.set(s,i);return}t.type||=this.editorType,this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:t}})}show(t=this._isVisible){this.div.classList.toggle("hidden",!t),this._isVisible=t}enable(){this.div&&(this.div.tabIndex=0),this.#r=!1}disable(){this.div&&(this.div.tabIndex=-1),this.#r=!0}updateFakeAnnotationElement(t){if(!this.#d&&!this.deleted){this.#d=t.addFakeAnnotation(this);return}if(this.deleted){this.#d.remove(),this.#d=null;return}(this.hasEditedComment||this._hasBeenMoved||this._hasBeenResized)&&this.#d.updateEdited({rect:this.getPDFRect(),popup:this.comment})}renderAnnotationElement(t){if(this.deleted)return t.hide(),null;let e=t.container.querySelector(".annotationContent");if(!e)e=document.createElement("div"),e.classList.add("annotationContent",this.editorType),t.container.prepend(e);else if(e.nodeName==="CANVAS"){const s=e;e=document.createElement("div"),e.classList.add("annotationContent",this.editorType),s.before(e)}return e}resetAnnotationElement(t){const{firstElementChild:e}=t.container;e?.nodeName==="DIV"&&e.classList.contains("annotationContent")&&e.remove()}}class Un extends H{constructor(t){super(t),this.annotationElementId=t.annotationElementId,this.deleted=!0}serialize(){return this.serializeDeleted()}}const vi=3285377520,Ft=4294901760,jt=65535;class ks{constructor(t){this.h1=t?t&4294967295:vi,this.h2=t?t&4294967295:vi}update(t){let e,s;if(typeof t=="string"){e=new Uint8Array(t.length*2),s=0;for(let p=0,m=t.length;p<m;p++){const v=t.charCodeAt(p);v<=255?e[s++]=v:(e[s++]=v>>>8,e[s++]=v&255)}}else if(ArrayBuffer.isView(t))e=t.slice(),s=e.byteLength;else throw new Error("Invalid data format, must be a string or TypedArray.");const i=s>>2,n=s-i*4,r=new Uint32Array(e.buffer,0,i);let a=0,o=0,l=this.h1,c=this.h2;const d=3432918353,u=461845907,f=d&jt,g=u&jt;for(let p=0;p<i;p++)p&1?(a=r[p],a=a*d&Ft|a*f&jt,a=a<<15|a>>>17,a=a*u&Ft|a*g&jt,l^=a,l=l<<13|l>>>19,l=l*5+3864292196):(o=r[p],o=o*d&Ft|o*f&jt,o=o<<15|o>>>17,o=o*u&Ft|o*g&jt,c^=o,c=c<<13|c>>>19,c=c*5+3864292196);switch(a=0,n){case 3:a^=e[i*4+2]<<16;case 2:a^=e[i*4+1]<<8;case 1:a^=e[i*4],a=a*d&Ft|a*f&jt,a=a<<15|a>>>17,a=a*u&Ft|a*g&jt,i&1?l^=a:c^=a}this.h1=l,this.h2=c}hexdigest(){let t=this.h1,e=this.h2;return t^=e>>>1,t=t*3981806797&Ft|t*36045&jt,e=e*4283543511&Ft|((e<<16|t>>>16)*2950163797&Ft)>>>16,t^=e>>>1,t=t*444984403&Ft|t*60499&jt,e=e*3301882366&Ft|((e<<16|t>>>16)*3120437893&Ft)>>>16,t^=e>>>1,(t>>>0).toString(16).padStart(8,"0")+(e>>>0).toString(16).padStart(8,"0")}}const Ne=Object.freeze({map:null,hash:"",transfer:void 0});class Qs{#t=!1;#e=null;#s=null;#i=new Map;onSetModified=null;onResetModified=null;onAnnotationEditor=null;getValue(t,e){const s=this.#i.get(t);return s===void 0?e:Object.assign(e,s)}getRawValue(t){return this.#i.get(t)}remove(t){const e=this.#i.get(t);e!==void 0&&(e instanceof H&&this.#s.delete(e.annotationElementId),this.#i.delete(t),this.#i.size===0&&this.resetModified(),!this.#i.values().some(s=>s instanceof H)&&this.onAnnotationEditor?.(null))}setValue(t,e){const s=this.#i.get(t);let i=!1;if(s!==void 0)for(const[n,r]of Object.entries(e))s[n]!==r&&(i=!0,s[n]=r);else i=!0,this.#i.set(t,e);i&&this.#n(),e instanceof H&&((this.#s||=new Map).set(e.annotationElementId,e),this.onAnnotationEditor?.(e.constructor._type))}has(t){return this.#i.has(t)}get size(){return this.#i.size}#n(){this.#t||(this.#t=!0,this.onSetModified?.())}resetModified(){this.#t&&(this.#t=!1,this.onResetModified?.())}get print(){return new Wi(this)}get serializable(){if(this.#i.size===0)return Ne;const t=new Map,e=new ks,s=[],i=Object.create(null);let n=!1;for(const[r,a]of this.#i){const o=a instanceof H?a.serialize(!1,i):a;a.page&&(a.pageIndex=a.page._pageIndex,delete a.page),o&&(t.set(r,o),e.update(`${r}:${JSON.stringify(o)}`),n||=!!o.bitmap)}if(n)for(const r of t.values())r.bitmap&&s.push(r.bitmap);return t.size>0?{map:t,hash:e.hexdigest(),transfer:s}:Ne}get editorStats(){let t=null;const e=new Map;let s=0,i=0;for(const n of this.#i.values()){if(!(n instanceof H)){n.popup&&(n.popup.deleted?i+=1:s+=1);continue}n.isCommentDeleted?i+=1:n.hasEditedComment&&(s+=1);const r=n.telemetryFinalData;if(!r)continue;const{type:a}=r;e.has(a)||e.set(a,Object.getPrototypeOf(n).constructor),t||=Object.create(null);const o=t[a]||=new Map;for(const[l,c]of Object.entries(r)){if(l==="type")continue;const d=o.getOrInsertComputed(l,zs);d.set(c,(d.get(c)??0)+1)}}if((i>0||s>0)&&(t||=Object.create(null),t.comments={deleted:i,edited:s}),!t)return null;for(const[n,r]of e)t[n]=r.computeTelemetryFinalData(t[n]);return t}resetModifiedIds(){this.#e=null}updateEditor(t,e){const s=this.#s?.get(t);return s?(s.updateFromAnnotationLayer(e),!0):!1}getEditor(t){return this.#s?.get(t)||null}get modifiedIds(){if(this.#e)return this.#e;const t=[];if(this.#s)for(const s of this.#s.values())s.serialize()&&t.push(s.annotationElementId);let e="";if(t.length){const s=new ks;s.update(t.join(",")),e=s.hexdigest()}return this.#e={ids:new Set(t),hash:e}}[Symbol.iterator](){return this.#i.entries()}}class Wi extends Qs{#t=Ne;constructor(t){super();const{serializable:e}=t;if(e===Ne)return;const{map:s,hash:i,transfer:n}=e,r=structuredClone(s,n?{transfer:n}:null);this.#t={map:r,hash:i,transfer:[]}}get print(){nt("Should not call PrintAnnotationStorage.print")}get serializable(){return this.#t}get modifiedIds(){return K(this,"modifiedIds",{ids:new Set,hash:""})}}V(7588);const fe="__forcedDependency",{floor:yi,ceil:bi}=Math;function Ai(h,t,e,s,i,n){h[t*4+0]=Math.min(h[t*4+0],e),h[t*4+1]=Math.min(h[t*4+1],s),h[t*4+2]=Math.max(h[t*4+2],i),h[t*4+3]=Math.max(h[t*4+3],n)}const Bs=new Uint32Array(new Uint8Array([255,255,0,0]).buffer)[0];class Hn{#t;#e;constructor(t,e){this.#t=t,this.#e=e}get length(){return this.#t.length}isEmpty(t){return this.#t[t]===Bs}minX(t){return this.#e[t*4+0]/256}minY(t){return this.#e[t*4+1]/256}maxX(t){return(this.#e[t*4+2]+1)/256}maxY(t){return(this.#e[t*4+3]+1)/256}}const wi=(h,t)=>h?.getOrInsertComputed(t,()=>({dependencies:new Set,isRenderingOperation:!1}));class $n{#t=[[1,0,0,1,0,0]];#e=[-1/0,-1/0,1/0,1/0];#s=new Float64Array(Qt);_pendingBBoxIdx=-1;#i;#n;#r;#a;_savesStack=[];_markedContentStack=[];constructor(t,e){this.#i=t.width,this.#n=t.height,this.#o(e)}growOperationsCount(t){t>=this.#a.length&&this.#o(t,this.#a)}#o(t,e){const s=new ArrayBuffer(t*4);this.#r=new Uint8ClampedArray(s),this.#a=new Uint32Array(s),e&&e.length>0?(this.#a.set(e),this.#a.fill(Bs,e.length)):this.#a.fill(Bs)}get clipBox(){return this.#e}save(t){return this.#e={__proto__:this.#e},this._savesStack.push(t),this}restore(t,e){const s=Object.getPrototypeOf(this.#e);if(s===null)return this;this.#e=s;const i=this._savesStack.pop();return i!==void 0&&(e?.(i,t),this.#a[t]=this.#a[i]),this}recordOpenMarker(t){return this._savesStack.push(t),this}getOpenMarker(){return this._savesStack.length===0?null:this._savesStack.at(-1)}recordCloseMarker(t,e){const s=this._savesStack.pop();return s!==void 0&&(e?.(s,t),this.#a[t]=this.#a[s]),this}beginMarkedContent(t){return this._markedContentStack.push(t),this}endMarkedContent(t,e){const s=this._markedContentStack.pop();return s!==void 0&&(e?.(s,t),this.#a[t]=this.#a[s]),this}pushBaseTransform(t){return this.#t.push(F.multiplyByDOMMatrix(this.#t.at(-1),t.getTransform())),this}popBaseTransform(){return this.#t.length>1&&this.#t.pop(),this}resetBBox(t){return this._pendingBBoxIdx!==t&&(this._pendingBBoxIdx=t,this.#s.set(Qt,0)),this}recordClipBox(t,e,s,i,n,r){const a=F.multiplyByDOMMatrix(this.#t.at(-1),e.getTransform()),o=Qt.slice();F.axialAlignedBoundingBox([s,n,i,r],a,o);const l=F.intersect(this.#e,o);return l?(this.#e[0]=l[0],this.#e[1]=l[1],this.#e[2]=l[2],this.#e[3]=l[3]):(this.#e[0]=this.#e[1]=1/0,this.#e[2]=this.#e[3]=-1/0),this}recordBBox(t,e,s,i,n,r){const a=this.#e;if(a[0]===1/0)return this;const o=F.multiplyByDOMMatrix(this.#t.at(-1),e.getTransform());if(a[0]===-1/0)return F.axialAlignedBoundingBox([s,n,i,r],o,this.#s),this;const l=Qt.slice();return F.axialAlignedBoundingBox([s,n,i,r],o,l),this.#s[0]=ht(l[0],a[0],this.#s[0]),this.#s[1]=ht(l[1],a[1],this.#s[1]),this.#s[2]=ht(l[2],this.#s[2],a[2]),this.#s[3]=ht(l[3],this.#s[3],a[3]),this}recordFullPageBBox(t){return this.#s[0]=Math.max(0,this.#e[0]),this.#s[1]=Math.max(0,this.#e[1]),this.#s[2]=Math.min(this.#i,this.#e[2]),this.#s[3]=Math.min(this.#n,this.#e[3]),this}recordOperation(t,e=!1,s){if(this._pendingBBoxIdx!==t)return this;const i=yi(this.#s[0]*256/this.#i),n=yi(this.#s[1]*256/this.#n),r=bi(this.#s[2]*256/this.#i),a=bi(this.#s[3]*256/this.#n);if(Ai(this.#r,t,i,n,r,a),s)for(const o of s)for(const l of o)l!==t&&Ai(this.#r,l,i,n,r,a);return e||(this._pendingBBoxIdx=-1),this}bboxToClipBoxDropOperation(t){return this._pendingBBoxIdx===t&&(this._pendingBBoxIdx=-1,this.#e[0]=Math.max(this.#e[0],this.#s[0]),this.#e[1]=Math.max(this.#e[1],this.#s[1]),this.#e[2]=Math.min(this.#e[2],this.#s[2]),this.#e[3]=Math.min(this.#e[3],this.#s[3])),this}take(){return new Hn(this.#a,this.#r)}takeDebugMetadata(){throw new Error("Unreachable")}recordSimpleData(t,e){return this}recordIncrementalData(t,e){return this}resetIncrementalData(t,e){return this}recordNamedData(t,e){return this}recordSimpleDataFromNamed(t,e,s){return this}recordFutureForcedDependency(t,e){return this}inheritSimpleDataAsFutureForcedDependencies(t){return this}inheritPendingDependenciesAsFutureForcedDependencies(){return this}recordCharacterBBox(t,e,s,i=1,n=0,r=0,a){return this}getSimpleIndex(t){}recordDependencies(t,e){return this}recordNamedDependency(t,e){return this}recordShowTextOperation(t,e=!1){return this}}class jn{#t={__proto__:null};#e={__proto__:null,transform:[],moveText:[],sameLineText:[],[fe]:[]};#s=new Map;#i=new Set;#n=new Map;#r;#a;#o;constructor(t,e=!1){this.#o=t,e&&(this.#r=new Map,this.#a=(s,i)=>{wi(this.#r,i).dependencies.add(s)})}get clipBox(){return this.#o.clipBox}growOperationsCount(t){this.#o.growOperationsCount(t)}save(t){return this.#t={__proto__:this.#t},this.#e={__proto__:this.#e,transform:{__proto__:this.#e.transform},moveText:{__proto__:this.#e.moveText},sameLineText:{__proto__:this.#e.sameLineText},[fe]:{__proto__:this.#e[fe]}},this.#o.save(t),this}restore(t){this.#o.restore(t,this.#a);const e=Object.getPrototypeOf(this.#t);return e===null?this:(this.#t=e,this.#e=Object.getPrototypeOf(this.#e),this)}recordOpenMarker(t){return this.#o.recordOpenMarker(t,this.#a),this}getOpenMarker(){return this.#o.getOpenMarker()}recordCloseMarker(t){return this.#o.recordCloseMarker(t,this.#a),this}beginMarkedContent(t){return this.#o.beginMarkedContent(t),this}endMarkedContent(t){return this.#o.endMarkedContent(t,this.#a),this}pushBaseTransform(t){return this.#o.pushBaseTransform(t),this}popBaseTransform(){return this.#o.popBaseTransform(),this}recordSimpleData(t,e){return this.#t[t]=e,this}recordIncrementalData(t,e){return this.#e[t].push(e),this}resetIncrementalData(t,e){return this.#e[t].length=0,this}recordNamedData(t,e){return this.#s.set(t,e),this}recordSimpleDataFromNamed(t,e,s){this.#t[t]=this.#s.get(e)??s}recordFutureForcedDependency(t,e){return this.recordIncrementalData(fe,e),this}inheritSimpleDataAsFutureForcedDependencies(t){for(const e of t)e in this.#t&&this.recordFutureForcedDependency(e,this.#t[e]);return this}inheritPendingDependenciesAsFutureForcedDependencies(){for(const t of this.#i)this.recordFutureForcedDependency(fe,t);return this}resetBBox(t){return this.#o.resetBBox(t),this}recordClipBox(t,e,s,i,n,r){return this.#o.recordClipBox(t,e,s,i,n,r),this}recordBBox(t,e,s,i,n,r){return this.#o.recordBBox(t,e,s,i,n,r),this}recordCharacterBBox(t,e,s,i=1,n=0,r=0,a){const o=s.bbox;let l,c;if(o&&(l=o[2]!==o[0]&&o[3]!==o[1]&&this.#n.get(s),l!==!1&&(c=[0,0,0,0],F.axialAlignedBoundingBox(o,s.fontMatrix,c),(i!==1||n!==0||r!==0)&&F.scaleMinMax([i,0,0,-i,n,r],c),l)))return this.recordBBox(t,e,c[0],c[2],c[1],c[3]);if(!a)return this.recordFullPageBBox(t);const d=a();return o&&c&&l===void 0&&(l=c[0]<=n-d.actualBoundingBoxLeft&&c[2]>=n+d.actualBoundingBoxRight&&c[1]<=r-d.actualBoundingBoxAscent&&c[3]>=r+d.actualBoundingBoxDescent,this.#n.set(s,l),l)?this.recordBBox(t,e,c[0],c[2],c[1],c[3]):this.recordBBox(t,e,n-d.actualBoundingBoxLeft,n+d.actualBoundingBoxRight,r-d.actualBoundingBoxAscent,r+d.actualBoundingBoxDescent)}recordFullPageBBox(t){return this.#o.recordFullPageBBox(t),this}getSimpleIndex(t){return this.#t[t]}recordDependencies(t,e){const s=this.#i,i=this.#t,n=this.#e;for(const r of e)r in this.#t?s.add(i[r]):r in n&&n[r].forEach(s.add,s);return this}recordNamedDependency(t,e){return this.#s.has(e)&&this.#i.add(this.#s.get(e)),this}recordOperation(t,e=!1){if(this.recordDependencies(t,[fe]),this.#r){const i=wi(this.#r,t),{dependencies:n}=i;this.#i.forEach(n.add,n),this.#o._savesStack.forEach(n.add,n),this.#o._markedContentStack.forEach(n.add,n),n.delete(t),i.isRenderingOperation=!0}const s=!e&&t===this.#o._pendingBBoxIdx;return this.#o.recordOperation(t,e,[this.#i,this.#o._savesStack,this.#o._markedContentStack]),s&&this.#i.clear(),this}recordShowTextOperation(t,e=!1){const s=Array.from(this.#i);this.recordOperation(t,e),this.recordIncrementalData("sameLineText",t);for(const i of s)this.recordIncrementalData("sameLineText",i);return this}bboxToClipBoxDropOperation(t,e=!1){const s=!e&&t===this.#o._pendingBBoxIdx;return this.#o.bboxToClipBoxDropOperation(t),s&&this.#i.clear(),this}take(){return this.#n.clear(),this.#o.take()}takeDebugMetadata(){return this.#r}}class ke{#t;#e;#s;#i=0;#n=0;constructor(t,e,s){if(t instanceof ke&&t.#s===!!s)return t;this.#t=t,this.#e=e,this.#s=!!s}get clipBox(){return this.#t.clipBox}growOperationsCount(){throw new Error("Unreachable")}save(t){return this.#n++,this.#t.save(this.#e),this}restore(t){return this.#n>0&&(this.#t.restore(this.#e),this.#n--),this}recordOpenMarker(t){return this.#i++,this}getOpenMarker(){return this.#i>0?this.#e:this.#t.getOpenMarker()}recordCloseMarker(t){return this.#i--,this}beginMarkedContent(t){return this}endMarkedContent(t){return this}pushBaseTransform(t){return this.#t.pushBaseTransform(t),this}popBaseTransform(){return this.#t.popBaseTransform(),this}recordSimpleData(t,e){return this.#t.recordSimpleData(t,this.#e),this}recordIncrementalData(t,e){return this.#t.recordIncrementalData(t,this.#e),this}resetIncrementalData(t,e){return this.#t.resetIncrementalData(t,this.#e),this}recordNamedData(t,e){return this}recordSimpleDataFromNamed(t,e,s){return this.#t.recordSimpleDataFromNamed(t,e,this.#e),this}recordFutureForcedDependency(t,e){return this.#t.recordFutureForcedDependency(t,this.#e),this}inheritSimpleDataAsFutureForcedDependencies(t){return this.#t.inheritSimpleDataAsFutureForcedDependencies(t),this}inheritPendingDependenciesAsFutureForcedDependencies(){return this.#t.inheritPendingDependenciesAsFutureForcedDependencies(),this}resetBBox(t){return this.#s||this.#t.resetBBox(this.#e),this}recordClipBox(t,e,s,i,n,r){return this.#s||this.#t.recordClipBox(this.#e,e,s,i,n,r),this}recordBBox(t,e,s,i,n,r){return this.#s||this.#t.recordBBox(this.#e,e,s,i,n,r),this}recordCharacterBBox(t,e,s,i,n,r,a){return this.#s||this.#t.recordCharacterBBox(this.#e,e,s,i,n,r,a),this}recordFullPageBBox(t){return this.#s||this.#t.recordFullPageBBox(this.#e),this}getSimpleIndex(t){return this.#t.getSimpleIndex(t)}recordDependencies(t,e){return this.#t.recordDependencies(this.#e,e),this}recordNamedDependency(t,e){return this.#t.recordNamedDependency(this.#e,e),this}recordOperation(t){return this.#t.recordOperation(this.#e,!0),this}recordShowTextOperation(t){return this.#t.recordShowTextOperation(this.#e,!0),this}bboxToClipBoxDropOperation(t){return this.#s||this.#t.bboxToClipBoxDropOperation(this.#e,!0),this}take(){throw new Error("Unreachable")}takeDebugMetadata(){throw new Error("Unreachable")}}const Lt={stroke:["path","transform","filter","strokeColor","strokeAlpha","lineWidth","lineCap","lineJoin","miterLimit","dash"],fill:["path","transform","filter","fillColor","fillAlpha","globalCompositeOperation","SMask"],imageXObject:["transform","SMask","filter","fillAlpha","strokeAlpha","globalCompositeOperation"],rawFillPath:["filter","fillColor","fillAlpha"],showText:["transform","leading","charSpacing","wordSpacing","hScale","textRise","moveText","textMatrix","font","fontObj","filter","fillColor","textRenderingMode","SMask","fillAlpha","strokeAlpha","globalCompositeOperation","sameLineText"],transform:["transform"],transformAndFill:["transform","fillColor"]};class is{#t;#e;#s=4;#i=0;#n=new is.#r(this.#s*6);static#r=yt.isFloat16ArraySupported?Float16Array:Float32Array;constructor(t){this.#t=t.width,this.#e=t.height}record(t,e,s,i){if(this.#i===this.#s){this.#s*=2;const a=new is.#r(this.#s*6);a.set(this.#n),this.#n=a}const n=F.domMatrixToTransform(t.getTransform());let r;if(i[0]!==1/0){const a=Qt.slice();F.axialAlignedBoundingBox([0,-s,e,0],n,a);const o=F.intersect(i,a);if(!o)return;const[l,c,d,u]=o;if(l!==a[0]||c!==a[1]||d!==a[2]||u!==a[3]){const f=Math.atan2(n[1],n[0]),g=Math.abs(Math.sin(f)),p=Math.abs(Math.cos(f));if(g<1e-6||p<1e-6||Math.abs(g-p)<1e-6)r=[l,c,l,u,d,c];else{const m=d-l,v=u-c,y=g*g,b=p*p,w=p*g,A=b-y,S=(v*b-m*w)/A,E=(v*w-m*y)/A;r=[l+E,c,l,c+S,d,u-S]}}}r||(r=[0,-s,0,0,e,-s],F.applyTransform(r,n,0),F.applyTransform(r,n,2),F.applyTransform(r,n,4)),r[0]/=this.#t,r[1]/=this.#e,r[2]/=this.#t,r[3]/=this.#e,r[4]/=this.#t,r[5]/=this.#e,this.#n.set(r,this.#i*6),this.#i++}take(){return this.#n.subarray(0,this.#i*6)}}class Gn{#t=new Set;constructor({ownerDocument:t=globalThis.document,styleElement:e=null}){this._document=t,this.nativeFontFaces=new Set,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(t){this.nativeFontFaces.add(t),this._document.fonts.add(t)}removeNativeFontFace(t){this.nativeFontFaces.delete(t),this._document.fonts.delete(t)}insertRule(t){this.styleElement||(this.styleElement=this._document.createElement("style"),this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));const e=this.styleElement.sheet;e.insertRule(t,e.cssRules.length)}clear(){for(const t of this.nativeFontFaces)this._document.fonts.delete(t);this.nativeFontFaces.clear(),this.#t.clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont({systemFontInfo:t,disableFontFace:e,_inspectFont:s}){if(!(!t||this.#t.has(t.loadedName))){if(dt(!e,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){const{loadedName:i,src:n,style:r}=t,a=new FontFace(i,n,r);this.addNativeFontFace(a);try{await a.load(),this.#t.add(i),s?.(t)}catch{z(`Cannot load system font: ${t.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(a)}return}nt("Not implemented: loadSystemFont without the Font Loading API.")}}async bind(t){if(t.attached||t.missingFile&&!t.systemFontInfo)return;if(t.attached=!0,t.systemFontInfo){await this.loadSystemFont(t);return}if(this.isFontLoadingAPISupported){const s=t.createNativeFontFace();if(s){this.addNativeFontFace(s);try{await s.loaded}catch(i){throw z(`Failed to load font '${s.family}': '${i}'.`),t.disableFontFace=!0,i}}return}const e=t.createFontFaceRule();if(e){if(this.insertRule(e),this.isSyncFontLoadingSupported)return;await new Promise(s=>{const i=this._queueLoadingCallback(s);this._prepareFontLoadEvent(t,i)})}}get isFontLoadingAPISupported(){const t=!!this._document?.fonts;return K(this,"isFontLoadingAPISupported",t)}get isSyncFontLoadingSupported(){return K(this,"isSyncFontLoadingSupported",Mt||yt.platform.isFirefox)}_queueLoadingCallback(t){function e(){for(dt(!i.done,"completeRequest() cannot be called twice."),i.done=!0;s.length>0&&s[0].done;){const n=s.shift();setTimeout(n.callback,0)}}const{loadingRequests:s}=this,i={done:!1,complete:e,callback:t};return s.push(i),i}get _loadTestFont(){const t=atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");return K(this,"_loadTestFont",t)}_prepareFontLoadEvent(t,e){function s(A,S){return A.charCodeAt(S)<<24|A.charCodeAt(S+1)<<16|A.charCodeAt(S+2)<<8|A.charCodeAt(S+3)&255}function i(A){return String.fromCharCode(A>>24&255,A>>16&255,A>>8&255,A&255)}function n(A,S,E,C){const x=A.substring(0,S),P=A.substring(S+E);return x+C+P}let r,a;const o=this._document.createElement("canvas");o.width=1,o.height=1;const l=o.getContext("2d");let c=0;function d(A,S){if(++c>30){z("Load test font never loaded."),S();return}if(l.font="30px "+A,l.fillText(".",0,20),l.getImageData(0,0,1,1).data[3]>0){S();return}setTimeout(d.bind(null,A,S))}const u=`lt${Date.now()}${this.loadTestFontId++}`;let f=this._loadTestFont;f=n(f,976,u.length,u);const p=16,m=1482184792;let v=s(f,p);for(r=0,a=u.length-3;r<a;r+=4)v=v-m+s(u,r)|0;r<u.length&&(v=v-m+s(u+"XXX",r)|0),f=n(f,p,4,i(v));const y=`url(data:font/opentype;base64,${btoa(f)});`,b=`@font-face {font-family:"${u}";src:${y}}`;this.insertRule(b);const w=this._document.createElement("div");w.style.visibility="hidden",w.style.width=w.style.height="10px",w.style.position="absolute",w.style.top=w.style.left="0px";for(const A of[t.loadedName,u]){const S=this._document.createElement("span");S.textContent="Hi",S.style.fontFamily=A,w.append(S)}this._document.body.append(w),d(u,()=>{w.remove(),e.complete()})}}class zn{compiledGlyphs=Object.create(null);#t;constructor(t,e=null,s,i){this.#t=t,this._inspectFont=e,s&&(this.charProcOperatorList=s),i&&Object.assign(this,i)}createNativeFontFace(){if(!this.data||this.disableFontFace)return null;let t;if(!this.cssFontInfo)t=new FontFace(this.loadedName,this.data,{});else{const e={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(e.style=`oblique ${this.cssFontInfo.italicAngle}deg`),t=new FontFace(this.cssFontInfo.fontFamily,this.data,e)}return this._inspectFont?.(this),t}createFontFaceRule(){if(!this.data||this.disableFontFace)return null;const t=`url(data:${this.mimetype};base64,${this.data.toBase64()});`;let e;if(!this.cssFontInfo)e=`@font-face {font-family:"${this.loadedName}";src:${t}}`;else{let s=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(s+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),e=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${s}src:${t}}`}return this._inspectFont?.(this,t),e}getPathGenerator(t,e){if(this.compiledGlyphs[e]!==void 0)return this.compiledGlyphs[e];const s=this.loadedName+"_path_"+e;let i;try{i=t.get(s)}catch(r){z(`getPathGenerator - ignoring character: "${r}".`)}const n=zi(i?.path);return this.fontExtraProperties||t.delete(s),this.compiledGlyphs[e]=n}get black(){return this.#t.black}get bold(){return this.#t.bold}get disableFontFace(){return this.#t.disableFontFace}set disableFontFace(t){K(this,"disableFontFace",!!t)}get fontExtraProperties(){return this.#t.fontExtraProperties}get isInvalidPDFjsFont(){return this.#t.isInvalidPDFjsFont}get isType3Font(){return this.#t.isType3Font}get italic(){return this.#t.italic}get missingFile(){return this.#t.missingFile}get remeasure(){return this.#t.remeasure}get vertical(){return this.#t.vertical}get ascent(){return this.#t.ascent}get defaultWidth(){return this.#t.defaultWidth}get descent(){return this.#t.descent}get bbox(){return this.#t.bbox}get fontMatrix(){return this.#t.fontMatrix}get fallbackName(){return this.#t.fallbackName}get loadedName(){return this.#t.loadedName}get mimetype(){return this.#t.mimetype}get name(){return this.#t.name}get data(){return this.#t.data}clearData(){this.#t.clearData()}get cssFontInfo(){return this.#t.cssFontInfo}get systemFontInfo(){return this.#t.systemFontInfo}get defaultVMetrics(){return this.#t.defaultVMetrics}}class Vn{static strings=["fontFamily","fontWeight","italicAngle"]}class Wn{static strings=["css","loadedName","baseFontName","src"]}class Bt{static bools=["black","bold","disableFontFace","fontExtraProperties","isInvalidPDFjsFont","isType3Font","italic","missingFile","remeasure","vertical"];static numbers=["ascent","defaultWidth","descent"];static strings=["fallbackName","loadedName","mimetype","name"];static OFFSET_NUMBERS=Math.ceil(this.bools.length*2/8);static OFFSET_BBOX=this.OFFSET_NUMBERS+this.numbers.length*8;static OFFSET_FONT_MATRIX=this.OFFSET_BBOX+1+8;static OFFSET_DEFAULT_VMETRICS=this.OFFSET_FONT_MATRIX+1+48;static OFFSET_STRINGS=this.OFFSET_DEFAULT_VMETRICS+1+6}class ie{static KIND=0;static HAS_BBOX=1;static HAS_BACKGROUND=2;static SHADING_TYPE=3;static N_COORD=4;static N_COLOR=8;static N_STOP=12;static N_FIGURES=16}class Xn{#t;#e=new TextDecoder;#s;constructor(t){this.#t=t,this.#s=new DataView(t)}#i(t){dt(t<Vn.strings.length,"Invalid string index");let e=0;for(let i=0;i<t;i++)e+=this.#s.getUint32(e)+4;const s=this.#s.getUint32(e);return this.#e.decode(new Uint8Array(this.#t,e+4,s))}get fontFamily(){return this.#i(0)}get fontWeight(){return this.#i(1)}get italicAngle(){return this.#i(2)}}class Yn{#t;#e=new TextDecoder;#s;constructor(t){this.#t=t,this.#s=new DataView(t)}get guessFallback(){return this.#s.getUint8(0)!==0}#i(t){dt(t<Wn.strings.length,"Invalid string index");let e=5;for(let i=0;i<t;i++)e+=this.#s.getUint32(e)+4;const s=this.#s.getUint32(e);return this.#e.decode(new Uint8Array(this.#t,e+4,s))}get css(){return this.#i(0)}get loadedName(){return this.#i(1)}get baseFontName(){return this.#i(2)}get src(){return this.#i(3)}get style(){let t=1;t+=4+this.#s.getUint32(t);const e=this.#s.getUint32(t),s=this.#e.decode(new Uint8Array(this.#t,t+4,e));t+=4+e;const i=this.#s.getUint32(t),n=this.#e.decode(new Uint8Array(this.#t,t+4,i));return{style:s,weight:n}}}class Kn{#t;#e=new TextDecoder;#s;constructor({buffer:t,extra:e}){this.#t=t,this.#s=new DataView(t),e&&Object.assign(this,e)}#i(t){dt(t<Bt.bools.length,"Invalid boolean index");const e=Math.floor(t/4),s=t*2%8,i=this.#s.getUint8(e)>>s&3;return i===0?void 0:i===2}get black(){return this.#i(0)}get bold(){return this.#i(1)}get disableFontFace(){return this.#i(2)}get fontExtraProperties(){return this.#i(3)}get isInvalidPDFjsFont(){return this.#i(4)}get isType3Font(){return this.#i(5)}get italic(){return this.#i(6)}get missingFile(){return this.#i(7)}get remeasure(){return this.#i(8)}get vertical(){return this.#i(9)}#n(t){return dt(t<Bt.numbers.length,"Invalid number index"),this.#s.getFloat64(Bt.OFFSET_NUMBERS+t*8)}get ascent(){return this.#n(0)}get defaultWidth(){return this.#n(1)}get descent(){return this.#n(2)}#r(t,e,s,i){const n=this.#s.getUint8(t);if(n===0)return;dt(n===e,"Invalid array length."),t+=1;const r=new Array(n);for(let a=0;a<n;a++)r[a]=this.#s[s](t,!0),t+=i;return r}get bbox(){return this.#r(Bt.OFFSET_BBOX,4,"getInt16",2)}get fontMatrix(){return this.#r(Bt.OFFSET_FONT_MATRIX,6,"getFloat64",8)}get defaultVMetrics(){return this.#r(Bt.OFFSET_DEFAULT_VMETRICS,3,"getInt16",2)}#a(t){dt(t<Bt.strings.length,"Invalid string index");let e=Bt.OFFSET_STRINGS+4;for(let i=0;i<t;i++)e+=this.#s.getUint32(e)+4;const s=this.#s.getUint32(e);return this.#e.decode(new Uint8Array(this.#t,e+4,s))}get fallbackName(){return this.#a(0)}get loadedName(){return this.#a(1)}get mimetype(){return this.#a(2)}get name(){return this.#a(3)}#o(){let t=Bt.OFFSET_STRINGS;const e=this.#s.getUint32(t);t+=4+e;const s=this.#s.getUint32(t);t+=4+s;const i=this.#s.getUint32(t);t+=4+i;const n=this.#s.getUint32(t);return{offset:t,length:n}}get data(){const{offset:t,length:e}=this.#o();return e===0?void 0:new Uint8Array(this.#t,t+4,e)}clearData(){const{offset:t,length:e}=this.#o();e!==0&&(this.#s.setUint32(t,0),this.#t=new Uint8Array(this.#t,0,t+4).slice().buffer,this.#s=new DataView(this.#t))}get cssFontInfo(){let t=Bt.OFFSET_STRINGS;const e=this.#s.getUint32(t);t+=4+e;const s=this.#s.getUint32(t);t+=4+s;const i=this.#s.getUint32(t);if(i===0)return null;const n=new Uint8Array(i);return n.set(new Uint8Array(this.#t,t+4,i)),new Xn(n.buffer)}get systemFontInfo(){let t=Bt.OFFSET_STRINGS;const e=this.#s.getUint32(t);t+=4+e;const s=this.#s.getUint32(t);if(s===0)return null;const i=new Uint8Array(s);return i.set(new Uint8Array(this.#t,t+4,s)),new Yn(i.buffer)}}class Jn{constructor(t){this.buffer=t,this.view=new DataView(t),this.data=new Uint8Array(t)}getIR(){const t=this.view,e=this.data[ie.KIND],s=!!this.data[ie.HAS_BBOX],i=!!this.data[ie.HAS_BACKGROUND],n=t.getUint32(ie.N_COORD,!0),r=t.getUint32(ie.N_COLOR,!0),a=t.getUint32(ie.N_STOP,!0);let o=20;const l=new Float32Array(this.buffer,o,n*2);o+=n*8;const c=new Uint8Array(this.buffer,o,r*4);o+=r*4;const d=[];for(let g=0;g<a;++g){const p=t.getFloat32(o,!0);o+=4;const m=t.getUint32(o,!0);o+=4,d.push([p,`#${m.toString(16).padStart(6,"0")}`])}let u=null;if(s){u=[];for(let g=0;g<4;++g)u.push(t.getFloat32(o,!0)),o+=4}let f=null;if(i&&(f=new Uint8Array(this.buffer,o,3),o+=3),e===1)return["RadialAxial","axial",u,d,Array.from(l.slice(0,2)),Array.from(l.slice(2,4)),null,null];if(e===2)return["RadialAxial","radial",u,d,[l[0],l[1]],[l[3],l[4]],l[2],l[5]];if(e===3){const g=this.data[ie.SHADING_TYPE];let p=null;if(l.length>0){p=Qt.slice();for(let m=0,v=l.length;m<v;m+=2)F.pointBoundingBox(l[m],l[m+1],p)}return["Mesh",g,l,c,n,p,u,f]}throw new Error(`Unsupported pattern kind: ${e}`)}}class Qn{#t;constructor(t){this.#t=t}get path(){return yt.isFloat16ArraySupported?new Float16Array(this.#t):new Float32Array(this.#t)}}function Zn(h){if(h instanceof URL)return h;if(typeof h=="string"){if(Mt){if(/^[a-z][a-z0-9\-+.]+:/i.test(h))return new URL(h);const e=process.getBuiltinModule("url");return new URL(e.pathToFileURL(h))}const t=URL.parse(h,window.location);if(t)return t}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}function qn(h){if(Mt&&typeof Buffer<"u"&&h instanceof Buffer)throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if(h instanceof Uint8Array&&h.byteLength===h.buffer.byteLength)return h;if(typeof h=="string")return cs(h);if(h instanceof ArrayBuffer||ArrayBuffer.isView(h)||typeof h=="object"&&!isNaN(h?.length))return new Uint8Array(h);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}function Ve(h){if(typeof h!="string")return null;if(h.endsWith("/"))return h;throw new Error(`Invalid factory url: "${h}" must include trailing slash.`)}const _s=h=>typeof h=="object"&&Number.isInteger(h?.num)&&h.num>=0&&Number.isInteger(h?.gen)&&h.gen>=0,tr=h=>typeof h=="object"&&typeof h?.name=="string",er=Cn.bind(null,_s,tr);class sr{#t=new Map;#e=Promise.resolve();postMessage(t,e){const s={data:structuredClone(t,e?{transfer:e}:null)};this.#e.then(()=>{for(const[i]of this.#t)i.call(this,s)})}addEventListener(t,e,s=null){let i=null;if(s?.signal instanceof AbortSignal){const{signal:n}=s;if(n.aborted){z("LoopbackPort - cannot use an `aborted` signal.");return}const r=()=>this.removeEventListener(t,e);i=()=>n.removeEventListener("abort",r),n.addEventListener("abort",r)}this.#t.set(e,i)}removeEventListener(t,e){this.#t.get(e)?.(),this.#t.delete(e)}terminate(){for(const[,t]of this.#t)t?.();this.#t.clear()}}V(1689);const We={DATA:1,ERROR:2},mt={CANCEL:1,CANCEL_COMPLETE:2,CLOSE:3,ENQUEUE:4,ERROR:5,PULL:6,PULL_COMPLETE:7,START_COMPLETE:8};function Si(){}function Pt(h){if(h instanceof te||h instanceof Ms||h instanceof ci||h instanceof ss||h instanceof xs)return h;switch(h instanceof Error||typeof h=="object"&&h!==null||nt('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),h.name){case"AbortException":return new te(h.message);case"InvalidPDFException":return new Ms(h.message);case"PasswordException":return new ci(h.message,h.code);case"ResponseException":return new ss(h.message,h.status,h.missing);case"UnknownErrorException":return new xs(h.message,h.details)}return new xs(h.message,h.toString())}class Pe{#t=new AbortController;constructor(t,e,s){this.sourceName=t,this.targetName=e,this.comObj=s,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),s.addEventListener("message",this.#e.bind(this),{signal:this.#t.signal})}#e({data:t}){if(t.targetName!==this.sourceName)return;if(t.stream){this.#i(t);return}if(t.callback){const s=t.callbackId,i=this.callbackCapabilities[s];if(!i)throw new Error(`Cannot resolve callback ${s}`);if(delete this.callbackCapabilities[s],t.callback===We.DATA)i.resolve(t.data);else if(t.callback===We.ERROR)i.reject(Pt(t.reason));else throw new Error("Unexpected callback case");return}const e=this.actionHandler[t.action];if(!e)throw new Error(`Unknown action from worker: ${t.action}`);if(t.callbackId){const s=this.sourceName,i=t.sourceName,n=this.comObj;Promise.try(e,t.data).then(function(r){n.postMessage({sourceName:s,targetName:i,callback:We.DATA,callbackId:t.callbackId,data:r})},function(r){n.postMessage({sourceName:s,targetName:i,callback:We.ERROR,callbackId:t.callbackId,reason:Pt(r)})});return}if(t.streamId){this.#s(t);return}e(t.data)}on(t,e){const s=this.actionHandler;if(s[t])throw new Error(`There is already an actionName called "${t}"`);s[t]=e}send(t,e,s){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,data:e},s)}sendWithPromise(t,e,s){const i=this.callbackId++,n=Promise.withResolvers();this.callbackCapabilities[i]=n;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,callbackId:i,data:e},s)}catch(r){n.reject(r)}return n.promise}sendWithStream(t,e,s,i){const n=this.streamId++,r=this.sourceName,a=this.targetName,o=this.comObj;return new ReadableStream({start:l=>{const c=Promise.withResolvers();return this.streamControllers[n]={controller:l,startCall:c,pullCall:null,cancelCall:null,isClosed:!1},o.postMessage({sourceName:r,targetName:a,action:t,streamId:n,data:e,desiredSize:l.desiredSize},i),c.promise},pull:l=>{const c=Promise.withResolvers();return this.streamControllers[n].pullCall=c,o.postMessage({sourceName:r,targetName:a,stream:mt.PULL,streamId:n,desiredSize:l.desiredSize}),c.promise},cancel:l=>{dt(l instanceof Error,"cancel must have a valid reason");const c=Promise.withResolvers();return this.streamControllers[n].cancelCall=c,this.streamControllers[n].isClosed=!0,o.postMessage({sourceName:r,targetName:a,stream:mt.CANCEL,streamId:n,reason:Pt(l)}),c.promise}},s)}#s(t){const e=t.streamId,s=this.sourceName,i=t.sourceName,n=this.comObj,r=this,a=this.actionHandler[t.action],o={enqueue(l,c=1,d){if(this.isCancelled)return;const u=this.desiredSize;this.desiredSize-=c,u>0&&this.desiredSize<=0&&(this.sinkCapability=Promise.withResolvers(),this.ready=this.sinkCapability.promise),n.postMessage({sourceName:s,targetName:i,stream:mt.ENQUEUE,streamId:e,chunk:l},d)},close(){this.isCancelled||(this.isCancelled=!0,n.postMessage({sourceName:s,targetName:i,stream:mt.CLOSE,streamId:e}),delete r.streamSinks[e])},error(l){dt(l instanceof Error,"error must have a valid reason"),!this.isCancelled&&(this.isCancelled=!0,n.postMessage({sourceName:s,targetName:i,stream:mt.ERROR,streamId:e,reason:Pt(l)}))},sinkCapability:Promise.withResolvers(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:t.desiredSize,ready:null};o.sinkCapability.resolve(),o.ready=o.sinkCapability.promise,this.streamSinks[e]=o,Promise.try(a,t.data,o).then(function(){n.postMessage({sourceName:s,targetName:i,stream:mt.START_COMPLETE,streamId:e,success:!0})},function(l){n.postMessage({sourceName:s,targetName:i,stream:mt.START_COMPLETE,streamId:e,reason:Pt(l)})})}#i(t){const e=t.streamId,s=this.sourceName,i=t.sourceName,n=this.comObj,r=this.streamControllers[e],a=this.streamSinks[e];switch(t.stream){case mt.START_COMPLETE:t.success?r.startCall.resolve():r.startCall.reject(Pt(t.reason));break;case mt.PULL_COMPLETE:t.success?r.pullCall.resolve():r.pullCall.reject(Pt(t.reason));break;case mt.PULL:if(!a){n.postMessage({sourceName:s,targetName:i,stream:mt.PULL_COMPLETE,streamId:e,success:!0});break}a.desiredSize<=0&&t.desiredSize>0&&a.sinkCapability.resolve(),a.desiredSize=t.desiredSize,Promise.try(a.onPull||Si).then(function(){n.postMessage({sourceName:s,targetName:i,stream:mt.PULL_COMPLETE,streamId:e,success:!0})},function(l){n.postMessage({sourceName:s,targetName:i,stream:mt.PULL_COMPLETE,streamId:e,reason:Pt(l)})});break;case mt.ENQUEUE:if(dt(r,"enqueue should have stream controller"),r.isClosed)break;r.controller.enqueue(t.chunk);break;case mt.CLOSE:if(dt(r,"close should have stream controller"),r.isClosed)break;r.isClosed=!0,r.controller.close(),this.#n(r,e);break;case mt.ERROR:dt(r,"error should have stream controller"),r.controller.error(Pt(t.reason)),this.#n(r,e);break;case mt.CANCEL_COMPLETE:t.success?r.cancelCall.resolve():r.cancelCall.reject(Pt(t.reason)),this.#n(r,e);break;case mt.CANCEL:if(!a)break;const o=Pt(t.reason);Promise.try(a.onCancel||Si,o).then(function(){n.postMessage({sourceName:s,targetName:i,stream:mt.CANCEL_COMPLETE,streamId:e,success:!0})},function(l){n.postMessage({sourceName:s,targetName:i,stream:mt.CANCEL_COMPLETE,streamId:e,reason:Pt(l)})}),a.sinkCapability.reject(o),a.isCancelled=!0,delete this.streamSinks[e];break;default:throw new Error("Unexpected stream case")}}async#n(t,e){await Promise.allSettled([t.startCall?.promise,t.pullCall?.promise,t.cancelCall?.promise]),delete this.streamControllers[e]}destroy(){this.#t?.abort(),this.#t=null}}class Xi{#t=Object.freeze({cMapUrl:"CMap",standardFontDataUrl:"font",wasmUrl:"wasm"});constructor({cMapUrl:t=null,standardFontDataUrl:e=null,wasmUrl:s=null}){this.cMapUrl=t,this.standardFontDataUrl=e,this.wasmUrl=s}async fetch({kind:t,filename:e}){switch(t){case"cMapUrl":case"standardFontDataUrl":case"wasmUrl":break;default:nt(`Not implemented: ${t}`)}const s=this[t];if(!s)throw new Error(`Ensure that the \`${t}\` API parameter is provided.`);const i=`${s}${e}`;return this._fetch(i,t).catch(n=>{throw new Error(`Unable to load ${this.#t[t]} data at: ${i}`)})}async _fetch(t,e){nt("Abstract method `_fetch` called.")}}class Ei extends Xi{async _fetch(t,e){const s=e==="cMapUrl"&&!t.endsWith(".bcmap")?"text":"bytes",i=await Vs(t,s);return i instanceof Uint8Array?i:cs(i)}}class Yi{#t=!1;constructor({enableHWA:t=!1}){this.#t=t}create(t,e){if(t<=0||e<=0)throw new Error("Invalid canvas size");const s=this._createCanvas(t,e);return{canvas:s,context:s.getContext("2d",{willReadFrequently:!this.#t})}}reset({canvas:t},e,s){if(!t)throw new Error("Canvas is not specified");if(e<=0||s<=0)throw new Error("Invalid canvas size");t.width=e,t.height=s}destroy(t){const{canvas:e}=t;if(!e)throw new Error("Canvas is not specified");e.width=e.height=0,t.canvas=null,t.context=null}_createCanvas(t,e){nt("Abstract method `_createCanvas` called.")}}class ir extends Yi{constructor({ownerDocument:t=globalThis.document,enableHWA:e=!1}){super({enableHWA:e}),this._document=t}_createCanvas(t,e){const s=this._document.createElement("canvas");return s.width=t,s.height=e,s}}V(2489);class Ki{addFilter(t){return"none"}addHCMFilter(t,e){return"none"}addAlphaFilter(t){return"none"}addLuminosityFilter(t){return"none"}addHighlightHCMFilter(t,e,s,i,n){return"none"}destroy(t=!1){}}class nr extends Ki{#t;#e;#s;#i;#n;#r;#a=0;constructor({docId:t,ownerDocument:e=globalThis.document}){super(),this.#i=t,this.#n=e}get#o(){return this.#e||=new Map}get#h(){return this.#r||=new Map}get#l(){if(!this.#s){const t=this.#n.createElement("div"),{style:e}=t;e.visibility="hidden",e.contain="strict",e.width=e.height=0,e.position="absolute",e.top=e.left=0,e.zIndex=-1;const s=this.#n.createElementNS(Xt,"svg");s.setAttribute("width",0),s.setAttribute("height",0),this.#s=this.#n.createElementNS(Xt,"defs"),t.append(s),s.append(this.#s),this.#n.body.append(t)}return this.#s}#u(t){if(t.length===1){const o=t[0],l=new Array(256);for(let d=0;d<256;d++)l[d]=o[d]/255;const c=l.join(",");return[c,c,c]}const[e,s,i]=t,n=new Array(256),r=new Array(256),a=new Array(256);for(let o=0;o<256;o++)n[o]=e[o]/255,r[o]=s[o]/255,a[o]=i[o]/255;return[n.join(","),r.join(","),a.join(",")]}#d(t){if(this.#t===void 0){this.#t="";const e=this.#n.URL;e!==this.#n.baseURI&&(ds(e)?z('#createUrl: ignore "data:"-URL for performance reasons.'):this.#t=Hi(e,""))}return`url(${this.#t}#${t})`}addFilter(t){if(!t)return"none";let e=this.#o.get(t);if(e)return e;const[s,i,n]=this.#u(t),r=t.length===1?s:`${s}${i}${n}`;if(e=this.#o.get(r),e)return this.#o.set(t,e),e;const a=`g_${this.#i}_transfer_map_${this.#a++}`,o=this.#d(a);this.#o.set(t,o),this.#o.set(r,o);const l=this.#g(a);return this.#p(s,i,n,l),o}addHCMFilter(t,e){const s=`${t}-${e}`,i="base";let n=this.#h.get(i);if(n?.key===s||(n?(n.filter?.remove(),n.key=s,n.url="none",n.filter=null):(n={key:s,url:"none",filter:null},this.#h.set(i,n)),!t||!e))return n.url;const r=this.#w(t);t=F.makeHexColor(...r);const a=this.#w(e);if(e=F.makeHexColor(...a),this.#l.style.color="",t==="#000000"&&e==="#ffffff"||t===e)return n.url;const o=new Array(256);for(let f=0;f<=255;f++){const g=f/255;o[f]=g<=.03928?g/12.92:((g+.055)/1.055)**2.4}const l=o.join(","),c=`g_${this.#i}_hcm_filter`,d=n.filter=this.#g(c);this.#p(l,l,l,d),this.#m(d);const u=(f,g)=>{const p=r[f]/255,m=a[f]/255,v=new Array(g+1);for(let y=0;y<=g;y++)v[y]=p+y/g*(m-p);return v.join(",")};return this.#p(u(0,5),u(1,5),u(2,5),d),n.url=this.#d(c),n.url}addAlphaFilter(t){let e=this.#o.get(t);if(e)return e;const[s]=this.#u([t]),i=`alpha_${s}`;if(e=this.#o.get(i),e)return this.#o.set(t,e),e;const n=`g_${this.#i}_alpha_map_${this.#a++}`,r=this.#d(n);this.#o.set(t,r),this.#o.set(i,r);const a=this.#g(n);return this.#v(s,a),r}addLuminosityFilter(t){let e=this.#o.get(t||"luminosity");if(e)return e;let s,i;if(t?([s]=this.#u([t]),i=`luminosity_${s}`):i="luminosity",e=this.#o.get(i),e)return this.#o.set(t,e),e;const n=`g_${this.#i}_luminosity_map_${this.#a++}`,r=this.#d(n);this.#o.set(t,r),this.#o.set(i,r);const a=this.#g(n);return this.#f(a),t&&this.#v(s,a),r}addHighlightHCMFilter(t,e,s,i,n){const r=`${e}-${s}-${i}-${n}`;let a=this.#h.get(t);if(a?.key===r||(a?(a.filter?.remove(),a.key=r,a.url="none",a.filter=null):(a={key:r,url:"none",filter:null},this.#h.set(t,a)),!e||!s))return a.url;const[o,l]=[e,s].map(this.#w.bind(this));let c=Math.round(.2126*o[0]+.7152*o[1]+.0722*o[2]),d=Math.round(.2126*l[0]+.7152*l[1]+.0722*l[2]),[u,f]=[i,n].map(this.#w.bind(this));d<c&&([c,d,u,f]=[d,c,f,u]),this.#l.style.color="";const g=(v,y,b)=>{const w=new Array(256),A=(d-c)/b,S=v/255,E=(y-v)/(255*b);let C=0;for(let x=0;x<=b;x++){const P=Math.round(c+x*A),T=S+x*E;for(let k=C;k<=P;k++)w[k]=T;C=P+1}for(let x=C;x<256;x++)w[x]=w[C-1];return w.join(",")},p=`g_${this.#i}_hcm_${t}_filter`,m=a.filter=this.#g(p);return this.#m(m),this.#p(g(u[0],f[0],5),g(u[1],f[1],5),g(u[2],f[2],5),m),a.url=this.#d(p),a.url}destroy(t=!1){t&&this.#r?.size||(this.#s?.parentNode.parentNode.remove(),this.#s=null,this.#e?.clear(),this.#e=null,this.#r?.clear(),this.#r=null,this.#a=0)}#f(t){const e=this.#n.createElementNS(Xt,"feColorMatrix");e.setAttribute("type","matrix"),e.setAttribute("values","0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.3 0.59 0.11 0 0"),t.append(e)}#m(t){const e=this.#n.createElementNS(Xt,"feColorMatrix");e.setAttribute("type","matrix"),e.setAttribute("values","0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0 0 0 1 0"),t.append(e)}#g(t){const e=this.#n.createElementNS(Xt,"filter");return e.setAttribute("color-interpolation-filters","sRGB"),e.setAttribute("id",t),this.#l.append(e),e}#c(t,e,s){const i=this.#n.createElementNS(Xt,e);i.setAttribute("type","discrete"),i.setAttribute("tableValues",s),t.append(i)}#p(t,e,s,i){const n=this.#n.createElementNS(Xt,"feComponentTransfer");i.append(n),this.#c(n,"feFuncR",t),this.#c(n,"feFuncG",e),this.#c(n,"feFuncB",s)}#v(t,e){const s=this.#n.createElementNS(Xt,"feComponentTransfer");e.append(s),this.#c(s,"feFuncA",t)}#w(t){return this.#l.style.color=t,He(getComputedStyle(this.#l).getPropertyValue("color"))}}if(Mt){let h;try{const t=process.getBuiltinModule("module").createRequire(import.meta.url);try{h=t("@napi-rs/canvas")}catch(e){z(`Cannot load "@napi-rs/canvas" package: "${e}".`)}}catch(t){z(`Cannot access the \`require\` function: "${t}".`)}globalThis.DOMMatrix||(h?.DOMMatrix?globalThis.DOMMatrix=h.DOMMatrix:z("Cannot polyfill `DOMMatrix`, rendering may be broken.")),globalThis.ImageData||(h?.ImageData?globalThis.ImageData=h.ImageData:z("Cannot polyfill `ImageData`, rendering may be broken.")),globalThis.Path2D||(h?.Path2D?globalThis.Path2D=h.Path2D:z("Cannot polyfill `Path2D`, rendering may be broken.")),globalThis.navigator?.language||(globalThis.navigator={language:"en-US",platform:"",userAgent:""})}async function rr(h){const e=await process.getBuiltinModule("fs/promises").readFile(h);return new Uint8Array(e)}class ar extends Ki{}class or extends Yi{_createCanvas(t,e){return process.getBuiltinModule("module").createRequire(import.meta.url)("@napi-rs/canvas").createCanvas(t,e)}}class lr extends Xi{async _fetch(t,e){return rr(t)}}const hr=`
|
|
5
|
+
struct Uniforms {
|
|
6
|
+
offsetX : f32,
|
|
7
|
+
offsetY : f32,
|
|
8
|
+
scaleX : f32,
|
|
9
|
+
scaleY : f32,
|
|
10
|
+
paddedWidth : f32,
|
|
11
|
+
paddedHeight : f32,
|
|
12
|
+
borderSize : f32,
|
|
13
|
+
_pad : f32,
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
@group(0) @binding(0) var<uniform> u : Uniforms;
|
|
17
|
+
|
|
18
|
+
struct VertexInput {
|
|
19
|
+
@location(0) position : vec2<f32>,
|
|
20
|
+
@location(1) color : vec4<f32>,
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
struct VertexOutput {
|
|
24
|
+
@builtin(position) position : vec4<f32>,
|
|
25
|
+
@location(0) color : vec3<f32>,
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
@vertex
|
|
29
|
+
fn vs_main(in : VertexInput) -> VertexOutput {
|
|
30
|
+
var out : VertexOutput;
|
|
31
|
+
let cx = (in.position.x + u.offsetX) * u.scaleX;
|
|
32
|
+
let cy = (in.position.y + u.offsetY) * u.scaleY;
|
|
33
|
+
out.position = vec4<f32>(
|
|
34
|
+
((cx + u.borderSize) / u.paddedWidth) * 2.0 - 1.0,
|
|
35
|
+
1.0 - ((cy + u.borderSize) / u.paddedHeight) * 2.0,
|
|
36
|
+
0.0,
|
|
37
|
+
1.0
|
|
38
|
+
);
|
|
39
|
+
out.color = in.color.rgb;
|
|
40
|
+
return out;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
@fragment
|
|
44
|
+
fn fs_main(in : VertexOutput) -> @location(0) vec4<f32> {
|
|
45
|
+
return vec4<f32>(in.color, 1.0);
|
|
46
|
+
}
|
|
47
|
+
`;class cr{#t=null;#e=null;#s=null;#i=null;async#n(){if(!globalThis.navigator?.gpu)return!1;try{const t=await navigator.gpu.requestAdapter();return t?(this.#i=navigator.gpu.getPreferredCanvasFormat(),this.#e=await t.requestDevice(),!0):!1}catch{return!1}}init(){return this.#t||=this.#n()}get isReady(){return this.#e!==null}loadMeshShader(){if(!this.#e||this.#s)return;const t=this.#e.createShaderModule({code:hr});this.#s=this.#e.createRenderPipeline({layout:"auto",vertex:{module:t,entryPoint:"vs_main",buffers:[{arrayStride:8,attributes:[{shaderLocation:0,offset:0,format:"float32x2"}]},{arrayStride:4,attributes:[{shaderLocation:1,offset:0,format:"unorm8x4"}]}]},fragment:{module:t,entryPoint:"fs_main",targets:[{format:this.#i}]},primitive:{topology:"triangle-list"}})}draw(t,e,s,i,n,r,a,o){this.loadMeshShader();const l=this.#e,{offsetX:c,offsetY:d,scaleX:u,scaleY:f}=i,g=l.createBuffer({size:Math.max(t.byteLength,4),usage:GPUBufferUsage.VERTEX|GPUBufferUsage.COPY_DST});t.byteLength>0&&l.queue.writeBuffer(g,0,t);const p=l.createBuffer({size:Math.max(e.byteLength,4),usage:GPUBufferUsage.VERTEX|GPUBufferUsage.COPY_DST});e.byteLength>0&&l.queue.writeBuffer(p,0,e);const m=l.createBuffer({size:32,usage:GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST});l.queue.writeBuffer(m,0,new Float32Array([c,d,u,f,r,a,o,0]));const v=l.createBindGroup({layout:this.#s.getBindGroupLayout(0),entries:[{binding:0,resource:{buffer:m}}]}),y=new OffscreenCanvas(r,a),b=y.getContext("webgpu");b.configure({device:l,format:this.#i,alphaMode:n?"opaque":"premultiplied"});const w=n?{r:n[0]/255,g:n[1]/255,b:n[2]/255,a:1}:{r:0,g:0,b:0,a:0},A=l.createCommandEncoder(),S=A.beginRenderPass({colorAttachments:[{view:b.getCurrentTexture().createView(),clearValue:w,loadOp:"clear",storeOp:"store"}]});return s>0&&(S.setPipeline(this.#s),S.setBindGroup(0,v),S.setVertexBuffer(0,g),S.setVertexBuffer(1,p),S.draw(s)),S.end(),l.queue.submit([A.finish()]),g.destroy(),p.destroy(),m.destroy(),y.transferToImageBitmap()}}const fs=new cr;function dr(){return fs.init()}function ur(){return fs.isReady}function fr(){fs.loadMeshShader()}function pr(h,t,e,s,i,n,r,a){return fs.draw(h,t,e,s,i,n,r,a)}const xt={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};function qe(h,t){if(!t)return;const e=t[2]-t[0],s=t[3]-t[1],i=new Path2D;i.rect(t[0],t[1],e,s),h.clip(i)}class Zs{isModifyingCurrentTransform(){return!1}getPattern(){nt("Abstract method `getPattern` called.")}}class gr extends Zs{constructor(t){super(),this._type=t[1],this._bbox=t[2],this._colorStops=t[3],this._p0=t[4],this._p1=t[5],this._r0=t[6],this._r1=t[7],this.matrix=null}isOriginBased(){return this._p0[0]===0&&this._p0[1]===0&&(!this.isRadial()||this._p1[0]===0&&this._p1[1]===0)}isRadial(){return this._type==="radial"}areConic(){if(!this.isRadial())return!1;const t=Math.hypot(this._p0[0]-this._p1[0],this._p0[1]-this._p1[1]);return t+this._r1>this._r0&&t+this._r0>this._r1}_createGradient(t,e=null){let s,i=this._p0,n=this._p1;if(e&&(i=i.slice(),n=n.slice(),F.applyTransform(i,e),F.applyTransform(n,e)),this._type==="axial")s=t.createLinearGradient(i[0],i[1],n[0],n[1]);else if(this._type==="radial"){let r=this._r0,a=this._r1;if(e){const o=new Float32Array(2);F.singularValueDecompose2dScale(e,o),r*=o[0],a*=o[0]}s=t.createRadialGradient(i[0],i[1],r,n[0],n[1],a)}for(const r of this._colorStops)s.addColorStop(r[0],r[1]);return s}_createReversedGradient(t,e=null){let s=this._p1,i=this._p0;e&&(s=s.slice(),i=i.slice(),F.applyTransform(s,e),F.applyTransform(i,e));let n=this._r1,r=this._r0;if(e){const l=new Float32Array(2);F.singularValueDecompose2dScale(e,l),n*=l[0],r*=l[0]}const a=t.createRadialGradient(s[0],s[1],n,i[0],i[1],r),o=this._colorStops.map(([l,c])=>[1-l,c]).reverse();for(const[l,c]of o)a.addColorStop(l,c);return a}getPattern(t,e,s,i){let n;if(i===xt.STROKE||i===xt.FILL){if(this.isOriginBased()){let u=F.transform(s,e.baseTransform);this.matrix&&(u=F.transform(u,this.matrix));const f=.001,g=Math.hypot(u[0],u[1]),p=Math.hypot(u[2],u[3]),m=(u[0]*u[2]+u[1]*u[3])/(g*p);if(Math.abs(m)<f)if(this.isRadial()){if(Math.abs(g-p)<f)return this._createGradient(t,u)}else return this._createGradient(t,u)}const r=e.current.getClippedPathBoundingBox(i,ot(t))||[0,0,0,0],a=Math.ceil(r[2]-r[0])||1,o=Math.ceil(r[3]-r[1])||1,l=e.canvasFactory.create(a,o),c=l.context;c.clearRect(0,0,c.canvas.width,c.canvas.height),c.beginPath(),c.rect(0,0,c.canvas.width,c.canvas.height),c.translate(-r[0],-r[1]),s=F.transform(s,[1,0,0,1,r[0],r[1]]),c.transform(...e.baseTransform),this.matrix&&c.transform(...this.matrix),qe(c,this._bbox),this.areConic()&&(c.fillStyle=this._createReversedGradient(c),c.fill()),c.fillStyle=this._createGradient(c),c.fill(),n=t.createPattern(l.canvas,"no-repeat"),e.canvasFactory.destroy(l);const d=new DOMMatrix(s);n.setTransform(d)}else this.areConic()&&(t.save(),qe(t,this._bbox),t.fillStyle=this._createReversedGradient(t),t.fillRect(-1e10,-1e10,2e10,2e10),t.restore()),qe(t,this._bbox),n=this._createGradient(t);return n}}function mr(h,t,e,s,i,n,r,a){const o=t.coords,l=t.colors,c=h.data,d=h.width*4;let u;o[e*2+1]>o[s*2+1]&&(u=e,e=s,s=u,u=n,n=r,r=u),o[s*2+1]>o[i*2+1]&&(u=s,s=i,i=u,u=r,r=a,a=u),o[e*2+1]>o[s*2+1]&&(u=e,e=s,s=u,u=n,n=r,r=u);const f=(o[e*2]+t.offsetX)*t.scaleX,g=(o[e*2+1]+t.offsetY)*t.scaleY,p=(o[s*2]+t.offsetX)*t.scaleX,m=(o[s*2+1]+t.offsetY)*t.scaleY,v=(o[i*2]+t.offsetX)*t.scaleX,y=(o[i*2+1]+t.offsetY)*t.scaleY;if(g>=y)return;const b=l[n*4],w=l[n*4+1],A=l[n*4+2],S=l[r*4],E=l[r*4+1],C=l[r*4+2],x=l[a*4],P=l[a*4+1],T=l[a*4+2],k=Math.round(g),R=Math.round(y);let D,W,M,O,_,j,tt,et;for(let Q=k;Q<=R;Q++){if(Q<m){const I=Q<g?0:(g-Q)/(g-m);D=f-(f-p)*I,W=b-(b-S)*I,M=w-(w-E)*I,O=A-(A-C)*I}else{let I;Q>y?I=1:m===y?I=0:I=(m-Q)/(m-y),D=p-(p-v)*I,W=S-(S-x)*I,M=E-(E-P)*I,O=C-(C-T)*I}let G;Q<g?G=0:Q>y?G=1:G=(g-Q)/(g-y),_=f-(f-v)*G,j=b-(b-x)*G,tt=w-(w-P)*G,et=A-(A-T)*G;const q=Math.round(Math.min(D,_)),at=Math.round(Math.max(D,_));let L=d*Q+q*4;for(let I=q;I<=at;I++)G=(D-I)/(D-_),G<0?G=0:G>1&&(G=1),c[L++]=W-(W-j)*G|0,c[L++]=M-(M-tt)*G|0,c[L++]=O-(O-et)*G|0,c[L++]=255}}class vr extends Zs{constructor(t){super(),this._posData=t[2],this._colData=t[3],this._vertexCount=t[4],this._bounds=t[5],this._bbox=t[6],this._background=t[7],this.matrix=null,fr()}_createMeshCanvas(t,e,s){const a=Math.floor(this._bounds[0]),o=Math.floor(this._bounds[1]),l=Math.ceil(this._bounds[2])-a,c=Math.ceil(this._bounds[3])-o,d=Math.min(Math.ceil(Math.abs(l*t[0]*1.1)),3e3)||1,u=Math.min(Math.ceil(Math.abs(c*t[1]*1.1)),3e3)||1,f=l?l/d:1,g=c?c/u:1,p={coords:this._posData,colors:this._colData,offsetX:-a,offsetY:-o,scaleX:1/f,scaleY:1/g},m=d+4,v=u+4,y=s.create(m,v);if(ur()&&this._vertexCount>48)y.context.drawImage(pr(this._posData,this._colData,this._vertexCount,p,e,m,v,2),0,0);else{const b=y.context.createImageData(d,u);if(e){const w=b.data;for(let A=0,S=w.length;A<S;A+=4)w[A]=e[0],w[A+1]=e[1],w[A+2]=e[2],w[A+3]=255}for(let w=0,A=this._vertexCount;w<A;w+=3)mr(b,p,w,w+1,w+2,w,w+1,w+2);y.context.putImageData(b,2,2)}return{canvas:y.canvas,offsetX:a-2*f,offsetY:o-2*g,scaleX:f,scaleY:g}}isModifyingCurrentTransform(){return!0}getPattern(t,e,s,i){qe(t,this._bbox);const n=new Float32Array(2);if(i===xt.SHADING)F.singularValueDecompose2dScale(ot(t),n);else if(this.matrix){F.singularValueDecompose2dScale(this.matrix,n);const[o,l]=n;F.singularValueDecompose2dScale(e.baseTransform,n),n[0]*=o,n[1]*=l}else F.singularValueDecompose2dScale(e.baseTransform,n);const r=this._createMeshCanvas(n,i===xt.SHADING?null:this._background,e.canvasFactory);i!==xt.SHADING&&(t.setTransform(...e.baseTransform),this.matrix&&t.transform(...this.matrix)),t.translate(r.offsetX,r.offsetY),t.scale(r.scaleX,r.scaleY);const a=t.createPattern(r.canvas,"no-repeat");return e.canvasFactory.destroy(r),a}}class yr extends Zs{getPattern(){return"hotpink"}}function br(h){switch(h[0]){case"RadialAxial":return new gr(h);case"Mesh":return new vr(h);case"Dummy":return new yr}throw new Error(`Unknown IR type: ${h[0]}`)}const xi={COLORED:1,UNCOLORED:2};class Me{static MAX_PATTERN_SIZE=3e3;constructor(t,e,s,i){this.color=t[1],this.operatorList=t[2],this.matrix=t[3],this.bbox=t[4],this.xstep=t[5],this.ystep=t[6],this.paintType=t[7],this.tilingType=t[8],this.needsIsolation=t[9]??!0,this.ctx=e,this.canvasGraphicsFactory=s,this.baseTransform=i,this.patternBaseMatrix=this.matrix?F.transform(i,this.matrix):i}canSkipPatternCanvas([t,e,s,i]){const[n,r,a,o]=this.bbox,l=Math.abs(this.xstep),c=Math.abs(this.ystep);if(t>l+1e-6||e>c+1e-6)return null;const d=Math.floor((s-a)/l)+1,u=Math.ceil((s+t-n)/l)-1,f=Math.floor((i-o)/c)+1,g=Math.ceil((i+e-r)/c)-1;return u<=d&&g<=f?[d,f]:null}updatePatternDims(t,e){const s=F.inverseTransform(this.patternBaseMatrix),i=[t[0],t[1]],n=[t[2],t[3]];F.applyTransform(i,s),F.applyTransform(n,s),e[0]=Math.abs(n[0]-i[0]),e[1]=Math.abs(n[1]-i[1]),e[2]=Math.min(i[0],n[0]),e[3]=Math.min(i[1],n[1])}_renderTileCanvas(t,e,s,i){const[n,r,a,o]=this.bbox,l=t.canvasFactory.create(s.size,i.size),c=l.context,d=this.canvasGraphicsFactory.createCanvasGraphics(c,e);return d.groupLevel=t.groupLevel,this.setFillAndStrokeStyleToContext(d,this.paintType,this.color),c.translate(-s.scale*n,-i.scale*r),d.transform(0,s.scale,0,0,i.scale,0,0),c.save(),d.dependencyTracker?.save(),this.clipBbox(d,n,r,a,o),d.baseTransform=ot(d.ctx),d.executeOperatorList(this.operatorList),d.endDrawing(),d.dependencyTracker?.restore(),c.restore(),l}_getCombinedScales(){const t=new Float32Array(2);F.singularValueDecompose2dScale(this.matrix,t);const[e,s]=t;return F.singularValueDecompose2dScale(this.baseTransform,t),[e*t[0],s*t[1]]}drawPattern(t,e,s=!1,[i,n],r){const[a,o,l,c]=this.bbox,d=t.dependencyTracker;if(d&&(t.dependencyTracker=new ke(d,r)),t.save(),s?t.ctx.clip(e,"evenodd"):t.ctx.clip(e),t.ctx.setTransform(...this.patternBaseMatrix),t.ctx.translate(i*this.xstep,n*this.ystep),this.needsIsolation||t.ctx.globalAlpha!==1||t.ctx.globalCompositeOperation!=="source-over"||t.inSMaskMode){const u=l-a,f=c-o,[g,p]=this._getCombinedScales(),m=this.getSizeAndScale(u,this.ctx.canvas.width,g),v=this.getSizeAndScale(f,this.ctx.canvas.height,p),y=this._renderTileCanvas(t,r,m,v);t.ctx.drawImage(y.canvas,a,o,u,f),t.canvasFactory.destroy(y)}else this.setFillAndStrokeStyleToContext(t,this.paintType,this.color),this.clipBbox(t,a,o,l,c),t.baseTransformStack.push(t.baseTransform),t.baseTransform=ot(t.ctx),t.executeOperatorList(this.operatorList),t.baseTransform=t.baseTransformStack.pop();t.restore(),d&&(t.dependencyTracker=d)}createPatternCanvas(t,e){const[s,i,n,r]=this.bbox,a=n-s,o=r-i;let{xstep:l,ystep:c}=this;l=Math.abs(l),c=Math.abs(c),hs("TilingType: "+this.tilingType);const[d,u]=this._getCombinedScales();let f=a,g=o,p=!1,m=!1;Math.ceil(l*d)>=Math.ceil(a*d)?f=l:p=!0,Math.ceil(c*u)>=Math.ceil(o*u)?g=c:m=!0;const v=this.getSizeAndScale(f,this.ctx.canvas.width,d),y=this.getSizeAndScale(g,this.ctx.canvas.height,u),b=this._renderTileCanvas(t,e,v,y);if(p||m){const w=b.canvas;p&&(f=l),m&&(g=c);const A=this.getSizeAndScale(f,this.ctx.canvas.width,d),S=this.getSizeAndScale(g,this.ctx.canvas.height,u),E=A.size,C=S.size,x=t.canvasFactory.create(E,C),P=x.context,T=p?Math.floor(a/l):0,k=m?Math.floor(o/c):0;for(let R=0;R<=T;R++)for(let D=0;D<=k;D++)P.drawImage(w,E*R,C*D,E,C,0,0,E,C);return t.canvasFactory.destroy(b),{canvas:x.canvas,canvasEntry:x,scaleX:A.scale,scaleY:S.scale,offsetX:s,offsetY:i}}return{canvas:b.canvas,canvasEntry:b,scaleX:v.scale,scaleY:y.scale,offsetX:s,offsetY:i}}getSizeAndScale(t,e,s){const i=Math.max(Me.MAX_PATTERN_SIZE,e);let n=Math.ceil(t*s);return n>=i?n=i:s=n/t,{scale:s,size:n}}clipBbox(t,e,s,i,n){const r=i-e,a=n-s,o=new Path2D;o.rect(e,s,r,a),F.axialAlignedBoundingBox([e,s,i,n],ot(t.ctx),t.current.minMax),t.ctx.clip(o),t.current.updateClipFromPath()}setFillAndStrokeStyleToContext(t,e,s){const i=t.ctx,n=t.current;switch(n.patternFill=n.patternStroke=!1,e){case xi.COLORED:const{fillStyle:r,strokeStyle:a}=this.ctx;i.fillStyle=n.fillColor=r,i.strokeStyle=n.strokeColor=a;break;case xi.UNCOLORED:i.fillStyle=i.strokeStyle=s,n.fillColor=n.strokeColor=s;break;default:throw new wn(`Unsupported paint type: ${e}`)}}isModifyingCurrentTransform(){return!1}getPattern(t,e,s,i,n){const r=i!==xt.SHADING?F.transform(s,this.patternBaseMatrix):s,a=this.createPatternCanvas(e,n);let o=new DOMMatrix(r);o=o.translate(a.offsetX,a.offsetY),o=o.scale(1/a.scaleX,1/a.scaleY);const l=t.createPattern(a.canvas,"repeat");return e.canvasFactory.destroy(a.canvasEntry),l.setTransform(o),l}}function Ar({src:h,srcPos:t=0,dest:e,width:s,height:i,nonBlackColor:n=4294967295,inverseDecode:r=!1}){const a=yt.isLittleEndian?4278190080:255,[o,l]=r?[n,a]:[a,n],c=s>>3,d=s&7,u=o^l,f=h.length;e=new Uint32Array(e.buffer);let g=0;for(let p=0;p<i;++p){for(const v=t+c;t<v;++t,g+=8){const y=h[t];e[g]=o^-(y>>7&1)&u,e[g+1]=o^-(y>>6&1)&u,e[g+2]=o^-(y>>5&1)&u,e[g+3]=o^-(y>>4&1)&u,e[g+4]=o^-(y>>3&1)&u,e[g+5]=o^-(y>>2&1)&u,e[g+6]=o^-(y>>1&1)&u,e[g+7]=o^-(y&1)&u}if(d===0)continue;const m=t<f?h[t++]:255;for(let v=0;v<d;++v,++g)e[g]=o^-(m>>7-v&1)&u}return{srcPos:t,destPos:g}}const Ti=16,Ci=100,wr=15,Pi=10,It=16,Cs=new DOMMatrix,Dt=new Float32Array(2);function Sr(h,t){if(h._removeMirroring)throw new Error("Context is already forwarding operations.");h.__originalSave=h.save,h.__originalRestore=h.restore,h.__originalRotate=h.rotate,h.__originalScale=h.scale,h.__originalTranslate=h.translate,h.__originalTransform=h.transform,h.__originalSetTransform=h.setTransform,h.__originalResetTransform=h.resetTransform,h.__originalClip=h.clip,h.__originalMoveTo=h.moveTo,h.__originalLineTo=h.lineTo,h.__originalBezierCurveTo=h.bezierCurveTo,h.__originalRect=h.rect,h.__originalClosePath=h.closePath,h.__originalBeginPath=h.beginPath,h._removeMirroring=()=>{h.save=h.__originalSave,h.restore=h.__originalRestore,h.rotate=h.__originalRotate,h.scale=h.__originalScale,h.translate=h.__originalTranslate,h.transform=h.__originalTransform,h.setTransform=h.__originalSetTransform,h.resetTransform=h.__originalResetTransform,h.clip=h.__originalClip,h.moveTo=h.__originalMoveTo,h.lineTo=h.__originalLineTo,h.bezierCurveTo=h.__originalBezierCurveTo,h.rect=h.__originalRect,h.closePath=h.__originalClosePath,h.beginPath=h.__originalBeginPath,delete h._removeMirroring},h.save=function(){t.save(),this.__originalSave()},h.restore=function(){t.restore(),this.__originalRestore()},h.translate=function(e,s){t.translate(e,s),this.__originalTranslate(e,s)},h.scale=function(e,s){t.scale(e,s),this.__originalScale(e,s)},h.transform=function(e,s,i,n,r,a){t.transform(e,s,i,n,r,a),this.__originalTransform(e,s,i,n,r,a)},h.setTransform=function(e,s,i,n,r,a){s===void 0?(t.setTransform(e),this.__originalSetTransform(e)):(t.setTransform(e,s,i,n,r,a),this.__originalSetTransform(e,s,i,n,r,a))},h.resetTransform=function(){t.resetTransform(),this.__originalResetTransform()},h.rotate=function(e){t.rotate(e),this.__originalRotate(e)},h.clip=function(e){t.clip(e),this.__originalClip(e)},h.moveTo=function(e,s){t.moveTo(e,s),this.__originalMoveTo(e,s)},h.lineTo=function(e,s){t.lineTo(e,s),this.__originalLineTo(e,s)},h.bezierCurveTo=function(e,s,i,n,r,a){t.bezierCurveTo(e,s,i,n,r,a),this.__originalBezierCurveTo(e,s,i,n,r,a)},h.rect=function(e,s,i,n){t.rect(e,s,i,n),this.__originalRect(e,s,i,n)},h.closePath=function(){t.closePath(),this.__originalClosePath()},h.beginPath=function(){t.beginPath(),this.__originalBeginPath()}}function Xe(h,t,e,s,i,n,r,a,o,l){const[c,d,u,f,g,p]=ot(h);if(d===0&&u===0){const y=r*c+g,b=Math.round(y),w=a*f+p,A=Math.round(w),S=(r+o)*c+g,E=Math.abs(Math.round(S)-b)||1,C=(a+l)*f+p,x=Math.abs(Math.round(C)-A)||1;return h.setTransform(Math.sign(c),0,0,Math.sign(f),b,A),h.drawImage(t,e,s,i,n,0,0,E,x),h.setTransform(c,d,u,f,g,p),[E,x]}if(c===0&&f===0){const y=a*u+g,b=Math.round(y),w=r*d+p,A=Math.round(w),S=(a+l)*u+g,E=Math.abs(Math.round(S)-b)||1,C=(r+o)*d+p,x=Math.abs(Math.round(C)-A)||1;return h.setTransform(0,Math.sign(d),Math.sign(u),0,b,A),h.drawImage(t,e,s,i,n,0,0,x,E),h.setTransform(c,d,u,f,g,p),[x,E]}h.drawImage(t,e,s,i,n,r,a,o,l);const m=Math.hypot(c,d),v=Math.hypot(u,f);return[m*o,v*l]}class Ii{alphaIsShape=!1;fontSize=0;fontSizeScale=1;textMatrix=null;textMatrixScale=1;fontMatrix=Rs;leading=0;x=0;y=0;lineX=0;lineY=0;charSpacing=0;wordSpacing=0;textHScale=1;textRenderingMode=At.FILL;textRise=0;fillColor="#000000";strokeColor="#000000";tilingPatternDims=null;patternFill=!1;patternStroke=!1;fillAlpha=1;strokeAlpha=1;lineWidth=1;activeSMask=null;transferMaps="none";minMax=ne.slice();constructor(t,e){this.clipBox=new Float32Array([0,0,t,e])}clone(){const t=Object.create(this);return t.clipBox=this.clipBox.slice(),t.minMax=this.minMax.slice(),t.tilingPatternDims=this.tilingPatternDims?.slice(),t}getPathBoundingBox(t=xt.FILL,e=null){const s=this.minMax.slice();if(t===xt.STROKE){e||nt("Stroke bounding box must include transform."),F.singularValueDecompose2dScale(e,Dt);const i=Dt[0]*this.lineWidth/2,n=Dt[1]*this.lineWidth/2;s[0]-=i,s[1]-=n,s[2]+=i,s[3]+=n}return s}updateClipFromPath(){const t=F.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(t||[0,0,0,0])}isEmptyClip(){return this.minMax[0]===1/0}startNewPathAndClipBox(t){this.clipBox.set(t,0),this.minMax.set(ne,0)}getClippedPathBoundingBox(t=xt.FILL,e=null){return F.intersect(this.clipBox,this.getPathBoundingBox(t,e))}}function Ri(h,t){if(t instanceof ImageData){h.putImageData(t,0,0);return}const e=t.height,s=t.width,i=e%It,n=(e-i)/It,r=i===0?n:n+1,a=h.createImageData(s,It);let o=0,l;const c=t.data,d=a.data;let u,f,g,p;if(t.kind===Ze.GRAYSCALE_1BPP){const m=c.byteLength,v=new Uint32Array(d.buffer,0,d.byteLength>>2),y=v.length,b=s+7>>3,w=4294967295,A=yt.isLittleEndian?4278190080:255;for(u=0;u<r;u++){for(g=u<n?It:i,l=0,f=0;f<g;f++){const S=m-o;let E=0;const C=S>b?s:S*8-7,x=C&-8;let P=0,T=0;for(;E<x;E+=8)T=c[o++],v[l++]=T&128?w:A,v[l++]=T&64?w:A,v[l++]=T&32?w:A,v[l++]=T&16?w:A,v[l++]=T&8?w:A,v[l++]=T&4?w:A,v[l++]=T&2?w:A,v[l++]=T&1?w:A;for(;E<C;E++)P===0&&(T=c[o++],P=128),v[l++]=T&P?w:A,P>>=1}for(;l<y;)v[l++]=0;h.putImageData(a,0,u*It)}}else if(t.kind===Ze.RGBA_32BPP){for(f=0,p=s*It*4,u=0;u<n;u++)d.set(c.subarray(o,o+p)),o+=p,h.putImageData(a,0,f),f+=It;u<r&&(p=s*i*4,d.set(c.subarray(o,o+p)),h.putImageData(a,0,f))}else if(t.kind===Ze.RGB_24BPP)for(g=It,p=s*g,u=0;u<r;u++){for(u>=n&&(g=i,p=s*g),l=0,f=p;f--;)d[l++]=c[o++],d[l++]=c[o++],d[l++]=c[o++],d[l++]=255;h.putImageData(a,0,u*It)}else throw new Error(`bad image kind: ${t.kind}`)}function Oi(h,t){if(t.bitmap){h.drawImage(t.bitmap,0,0);return}const e=t.height,s=t.width,i=e%It,n=(e-i)/It,r=i===0?n:n+1,a=h.createImageData(s,It);let o=0;const l=t.data,c=a.data;for(let d=0;d<r;d++){const u=d<n?It:i;({srcPos:o}=Ar({src:l,srcPos:o,dest:c,width:s,height:u,nonBlackColor:0})),h.putImageData(a,0,d*It)}}function xe(h,t){const e=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font","filter"];for(const s of e)h[s]!==void 0&&(t[s]=h[s]);h.setLineDash!==void 0&&(t.setLineDash(h.getLineDash()),t.lineDashOffset=h.lineDashOffset)}function Ye(h){h.strokeStyle=h.fillStyle="#000000",h.fillRule="nonzero",h.globalAlpha=1,h.lineWidth=1,h.lineCap="butt",h.lineJoin="miter",h.miterLimit=10,h.globalCompositeOperation="source-over",h.font="10px sans-serif",h.setLineDash!==void 0&&(h.setLineDash([]),h.lineDashOffset=0);const{filter:t}=h;t!=="none"&&t!==""&&(h.filter="none")}function Mi(h,t){if(t)return!0;F.singularValueDecompose2dScale(h,Dt);const e=Math.fround(Vt.pixelRatio*Se.PDF_TO_CSS_UNITS);return Dt[0]<=e&&Dt[1]<=e}const Er=["butt","round","square"],xr=["miter","round","bevel"],Tr={},Di={};class Ae{constructor(t,e,s,i,n,{optionalContentConfig:r,markedContentStack:a=null},o,l,c,d){this.ctx=t,this.current=new Ii(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.commonObjs=e,this.objs=s,this.canvasFactory=i,this.filterFactory=n,this.groupStack=[],this.baseTransform=null,this.baseTransformStack=[],this.groupLevel=0,this.smaskStack=[],this.tempSMask=null,this.smaskGroupCanvases=[],this.smaskPreparedEntry=null,this.smaskPreparedFor=null,this.smaskPreparedOffsetX=0,this.smaskPreparedOffsetY=0,this.suspendedCtx=null,this.contentVisible=!0,this.markedContentStack=a||[],this.optionalContentConfig=r,this.cachedPatterns=new Map,this.annotationCanvasMap=o,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=l,this._cachedScaleForStroking=[-1,0],this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map,this.dependencyTracker=c??null,this.imagesTracker=d??null}getObject(t,e,s=null){return typeof e=="string"?(this.dependencyTracker?.recordNamedDependency(t,e),e.startsWith("g_")?this.commonObjs.get(e):this.objs.get(e)):s}beginDrawing({transform:t,viewport:e,transparency:s=!1,background:i=null}){const n=this.ctx.canvas.width,r=this.ctx.canvas.height,a=this.ctx.fillStyle;if(this.ctx.fillStyle=i||"#ffffff",this.ctx.fillRect(0,0,n,r),this.ctx.fillStyle=a,s){const o=this.transparentCanvasEntry=this.canvasFactory.create(n,r);this.compositeCtx=this.ctx,{canvas:this.transparentCanvas,context:this.ctx}=o,this.ctx.save(),this.ctx.transform(...ot(this.compositeCtx))}this.ctx.save(),Ye(this.ctx),t&&(this.ctx.transform(...t),this.outputScaleX=t[0],this.outputScaleY=t[3]),this.ctx.transform(...e.transform),this.viewportScale=e.scale,this.baseTransform=ot(this.ctx)}executeOperatorList(t,e,s,i,n){const r=t.argsArray,a=t.fnArray;let o=e||0;const l=r.length;if(l===o)return o;const c=l-o>Pi&&typeof s=="function",d=c?Date.now()+wr:0;let u=0;const f=this.commonObjs,g=this.objs;let p,m;for(;;){if(i!==void 0){if(o===i.nextBreakPoint)return i.breakIt(o,s),o;if(i.shouldSkip(o)){if(++o===l)return o;continue}}if(!n||n(o))if(p=a[o],m=r[o]??null,p!==Kt.dependency)m===null?this[p](o):this[p](o,...m);else for(const v of m){this.dependencyTracker?.recordNamedData(v,o);const y=v.startsWith("g_")?f:g;if(!y.has(v))return y.get(v,s),o}if(o++,o===l)return o;if(c&&++u>Pi){if(Date.now()>d)return s(),o;u=0}}}#t(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.current.activeSMask=null,this.ctx.restore(),this.transparentCanvas&&(this.ctx=this.compositeCtx,this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.drawImage(this.transparentCanvas,0,0),this.ctx.restore(),this.canvasFactory.destroy(this.transparentCanvasEntry),this.transparentCanvas=null,this.transparentCanvasEntry=null)}endDrawing(){this.#t();for(const t of this.smaskGroupCanvases)this.canvasFactory.destroy(t);this.smaskGroupCanvases.length=0,this._clearPreparedSMask(),this.tempSMask=null,this.smaskStack.length=0,this.cachedPatterns.clear();for(const t of this._cachedBitmapsMap.values()){for(const e of t.values())typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement&&(e.width=e.height=0);t.clear()}this._cachedBitmapsMap.clear(),this.#e()}#e(){if(this.pageColors){const t=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if(t!=="none"){const e=this.ctx.filter;this.ctx.filter=t,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=e}}}_scaleImage(t,e){const s=t.width??t.displayWidth,i=t.height??t.displayHeight,n=Math.max(Math.hypot(e[0],e[1]),1),r=Math.max(Math.hypot(e[2],e[3]),1),a=[];let o=n,l=r,c=s,d=i;for(;o>2&&c>1||l>2&&d>1;){let v=c,y=d;o>2&&c>1&&(v=Math.ceil(c/2),o/=c/v),l>2&&d>1&&(y=Math.ceil(d/2),l/=d/y),a.push({newWidth:v,newHeight:y}),c=v,d=y}if(a.length===0)return{img:t,paintWidth:s,paintHeight:i,tmpCanvas:null};if(a.length===1){const{newWidth:v,newHeight:y}=a[0],b=this.canvasFactory.create(v,y);return b.context.drawImage(t,0,0,s,i,0,0,v,y),{img:b.canvas,paintWidth:v,paintHeight:y,tmpCanvas:b}}let u=this.canvasFactory.create(1,1),f=this.canvasFactory.create(1,1),g=s,p=i,m=t;for(const{newWidth:v,newHeight:y}of a)this.canvasFactory.reset(f,v,y),f.context.drawImage(m,0,0,g,p,0,0,v,y),[u,f]=[f,u],m=u.canvas,g=v,p=y;return this.canvasFactory.destroy(f),{img:u.canvas,paintWidth:g,paintHeight:p,tmpCanvas:u}}_createMaskCanvas(t,e){const s=this.ctx,{width:i,height:n}=e,r=this.current.fillColor,a=this.current.patternFill,o=ot(s);let l,c,d,u;if((e.bitmap||e.data)&&e.count>1){const T=e.bitmap||e.data.buffer;c=JSON.stringify(a?o:[o.slice(0,4),r]),l=this._cachedBitmapsMap.getOrInsertComputed(T,zs);const k=l.get(c);if(k&&!a){const R=Math.round(Math.min(o[0],o[2])+o[4]),D=Math.round(Math.min(o[1],o[3])+o[5]);return this.dependencyTracker?.recordDependencies(t,Lt.transformAndFill),{canvas:k,offsetX:R,offsetY:D}}d=k}d||(u=this.canvasFactory.create(i,n),Oi(u.context,e));let f=F.transform(o,[1/i,0,0,-1/n,0,0]);f=F.transform(f,[1,0,0,1,0,-n]);const g=ne.slice();F.axialAlignedBoundingBox([0,0,i,n],f,g);const[p,m,v,y]=g,b=Math.round(v-p)||1,w=Math.round(y-m)||1,A=this.canvasFactory.create(b,w),S=A.context,E=p,C=m;S.translate(-E,-C),S.transform(...f);let x=null;if(!d){const T=this._scaleImage(u.canvas,$t(S));d=T.img,x=T.tmpCanvas,d!==u.canvas&&(this.canvasFactory.destroy(u),u=null),l&&a&&(l.set(c,d),x=null,u=null)}S.imageSmoothingEnabled=Mi(ot(S),e.interpolate),Xe(S,d,0,0,d.width,d.height,0,0,i,n),x&&this.canvasFactory.destroy(x),u&&this.canvasFactory.destroy(u),S.globalCompositeOperation="source-in";const P=F.transform($t(S),[1,0,0,1,-E,-C]);return S.fillStyle=a?r.getPattern(s,this,P,xt.FILL,t):r,S.fillRect(0,0,i,n),l&&!a&&l.set(c,A.canvas),this.dependencyTracker?.recordDependencies(t,Lt.transformAndFill),{canvas:A.canvas,canvasEntry:l&&!a?null:A,offsetX:Math.round(E),offsetY:Math.round(C)}}setLineWidth(t,e){this.dependencyTracker?.recordSimpleData("lineWidth",t),e!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=e,this.ctx.lineWidth=e}setLineCap(t,e){this.dependencyTracker?.recordSimpleData("lineCap",t),this.ctx.lineCap=Er[e]}setLineJoin(t,e){this.dependencyTracker?.recordSimpleData("lineJoin",t),this.ctx.lineJoin=xr[e]}setMiterLimit(t,e){this.dependencyTracker?.recordSimpleData("miterLimit",t),this.ctx.miterLimit=e}setDash(t,e,s){this.dependencyTracker?.recordSimpleData("dash",t);const i=this.ctx;i.setLineDash!==void 0&&(i.setLineDash(e),i.lineDashOffset=s)}setRenderingIntent(t,e){}setFlatness(t,e){}setGState(t,e){for(const[s,i]of e)switch(s){case"LW":this.setLineWidth(t,i);break;case"LC":this.setLineCap(t,i);break;case"LJ":this.setLineJoin(t,i);break;case"ML":this.setMiterLimit(t,i);break;case"D":this.setDash(t,i[0],i[1]);break;case"RI":this.setRenderingIntent(t,i);break;case"FL":this.setFlatness(t,i);break;case"Font":this.setFont(t,i[0],i[1]);break;case"CA":this.dependencyTracker?.recordSimpleData("strokeAlpha",t),this.current.strokeAlpha=i;break;case"ca":this.dependencyTracker?.recordSimpleData("fillAlpha",t),this.ctx.globalAlpha=this.current.fillAlpha=i;break;case"BM":this.dependencyTracker?.recordSimpleData("globalCompositeOperation",t),this.ctx.globalCompositeOperation=i;break;case"SMask":this.dependencyTracker?.recordSimpleData("SMask",t),this.current.activeSMask=i?this.tempSMask:null,this.current.activeSMask&&(this.current.activeSMask.blendMode=this.ctx.globalCompositeOperation),this.tempSMask=null,this.checkSMaskState(t);break;case"TR":this.dependencyTracker?.recordSimpleData("filter",t),this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(i);break}}get inSMaskMode(){return!!this.suspendedCtx}_clearPreparedSMask(){this.smaskPreparedEntry&&(this.canvasFactory.destroy(this.smaskPreparedEntry),this.smaskPreparedEntry=null),this.smaskPreparedFor=null,this.smaskPreparedOffsetX=0,this.smaskPreparedOffsetY=0}_ensurePreparedSMask(t,e,s){t!==this.smaskPreparedFor&&(this._clearPreparedSMask(),this._prepareSMaskCanvas(t,e,s))}checkSMaskState(t){const e=this.inSMaskMode;this.current.activeSMask&&!e?this.beginSMaskMode(t):!this.current.activeSMask&&e?this.endSMaskMode():this.current.activeSMask&&e&&this._ensurePreparedSMask(this.current.activeSMask,this.ctx.canvas.width,this.ctx.canvas.height)}_prepareSMaskCanvas(t,e,s){const{canvas:i,subtype:n,backdrop:r,transferMap:a}=t,o=n==="Luminosity"||n==="Alpha"&&a;if(!r&&!o){this.smaskPreparedFor=t;return}let l,c,d;if(r&&o){const u=this.canvasFactory.create(e,s),f=u.context;f.drawImage(i,t.offsetX,t.offsetY),f.globalCompositeOperation="destination-atop",f.fillStyle=r,f.fillRect(0,0,e,s),f.globalCompositeOperation="source-over",l=this.canvasFactory.create(e,s);const g=l.context;g.filter=n==="Alpha"?this.filterFactory.addAlphaFilter(a):this.filterFactory.addLuminosityFilter(a),g.drawImage(u.canvas,0,0),g.filter="none",this.canvasFactory.destroy(u),c=d=0}else if(o){l=this.canvasFactory.create(i.width,i.height);const u=l.context;u.filter=n==="Alpha"?this.filterFactory.addAlphaFilter(a):this.filterFactory.addLuminosityFilter(a),u.drawImage(i,0,0),u.filter="none",{offsetX:c,offsetY:d}=t}else{l=this.canvasFactory.create(e,s);const u=l.context;u.drawImage(i,t.offsetX,t.offsetY),u.globalCompositeOperation="destination-atop",u.fillStyle=r,u.fillRect(0,0,e,s),u.globalCompositeOperation="source-over",c=d=0}this.smaskPreparedEntry=l,this.smaskPreparedFor=t,this.smaskPreparedOffsetX=c,this.smaskPreparedOffsetY=d}beginSMaskMode(t){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");const{width:e,height:s}=this.ctx.canvas,i=this.canvasFactory.create(e,s);this.smaskScratchCanvas=i,this.suspendedCtx=this.ctx;const n=this.ctx=i.context;n.setTransform(this.suspendedCtx.getTransform()),xe(this.suspendedCtx,n),Sr(n,this.suspendedCtx),this._ensurePreparedSMask(this.current.activeSMask,e,s),this.setGState(t,[["BM","source-over"]])}endSMaskMode(){if(!this.inSMaskMode)throw new Error("endSMaskMode called while not in smask mode");this.ctx._removeMirroring(),xe(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null,this.canvasFactory.destroy(this.smaskScratchCanvas),this.smaskScratchCanvas=null,this._clearPreparedSMask()}compose(t){if(!this.current.activeSMask)return;t?(t[0]=Math.floor(t[0]),t[1]=Math.floor(t[1]),t[2]=Math.ceil(t[2]),t[3]=Math.ceil(t[3])):t=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];const e=this.current.activeSMask,s=this.suspendedCtx;this.composeSMask(s,e,this.ctx,t),this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.clearRect(t[0],t[1],t[2]-t[0],t[3]-t[1]),this.ctx.restore()}composeSMask(t,e,s,i){const n=i[0],r=i[1],a=i[2]-n,o=i[3]-r;if(a===0||o===0)return;const l=this.smaskPreparedEntry;if(l){const c=n-this.smaskPreparedOffsetX,d=r-this.smaskPreparedOffsetY;s.save(),s.globalAlpha=1,s.setTransform(1,0,0,1,0,0);const u=new Path2D;u.rect(n,r,a,o),s.clip(u),s.globalCompositeOperation="destination-in",s.drawImage(l.canvas,c,d,a,o,n,r,a,o),s.restore()}else this.genericComposeSMask(e.context,s,a,o,n,r,e.offsetX,e.offsetY);t.save(),t.globalAlpha=1,t.globalCompositeOperation=e.blendMode||"source-over",t.setTransform(1,0,0,1,0,0),t.drawImage(s.canvas,n,r,a,o,n,r,a,o),t.restore()}genericComposeSMask(t,e,s,i,n,r,a,o){const l=t.canvas,c=n-a,d=r-o;e.save(),e.globalAlpha=1,e.setTransform(1,0,0,1,0,0);const u=new Path2D;u.rect(n,r,s,i),e.clip(u),e.globalCompositeOperation="destination-in",e.drawImage(l,c,d,s,i,n,r,s,i),e.restore()}save(t){this.inSMaskMode&&xe(this.ctx,this.suspendedCtx),this.ctx.save();const e=this.current;this.stateStack.push(e),this.current=e.clone(),this.dependencyTracker?.save(t)}restore(t){if(this.dependencyTracker?.restore(t),this.stateStack.length===0){this.inSMaskMode&&this.endSMaskMode();return}this.current=this.stateStack.pop(),this.ctx.restore(),this.inSMaskMode&&(xe(this.suspendedCtx,this.ctx),this.ctx.setTransform(this.suspendedCtx.getTransform())),this.checkSMaskState(t),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}transform(t,e,s,i,n,r,a){this.dependencyTracker?.recordIncrementalData("transform",t),this.ctx.transform(e,s,i,n,r,a),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(t,e,s,i){let[n]=s;if(!i){n||=s[0]=new Path2D,e!==Kt.stroke&&e!==Kt.closeStroke&&(this.current.tilingPatternDims=null),this[e](t,n);return}if(this.dependencyTracker!==null){const a=e===Kt.stroke?this.current.lineWidth/2:0;this.dependencyTracker.resetBBox(t).recordBBox(t,this.ctx,i[0]-a,i[2]+a,i[1]-a,i[3]+a).recordDependencies(t,["transform"])}n instanceof Path2D||(n=s[0]=zi(n)),F.axialAlignedBoundingBox(i,ot(this.ctx),this.current.minMax);const r=this.current.tilingPatternDims;if(r&&e!==Kt.stroke&&e!==Kt.closeStroke&&this.current.fillColor instanceof Me){const a=F.intersect(this.current.clipBox,this.current.minMax);a?this.current.fillColor.updatePatternDims(a,r):this.current.tilingPatternDims=null}this[e](t,n),this._pathStartIdx=t}closePath(t){this.ctx.closePath()}stroke(t,e,s=!0){const i=this.ctx,n=this.current.strokeColor;if(i.globalAlpha=this.current.strokeAlpha,this.contentVisible)if(typeof n=="object"&&n?.getPattern){const r=n.isModifyingCurrentTransform()?i.getTransform():null;if(i.save(),i.strokeStyle=n.getPattern(i,this,$t(i),xt.STROKE,t),r){const a=new Path2D;a.addPath(e,i.getTransform().invertSelf().multiplySelf(r)),e=a}this.rescaleAndStroke(e,!1),i.restore()}else this.rescaleAndStroke(e,!0);this.dependencyTracker?.recordDependencies(t,Lt.stroke),s&&this.consumePath(t,e,this.current.getClippedPathBoundingBox(xt.STROKE,ot(this.ctx))),i.globalAlpha=this.current.fillAlpha}closeStroke(t,e){this.stroke(t,e)}fill(t,e,s=!0){const i=this.ctx,n=this.current.fillColor,r=this.current.patternFill;let a=!1;const o=this.current.getClippedPathBoundingBox();if(this.dependencyTracker?.recordDependencies(t,Lt.fill),r){const l=this.current.tilingPatternDims,c=l&&n.canSkipPatternCanvas(l);if(c){n.drawPattern(this,e,this.pendingEOFill,c,t),this.pendingEOFill=!1,s&&this.consumePath(t,e,o),this.current.tilingPatternDims=null;return}const d=n.isModifyingCurrentTransform()?i.getTransform():null;if(this.dependencyTracker?.save(t),i.save(),i.fillStyle=n.getPattern(i,this,$t(i),xt.FILL,t),d){const u=new Path2D;u.addPath(e,i.getTransform().invertSelf().multiplySelf(d)),e=u}a=!0}this.contentVisible&&o!==null&&(this.pendingEOFill?(i.fill(e,"evenodd"),this.pendingEOFill=!1):i.fill(e)),a&&(i.restore(),this.dependencyTracker?.restore(t)),s&&this.consumePath(t,e,o)}eoFill(t,e){this.pendingEOFill=!0,this.fill(t,e)}fillStroke(t,e){this.fill(t,e,!1),this.stroke(t,e,!1),this.consumePath(t,e)}eoFillStroke(t,e){this.pendingEOFill=!0,this.fillStroke(t,e)}closeFillStroke(t,e){this.fillStroke(t,e)}closeEOFillStroke(t,e){this.pendingEOFill=!0,this.fillStroke(t,e)}endPath(t,e){this.consumePath(t,e)}rawFillPath(t,e){this.ctx.fill(e),this.dependencyTracker?.recordDependencies(t,Lt.rawFillPath).recordOperation(t)}clip(t){this.dependencyTracker?.recordFutureForcedDependency("clipMode",t),this.pendingClip=Tr}eoClip(t){this.dependencyTracker?.recordFutureForcedDependency("clipMode",t),this.pendingClip=Di}beginText(t){this.current.textMatrix=null,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0,this.dependencyTracker?.recordOpenMarker(t).resetIncrementalData("sameLineText").resetIncrementalData("moveText",t)}endText(t){const e=this.pendingTextPaths,s=this.ctx;if(this.dependencyTracker){const{dependencyTracker:i}=this;e!==void 0&&i.recordFutureForcedDependency("textClip",i.getOpenMarker()).recordFutureForcedDependency("textClip",t),i.recordCloseMarker(t)}if(e!==void 0){const i=new Path2D,n=s.getTransform().invertSelf();for(const{transform:r,x:a,y:o,fontSize:l,path:c}of e)c&&i.addPath(c,new DOMMatrix(r).preMultiplySelf(n).translate(a,o).scale(l,-l));s.clip(i)}delete this.pendingTextPaths}setCharSpacing(t,e){this.dependencyTracker?.recordSimpleData("charSpacing",t),this.current.charSpacing=e}setWordSpacing(t,e){this.dependencyTracker?.recordSimpleData("wordSpacing",t),this.current.wordSpacing=e}setHScale(t,e){this.dependencyTracker?.recordSimpleData("hScale",t),this.current.textHScale=e/100}setLeading(t,e){this.dependencyTracker?.recordSimpleData("leading",t),this.current.leading=-e}setFont(t,e,s){this.dependencyTracker?.recordSimpleData("font",t).recordSimpleDataFromNamed("fontObj",e,t);const i=this.commonObjs.get(e),n=this.current;if(!i)throw new Error(`Can't find font for ${e}`);if(n.fontMatrix=i.fontMatrix||Rs,(n.fontMatrix[0]===0||n.fontMatrix[3]===0)&&z("Invalid font matrix for font "+e),s<0?(s=-s,n.fontDirection=-1):n.fontDirection=1,this.current.font=i,this.current.fontSize=s,i.isType3Font)return;const r=i.loadedName||"sans-serif",a=i.systemFontInfo?.css||`"${r}", ${i.fallbackName}`;let o="normal";i.black?o="900":i.bold&&(o="bold");const l=i.italic?"italic":"normal";let c=s;s<Ti?c=Ti:s>Ci&&(c=Ci),this.current.fontSizeScale=s/c,this.ctx.font=`${l} ${o} ${c}px ${a}`}setTextRenderingMode(t,e){this.dependencyTracker?.recordSimpleData("textRenderingMode",t),this.current.textRenderingMode=e}setTextRise(t,e){this.dependencyTracker?.recordSimpleData("textRise",t),this.current.textRise=e}moveText(t,e,s){this.dependencyTracker?.resetIncrementalData("sameLineText").recordIncrementalData("moveText",t),this.current.x=this.current.lineX+=e,this.current.y=this.current.lineY+=s}setLeadingMoveText(t,e,s){this.setLeading(t,-s),this.moveText(t,e,s)}setTextMatrix(t,e){this.dependencyTracker?.resetIncrementalData("sameLineText").recordSimpleData("textMatrix",t);const{current:s}=this;s.textMatrix=e,s.textMatrixScale=Math.hypot(e[0],e[1]),s.x=s.lineX=0,s.y=s.lineY=0}nextLine(t){this.moveText(t,0,this.current.leading),this.dependencyTracker?.recordIncrementalData("moveText",this.dependencyTracker.getSimpleIndex("leading")??t)}#s(t,e,s){const i=new Path2D;return i.addPath(t,new DOMMatrix(s).invertSelf().multiplySelf(e)),i}paintChar(t,e,s,i,n,r){const a=this.ctx,o=this.current,l=o.font,c=o.textRenderingMode,d=o.fontSize/o.fontSizeScale,u=c&At.FILL_STROKE_MASK,f=!!(c&At.ADD_TO_PATH_FLAG),g=o.patternFill&&!l.missingFile,p=o.patternStroke&&!l.missingFile;let m;if((l.disableFontFace||f||g||p)&&!l.missingFile&&(m=l.getPathGenerator(this.commonObjs,e)),m&&(l.disableFontFace||g||p)){a.save(),a.translate(s,i),a.scale(d,-d),this.dependencyTracker?.recordCharacterBBox(t,a,l);let v;if(u===At.FILL||u===At.FILL_STROKE)if(n){v=a.getTransform(),a.setTransform(...n);const y=this.#s(m,v,n);a.fill(y)}else a.fill(m);if(u===At.STROKE||u===At.FILL_STROKE)if(r){v||=a.getTransform(),a.setTransform(...r);const{a:y,b,c:w,d:A}=v,S=F.inverseTransform(r),E=F.transform([y,b,w,A,0,0],S);F.singularValueDecompose2dScale(E,Dt),a.lineWidth*=Math.max(Dt[0],Dt[1])/d,a.stroke(this.#s(m,v,r))}else a.lineWidth/=d,a.stroke(m);a.restore()}else(u===At.FILL||u===At.FILL_STROKE)&&(a.fillText(e,s,i),this.dependencyTracker?.recordCharacterBBox(t,a,l,d,s,i,()=>a.measureText(e))),(u===At.STROKE||u===At.FILL_STROKE)&&(this.dependencyTracker&&this.dependencyTracker?.recordCharacterBBox(t,a,l,d,s,i,()=>a.measureText(e)).recordDependencies(t,Lt.stroke),a.strokeText(e,s,i));f&&((this.pendingTextPaths||=[]).push({transform:ot(a),x:s,y:i,fontSize:d,path:m}),this.dependencyTracker?.recordCharacterBBox(t,a,l,d,s,i))}get isFontSubpixelAAEnabled(){const t=this.canvasFactory.create(10,10),e=t.context;e.scale(1.5,1),e.fillText("I",0,10);const s=e.getImageData(0,0,10,10).data;this.canvasFactory.destroy(t);let i=!1;for(let n=3;n<s.length;n+=4)if(s[n]>0&&s[n]<255){i=!0;break}return K(this,"isFontSubpixelAAEnabled",i)}showText(t,e){this.dependencyTracker&&(this.dependencyTracker.recordDependencies(t,Lt.showText).resetBBox(t),this.current.textRenderingMode&At.ADD_TO_PATH_FLAG&&this.dependencyTracker.recordFutureForcedDependency("textClip",t).inheritPendingDependenciesAsFutureForcedDependencies());const s=this.current,i=s.font;if(i.isType3Font){this.showType3Text(t,e),this.dependencyTracker?.recordShowTextOperation(t);return}const n=s.fontSize;if(n===0){this.dependencyTracker?.recordOperation(t);return}const r=this.ctx,a=s.fontSizeScale,o=s.charSpacing,l=s.wordSpacing,c=s.fontDirection,d=s.textHScale*c,u=e.length,f=i.vertical,g=f?1:-1,p=i.defaultVMetrics,m=n*s.fontMatrix[0],v=s.textRenderingMode===At.FILL&&!i.disableFontFace&&!s.patternFill;r.save(),s.textMatrix&&r.transform(...s.textMatrix),r.translate(s.x,s.y+s.textRise),c>0?r.scale(d,-1):r.scale(d,1);let y,b;const w=s.textRenderingMode&At.FILL_STROKE_MASK,A=w===At.FILL||w===At.FILL_STROKE,S=w===At.STROKE||w===At.FILL_STROKE;let E=s.lineWidth;const C=s.textMatrixScale;if(C===0||E===0?S&&(E=this.getSinglePixelWidth()):E/=C,a!==1&&(r.scale(a,a),E/=a),r.lineWidth=E,A&&s.patternFill){r.save();const T=s.fillColor.getPattern(r,this,$t(r),xt.FILL,t);y=ot(r),r.restore(),r.fillStyle=T}if(S&&s.patternStroke){r.save();const T=s.strokeColor.getPattern(r,this,$t(r),xt.STROKE,t);b=ot(r),r.restore(),r.strokeStyle=T}if(i.isInvalidPDFjsFont){const T=[];let k=0;for(const D of e)T.push(D.unicode),k+=D.width;const R=T.join("");if(r.fillText(R,0,0),this.dependencyTracker!==null){const D=r.measureText(R);this.dependencyTracker.recordBBox(t,this.ctx,-D.actualBoundingBoxLeft,D.actualBoundingBoxRight,-D.actualBoundingBoxAscent,D.actualBoundingBoxDescent).recordShowTextOperation(t)}s.x+=k*m*d,r.restore(),this.compose();return}let x=0,P;for(P=0;P<u;++P){const T=e[P];if(typeof T=="number"){x+=g*T*n/1e3;continue}let k=!1;const R=(T.isSpace?l:0)+o,D=T.fontChar,W=T.accent;let M,O,_=T.width;if(f){const et=T.vmetric||p,Q=-(T.vmetric?et[1]:_*.5)*m,G=et[2]*m;_=et?-et[0]:_,M=Q/a,O=(x+G)/a}else M=x/a,O=0;let j;if(i.remeasure&&_>0){j=r.measureText(D);const et=j.width*1e3/n*a;if(_<et&&this.isFontSubpixelAAEnabled){const Q=_/et;k=!0,r.save(),r.scale(Q,1),M/=Q}else _!==et&&(M+=(_-et)/2e3*n/a)}if(this.contentVisible&&(T.isInFont||i.missingFile)){if(v&&!W)r.fillText(D,M,O),this.dependencyTracker?.recordCharacterBBox(t,r,j?{bbox:null}:i,n/a,M,O,()=>j??r.measureText(D));else if(this.paintChar(t,D,M,O,y,b),W){const et=M+n*W.offset.x/a,Q=O-n*W.offset.y/a;this.paintChar(t,W.fontChar,et,Q,y,b)}}const tt=f?_*m-R*c:_*m+R*c;x+=tt,k&&r.restore()}f?s.y-=x:s.x+=x*d,r.restore(),this.compose(),this.dependencyTracker?.recordShowTextOperation(t)}showType3Text(t,e){const s=this.ctx,i=this.current,n=i.font,r=i.fontSize,a=i.fontDirection,o=n.vertical?1:-1,l=i.charSpacing,c=i.wordSpacing,d=i.textHScale*a,u=i.fontMatrix||Rs,f=e.length,g=i.textRenderingMode===At.INVISIBLE;let p,m,v,y;if(g||r===0)return;this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,s.save(),i.textMatrix&&s.transform(...i.textMatrix),s.translate(i.x,i.y+i.textRise),s.scale(d,a);const b=this.dependencyTracker;for(this.dependencyTracker=b?new ke(b,t):null,p=0;p<f;++p){if(m=e[p],typeof m=="number"){y=o*m*r/1e3,this.ctx.translate(y,0),i.x+=y*d;continue}const w=(m.isSpace?c:0)+l,A=n.charProcOperatorList[m.operatorListId];A?this.contentVisible&&(this.save(),s.scale(r,r),s.transform(...u),this.executeOperatorList(A),this.restore()):z(`Type3 character "${m.operatorListId}" is not available.`);const S=[m.width,0];F.applyTransform(S,u),v=S[0]*r+w,s.translate(v,0),i.x+=v*d}s.restore(),b&&(this.dependencyTracker=b)}setCharWidth(t,e,s){}setCharWidthAndBounds(t,e,s,i,n,r,a){const o=new Path2D;o.rect(i,n,r-i,a-n),this.ctx.clip(o),this.dependencyTracker?.recordBBox(t,this.ctx,i,r,n,a).recordClipBox(t,this.ctx,i,r,n,a),this.endPath(t)}getColorN_Pattern(t,e){let s;if(e[0]==="TilingPattern"){const i=this.baseTransform||ot(this.ctx),n={createCanvasGraphics:(r,a)=>new Ae(r,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack},void 0,void 0,this.dependencyTracker?new ke(this.dependencyTracker,a,!0):null)};s=new Me(e,this.ctx,n,i)}else s=this._getPattern(t,e[1],e[2]);return s}setStrokeColorN(t,...e){this.dependencyTracker?.recordSimpleData("strokeColor",t),this.current.strokeColor=this.getColorN_Pattern(t,e),this.current.patternStroke=!0}setFillColorN(t,...e){this.dependencyTracker?.recordSimpleData("fillColor",t);const s=this.current.fillColor=this.getColorN_Pattern(t,e);this.current.patternFill=!0,this.current.tilingPatternDims=s instanceof Me?[0,0,0,0]:null}setStrokeRGBColor(t,e){this.dependencyTracker?.recordSimpleData("strokeColor",t),this.ctx.strokeStyle=this.current.strokeColor=e,this.current.patternStroke=!1}setStrokeTransparent(t){this.dependencyTracker?.recordSimpleData("strokeColor",t),this.ctx.strokeStyle=this.current.strokeColor="transparent",this.current.patternStroke=!1}setFillRGBColor(t,e){this.dependencyTracker?.recordSimpleData("fillColor",t),this.ctx.fillStyle=this.current.fillColor=e,this.current.patternFill=!1,this.current.tilingPatternDims=null}setFillTransparent(t){this.dependencyTracker?.recordSimpleData("fillColor",t),this.ctx.fillStyle=this.current.fillColor="transparent",this.current.patternFill=!1,this.current.tilingPatternDims=null}_getPattern(t,e,s=null){let i;return this.cachedPatterns.has(e)?i=this.cachedPatterns.get(e):(i=br(this.getObject(t,e)),this.cachedPatterns.set(e,i)),s&&(i.matrix=s),i}shadingFill(t,e){if(!this.contentVisible)return;const s=this.ctx;this.save(t);const i=this._getPattern(t,e);s.fillStyle=i.getPattern(s,this,$t(s),xt.SHADING,t);const n=$t(s);if(n){const{width:r,height:a}=s.canvas,o=ne.slice();F.axialAlignedBoundingBox([0,0,r,a],n,o);const[l,c,d,u]=o;this.ctx.fillRect(l,c,d-l,u-c)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.dependencyTracker?.resetBBox(t).recordFullPageBBox(t).recordDependencies(t,Lt.transform).recordDependencies(t,Lt.fill).recordOperation(t),this.compose(this.current.getClippedPathBoundingBox()),this.restore(t)}beginInlineImage(){nt("Should not call beginInlineImage")}beginImageData(){nt("Should not call beginImageData")}paintFormXObjectBegin(t,e,s){if(this.contentVisible&&(this.save(t),this.baseTransformStack.push(this.baseTransform),e&&this.transform(t,...e),this.baseTransform=ot(this.ctx),s)){F.axialAlignedBoundingBox(s,this.baseTransform,this.current.minMax);const[i,n,r,a]=s,o=new Path2D;o.rect(i,n,r-i,a-n),this.ctx.clip(o),this.dependencyTracker?.recordClipBox(t,this.ctx,i,r,n,a),this.endPath(t)}}paintFormXObjectEnd(t){this.contentVisible&&(this.restore(t),this.baseTransform=this.baseTransformStack.pop())}beginGroup(t,e){if(!this.contentVisible)return;this.save(t);const{inSMaskMode:s}=this;s&&(this.endSMaskMode(),this.current.activeSMask=null);const i=this.ctx;if(e.isolated||hs("TODO: Support non-isolated groups."),e.knockout&&z("Knockout groups not supported."),!e.needsIsolation&&i.globalAlpha===1&&i.globalCompositeOperation==="source-over"&&!s){if(e.bbox){let g=new Path2D;const[p,m,v,y]=e.bbox;if(g.rect(p,m,v-p,y-m),e.matrix){const b=new Path2D;b.addPath(g,new DOMMatrix(e.matrix)),g=b}i.clip(g)}this.groupStack.push(null),this.groupLevel++;return}const n=ot(i);e.matrix&&i.transform(...e.matrix);const r=[0,0,i.canvas.width,i.canvas.height];let a;e.bbox?(a=ne.slice(),F.axialAlignedBoundingBox(e.bbox,ot(i),a),a=F.intersect(a,r)||[0,0,0,0]):a=r;const o=Math.floor(a[0]),l=Math.floor(a[1]),c=Math.max(Math.ceil(a[2])-o,1),d=Math.max(Math.ceil(a[3])-l,1);this.current.startNewPathAndClipBox([0,0,c,d]);const u=this.canvasFactory.create(c,d);e.smask&&this.smaskGroupCanvases.push(u);const f=u.context;if(f.translate(-o,-l),f.transform(...n),!e.isolated&&!e.smask&&s&&e.needsIsolation&&(f.save(),f.setTransform(1,0,0,1,0,0),f.drawImage(i.canvas,-o,-l),f.restore()),e.bbox){let g=new Path2D;const[p,m,v,y]=e.bbox;if(g.rect(p,m,v-p,y-m),e.matrix){const b=new Path2D;b.addPath(g,new DOMMatrix(e.matrix)),g=b}f.clip(g)}e.smask&&this.smaskStack.push({canvas:u.canvas,context:f,offsetX:o,offsetY:l,subtype:e.smask.subtype,backdrop:e.smask.backdrop,transferMap:e.smask.transferMap||null}),(!e.smask||this.dependencyTracker)&&(i.setTransform(1,0,0,1,0,0),i.translate(o,l),i.save()),xe(i,f),this.ctx=f,this.dependencyTracker?.inheritSimpleDataAsFutureForcedDependencies(["fillAlpha","strokeAlpha","globalCompositeOperation"]).pushBaseTransform(i),this.setGState(t,[["BM","source-over"],["ca",1],["CA",1],["TR",null]]),this.groupStack.push(i),this.groupLevel++}endGroup(t,e){if(!this.contentVisible)return;this.groupLevel--;const s=this.ctx,i=this.groupStack.pop();if(i===null){this.restore(t);return}if(this.ctx=i,this.ctx.imageSmoothingEnabled=!1,this.dependencyTracker?.popBaseTransform(),e.smask)this.tempSMask=this.smaskStack.pop(),this.restore(t),this.dependencyTracker&&(this.ctx.restore(),this.inSMaskMode&&this.ctx.setTransform(this.suspendedCtx.getTransform()));else{this.ctx.restore();const n=ot(this.ctx);this.restore(t),this.ctx.save(),this.ctx.setTransform(...n);const r=ne.slice();F.axialAlignedBoundingBox([0,0,s.canvas.width,s.canvas.height],n,r),this.ctx.drawImage(s.canvas,0,0),this.ctx.restore(),this.canvasFactory.destroy({canvas:s.canvas,context:s}),this.compose(r)}}beginAnnotation(t,e,s,i,n,r){if(this.#t(),Ye(this.ctx),this.ctx.save(),this.save(t),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),s){const a=s[2]-s[0],o=s[3]-s[1];if(r&&this.annotationCanvasMap){i=i.slice(),i[4]-=s[0],i[5]-=s[1],s=s.slice(),s[0]=s[1]=0,s[2]=a,s[3]=o,F.singularValueDecompose2dScale(ot(this.ctx),Dt);const{viewportScale:l}=this,c=Math.ceil(a*this.outputScaleX*l),d=Math.ceil(o*this.outputScaleY*l);this.annotationCanvas=this.canvasFactory.create(c,d);const{canvas:u,context:f}=this.annotationCanvas;this.annotationCanvasMap.set(e,u),this.annotationCanvas.savedCtx=this.ctx,this.ctx=f,this.ctx.save(),this.ctx.setTransform(Dt[0],0,0,-Dt[1],0,o*Dt[1]),Ye(this.ctx)}else{Ye(this.ctx),this.endPath(t);const l=new Path2D;l.rect(s[0],s[1],a,o),this.ctx.clip(l)}}this.current=new Ii(this.ctx.canvas.width,this.ctx.canvas.height),this.baseTransformStack.push(this.baseTransform),this.transform(t,...i),this.transform(t,...n),this.baseTransform=ot(this.ctx)}endAnnotation(t){this.annotationCanvas&&(this.ctx.restore(),this.#e(),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas),this.baseTransform=this.baseTransformStack.pop()}paintImageMaskXObject(t,e){if(!this.contentVisible)return;const s=e.count;e=this.getObject(t,e.data,e),e.count=s;const i=this.ctx,n=this._createMaskCanvas(t,e),r=n.canvas;i.save(),i.setTransform(1,0,0,1,0,0),i.drawImage(r,n.offsetX,n.offsetY),this.dependencyTracker?.resetBBox(t).recordBBox(t,this.ctx,n.offsetX,n.offsetX+r.width,n.offsetY,n.offsetY+r.height).recordOperation(t),i.restore(),n.canvasEntry&&this.canvasFactory.destroy(n.canvasEntry),this.compose()}paintImageMaskXObjectRepeat(t,e,s,i=0,n=0,r,a){if(!this.contentVisible)return;e=this.getObject(t,e.data,e);const o=this.ctx;o.save();const l=ot(o);o.transform(s,i,n,r,0,0);const c=this._createMaskCanvas(t,e);o.setTransform(1,0,0,1,c.offsetX-l[4],c.offsetY-l[5]),this.dependencyTracker?.resetBBox(t);for(let d=0,u=a.length;d<u;d+=2){const f=F.transform(l,[s,i,n,r,a[d],a[d+1]]);o.drawImage(c.canvas,f[4],f[5]),this.dependencyTracker?.recordBBox(t,this.ctx,f[4],f[4]+c.canvas.width,f[5],f[5]+c.canvas.height)}o.restore(),c.canvasEntry&&this.canvasFactory.destroy(c.canvasEntry),this.compose(),this.dependencyTracker?.recordOperation(t)}paintImageMaskXObjectGroup(t,e){if(!this.contentVisible)return;const s=this.ctx,i=this.current.fillColor,n=this.current.patternFill;this.dependencyTracker?.resetBBox(t).recordDependencies(t,Lt.transformAndFill);for(const r of e){const{data:a,width:o,height:l,transform:c}=r,d=this.canvasFactory.create(o,l),u=d.context;u.save();const f=this.getObject(t,a,r);Oi(u,f),u.globalCompositeOperation="source-in",u.fillStyle=n?i.getPattern(u,this,$t(s),xt.FILL,t):i,u.fillRect(0,0,o,l),u.restore(),s.save(),s.transform(...c),s.scale(1,-1),Xe(s,d.canvas,0,0,o,l,0,-1,1,1),this.canvasFactory.destroy(d),this.dependencyTracker?.recordBBox(t,s,0,o,0,l),s.restore()}this.compose(),this.dependencyTracker?.recordOperation(t)}paintImageXObject(t,e){if(!this.contentVisible)return;const s=this.getObject(t,e);if(!s){z("Dependent image isn't ready yet");return}this.paintInlineImageXObject(t,s)}paintImageXObjectRepeat(t,e,s,i,n){if(!this.contentVisible)return;const r=this.getObject(t,e);if(!r){z("Dependent image isn't ready yet");return}const a=r.width,o=r.height,l=[];for(let c=0,d=n.length;c<d;c+=2)l.push({transform:[s,0,0,i,n[c],n[c+1]],x:0,y:0,w:a,h:o});this.paintInlineImageXObjectGroup(t,r,l)}applyTransferMapsToCanvas(t){return this.current.transferMaps!=="none"&&(t.filter=this.current.transferMaps,t.drawImage(t.canvas,0,0),t.filter="none"),t.canvas}applyTransferMapsToBitmap(t){if(this.current.transferMaps==="none")return{img:t.bitmap,canvasEntry:null};const{bitmap:e,width:s,height:i}=t,n=this.canvasFactory.create(s,i),r=n.context;return r.filter=this.current.transferMaps,r.drawImage(e,0,0),r.filter="none",{img:n.canvas,canvasEntry:n}}paintInlineImageXObject(t,e){if(!this.contentVisible)return;const s=e.width,i=e.height,n=this.ctx;this.save(t);const{filter:r}=n;r!=="none"&&r!==""&&(n.filter="none"),n.scale(1/s,-1/i);let a,o=null;if(e.bitmap){const c=this.applyTransferMapsToBitmap(e);a=c.img,o=c.canvasEntry}else if(typeof HTMLElement=="function"&&e instanceof HTMLElement||!e.data)a=e;else{const c=this.canvasFactory.create(s,i);Ri(c.context,e),a=this.applyTransferMapsToCanvas(c.context),o=c}const l=this._scaleImage(a,$t(n));n.imageSmoothingEnabled=Mi(ot(n),e.interpolate),this.dependencyTracker&&(this.dependencyTracker.resetBBox(t).recordBBox(t,n,0,s,-i,0).recordDependencies(t,Lt.imageXObject).recordOperation(t),this.imagesTracker?.record(n,s,i,this.dependencyTracker.clipBox)),Xe(n,l.img,0,0,l.paintWidth,l.paintHeight,0,-i,s,i),l.tmpCanvas&&this.canvasFactory.destroy(l.tmpCanvas),o&&this.canvasFactory.destroy(o),this.compose(),this.restore(t)}paintInlineImageXObjectGroup(t,e,s){if(!this.contentVisible)return;const i=this.ctx;let n,r=null;if(e.bitmap)n=e.bitmap;else{const a=e.width,o=e.height,l=this.canvasFactory.create(a,o);Ri(l.context,e),n=this.applyTransferMapsToCanvas(l.context),r=l}this.dependencyTracker?.resetBBox(t);for(const a of s)i.save(),i.transform(...a.transform),i.scale(1,-1),Xe(i,n,a.x,a.y,a.w,a.h,0,-1,1,1),this.dependencyTracker?.recordBBox(t,i,0,1,-1,0),i.restore();r&&this.canvasFactory.destroy(r),this.dependencyTracker?.recordOperation(t),this.compose()}paintSolidColorImageMask(t){this.contentVisible&&(this.dependencyTracker?.resetBBox(t).recordBBox(t,this.ctx,0,1,0,1).recordDependencies(t,Lt.fill).recordOperation(t),this.ctx.fillRect(0,0,1,1),this.compose())}markPoint(t,e){}markPointProps(t,e,s){}beginMarkedContent(t,e){this.dependencyTracker?.beginMarkedContent(t),this.markedContentStack.push({visible:!0})}beginMarkedContentProps(t,e,s){this.dependencyTracker?.beginMarkedContent(t),e==="OC"?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(s)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(t){this.dependencyTracker?.endMarkedContent(t),this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(t){}endCompat(t){}consumePath(t,e,s){const i=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(s);const n=this.ctx;this.pendingClip?(i||(this.pendingClip===Di?n.clip(e,"evenodd"):n.clip(e)),this.pendingClip=null,this.dependencyTracker?.bboxToClipBoxDropOperation(t).recordFutureForcedDependency("clipPath",t)):this.dependencyTracker?.recordOperation(t),this.current.startNewPathAndClipBox(this.current.clipBox)}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){const t=ot(this.ctx);if(t[1]===0&&t[2]===0)this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(t[0]),Math.abs(t[3]));else{const e=Math.abs(t[0]*t[3]-t[2]*t[1]),s=Math.hypot(t[0],t[2]),i=Math.hypot(t[1],t[3]);this._cachedGetSinglePixelWidth=Math.max(s,i)/e}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(this._cachedScaleForStroking[0]===-1){const{lineWidth:t}=this.current,{a:e,b:s,c:i,d:n}=this.ctx.getTransform();let r,a;if(s===0&&i===0){const o=Math.abs(e),l=Math.abs(n);if(o===l)if(t===0)r=a=1/o;else{const c=o*t;r=a=c<1?1/c:1}else if(t===0)r=1/o,a=1/l;else{const c=o*t,d=l*t;r=c<1?1/c:1,a=d<1?1/d:1}}else{const o=Math.abs(e*n-s*i),l=Math.hypot(e,s),c=Math.hypot(i,n);if(t===0)r=c/o,a=l/o;else{const d=t*o;r=c>d?c/d:1,a=l>d?l/d:1}}this._cachedScaleForStroking[0]=r,this._cachedScaleForStroking[1]=a}return this._cachedScaleForStroking}rescaleAndStroke(t,e){const{ctx:s,current:{lineWidth:i}}=this,[n,r]=this.getScaleForStroking();if(n===r){s.lineWidth=(i||1)*n,s.stroke(t);return}const a=s.getLineDash();e&&s.save(),s.scale(n,r),Cs.a=1/n,Cs.d=1/r;const o=new Path2D;if(o.addPath(t,Cs),a.length>0){const l=Math.max(n,r);s.setLineDash(a.map(c=>c/l)),s.lineDashOffset/=l}s.lineWidth=i||1,s.stroke(o),e&&s.restore()}isContentVisible(){for(let t=this.markedContentStack.length-1;t>=0;t--)if(!this.markedContentStack[t].visible)return!1;return!0}}for(const h in Kt)Ae.prototype[h]!==void 0&&(Ae.prototype[Kt[h]]=Ae.prototype[h]);class ps{#t=null;#e=null;_fullReader=null;_rangeReaders=new Set;_source=null;constructor(t,e,s){this._source=t,this.#t=e,this.#e=s}get _progressiveDataLength(){return this._fullReader?._loaded??0}getFullReader(){return dt(!this._fullReader,"BasePDFStream.getFullReader can only be called once."),this._fullReader=new this.#t(this)}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const s=new this.#e(this,t,e);return this._rangeReaders.add(s),s}cancelAllRequests(t){this._fullReader?.cancel(t);for(const e of new Set(this._rangeReaders))e.cancel(t)}}class gs{onProgress=null;_contentLength=0;_filename=null;_headersCapability=Promise.withResolvers();_isRangeSupported=!1;_isStreamingSupported=!1;_loaded=0;_stream=null;constructor(t){this._stream=t}_callOnProgress(){this.onProgress?.({loaded:this._loaded,total:this._contentLength})}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){nt("Abstract method `read` called")}cancel(t){nt("Abstract method `cancel` called")}}class ms{_stream=null;constructor(t,e,s){this._stream=t}async read(){nt("Abstract method `read` called")}cancel(t){nt("Abstract method `cancel` called")}}function Cr(h){let t=!0,e=s("filename\\*","i").exec(h);if(e){e=e[1];let c=a(e);return c=unescape(c),c=o(c),c=l(c),n(c)}if(e=r(h),e){const c=l(e);return n(c)}if(e=s("filename","i").exec(h),e){e=e[1];let c=a(e);return c=l(c),n(c)}function s(c,d){return new RegExp("(?:^|;)\\s*"+c+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',d)}function i(c,d){if(c){if(!/^[\x00-\xFF]+$/.test(d))return d;try{const u=new TextDecoder(c,{fatal:!0}),f=cs(d);d=u.decode(f),t=!1}catch{}}return d}function n(c){return t&&/[\x80-\xff]/.test(c)&&(c=i("utf-8",c),t&&(c=i("iso-8859-1",c))),c}function r(c){const d=[];let u;const f=s("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;(u=f.exec(c))!==null;){let[,p,m,v]=u;if(p=parseInt(p,10),p in d){if(p===0)break;continue}d[p]=[m,v]}const g=[];for(let p=0;p<d.length&&p in d;++p){let[m,v]=d[p];v=a(v),m&&(v=unescape(v),p===0&&(v=o(v))),g.push(v)}return g.join("")}function a(c){if(c.startsWith('"')){const d=c.slice(1).split('\\"');for(let u=0;u<d.length;++u){const f=d[u].indexOf('"');f!==-1&&(d[u]=d[u].slice(0,f),d.length=u+1),d[u]=d[u].replaceAll(/\\(.)/g,"$1")}c=d.join('"')}return c}function o(c){const d=c.indexOf("'");if(d===-1)return c;const u=c.slice(0,d),g=c.slice(d+1).replace(/^[^']*'/,"");return i(u,g)}function l(c){return!c.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(c)?c:c.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,function(d,u,f,g){if(f==="q"||f==="Q")return g=g.replaceAll("_"," "),g=g.replaceAll(/=([0-9a-fA-F]{2})/g,function(p,m){return String.fromCharCode(parseInt(m,16))}),i(u,g);try{g=atob(g)}catch{}return i(u,g)})}return""}function Ji(h,t){const e=new Headers;if(!h||!t||typeof t!="object")return e;for(const s in t){const i=t[s];i!==void 0&&e.append(s,i)}return e}function vs(h){return URL.parse(h)?.origin??null}function Qi({responseHeaders:h,isHttp:t,rangeChunkSize:e,disableRange:s}){const i={contentLength:0,isRangeSupported:!1},n=parseInt(h.get("Content-Length"),10);return!Number.isInteger(n)||(i.contentLength=n,n<=2*e)||s||!t||h.get("Accept-Ranges")!=="bytes"||(h.get("Content-Encoding")||"identity")==="identity"&&(i.isRangeSupported=!0),i}function Zi(h){const t=h.get("Content-Disposition");if(t){let e=Cr(t);if(e.includes("%"))try{e=decodeURIComponent(e)}catch{}if(Xs(e))return e}return null}function ys(h,t){return new ss(`Unexpected server response (${h}) while retrieving PDF "${t.href}".`,h,h===404||h===0&&t.protocol==="file:")}function qi(h,t){if(h!==t)throw new Error(`Expected range response-origin "${h}" to match "${t}".`)}function tn(h,t,e,s){return fetch(h,{method:"GET",headers:t,signal:s.signal,mode:"cors",credentials:e?"include":"same-origin",redirect:"follow"})}function en(h,t){if(h!==200&&h!==206)throw ys(h,t)}function bs(h){if(h instanceof Uint8Array)return h.buffer;if(h instanceof ArrayBuffer)return h;throw new Error(`getArrayBuffer - unexpected data: ${h}`)}class Pr extends ps{_responseOrigin=null;constructor(t){super(t,Ir,Rr);const{httpHeaders:e,url:s}=t;dt(/https?:/.test(s.protocol),"PDFFetchStream only supports http(s):// URLs."),this.headers=Ji(!0,e)}}class Ir extends gs{_abortController=new AbortController;_reader=null;constructor(t){super(t);const{disableRange:e,disableStream:s,rangeChunkSize:i,url:n,withCredentials:r}=t._source;this._isStreamingSupported=!s;const a=new Headers(t.headers);tn(n,a,r,this._abortController).then(o=>{t._responseOrigin=vs(o.url),en(o.status,n),this._reader=o.body.getReader();const l=o.headers,{contentLength:c,isRangeSupported:d}=Qi({responseHeaders:l,isHttp:!0,rangeChunkSize:i,disableRange:e});this._contentLength=c,this._isRangeSupported=d,this._filename=Zi(l),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new te("Streaming is disabled.")),this._headersCapability.resolve()}).catch(this._headersCapability.reject)}async read(){await this._headersCapability.promise;const{value:t,done:e}=await this._reader.read();return e?{value:t,done:e}:(this._loaded+=t.byteLength,this._callOnProgress(),{value:bs(t),done:!1})}cancel(t){this._reader?.cancel(t),this._abortController.abort()}}class Rr extends ms{_abortController=new AbortController;_readCapability=Promise.withResolvers();_reader=null;constructor(t,e,s){super(t,e,s);const{url:i,withCredentials:n}=t._source,r=new Headers(t.headers);r.append("Range",`bytes=${e}-${s-1}`),tn(i,r,n,this._abortController).then(a=>{const o=vs(a.url);qi(o,t._responseOrigin),en(a.status,i),this._reader=a.body.getReader(),this._readCapability.resolve()}).catch(this._readCapability.reject)}async read(){await this._readCapability.promise;const{value:t,done:e}=await this._reader.read();return e?{value:t,done:e}:{value:bs(t),done:!1}}cancel(t){this._reader?.cancel(t),this._abortController.abort()}}V(116);function Fi(h){return h instanceof Uint8Array&&h.byteLength===h.buffer.byteLength?h.buffer:new Uint8Array(h).buffer}function As(){for(const h of this._requests)h.resolve({value:void 0,done:!0});this._requests.length=0}class Or extends ps{_progressiveDone=!1;_queuedChunks=[];constructor(t){super(t,Mr,Dr);const{pdfDataRangeTransport:e}=t,{initialData:s,progressiveDone:i}=e;if(s?.length>0){const r=Fi(s);this._queuedChunks.push(r)}this._progressiveDone=i;const n=r=>{switch(r.type){case"range":case"progressiveRead":this.#t(r.begin,r.chunk);break;case"progressiveDone":this._fullReader?.progressiveDone(),this._progressiveDone=!0;break}};e.transportReady(n)}#t(t,e){const s=Fi(e);if(t===void 0)this._fullReader?this._fullReader._enqueue(s):this._queuedChunks.push(s);else{const i=this._rangeReaders.keys().find(n=>n._begin===t);dt(i,"#onReceiveData - no `PDFDataTransportStreamRangeReader` instance found."),i._enqueue(s)}}getFullReader(){const t=super.getFullReader();return this._queuedChunks=null,t}getRangeReader(t,e){const s=super.getRangeReader(t,e);return s&&(s.onDone=()=>this._rangeReaders.delete(s),this._source.pdfDataRangeTransport.requestDataRange(t,e)),s}cancelAllRequests(t){super.cancelAllRequests(t),this._source.pdfDataRangeTransport.abort()}}class Mr extends gs{#t=As.bind(this);_done=!1;_queuedChunks=null;_requests=[];constructor(t){super(t);const{pdfDataRangeTransport:e,disableRange:s,disableStream:i}=t._source,{length:n,contentDispositionFilename:r}=e;this._queuedChunks=t._queuedChunks||[];for(const o of this._queuedChunks)this._loaded+=o.byteLength;this._done=t._progressiveDone,this._contentLength=n,this._isStreamingSupported=!i,this._isRangeSupported=!s,Xs(r)&&(this._filename=r),this._headersCapability.resolve();const a=this._loaded;Promise.resolve().then(()=>{a>0&&this._loaded===a&&this._callOnProgress()})}_enqueue(t){this._done||(this._requests.length>0?this._requests.shift().resolve({value:t,done:!1}):this._queuedChunks.push(t),this._loaded+=t.byteLength,this._callOnProgress())}async read(){if(this._queuedChunks.length>0)return{value:this._queuedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0,this.#t()}progressiveDone(){this._done||=!0,this._queuedChunks.length===0&&this.#t()}}class Dr extends ms{#t=As.bind(this);onDone=null;_begin=-1;_done=!1;_queuedChunk=null;_requests=[];constructor(t,e,s){super(t,e,s),this._begin=e}_enqueue(t){this._done||(this._requests.length===0?this._queuedChunk=t:(this._requests.shift().resolve({value:t,done:!1}),this.#t()),this._done=!0,this.onDone?.())}async read(){if(this._queuedChunk){const e=this._queuedChunk;return this._queuedChunk=null,{value:e,done:!1}}if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0,this.#t(),this.onDone?.()}}const Ps=200,Li=206;function Fr(h){return typeof h!="string"?h:cs(h).buffer}class Lr extends ps{#t=new WeakMap;_responseOrigin=null;constructor(t){super(t,Nr,kr);const{httpHeaders:e,url:s}=t;this.url=s,this.isHttp=/https?:/.test(s.protocol),this.headers=Ji(this.isHttp,e)}_request(t){const e=new XMLHttpRequest,s={validateStatus:null,onHeadersReceived:t.onHeadersReceived,onDone:t.onDone,onError:t.onError,onProgress:t.onProgress};this.#t.set(e,s),e.open("GET",this.url),e.withCredentials=this._source.withCredentials;for(const[i,n]of this.headers)e.setRequestHeader(i,n);return this.isHttp&&"begin"in t&&"end"in t?(e.setRequestHeader("Range",`bytes=${t.begin}-${t.end-1}`),s.validateStatus=i=>i===Li||i===Ps):s.validateStatus=i=>i===Ps,e.responseType="arraybuffer",dt(t.onError,"Expected `onError` callback to be provided."),e.onerror=()=>t.onError(e.status),e.onreadystatechange=this.#s.bind(this,e),e.onprogress=this.#e.bind(this,e),e.send(null),e}#e(t,e){this.#t.get(t)?.onProgress?.(e)}#s(t,e){const s=this.#t.get(t);if(!s||(t.readyState>=2&&s.onHeadersReceived&&(s.onHeadersReceived(),delete s.onHeadersReceived),t.readyState!==4)||!this.#t.has(t))return;if(this.#t.delete(t),t.status===0&&this.isHttp){s.onError(t.status);return}const i=t.status||Ps;if(!s.validateStatus(i)){s.onError(t.status);return}const n=Fr(t.response);if(i===Li){const r=t.getResponseHeader("Content-Range");/bytes (\d+)-(\d+)\/(\d+)/.test(r)?s.onDone(n):(z('Missing or invalid "Content-Range" header.'),s.onError(0))}else n?s.onDone(n):s.onError(t.status)}_abortRequest(t){this.#t.has(t)&&(this.#t.delete(t),t.abort())}getRangeReader(t,e){const s=super.getRangeReader(t,e);return s&&(s.onClosed=()=>this._rangeReaders.delete(s)),s}}class Nr extends gs{#t=As.bind(this);_cachedChunks=[];_done=!1;_requests=[];_storedError=null;constructor(t){super(t),this._fullRequestXhr=t._request({onHeadersReceived:this.#e.bind(this),onDone:this.#s.bind(this),onError:this.#i.bind(this),onProgress:this.#n.bind(this)})}#e(){const t=this._stream,{disableRange:e,rangeChunkSize:s}=t._source,i=this._fullRequestXhr;t._responseOrigin=vs(i.responseURL);const n=i.getAllResponseHeaders(),r=new Headers(n?n.trimStart().replace(/[^\S ]+$/,"").split(/[\r\n]+/).map(l=>{const[c,...d]=l.split(": ");return[c,d.join(": ")]}):[]),{contentLength:a,isRangeSupported:o}=Qi({responseHeaders:r,isHttp:t.isHttp,rangeChunkSize:s,disableRange:e});this._contentLength=a,this._isRangeSupported=o,this._filename=Zi(r),this._isRangeSupported&&t._abortRequest(i),this._headersCapability.resolve()}#s(t){this._requests.length>0?this._requests.shift().resolve({value:t,done:!1}):this._cachedChunks.push(t),this._done=!0,this._cachedChunks.length===0&&this.#t()}#i(t){this._storedError=ys(t,this._stream.url),this._headersCapability.reject(this._storedError);for(const e of this._requests)e.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}#n(t){this.onProgress?.({loaded:t.loaded,total:t.lengthComputable?t.total:this._contentLength})}async read(){if(await this._headersCapability.promise,this._storedError)throw this._storedError;if(this._cachedChunks.length>0)return{value:this._cachedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0,this._headersCapability.reject(t),this.#t(),this._stream._abortRequest(this._fullRequestXhr),this._fullRequestXhr=null}}class kr extends ms{#t=As.bind(this);onClosed=null;_done=!1;_queuedChunk=null;_requests=[];_storedError=null;constructor(t,e,s){super(t,e,s),this._requestXhr=t._request({begin:e,end:s,onHeadersReceived:this.#e.bind(this),onDone:this.#s.bind(this),onError:this.#i.bind(this),onProgress:null})}#e(){const t=vs(this._requestXhr?.responseURL);try{qi(t,this._stream._responseOrigin)}catch(e){this._storedError=e,this.#i(0)}}#s(t){this._requests.length>0?this._requests.shift().resolve({value:t,done:!1}):this._queuedChunk=t,this._done=!0,this.#t(),this.onClosed?.()}#i(t){this._storedError??=ys(t,this._stream.url);for(const e of this._requests)e.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}async read(){if(this._storedError)throw this._storedError;if(this._queuedChunk!==null){const e=this._queuedChunk;return this._queuedChunk=null,{value:e,done:!1}}if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0,this.#t(),this._stream._abortRequest(this._requestXhr),this.onClosed?.()}}function sn(h,t=null){const e=process.getBuiltinModule("fs"),{Readable:s}=process.getBuiltinModule("stream"),i=e.createReadStream(h,t);return s.toWeb(i)}class Br extends ps{constructor(t){super(t,_r,Ur);const{url:e}=t;dt(e.protocol==="file:","PDFNodeStream only supports file:// URLs.")}}class _r extends gs{_reader=null;constructor(t){super(t);const{disableRange:e,disableStream:s,rangeChunkSize:i,url:n}=t._source;this._isStreamingSupported=!s,process.getBuiltinModule("fs/promises").lstat(n).then(a=>{const o=sn(n);this._reader=o.getReader();const{size:l}=a;this._contentLength=l,this._isRangeSupported=!e&&l>2*i,!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new te("Streaming is disabled.")),this._headersCapability.resolve()}).catch(a=>{a.code==="ENOENT"&&(a=ys(0,n)),this._headersCapability.reject(a)})}async read(){await this._headersCapability.promise;const{value:t,done:e}=await this._reader.read();return e?{value:t,done:e}:(this._loaded+=t.byteLength,this._callOnProgress(),{value:bs(t),done:!1})}cancel(t){this._reader?.cancel(t)}}class Ur extends ms{_readCapability=Promise.withResolvers();_reader=null;constructor(t,e,s){super(t,e,s);const{url:i}=t._source;try{const n=sn(i,{start:e,end:s-1});this._reader=n.getReader(),this._readCapability.resolve()}catch(n){this._readCapability.reject(n)}}async read(){await this._readCapability.promise;const{value:t,done:e}=await this._reader.read();return e?{value:t,done:e}:{value:bs(t),done:!1}}cancel(t){this._reader?.cancel(t)}}function Hr(h){return Re(h)?Pr:Mt?Br:Lr}class De{static#t=null;static#e="";static get workerPort(){return this.#t}static set workerPort(t){if(!(typeof Worker<"u"&&t instanceof Worker)&&t!==null)throw new Error("Invalid `workerPort` type.");this.#t=t}static get workerSrc(){return this.#e}static set workerSrc(t){if(typeof t!="string")throw new Error("Invalid `workerSrc` type.");this.#e=t}}class $r{#t;#e;constructor({parsedData:t,rawData:e}){this.#t=t,this.#e=e}getRaw(){return this.#e}get(t){return this.#t.get(t)??null}[Symbol.iterator](){return this.#t.entries()}}const ge=Symbol("INTERNAL");class jr{#t=!1;#e=!1;#s=!1;#i=!0;constructor(t,{name:e,intent:s,usage:i,rbGroups:n}){this.#t=!!(t&Rt.DISPLAY),this.#e=!!(t&Rt.PRINT),this.name=e,this.intent=s,this.usage=i,this.rbGroups=n}get visible(){if(this.#s)return this.#i;if(!this.#i)return!1;const{print:t,view:e}=this.usage;return this.#t?e?.viewState!=="OFF":this.#e?t?.printState!=="OFF":!0}_setVisible(t,e,s=!1){t!==ge&&nt("Internal method `_setVisible` called."),this.#s=s,this.#i=e}}class Gr{#t=null;#e=new Map;#s=null;#i=null;constructor(t,e=Rt.DISPLAY){if(this.renderingIntent=e,this.name=null,this.creator=null,t!==null){this.name=t.name,this.creator=t.creator,this.#i=t.order;for(const s of t.groups)this.#e.set(s.id,new jr(e,s));if(t.baseState==="OFF")for(const s of this.#e.values())s._setVisible(ge,!1);for(const s of t.on)this.#e.get(s)._setVisible(ge,!0);for(const s of t.off)this.#e.get(s)._setVisible(ge,!1);this.#s=this.getHash()}}#n(t){const e=t.length;if(e<2)return!0;const s=t[0];for(let i=1;i<e;i++){const n=t[i];let r;if(Array.isArray(n))r=this.#n(n);else if(this.#e.has(n))r=this.#e.get(n).visible;else return z(`Optional content group not found: ${n}`),!0;switch(s){case"And":if(!r)return!1;break;case"Or":if(r)return!0;break;case"Not":return!r;default:return!0}}return s==="And"}isVisible(t){if(this.#e.size===0)return!0;if(!t)return hs("Optional content group not defined."),!0;if(t.type==="OCG")return this.#e.has(t.id)?this.#e.get(t.id).visible:(z(`Optional content group not found: ${t.id}`),!0);if(t.type==="OCMD"){if(t.expression)return this.#n(t.expression);if(!t.policy||t.policy==="AnyOn"){for(const e of t.ids){if(!this.#e.has(e))return z(`Optional content group not found: ${e}`),!0;if(this.#e.get(e).visible)return!0}return!1}else if(t.policy==="AllOn"){for(const e of t.ids){if(!this.#e.has(e))return z(`Optional content group not found: ${e}`),!0;if(!this.#e.get(e).visible)return!1}return!0}else if(t.policy==="AnyOff"){for(const e of t.ids){if(!this.#e.has(e))return z(`Optional content group not found: ${e}`),!0;if(!this.#e.get(e).visible)return!0}return!1}else if(t.policy==="AllOff"){for(const e of t.ids){if(!this.#e.has(e))return z(`Optional content group not found: ${e}`),!0;if(this.#e.get(e).visible)return!1}return!0}return z(`Unknown optional content policy ${t.policy}.`),!0}return z(`Unknown group type ${t.type}.`),!0}setVisibility(t,e=!0,s=!0){const i=this.#e.get(t);if(!i){z(`Optional content group not found: ${t}`);return}if(s&&e&&i.rbGroups.length)for(const n of i.rbGroups)for(const r of n)r!==t&&this.#e.get(r)?._setVisible(ge,!1,!0);i._setVisible(ge,!!e,!0),this.#t=null}setOCGState({state:t,preserveRB:e}){let s;for(const i of t){switch(i){case"ON":case"OFF":case"Toggle":s=i;continue}const n=this.#e.get(i);if(n)switch(s){case"ON":this.setVisibility(i,!0,e);break;case"OFF":this.setVisibility(i,!1,e);break;case"Toggle":this.setVisibility(i,!n.visible,e);break}}this.#t=null}get hasInitialVisibility(){return this.#s===null||this.getHash()===this.#s}getOrder(){return this.#e.size?this.#i?this.#i.slice():[...this.#e.keys()]:null}getGroup(t){return this.#e.get(t)||null}getHash(){if(this.#t!==null)return this.#t;const t=new ks;for(const[e,s]of this.#e)t.update(`${e}:${s.visible}`);return this.#t=t.hexdigest()}[Symbol.iterator](){return this.#e.entries()}}class zr{#t=null;#e=null;#s=0;#i=null;#n=null;get pagesNumber(){return this.#s}set pagesNumber(t){this.#s!==t&&(this.#s=t,this.#t=null,this.#e=null)}#r(){if(this.#t)return;const t=this.#s,e=this.#t=new Uint32Array(t);for(let s=0;s<t;s++)e[s]=s+1;this.#e=new Int32Array(e)}#a(){const t=new Map,e=this.#t;for(let s=0,i=this.#s;s<i;s++){const n=e[s],r=t.get(n);r?r.push(s+1):t.set(n,[s+1])}return t}movePages(t,e,s){this.#r();const i=this.#t,n=this.#a(),r=e.length,a=new Uint32Array(r);let o=0;for(let u=0;u<r;u++){const f=e[u]-1;a[u]=i[f],f<s&&o++}const l=this.#s,c=l-r,d=ht(s-o,0,c);for(let u=0,f=0;u<l;u++)t.has(u+1)||(i[f++]=i[u]);i.copyWithin(d+r,d,c),i.set(a,d),this.#o(n),i.every((u,f)=>u===f+1)&&(this.#t=null)}deletePages(t){this.#r();const e=this.#t,s=this.#a();this.#n={pageNumberToId:e.slice(),pagesNumber:this.#s,prevPageNumbers:this.#e.slice()};const i=this.#s-t.length;this.#s=i;const n=this.#t=new Uint32Array(i);this.#e=new Int32Array(i);let r=0,a=0;for(const o of t){const l=o-1;l!==r&&(n.set(e.subarray(r,l),a),a+=l-r),r=l+1}r<e.length&&n.set(e.subarray(r),a),this.#o(s,new Set(t))}cancelDelete(){this.#n&&(this.#t=this.#n.pageNumberToId,this.#s=this.#n.pagesNumber,this.#e=this.#n.prevPageNumbers,this.#n=null)}cleanSavedData(){this.#n=null}copyPages(t){this.#r(),this.#i={pageNumbers:t,pageIds:t.map(e=>this.#t[e-1])}}cancelCopy(){this.#i=null}pastePages(t){this.#r();const e=this.#t,s=this.#a(),{pageNumbers:i,pageIds:n}=this.#i,r=this.#s+i.length;this.#s=r;const a=this.#t=new Uint32Array(r);this.#e=new Int32Array(r),a.set(e.subarray(0,t),0),a.set(n,t),a.set(e.subarray(t),t+i.length),this.#o(s,null,t,i),this.#i=null}#o(t,e=null,s=-1,i=null){const n=this.#e,r=this.#t,a=s+(i?.length??0),o=new Map;for(let l=0,c=this.#s;l<c;l++){if(l>=s&&l<a){n[l]=-i[l-s];continue}const d=r[l],u=t.get(d);let f=o.get(d)||0;if(e&&u)for(;f<u.length&&e.has(u[f]);)f++;n[l]=u?.[f],o.set(d,f+1)}}hasBeenAltered(){return this.#t!==null}getPageMappingForSaving(t=null){t??=this.#a();let e=0;for(const i of t.values())e=Math.max(e,i.length);const s=new Array(e);for(let i=0;i<e;i++)s[i]={document:null,pageIndices:[],includePages:[]};for(const[i,n]of t)for(let r=0,a=n.length;r<a;r++)s[r].includePages.push([i-1,n[r]-1]);for(const{includePages:i,pageIndices:n}of s){i.sort((r,a)=>r[0]-a[0]);for(let r=0,a=i.length;r<a;r++)n.push(i[r][1]),i[r]=i[r][0]}return s}extractPages(t){t=Array.from(t).sort((s,i)=>s-i);const e=new Map;for(let s=0,i=t.length;s<i;s++){const n=this.getPageId(t[s]);e.getOrInsertComputed(n,Gs).push(s+1)}return this.getPageMappingForSaving(e)}getPrevPageNumber(t){return this.#e?.[t-1]??0}getPageNumber(t){if(!this.#t)return t;const e=this.#t;for(let s=0,i=this.#s;s<i;s++)if(e[s]===t)return s+1;return 0}getPageId(t){return this.#t?.[t-1]??t}getMapping(){return this.#t?.subarray(0,this.pagesNumber)}}const me=Symbol("INITIAL_DATA"),Ni=()=>({...Promise.withResolvers(),data:me});class nn{#t=new Map;get(t,e=null){if(e){const i=this.#t.getOrInsertComputed(t,Ni);return i.promise.then(()=>e(i.data)),null}const s=this.#t.get(t);if(!s||s.data===me)throw new Error(`Requesting object that isn't resolved yet ${t}.`);return s.data}has(t){const e=this.#t.get(t);return!!e&&e.data!==me}delete(t){const e=this.#t.get(t);return!e||e.data===me?!1:(this.#t.delete(t),!0)}resolve(t,e=null){const s=this.#t.getOrInsertComputed(t,Ni);if(s.data!==me)throw new Error(`Object already resolved ${t}.`);s.data=e,s.resolve()}clear(){for(const{data:t}of this.#t.values())t?.bitmap?.close();this.#t.clear()}*[Symbol.iterator](){for(const[t,{data:e}]of this.#t)e!==me&&(yield[t,e])}}const Vr=1e5,ki=30;class Ot{#t=Promise.withResolvers();#e=null;#s=!1;#i=!!globalThis.FontInspector?.enabled;#n=null;#r=null;#a=null;#o=0;#h=0;#l=null;#u=null;#d=0;#f=0;#m=Object.create(null);#g=[];#c=null;#p=[];#v=new WeakMap;#w=null;static#b=new Map;static#E=new Map;static#P=new WeakMap;static#y=null;static#x=new Set;constructor({textContentSource:t,images:e,container:s,viewport:i}){if(t instanceof ReadableStream)this.#c=t;else if(typeof t=="object")this.#c=new ReadableStream({start(l){l.enqueue(t),l.close()}});else throw new Error('No "textContentSource" parameter specified.');this.#e=this.#u=s,this.#n=e,this.#f=i.scale*Vt.pixelRatio,this.#d=i.rotation,this.#a={div:null,properties:null,ctx:null};const{pageWidth:n,pageHeight:r,pageX:a,pageY:o}=i.rawDims;this.#w=[1,0,0,-1,-a,o+r],this.#h=n,this.#o=r,Ot.#F(),s.style.setProperty("--min-font-size",Ot.#y),he(s,i),this.#t.promise.finally(()=>{Ot.#x.delete(this),this.#a=null,this.#m=null}).catch(()=>{})}static get fontFamilyMap(){const{isWindows:t,isFirefox:e}=yt.platform;return K(this,"fontFamilyMap",new Map([["sans-serif",`${t&&e?"Calibri, ":""}sans-serif`],["monospace",`${t&&e?"Lucida Console, ":""}monospace`]]))}render(){this.#n&&this.#e.append(this.#n.render());const t=()=>{this.#l.read().then(({value:e,done:s})=>{if(s){this.#t.resolve();return}this.#r??=e.lang,Object.assign(this.#m,e.styles),this.#S(e.items),t()},this.#t.reject)};return this.#l=this.#c.getReader(),Ot.#x.add(this),t(),this.#t.promise}update({viewport:t,onBefore:e=null}){const s=t.scale*Vt.pixelRatio,i=t.rotation;if(i!==this.#d&&(e?.(),this.#d=i,he(this.#u,{rotation:i})),s!==this.#f){e?.(),this.#f=s;const n={div:null,properties:null,ctx:Ot.#O(this.#r)};for(const r of this.#p)n.properties=this.#v.get(r),n.div=r,this.#R(n)}}cancel(){const t=new te("TextLayer task cancelled.");this.#l?.cancel(t).catch(()=>{}),this.#l=null,this.#t.reject(t)}get textDivs(){return this.#p}get textContentItemsStr(){return this.#g}#S(t){if(this.#s)return;this.#a.ctx??=Ot.#O(this.#r);const e=this.#p,s=this.#g;for(const i of t){if(e.length>Vr){z("Ignoring additional textDivs for performance reasons."),this.#s=!0;return}if(i.str===void 0){if(i.type==="beginMarkedContentProps"||i.type==="beginMarkedContent"){const n=this.#e;this.#e=document.createElement("span"),this.#e.classList.add("markedContent"),i.id&&this.#e.setAttribute("id",`${i.id}`),i.tag==="Artifact"&&(this.#e.ariaHidden=!0),n.append(this.#e)}else i.type==="endMarkedContent"&&(this.#e=this.#e.parentNode);continue}s.push(i.str),this.#C(i)}}#C(t){const e=document.createElement("span"),s={angle:0,canvasWidth:0,hasText:t.str!=="",hasEOL:t.hasEOL,fontSize:0};this.#p.push(e);const i=F.transform(this.#w,t.transform);let n=Math.atan2(i[1],i[0]);const r=this.#m[t.fontName];r.vertical&&(n+=Math.PI/2);let a=this.#i&&r.fontSubstitution||r.fontFamily;a=Ot.fontFamilyMap.get(a)||a;const o=Math.hypot(i[2],i[3]),l=o*Ot.#L(a,r,this.#r);let c,d;n===0?(c=i[4],d=i[5]-l):(c=i[4]+l*Math.sin(n),d=i[5]-l*Math.cos(n));const u=e.style;u.left=`${(100*c/this.#h).toFixed(2)}%`,u.top=`${(100*d/this.#o).toFixed(2)}%`,u.setProperty("--font-height",`${o.toFixed(2)}px`),u.fontFamily=a,s.fontSize=o,e.setAttribute("role","presentation"),e.textContent=t.str,e.dir=t.dir,this.#i&&(e.dataset.fontName=r.fontSubstitutionLoadedName||t.fontName),n!==0&&(s.angle=n*(180/Math.PI));let f=!1;if(t.str.length>1)f=!0;else if(t.str!==" "&&t.transform[0]!==t.transform[3]){const g=Math.abs(t.transform[0]),p=Math.abs(t.transform[3]);g!==p&&Math.max(g,p)/Math.min(g,p)>1.5&&(f=!0)}if(f&&(s.canvasWidth=r.vertical?t.height:t.width),this.#v.set(e,s),this.#a.div=e,this.#a.properties=s,this.#R(this.#a),s.hasText&&this.#e.append(e),s.hasEOL){const g=document.createElement("br");g.setAttribute("role","presentation"),this.#e.append(g)}}#R(t){const{div:e,properties:s,ctx:i}=t,{style:n}=e;if(s.canvasWidth!==0&&s.hasText){const{fontFamily:r}=n,{canvasWidth:a,fontSize:o}=s;Ot.#I(i,o*this.#f,r);const{width:l}=i.measureText(e.textContent);l>0&&n.setProperty("--scale-x",a*this.#f/l)}s.angle!==0&&n.setProperty("--rotate",`${s.angle}deg`)}static cleanup(){if(!(this.#x.size>0)){this.#b.clear();for(const{canvas:t}of this.#E.values())t.remove();this.#E.clear()}}static#O(t=null){let e=this.#E.get(t||="");if(!e){const s=document.createElement("canvas");s.className="hiddenCanvasElement",s.lang=t,document.body.append(s),e=s.getContext("2d",{alpha:!1,willReadFrequently:!0}),this.#E.set(t,e),this.#P.set(e,{size:0,family:""})}return e}static#I(t,e,s){const i=this.#P.get(t);e===i.size&&s===i.family||(t.font=`${e}px ${s}`,i.size=e,i.family=s)}static#F(){if(this.#y!==null)return;const t=document.createElement("div");t.style.opacity=0,t.style.lineHeight=1,t.style.fontSize="1px",t.style.position="absolute",t.textContent="X",document.body.append(t),this.#y=t.getBoundingClientRect().height,t.remove()}static#L(t,e,s){const i=this.#b.get(t);if(i)return i;const n=this.#O(s);n.canvas.width=n.canvas.height=ki,this.#I(n,ki,t);const r=n.measureText(""),a=r.fontBoundingBoxAscent,o=Math.abs(r.fontBoundingBoxDescent);n.canvas.width=n.canvas.height=0;let l=.8;return a?l=a/(a+o):(yt.platform.isFirefox&&z("Enable the `dom.textMetrics.fontBoundingBox.enabled` preference in `about:config` to improve TextLayer rendering."),e.ascent?l=e.ascent:e.descent&&(l=1+e.descent)),this.#b.set(t,l),l}}const Wr=100;function Xr(h={}){typeof h=="string"||h instanceof URL?h={url:h}:(h instanceof ArrayBuffer||ArrayBuffer.isView(h))&&(h={data:h});const t=new qs,{docId:e}=t,s=h.url?Zn(h.url):null,i=h.data?qn(h.data):null,n=h.httpHeaders||null,r=h.withCredentials===!0,a=h.password??null,o=h.range instanceof rn?h.range:null,l=Number.isInteger(h.rangeChunkSize)&&h.rangeChunkSize>0?h.rangeChunkSize:2**16;let c=h.worker instanceof Be?h.worker:null;const d=h.verbosity,u=typeof h.docBaseUrl=="string"&&!ds(h.docBaseUrl)?h.docBaseUrl:null,f=Ve(h.cMapUrl),g=h.cMapPacked!==!1,p=Ve(h.iccUrl),m=Ve(h.standardFontDataUrl),v=Ve(h.wasmUrl),y=h.stopAtErrors!==!0,b=Number.isInteger(h.maxImageSize)&&h.maxImageSize>-1?h.maxImageSize:-1,w=typeof h.isOffscreenCanvasSupported=="boolean"?h.isOffscreenCanvasSupported:!Mt,A=typeof h.isImageDecoderSupported=="boolean"?h.isImageDecoderSupported:!Mt&&(yt.platform.isFirefox||!globalThis.chrome),S=Number.isInteger(h.canvasMaxAreaInBytes)?h.canvasMaxAreaInBytes:-1,E=typeof h.disableFontFace=="boolean"?h.disableFontFace:Mt,C=h.fontExtraProperties===!0,x=h.enableXfa===!0,P=h.ownerDocument||globalThis.document,T=h.disableRange===!0,k=h.disableStream===!0,R=h.disableAutoFetch===!0,D=h.pdfBug===!0,W=h.CanvasFactory||(Mt?or:ir),M=h.FilterFactory||(Mt?ar:nr),O=h.BinaryDataFactory||(Mt?lr:Ei),_=h.enableHWA===!0,tt=h.enableWebGPU===!0?dr():Promise.resolve(!1),et=h.useWasm!==!1,Q=h.pagesMapper||new zr,G=typeof h.useSystemFonts=="boolean"?h.useSystemFonts:!Mt&&!E,q=typeof h.useWorkerFetch=="boolean"?h.useWorkerFetch:!!(O===Ei&&f&&g&&m&&v&&Re(f,document.baseURI)&&Re(m,document.baseURI)&&Re(v,document.baseURI)),at=null;yn(d);const L={canvasFactory:new W({ownerDocument:P,enableHWA:_}),filterFactory:new M({docId:e,ownerDocument:P}),binaryDataFactory:q?null:new O({cMapUrl:f,standardFontDataUrl:m,wasmUrl:v})};c||(c=Be.create({verbosity:d,port:De.workerPort}),t._worker=c);const I={docId:e,apiVersion:"5.7.284",data:i,password:a,disableAutoFetch:R,rangeChunkSize:l,docBaseUrl:u,enableXfa:x,evaluatorOptions:{maxImageSize:b,disableFontFace:E,ignoreErrors:y,isOffscreenCanvasSupported:w,isImageDecoderSupported:A,canvasMaxAreaInBytes:S,fontExtraProperties:C,useSystemFonts:G,useWasm:et,useWorkerFetch:q,cMapUrl:f,cMapPacked:g,iccUrl:p,standardFontDataUrl:m,wasmUrl:v,hasGPU:!1}},N={ownerDocument:P,pdfBug:D,styleElement:at,enableHWA:_,loadingParams:{disableAutoFetch:R,enableXfa:x}};return Promise.all([c.promise,tt]).then(function([,U]){if(t.destroyed)throw new Error("Loading aborted");if(c.destroyed)throw new Error("Worker was destroyed");I.evaluatorOptions.hasGPU=U;const Z=c.messageHandler.sendWithPromise("GetDocRequest",I,i?[i.buffer]:null);let $;if(!i)if(o)$=new Or({pdfDataRangeTransport:o,disableRange:T,disableStream:k});else if(s){const X=Hr(s);$=new X({url:s,httpHeaders:n,withCredentials:r,rangeChunkSize:l,disableRange:T,disableStream:k})}else throw new Error("getDocument - expected either `data`, `range`, or `url` parameter.");return Z.then(X=>{if(t.destroyed)throw new Error("Loading aborted");if(c.destroyed)throw new Error("Worker was destroyed");const rt=new Pe(e,X,c.port),wt=new Kr(rt,t,$,N,L,Q);t._transport=wt,rt.send("Ready",null)})}).catch(t._capability.reject),t}class qs{static#t=0;_capability=Promise.withResolvers();_transport=null;_worker=null;docId=`d${qs.#t++}`;destroyed=!1;onPassword=null;onProgress=null;get promise(){return this._capability.promise}async destroy(){this.destroyed=!0;try{this._worker?.port&&(this._worker._pendingDestroy=!0),await this._transport?.destroy()}catch(t){throw this._worker?.port&&delete this._worker._pendingDestroy,t}this._transport=null,this._worker?.destroy(),this._worker=null}async getData(){return this._transport.getData()}}class rn{#t=Promise.withResolvers();#e=null;constructor(t,e,s=!1,i=null){this.length=t,this.initialData=e,this.progressiveDone=s,this.contentDispositionFilename=i,Object.defineProperty(this,"onDataProgress",{value:()=>{Rn("`PDFDataRangeTransport.prototype.onDataProgress` - method was removed, since loading progress is now reported automatically through the `PDFDataTransportStream` class (and related code).")}})}onDataRange(t,e){this.#e({type:"range",begin:t,chunk:e})}onDataProgressiveRead(t){this.#t.promise.then(()=>{this.#e({type:"progressiveRead",chunk:t})})}onDataProgressiveDone(){this.#t.promise.then(()=>{this.#e({type:"progressiveDone"})})}transportReady(t){this.#e=t,this.#t.resolve()}requestDataRange(t,e){nt("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}class Yr{constructor(t,e){this._pdfInfo=t,this._transport=e}get pagesMapper(){return this._transport.pagesMapper}get annotationStorage(){return this._transport.annotationStorage}get canvasFactory(){return this._transport.canvasFactory}get filterFactory(){return this._transport.filterFactory}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return K(this,"isPureXfa",!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(t){return this._transport.getPage(t)}getPageIndex(t){return this._transport.getPageIndex(t)}getDestinations(){return this._transport.getDestinations()}getDestination(t){return this._transport.getDestination(t)}getPageLabels(){return this._transport.getPageLabels()}getPageLayout(){return this._transport.getPageLayout()}getPageMode(){return this._transport.getPageMode()}getViewerPreferences(){return this._transport.getViewerPreferences()}getOpenAction(){return this._transport.getOpenAction()}getAttachments(){return this._transport.getAttachments()}getAnnotationsByType(t,e){return this._transport.getAnnotationsByType(t,e)}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig({intent:t="display"}={}){const{renderingIntent:e}=this._transport.getRenderingIntent(t);return this._transport.getOptionalContentConfig(e)}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getMarkInfo(){return this._transport.getMarkInfo()}getData(){return this._transport.getData()}saveDocument(){return this._transport.saveDocument()}extractPages(t){return this._transport.extractPages(t)}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}getRawData(t){return this._transport.getRawData(t)}cleanup(t=!1){return this._transport.startCleanup(t||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}cachedPageNumber(t){return this._transport.cachedPageNumber(t)}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}getFieldObjects(){return this._transport.getFieldObjects()}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}}class ti{#t=!1;#e=null;constructor(t,e,s,i,n=!1){this._pageIndex=t,this._pageInfo=e,this._transport=s,this._stats=n?new ui:null,this._pdfBug=n,this.commonObjs=s.commonObjs,this.objs=new nn,this._intentStates=new Map,this.destroyed=!1,this.recordedBBoxes=null,this.#e=i,this.imageCoordinates=null}clone(t){const e=new ti(t,this._pageInfo,this._transport,this.#e,this._pdfBug);return e.clonedFromIndex=this.clonedFromIndex??this._pageIndex,this._transport.updatePage(e),e}get pageNumber(){return this._pageIndex+1}set pageNumber(t){this._pageIndex=t-1,this._transport.updatePage(this)}get rotate(){return this._pageInfo.rotate}get ref(){return this._pageInfo.ref}get userUnit(){return this._pageInfo.userUnit}get view(){return this._pageInfo.view}getViewport({scale:t,rotation:e=this.rotate,offsetX:s=0,offsetY:i=0,dontFlip:n=!1}={}){return new Ue({viewBox:this.view,userUnit:this.userUnit,scale:t,rotation:e,offsetX:s,offsetY:i,dontFlip:n})}getAnnotations({intent:t="display"}={}){const{renderingIntent:e}=this._transport.getRenderingIntent(t);return this._transport.getAnnotations(this._pageIndex,e)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return K(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){return this._transport._htmlForXfa?.children[this._pageIndex]||null}render({canvasContext:t,canvas:e=t.canvas,viewport:s,intent:i="display",annotationMode:n=Zt.ENABLE,transform:r=null,background:a=null,optionalContentConfigPromise:o=null,annotationCanvasMap:l=null,pageColors:c=null,printAnnotationStorage:d=null,isEditing:u=!1,recordImages:f=!1,recordOperations:g=!1,operationsFilter:p=null}){this._stats?.time("Overall");const m=this._transport.getRenderingIntent(i,n,d,u),{renderingIntent:v,cacheKey:y}=m;this.#t=!1,o||=this._transport.getOptionalContentConfig(v);const b=this._intentStates.getOrInsertComputed(y,Ds);b.streamReaderCancelTimeout&&(clearTimeout(b.streamReaderCancelTimeout),b.streamReaderCancelTimeout=null);const w=!!(v&Rt.PRINT);b.displayReadyCapability||(b.displayReadyCapability=Promise.withResolvers(),b.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(m));const A=!!(this._pdfBug&&globalThis.StepperManager?.enabled),S=!!e&&!this.recordedBBoxes&&(g||A),E=!!e&&!this.imageCoordinates&&f,C=R=>{if(b.renderTasks.delete(T),S){const D=T.gfx?.dependencyTracker.take();D&&(T.stepper?.setOperatorBBoxes(D,T.gfx.dependencyTracker.takeDebugMetadata()),g&&(this.recordedBBoxes=D))}E&&!R&&(this.imageCoordinates=T.gfx?.imagesTracker.take()),w&&(this.#t=!0),this.#s(),R?(T.capability.reject(R),this._abortOperatorList({intentState:b,reason:R instanceof Error?R:new Error(R)})):T.capability.resolve(),this._stats&&(this._stats.timeEnd("Rendering"),this._stats.timeEnd("Overall"),globalThis.Stats?.enabled&&globalThis.Stats.add(this.pageNumber,this._stats))};let x=null,P=null;(S||E)&&(P=new $n(e,b.operatorList.length)),S&&(x=new jn(P,A));const T=new be({callback:C,params:{canvas:e,canvasContext:t,dependencyTracker:x??P,imagesTracker:E?new is(e):null,viewport:s,transform:r,background:a},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:l,operatorList:b.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!w,pdfBug:this._pdfBug,pageColors:c,enableHWA:this._transport.enableHWA,operationsFilter:p});(b.renderTasks||=new Set).add(T);const k=T.task;return Promise.all([b.displayReadyCapability.promise,o]).then(([R,D])=>{if(this.destroyed){C();return}if(this._stats?.time("Rendering"),!(D.renderingIntent&v))throw new Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");T.initializeGraphics({transparency:R,optionalContentConfig:D}),T.operatorListChanged()}).catch(C),k}getOperatorList({intent:t="display",annotationMode:e=Zt.ENABLE,printAnnotationStorage:s=null,isEditing:i=!1}={}){function n(){a.operatorList.lastChunk&&(a.opListReadCapability.resolve(a.operatorList),a.renderTasks.delete(o))}const r=this._transport.getRenderingIntent(t,e,s,i,!0),a=this._intentStates.getOrInsertComputed(r.cacheKey,Ds);let o;return a.opListReadCapability||(o=Object.create(null),o.operatorListChanged=n,a.opListReadCapability=Promise.withResolvers(),(a.renderTasks||=new Set).add(o),a.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(r)),a.opListReadCapability.promise}streamTextContent({includeMarkedContent:t=!1,disableNormalization:e=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageId:this.#e.getPageId(this._pageIndex+1)-1,pageIndex:this._pageIndex,includeMarkedContent:t===!0,disableNormalization:e===!0},{highWaterMark:100,size(i){return i.items.length}})}async getTextContent(t={}){if(this._transport._htmlForXfa)return this.getXfa().then(i=>Le.textContent(i));const e=this.streamTextContent(t),s={items:[],styles:Object.create(null),lang:null};for await(const i of e)s.lang??=i.lang,Object.assign(s.styles,i.styles),s.items.push(...i.items);return s}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const t=[];for(const e of this._intentStates.values())if(this._abortOperatorList({intentState:e,reason:new Error("Page was destroyed."),force:!0}),!e.opListReadCapability)for(const s of e.renderTasks)t.push(s.completed),s.cancel();return this.objs.clear(),this.#t=!1,Promise.all(t)}cleanup(t=!1){this.#t=!0;const e=this.#s();return t&&e&&(this._stats&&=new ui),e}#s(){if(!this.#t||this.destroyed)return!1;for(const{renderTasks:t,operatorList:e}of this._intentStates.values())if(t.size>0||!e.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),this.#t=!1,!0}_startRenderPage(t,e){const s=this._intentStates.get(e);s&&(this._stats?.timeEnd("Page Request"),s.displayReadyCapability?.resolve(t))}_renderPageChunk(t,e){for(let s=0,i=t.length;s<i;s++)e.operatorList.fnArray.push(t.fnArray[s]),e.operatorList.argsArray.push(t.argsArray[s]);e.operatorList.lastChunk=t.lastChunk,e.operatorList.separateAnnots=t.separateAnnots;for(const s of e.renderTasks)s.operatorListChanged();t.lastChunk&&this.#s()}_pumpOperatorList({renderingIntent:t,cacheKey:e,annotationStorageSerializable:s,modifiedIds:i}){const{map:n,transfer:r}=s,o=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageId:this.#e.getPageId(this._pageIndex+1)-1,pageIndex:this._pageIndex,intent:t,cacheKey:e,annotationStorage:n,modifiedIds:i},void 0,r).getReader(),l=this._intentStates.get(e);l.streamReader=o;const c=()=>{o.read().then(({value:d,done:u})=>{if(u){l.streamReader=null;return}this._transport.destroyed||(this._renderPageChunk(d,l),c())},d=>{if(l.streamReader=null,!this._transport.destroyed){if(l.operatorList){l.operatorList.lastChunk=!0;for(const u of l.renderTasks)u.operatorListChanged();this.#s()}if(l.displayReadyCapability)l.displayReadyCapability.reject(d);else if(l.opListReadCapability)l.opListReadCapability.reject(d);else throw d}})};c()}_abortOperatorList({intentState:t,reason:e,force:s=!1}){if(t.streamReader){if(t.streamReaderCancelTimeout&&(clearTimeout(t.streamReaderCancelTimeout),t.streamReaderCancelTimeout=null),!s){if(t.renderTasks.size>0)return;if(e instanceof Ws){let i=Wr;e.extraDelay>0&&e.extraDelay<1e3&&(i+=e.extraDelay),t.streamReaderCancelTimeout=setTimeout(()=>{t.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:t,reason:e,force:!0})},i);return}}if(t.streamReader.cancel(new te(e.message)).catch(()=>{}),t.streamReader=null,!this._transport.destroyed){for(const[i,n]of this._intentStates)if(n===t){this._intentStates.delete(i);break}this.cleanup()}}}get stats(){return this._stats}}var qt,_t,Jt,ae,as,oe,le,Tt,ts,an,on,Ie,we,es;const ft=class ft{constructor({name:t=null,port:e=null,verbosity:s=bn()}={}){Ut(this,Tt);Ut(this,qt,Promise.withResolvers());Ut(this,_t,null);Ut(this,Jt,null);Ut(this,ae,null);if(this.name=t,this.destroyed=!1,this.verbosity=s,e){if(lt(ft,le).has(e))throw new Error("Cannot use more than one PDFWorker per port.");lt(ft,le).set(e,this),Ht(this,Tt,an).call(this,e)}else Ht(this,Tt,on).call(this)}get promise(){return lt(this,qt).promise}get port(){return lt(this,Jt)}get messageHandler(){return lt(this,_t)}destroy(){this.destroyed=!0,lt(this,ae)?.terminate(),Ct(this,ae,null),lt(ft,le).delete(lt(this,Jt)),Ct(this,Jt,null),lt(this,_t)?.destroy(),Ct(this,_t,null)}static create(t){const e=lt(this,le).get(t?.port);if(e){if(e._pendingDestroy)throw new Error("PDFWorker.create - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return e}return new ft(t)}static get workerSrc(){if(De.workerSrc)return De.workerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _setupFakeWorkerGlobal(){return K(this,"_setupFakeWorkerGlobal",(async()=>lt(this,we,es)?lt(this,we,es):(await import(this.workerSrc)).WorkerMessageHandler)())}};qt=new WeakMap,_t=new WeakMap,Jt=new WeakMap,ae=new WeakMap,as=new WeakMap,oe=new WeakMap,le=new WeakMap,Tt=new WeakSet,ts=function(){lt(this,qt).resolve(),lt(this,_t).send("configure",{verbosity:this.verbosity})},an=function(t){Ct(this,Jt,t),Ct(this,_t,new Pe("main","worker",t)),lt(this,_t).on("ready",()=>{}),Ht(this,Tt,ts).call(this)},on=function(){if(lt(ft,oe)||lt(ft,we,es)){Ht(this,Tt,Ie).call(this);return}let{workerSrc:t}=ft;try{ft._isSameOrigin(window.location,t)||(t=ft._createCDNWrapper(new URL(t,window.location).href));const e=new Worker(t,{type:"module"}),s=new Pe("main","worker",e),i=()=>{n.abort(),s.destroy(),e.terminate(),this.destroyed?lt(this,qt).reject(new Error("Worker was destroyed")):Ht(this,Tt,Ie).call(this)},n=new AbortController;e.addEventListener("error",()=>{lt(this,ae)||i()},{signal:n.signal}),s.on("test",a=>{if(n.abort(),this.destroyed||!a){i();return}Ct(this,_t,s),Ct(this,Jt,e),Ct(this,ae,e),Ht(this,Tt,ts).call(this)}),s.on("ready",a=>{if(n.abort(),this.destroyed){i();return}try{r()}catch{Ht(this,Tt,Ie).call(this)}});const r=()=>{const a=new Uint8Array;s.send("test",a,[a.buffer])};r();return}catch{hs("The worker has been disabled.")}Ht(this,Tt,Ie).call(this)},Ie=function(){lt(ft,oe)||(z("Setting up fake worker."),Ct(ft,oe,!0)),ft._setupFakeWorkerGlobal.then(t=>{if(this.destroyed){lt(this,qt).reject(new Error("Worker was destroyed"));return}const e=new sr;Ct(this,Jt,e);const s=`fake${li(ft,as)._++}`,i=new Pe(s+"_worker",s,e);t.setup(i,e),Ct(this,_t,new Pe(s,s+"_worker",e)),Ht(this,Tt,ts).call(this)}).catch(t=>{lt(this,qt).reject(new Error(`Setting up fake worker failed: "${t.message}".`))})},we=new WeakSet,es=function(){try{return globalThis.pdfjsWorker?.WorkerMessageHandler||null}catch{return null}},Ut(ft,we),Ut(ft,as,0),Ut(ft,oe,!1),Ut(ft,le,new WeakMap),Mt&&(Ct(ft,oe,!0),De.workerSrc||="./pdf.worker.mjs"),ft._isSameOrigin=(t,e)=>{const s=URL.parse(t);if(!s?.origin||s.origin==="null")return!1;const i=new URL(e,s);return s.origin===i.origin},ft._createCDNWrapper=t=>{const e=`await import("${t}");`;return URL.createObjectURL(new Blob([e],{type:"text/javascript"}))};let Be=ft;class Kr{downloadInfoCapability=Promise.withResolvers();#t=null;#e=new Map;#s=null;#i=new Map;#n=new Map;#r=new Map;#a=null;constructor(t,e,s,i,n,r){this.messageHandler=t,this.loadingTask=e,this.#s=s,this.commonObjs=new nn,this.fontLoader=new Gn({ownerDocument:i.ownerDocument,styleElement:i.styleElement}),this.enableHWA=i.enableHWA,this.loadingParams=i.loadingParams,this._params=i,this.canvasFactory=n.canvasFactory,this.filterFactory=n.filterFactory,this.binaryDataFactory=n.binaryDataFactory,this.pagesMapper=r,this.destroyed=!1,this.destroyCapability=null,this.setupMessageHandler()}updatePage(t){const{_pageIndex:e}=t;this.#i.set(e,t),this.#n.set(e,Promise.resolve(t))}#o(t,e=null){return this.#e.getOrInsertComputed(t,()=>this.messageHandler.sendWithPromise(t,e))}#h({loaded:t,total:e}){this.loadingTask.onProgress?.({loaded:t,total:e,percent:e?ht(Math.round(t/e*100),0,100):NaN})}get annotationStorage(){return K(this,"annotationStorage",new Qs)}getRenderingIntent(t,e=Zt.ENABLE,s=null,i=!1,n=!1){let r=Rt.DISPLAY,a=Ne;switch(t){case"any":r=Rt.ANY;break;case"display":break;case"print":r=Rt.PRINT;break;default:z(`getRenderingIntent - invalid intent: ${t}`)}const o=r&Rt.PRINT&&s instanceof Wi?s:this.annotationStorage;switch(e){case Zt.DISABLE:r+=Rt.ANNOTATIONS_DISABLE;break;case Zt.ENABLE:break;case Zt.ENABLE_FORMS:r+=Rt.ANNOTATIONS_FORMS;break;case Zt.ENABLE_STORAGE:r+=Rt.ANNOTATIONS_STORAGE,a=o.serializable;break;default:z(`getRenderingIntent - invalid annotationMode: ${e}`)}i&&(r+=Rt.IS_EDITING),n&&(r+=Rt.OPLIST);const{ids:l,hash:c}=o.modifiedIds,d=[r,a.hash,c];return{renderingIntent:r,cacheKey:d.join("_"),annotationStorageSerializable:a,modifiedIds:l}}destroy(){if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=Promise.withResolvers(),this.#a?.reject(new Error("Worker was destroyed during onPassword callback"));const t=[];for(const s of this.#i.values())t.push(s._destroy());this.#i.clear(),this.#n.clear(),this.#r.clear(),Object.hasOwn(this,"annotationStorage")&&this.annotationStorage.resetModified();const e=this.messageHandler.sendWithPromise("Terminate",null);return t.push(e),Promise.all(t).then(()=>{this.commonObjs.clear(),this.fontLoader.clear(),this.#e.clear(),this.filterFactory.destroy(),Ot.cleanup(),this.#s?.cancelAllRequests(new te("Worker was terminated.")),this.messageHandler?.destroy(),this.messageHandler=null,this.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:t,loadingTask:e}=this;t.on("GetReader",(s,i)=>{dt(this.#s,"GetReader - no `BasePDFStream` instance available."),this.#t=this.#s.getFullReader(),this.#t.onProgress=n=>this.#h(n),i.onPull=()=>{this.#t.read().then(function({value:n,done:r}){if(r){i.close();return}dt(n instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),i.enqueue(new Uint8Array(n),1,[n])}).catch(n=>{i.error(n)})},i.onCancel=n=>{this.#t.cancel(n),i.ready.catch(r=>{if(!this.destroyed)throw r})}}),t.on("ReaderHeadersReady",async s=>{await this.#t.headersReady;const{isStreamingSupported:i,isRangeSupported:n,contentLength:r}=this.#t;return i&&n&&(this.#t.onProgress=null),{isStreamingSupported:i,isRangeSupported:n,contentLength:r}}),t.on("GetRangeReader",(s,i)=>{dt(this.#s,"GetRangeReader - no `BasePDFStream` instance available.");const n=this.#s.getRangeReader(s.begin,s.end);if(!n){i.close();return}i.onPull=()=>{n.read().then(function({value:r,done:a}){if(a){i.close();return}dt(r instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),i.enqueue(new Uint8Array(r),1,[r])}).catch(r=>{i.error(r)})},i.onCancel=r=>{n.cancel(r),i.ready.catch(a=>{if(!this.destroyed)throw a})}}),t.on("GetDoc",({pdfInfo:s})=>{this.pagesMapper.pagesNumber=s.numPages,this._numPages=s.numPages,this._htmlForXfa=s.htmlForXfa,delete s.htmlForXfa,e._capability.resolve(new Yr(s,this))}),t.on("DocException",s=>{e._capability.reject(Pt(s))}),t.on("PasswordRequest",s=>{this.#a=Promise.withResolvers();try{if(!e.onPassword)throw Pt(s);const i=n=>{n instanceof Error?this.#a.reject(n):this.#a.resolve({password:n})};e.onPassword(i,s.code)}catch(i){this.#a.reject(i)}return this.#a.promise}),t.on("DataLoaded",s=>{this.#h({loaded:s.length,total:s.length}),this.downloadInfoCapability.resolve(s)}),t.on("StartRenderPage",s=>{if(this.destroyed)return;this.#i.get(s.pageIndex)._startRenderPage(s.transparency,s.cacheKey)}),t.on("commonobj",([s,i,n])=>{if(this.destroyed||this.commonObjs.has(s))return null;switch(i){case"Font":if("error"in n){const d=n.error;z(`Error during font loading: ${d}`),this.commonObjs.resolve(s,d);break}const r=new Kn(n),a=this._params.pdfBug&&globalThis.FontInspector?.enabled?(d,u)=>globalThis.FontInspector.fontAdded(d,u):null,o=new zn(r,a,n.charProcOperatorList,n.extra);this.fontLoader.bind(o).catch(()=>t.sendWithPromise("FontFallback",{id:s})).finally(()=>{o.fontExtraProperties||o.clearData(),this.commonObjs.resolve(s,o)});break;case"CopyLocalImage":const{imageRef:l}=n;dt(l,"The imageRef must be defined.");for(const d of this.#i.values())for(const[,u]of d.objs){if(u?.ref!==l)continue;if(!u.dataLen)return null;const f=structuredClone(u);return this.commonObjs.resolve(s,f),u.dataLen}break;case"FontPath":this.commonObjs.resolve(s,new Qn(n));break;case"Image":this.commonObjs.resolve(s,n);break;case"Pattern":const c=new Jn(n);this.commonObjs.resolve(s,c.getIR());break;default:throw new Error(`Got unknown common object type ${i}`)}return null}),t.on("obj",([s,i,n,r])=>{if(this.destroyed)return;const a=this.#i.get(i);if(!a.objs.has(s)){if(a._intentStates.size===0){r?.bitmap?.close();return}switch(n){case"Image":case"Pattern":a.objs.resolve(s,r);break;default:throw new Error(`Got unknown object type ${n}`)}}}),t.on("DocProgress",s=>{this.destroyed||this.#h(s)}),t.on("FetchBinaryData",async s=>{if(this.destroyed)throw new Error("Worker was destroyed.");if(!this.binaryDataFactory)throw new Error("`BinaryDataFactory` not initialized, see the `useWorkerFetch` parameter.");return this.binaryDataFactory.fetch(s)})}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){this.annotationStorage.size<=0&&z("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");const{map:t,transfer:e}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:t,filename:this.#t?.filename??null},e).finally(()=>{this.annotationStorage.resetModified()})}extractPages(t){const e={pageInfos:t};let s;if(this.annotationStorage.size>0){const{map:i,transfer:n}=this.annotationStorage.serializable;e.annotationStorage=i,s=n}return this.messageHandler.sendWithPromise("ExtractPages",e,s).finally(()=>{this.annotationStorage.resetModified()})}getPage(t){if(!Number.isInteger(t)||t<=0||t>this.pagesMapper.pagesNumber)return Promise.reject(new Error("Invalid page request."));const e=t-1,s=this.pagesMapper.getPageId(t)-1,i=this.#n.get(e);if(i)return i;const n=this.messageHandler.sendWithPromise("GetPage",{pageIndex:s}).then(r=>{if(this.destroyed)throw new Error("Transport destroyed");r.refStr&&this.#r.set(r.refStr,s);const a=new ti(e,r,this,this.pagesMapper,this._params.pdfBug);return this.#i.set(e,a),a});return this.#n.set(e,n),n}async getPageIndex(t){if(!_s(t))throw new Error("Invalid pageIndex request.");const e=await this.messageHandler.sendWithPromise("GetPageIndex",{num:t.num,gen:t.gen}),s=this.pagesMapper.getPageNumber(e+1);if(s===0)throw new Error("GetPageIndex: page has been removed.");return s-1}getAnnotations(t,e){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:this.pagesMapper.getPageId(t+1)-1,intent:e})}getFieldObjects(){return this.#o("GetFieldObjects")}hasJSActions(){return this.#o("HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(t){return typeof t!="string"?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:t})}getPageLabels(){return this.messageHandler.sendWithPromise("GetPageLabels",null)}getPageLayout(){return this.messageHandler.sendWithPromise("GetPageLayout",null)}getPageMode(){return this.messageHandler.sendWithPromise("GetPageMode",null)}getViewerPreferences(){return this.messageHandler.sendWithPromise("GetViewerPreferences",null)}getOpenAction(){return this.messageHandler.sendWithPromise("GetOpenAction",null)}getAttachments(){return this.messageHandler.sendWithPromise("GetAttachments",null)}getAnnotationsByType(t,e){return this.messageHandler.sendWithPromise("GetAnnotationsByType",{types:t,pageIndexesToSkip:e})}getDocJSActions(){return this.#o("GetDocJSActions")}getPageJSActions(t){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:this.pagesMapper.getPageId(t+1)-1})}getStructTree(t){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:this.pagesMapper.getPageId(t+1)-1})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(t){return this.#o("GetOptionalContentConfig").then(e=>new Gr(e,t))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const t="GetMetadata";return this.#e.getOrInsertComputed(t,()=>this.messageHandler.sendWithPromise(t,null).then(e=>({info:e[0],metadata:e[1]?new $r(e[1]):null,contentDispositionFilename:this.#t?.filename??null,contentLength:this.#t?.contentLength??null,hasStructTree:e[2]})))}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}getRawData(t){return this.messageHandler.sendWithPromise("GetRawData",t)}async startCleanup(t=!1){if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const e of this.#i.values())if(!e.cleanup())throw new Error(`startCleanup: Page ${e.pageNumber} is currently rendering.`);this.commonObjs.clear(),t||this.fontLoader.clear(),this.#e.clear(),this.filterFactory.destroy(!0),Ot.cleanup()}}cachedPageNumber(t){if(!_s(t))return null;const e=t.gen===0?`${t.num}R`:`${t.num}R${t.gen}`,s=this.#r.get(e);if(s>=0){const i=this.pagesMapper.getPageNumber(s+1);if(i!==0)return i}return null}}class Jr{_internalRenderTask=null;onContinue=null;onError=null;constructor(t){this._internalRenderTask=t}get promise(){return this._internalRenderTask.capability.promise}cancel(t=0){this._internalRenderTask.cancel(null,t)}get separateAnnots(){const{separateAnnots:t}=this._internalRenderTask.operatorList;if(!t)return!1;const{annotationCanvasMap:e}=this._internalRenderTask;return t.form||t.canvas&&e?.size>0}get imageCoordinates(){return this._internalRenderTask.imageCoordinates||null}}class be{#t=null;static#e=new WeakSet;constructor({callback:t,params:e,objs:s,commonObjs:i,annotationCanvasMap:n,operatorList:r,pageIndex:a,canvasFactory:o,filterFactory:l,useRequestAnimationFrame:c=!1,pdfBug:d=!1,pageColors:u=null,enableHWA:f=!1,operationsFilter:g=null}){this.callback=t,this.params=e,this.objs=s,this.commonObjs=i,this.annotationCanvasMap=n,this.operatorListIdx=null,this.operatorList=r,this._pageIndex=a,this.canvasFactory=o,this.filterFactory=l,this._pdfBug=d,this.pageColors=u,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=c===!0&&typeof window<"u",this.cancelled=!1,this.capability=Promise.withResolvers(),this.task=new Jr(this),this._cancelBound=this.cancel.bind(this),this._continueBound=this._continue.bind(this),this._scheduleNextBound=this._scheduleNext.bind(this),this._nextBound=this._next.bind(this),this._canvas=e.canvas,this._canvasContext=e.canvas?null:e.canvasContext,this._enableHWA=f,this._dependencyTracker=e.dependencyTracker,this._imagesTracker=e.imagesTracker,this._operationsFilter=g}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics({transparency:t=!1,optionalContentConfig:e}){if(this.cancelled)return;if(this._canvas){if(be.#e.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.");be.#e.add(this._canvas)}this._pdfBug&&globalThis.StepperManager?.enabled&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{viewport:s,transform:i,background:n,dependencyTracker:r,imagesTracker:a}=this.params,o=this._canvasContext||this._canvas.getContext("2d",{alpha:!1,willReadFrequently:!this._enableHWA});this.gfx=new Ae(o,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:e},this.annotationCanvasMap,this.pageColors,r,a),this.gfx.beginDrawing({transform:i,viewport:s,transparency:t,background:n}),this.operatorListIdx=0,this.graphicsReady=!0,this.graphicsReadyCallback?.()}cancel(t=null,e=0){this.running=!1,this.cancelled=!0,this.gfx?.endDrawing(),this.#t&&(window.cancelAnimationFrame(this.#t),this.#t=null),be.#e.delete(this._canvas),t||=new Ws(`Rendering cancelled, page ${this._pageIndex+1}`,e),this.callback(t),this.task.onError?.(t)}operatorListChanged(){if(!this.graphicsReady){this.graphicsReadyCallback||=this._continueBound;return}this.gfx.dependencyTracker?.growOperationsCount(this.operatorList.fnArray.length),this.stepper?.updateOperatorList(this.operatorList),!this.running&&this._continue()}_continue(){this.running=!0,!this.cancelled&&(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?this.#t=window.requestAnimationFrame(()=>{this.#t=null,this._nextBound().catch(this._cancelBound)}):Promise.resolve().then(this._nextBound).catch(this._cancelBound)}async _next(){this.cancelled||(this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper,this._operationsFilter),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk&&(this.gfx.endDrawing(),be.#e.delete(this._canvas),this.callback())))}}const Qr="5.7.284",Zr="7e5b36c2d";V(3068);class Nt{#t=null;#e=null;#s;#i=null;#n=!1;#r=!1;#a=null;#o;#h=null;#l=null;static#u=null;static get _keyboardManager(){return K(this,"_keyboardManager",new $e([[["Escape","mac+Escape"],Nt.prototype._hideDropdownFromKeyboard],[[" ","mac+ "],Nt.prototype._colorSelectFromKeyboard],[["ArrowDown","ArrowRight","mac+ArrowDown","mac+ArrowRight"],Nt.prototype._moveToNext],[["ArrowUp","ArrowLeft","mac+ArrowUp","mac+ArrowLeft"],Nt.prototype._moveToPrevious],[["Home","mac+Home"],Nt.prototype._moveToBeginning],[["End","mac+End"],Nt.prototype._moveToEnd]]))}constructor({editor:t=null,uiManager:e=null}){t?(this.#r=!1,this.#a=t):this.#r=!0,this.#l=t?._uiManager||e,this.#o=this.#l._eventBus,this.#s=t?.color?.toUpperCase()||this.#l?.highlightColors.values().next().value||"#FFFF98",Nt.#u||=Object.freeze({blue:"pdfjs-editor-colorpicker-blue",green:"pdfjs-editor-colorpicker-green",pink:"pdfjs-editor-colorpicker-pink",red:"pdfjs-editor-colorpicker-red",yellow:"pdfjs-editor-colorpicker-yellow"})}renderButton(){const t=this.#t=document.createElement("button");t.className="colorPicker",t.tabIndex="0",t.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-button"),t.ariaHasPopup="true",this.#a&&(t.ariaControls=`${this.#a.id}_colorpicker_dropdown`);const e=this.#l._signal;t.addEventListener("click",this.#g.bind(this),{signal:e}),t.addEventListener("keydown",this.#m.bind(this),{signal:e});const s=this.#e=document.createElement("span");return s.className="swatch",s.ariaHidden="true",s.style.backgroundColor=this.#s,t.append(s),t}renderMainDropdown(){const t=this.#i=this.#d();return t.ariaOrientation="horizontal",t.ariaLabelledBy="highlightColorPickerLabel",t}#d(){const t=document.createElement("div"),e=this.#l._signal;t.addEventListener("contextmenu",kt,{signal:e}),t.className="dropdown",t.role="listbox",t.ariaMultiSelectable="false",t.ariaOrientation="vertical",t.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-dropdown"),this.#a&&(t.id=`${this.#a.id}_colorpicker_dropdown`);for(const[s,i]of this.#l.highlightColors){const n=document.createElement("button");n.tabIndex="0",n.role="option",n.setAttribute("data-color",i),n.title=s,n.setAttribute("data-l10n-id",Nt.#u[s]);const r=document.createElement("span");n.append(r),r.className="swatch",r.style.backgroundColor=i,n.ariaSelected=i===this.#s,n.addEventListener("click",this.#f.bind(this,i),{signal:e}),t.append(n)}return t.addEventListener("keydown",this.#m.bind(this),{signal:e}),t}#f(t,e){e.stopPropagation(),this.#o.dispatch("switchannotationeditorparams",{source:this,type:J.HIGHLIGHT_COLOR,value:t}),this.updateColor(t)}_colorSelectFromKeyboard(t){if(t.target===this.#t){this.#g(t);return}const e=t.target.getAttribute("data-color");e&&this.#f(e,t)}_moveToNext(t){if(!this.#p){this.#g(t);return}if(t.target===this.#t){this.#i.firstElementChild?.focus();return}t.target.nextSibling?.focus()}_moveToPrevious(t){if(t.target===this.#i?.firstElementChild||t.target===this.#t){this.#p&&this._hideDropdownFromKeyboard();return}this.#p||this.#g(t),t.target.previousSibling?.focus()}_moveToBeginning(t){if(!this.#p){this.#g(t);return}this.#i.firstElementChild?.focus()}_moveToEnd(t){if(!this.#p){this.#g(t);return}this.#i.lastElementChild?.focus()}#m(t){Nt._keyboardManager.exec(this,t)}#g(t){if(this.#p){this.hideDropdown();return}if(this.#n=t.detail===0,this.#h||(this.#h=new AbortController,window.addEventListener("pointerdown",this.#c.bind(this),{signal:this.#l.combinedSignal(this.#h)})),this.#t.ariaExpanded="true",this.#i){this.#i.classList.remove("hidden");return}const e=this.#i=this.#d();this.#t.append(e)}#c(t){this.#i?.contains(t.target)||this.hideDropdown()}hideDropdown(){this.#i?.classList.add("hidden"),this.#t.ariaExpanded="false",this.#h?.abort(),this.#h=null}get#p(){return this.#i&&!this.#i.classList.contains("hidden")}_hideDropdownFromKeyboard(){if(!this.#r){if(!this.#p){this.#a?.unselect();return}this.hideDropdown(),this.#t.focus({preventScroll:!0,focusVisible:this.#n})}}updateColor(t){if(this.#e&&(this.#e.style.backgroundColor=t),!this.#i)return;const e=this.#l.highlightColors.values();for(const s of this.#i.children)s.ariaSelected=e.next().value===t.toUpperCase()}destroy(){this.#t?.remove(),this.#t=null,this.#e=null,this.#i?.remove(),this.#i=null}}class _e{#t=null;#e=!1;#s=null;#i=null;static#n=null;constructor(t){this.#s=t,this.#i=t._uiManager,_e.#n||=Object.freeze({freetext:"pdfjs-editor-color-picker-free-text-input",ink:"pdfjs-editor-color-picker-ink-input"})}renderButton(){if(this.#t)return this.#t;const{editorType:t,colorType:e,colorAndOpacityType:s,opacityType:i,color:n,opacity:r}=this.#s,a=this.#e=yt.isAlphaColorInputSupported&&i!==void 0,o=this.#t=document.createElement("input");if(o.type="color",a){o.setAttribute("alpha","");const l=F.hexNums[Math.round((r??1)*255)];o.value=(n||"#000000")+l}else o.value=n||"#000000";return o.className="basicColorPicker",o.tabIndex=0,o.setAttribute("data-l10n-id",_e.#n[t]),o.addEventListener("input",()=>{if(a){const l=Ys(o.value);if(!l)return;const[c,d,u,f]=l,g=F.makeHexColor(c,d,u);s!==void 0?this.#i.updateParams(s,{color:g,opacity:f}):(this.#i.updateParams(e,g),this.#i.updateParams(i,f))}else this.#i.updateParams(e,o.value)},{signal:this.#i._signal}),o}update(t){if(this.#t)if(this.#e){const e=F.hexNums[Math.round(this.#s.opacity*255)];this.#t.value=t+e}else this.#t.value=t}updateOpacity(t){if(!this.#t||!this.#e)return;const e=F.hexNums[Math.round(t*255)];this.#t.value=this.#s.color+e}destroy(){this.#t?.remove(),this.#t=null}hideDropdown(){}}V(531);function Bi(h){return Math.floor(ht(h,0,1)*255).toString(16).padStart(2,"0")}function Te(h){return ht(h,0,1)*255}class _i{static CMYK_G([t,e,s,i]){return["G",1-Math.min(1,.3*t+.59*s+.11*e+i)]}static G_CMYK([t]){return["CMYK",0,0,0,1-t]}static G_RGB([t]){return["RGB",t,t,t]}static G_rgb([t]){return t=Te(t),[t,t,t]}static G_HTML([t]){const e=Bi(t);return`#${e}${e}${e}`}static RGB_G([t,e,s]){return["G",.3*t+.59*e+.11*s]}static RGB_rgb(t){return t.map(Te)}static RGB_HTML(t){return`#${t.map(Bi).join("")}`}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB([t,e,s,i]){return["RGB",1-Math.min(1,t+i),1-Math.min(1,s+i),1-Math.min(1,e+i)]}static CMYK_rgb([t,e,s,i]){return[Te(1-Math.min(1,t+i)),Te(1-Math.min(1,s+i)),Te(1-Math.min(1,e+i))]}static CMYK_HTML(t){const e=this.CMYK_RGB(t).slice(1);return this.RGB_HTML(e)}static RGB_CMYK([t,e,s]){const i=1-t,n=1-e,r=1-s,a=Math.min(i,n,r);return["CMYK",i,n,r,a]}}class qr{create(t,e,s=!1){if(t<=0||e<=0)throw new Error("Invalid SVG dimensions");const i=this._createSVG("svg:svg");return i.setAttribute("version","1.1"),s||(i.setAttribute("width",`${t}px`),i.setAttribute("height",`${e}px`)),i.setAttribute("preserveAspectRatio","none"),i.setAttribute("viewBox",`0 0 ${t} ${e}`),i}createElement(t){if(typeof t!="string")throw new Error("Invalid SVG element type");return this._createSVG(t)}_createSVG(t){nt("Abstract method `_createSVG` called.")}}class ns extends qr{_createSVG(t){return document.createElementNS(Xt,t)}}const ta=9,ce=new WeakSet,ea=new Date().getTimezoneOffset()*60*1e3;class Is{static create(t){switch(t.data.annotationType){case vt.LINK:return new ei(t);case vt.TEXT:return new ia(t);case vt.WIDGET:switch(t.data.fieldType){case"Tx":return new na(t);case"Btn":return t.data.radioButton?new ln(t):t.data.checkBox?new aa(t):new oa(t);case"Ch":return new la(t);case"Sig":return new ra(t)}return new ue(t);case vt.POPUP:return new Us(t);case vt.FREETEXT:return new hn(t);case vt.LINE:return new ca(t);case vt.SQUARE:return new da(t);case vt.CIRCLE:return new ua(t);case vt.POLYLINE:return new cn(t);case vt.CARET:return new pa(t);case vt.INK:return new si(t);case vt.POLYGON:return new fa(t);case vt.HIGHLIGHT:return new dn(t);case vt.UNDERLINE:return new ga(t);case vt.SQUIGGLY:return new ma(t);case vt.STRIKEOUT:return new va(t);case vt.STAMP:return new un(t);case vt.FILEATTACHMENT:return new ya(t);default:return new ut(t)}}}class ut{#t=null;#e=!1;#s=null;constructor(t,{isRenderable:e=!1,ignoreBorder:s=!1,createQuadrilaterals:i=!1}={}){this.isRenderable=e,this.data=t.data,this.layer=t.layer,this.linkService=t.linkService,this.downloadManager=t.downloadManager,this.imageResourcesPath=t.imageResourcesPath,this.renderForms=t.renderForms,this.svgFactory=t.svgFactory,this.annotationStorage=t.annotationStorage,this.enableComment=t.enableComment,this.enableScripting=t.enableScripting,this.hasJSActions=t.hasJSActions,this._fieldObjects=t.fieldObjects,this.parent=t.parent,this.hasOwnCommentButton=!1,e&&(this.contentElement=this.container=this._createContainer(s)),i&&this._createQuadrilaterals()}static _hasPopupData({contentsObj:t,richText:e}){return!!(t?.str||e?.str)}get _isEditable(){return this.data.isEditable}get hasPopupData(){return ut._hasPopupData(this.data)||this.enableComment&&!!this.commentText}get commentData(){const{data:t}=this,e=this.annotationStorage?.getEditor(t.id);return e?e.getData():t}get hasCommentButton(){return this.enableComment&&this.hasPopupElement}get commentButtonPosition(){const t=this.annotationStorage?.getEditor(this.data.id);if(t)return t.commentButtonPositionInPage;const{quadPoints:e,inkLists:s,rect:i}=this.data;let n=-1/0,r=-1/0;if(e?.length>=8){for(let a=0;a<e.length;a+=8)e[a+1]>r?(r=e[a+1],n=e[a+2]):e[a+1]===r&&(n=Math.max(n,e[a+2]));return[n,r]}if(s?.length>=1){for(const a of s)for(let o=0,l=a.length;o<l;o+=2)a[o+1]>r?(r=a[o+1],n=a[o]):a[o+1]===r&&(n=Math.max(n,a[o]));if(n!==1/0)return[n,r]}return i?[i[2],i[3]]:null}_normalizePoint(t){const{page:{view:e},viewport:{rawDims:{pageWidth:s,pageHeight:i,pageX:n,pageY:r}}}=this.parent;return t[1]=e[3]-t[1]+e[1],t[0]=100*(t[0]-n)/s,t[1]=100*(t[1]-r)/i,t}get commentText(){const{data:t}=this;return this.annotationStorage.getRawValue(`${Fe}${t.id}`)?.popup?.contents||t.contentsObj?.str||""}set commentText(t){const{data:e}=this,s={deleted:!t,contents:t||""};this.annotationStorage.updateEditor(e.id,{popup:s})||this.annotationStorage.setValue(`${Fe}${e.id}`,{id:e.id,annotationType:e.annotationType,page:this.parent.page,popup:s,popupRef:e.popupRef,modificationDate:new Date}),t||this.removePopup()}removePopup(){(this.#s?.popup||this.popup)?.remove(),this.#s=this.popup=null}updateEdited(t){if(!this.container)return;t.rect&&(this.#t||={rect:this.data.rect.slice(0)});const{rect:e,popup:s}=t;e&&this.#i(e);let i=this.#s?.popup||this.popup;!i&&s?.text&&(this._createPopup(s),i=this.#s.popup),i&&(i.updateEdited(t),s?.deleted&&(i.remove(),this.#s=null,this.popup=null))}resetEdited(){this.#t&&(this.#i(this.#t.rect),this.#s?.popup.resetEdited(),this.#t=null)}#i(t){const{container:{style:e},data:{rect:s,rotation:i},parent:{viewport:{rawDims:{pageWidth:n,pageHeight:r,pageX:a,pageY:o}}}}=this;s?.splice(0,4,...t),e.left=`${100*(t[0]-a)/n}%`,e.top=`${100*(r-t[3]+o)/r}%`,i===0?(e.width=`${100*(t[2]-t[0])/n}%`,e.height=`${100*(t[3]-t[1])/r}%`):this.setRotation(i)}_createContainer(t){const{data:e,parent:{page:s,viewport:i}}=this,n=document.createElement("section");n.setAttribute("data-annotation-id",e.id),!(this instanceof ue)&&!(this instanceof ei)&&(n.tabIndex=0);const{style:r}=n;if(r.zIndex=this.parent.zIndex,this.parent.zIndex+=2,e.alternativeText&&(n.title=e.alternativeText),e.noRotate&&n.classList.add("norotate"),!e.rect||this instanceof Us){const{rotation:p}=e;return!e.hasOwnCanvas&&p!==0&&this.setRotation(p,n),n}const{width:a,height:o}=this;if(!t&&e.borderStyle.width>0){r.borderWidth=`${e.borderStyle.width}px`;const p=e.borderStyle.horizontalCornerRadius,m=e.borderStyle.verticalCornerRadius;if(p>0||m>0){const y=`calc(${p}px * var(--total-scale-factor)) / calc(${m}px * var(--total-scale-factor))`;r.borderRadius=y}else if(this instanceof ln){const y=`calc(${a}px * var(--total-scale-factor)) / calc(${o}px * var(--total-scale-factor))`;r.borderRadius=y}switch(e.borderStyle.style){case pe.SOLID:r.borderStyle="solid";break;case pe.DASHED:r.borderStyle="dashed";break;case pe.BEVELED:z("Unimplemented border style: beveled");break;case pe.INSET:z("Unimplemented border style: inset");break;case pe.UNDERLINE:r.borderBottomStyle="solid";break}const v=e.borderColor||null;v?(this.#e=!0,r.borderColor=F.makeHexColor(...v)):r.borderWidth=0}const l=F.normalizeRect([e.rect[0],s.view[3]-e.rect[1]+s.view[1],e.rect[2],s.view[3]-e.rect[3]+s.view[1]]),{pageWidth:c,pageHeight:d,pageX:u,pageY:f}=i.rawDims;r.left=`${100*(l[0]-u)/c}%`,r.top=`${100*(l[1]-f)/d}%`;const{rotation:g}=e;return e.hasOwnCanvas||g===0?(r.width=`${100*a/c}%`,r.height=`${100*o/d}%`):this.setRotation(g,n),n}setRotation(t,e=this.container){if(!this.data.rect)return;const{pageWidth:s,pageHeight:i}=this.parent.viewport.rawDims;let{width:n,height:r}=this;t%180!==0&&([n,r]=[r,n]),e.style.width=`${100*n/s}%`,e.style.height=`${100*r/i}%`,e.setAttribute("data-main-rotation",(360-t)%360)}get _commonActions(){const t=(e,s,i)=>{const n=i.detail[e],r=n[0],a=n.slice(1);i.target.style[s]=_i[`${r}_HTML`](a),this.annotationStorage.setValue(this.data.id,{[s]:_i[`${r}_rgb`](a)})};return K(this,"_commonActions",{display:e=>{const{display:s}=e.detail,i=s%2===1;this.container.style.visibility=i?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noView:i,noPrint:s===1||s===2})},print:e=>{this.annotationStorage.setValue(this.data.id,{noPrint:!e.detail.print})},hidden:e=>{const{hidden:s}=e.detail;this.container.style.visibility=s?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noPrint:s,noView:s})},focus:e=>{setTimeout(()=>e.target.focus({preventScroll:!1}),0)},userName:e=>{e.target.title=e.detail.userName},readonly:e=>{e.target.disabled=e.detail.readonly},required:e=>{this._setRequired(e.target,e.detail.required)},bgColor:e=>{t("bgColor","backgroundColor",e)},fillColor:e=>{t("fillColor","backgroundColor",e)},fgColor:e=>{t("fgColor","color",e)},textColor:e=>{t("textColor","color",e)},borderColor:e=>{t("borderColor","borderColor",e)},strokeColor:e=>{t("strokeColor","borderColor",e)},rotation:e=>{const s=e.detail.rotation;this.setRotation(s),this.annotationStorage.setValue(this.data.id,{rotation:s})}})}_dispatchEventFromSandbox(t,e){const s=this._commonActions;for(const i of Object.keys(e.detail))(t[i]||s[i])?.(e)}_setDefaultPropertiesFromJS(t){if(!this.enableScripting)return;const e=this.annotationStorage.getRawValue(this.data.id);if(!e)return;const s=this._commonActions;for(const[i,n]of Object.entries(e)){const r=s[i];if(r){const a={detail:{[i]:n},target:t};r(a),delete e[i]}}}_createQuadrilaterals(){if(!this.container)return;const{quadPoints:t}=this.data;if(!t)return;const[e,s,i,n]=this.data.rect.map(p=>Math.fround(p));if(t.length===8){const[p,m,v,y]=t.subarray(2,6);if(i===p&&n===m&&e===v&&s===y)return}const{style:r}=this.container;let a;if(this.#e){const{borderColor:p,borderWidth:m}=r;r.borderWidth=0,a=["url('data:image/svg+xml;utf8,",'<svg xmlns="http://www.w3.org/2000/svg"',' preserveAspectRatio="none" viewBox="0 0 1 1">',`<g fill="transparent" stroke="${p}" stroke-width="${m}">`],this.container.classList.add("hasBorder")}const o=i-e,l=n-s,{svgFactory:c}=this,d=c.createElement("svg");d.classList.add("quadrilateralsContainer"),d.setAttribute("width",0),d.setAttribute("height",0),d.role="none";const u=c.createElement("defs");d.append(u);const f=c.createElement("clipPath"),g=`clippath_${this.data.id}`;f.setAttribute("id",g),f.setAttribute("clipPathUnits","objectBoundingBox"),u.append(f);for(let p=2,m=t.length;p<m;p+=8){const v=t[p],y=t[p+1],b=t[p+2],w=t[p+3],A=c.createElement("rect"),S=(b-e)/o,E=(n-y)/l,C=(v-b)/o,x=(y-w)/l;A.setAttribute("x",S),A.setAttribute("y",E),A.setAttribute("width",C),A.setAttribute("height",x),f.append(A),a?.push(`<rect vector-effect="non-scaling-stroke" x="${S}" y="${E}" width="${C}" height="${x}"/>`)}this.#e&&(a.push("</g></svg>')"),r.backgroundImage=a.join("")),this.container.append(d),this.container.style.clipPath=`url(#${g})`}_createPopup(t=null){const{data:e}=this;let s,i;t?(s={str:t.text},i=t.date):(s=e.contentsObj,i=e.modificationDate),this.#s=new Us({data:{color:e.color,titleObj:e.titleObj,modificationDate:i,contentsObj:s,richText:e.richText,parentRect:e.rect,borderStyle:0,id:`popup_${e.id}`,rotation:e.rotation,noRotate:!0},linkService:this.linkService,parent:this.parent,elements:[this]})}get hasPopupElement(){return!!(this.#s||this.popup||this.data.popupRef)}get extraPopupElement(){return this.#s}render(){nt("Abstract method `AnnotationElement.render` called")}_getElementsByName(t,e=null){const s=[];if(this._fieldObjects){const i=this._fieldObjects[t];if(i)for(const{page:n,id:r,exportValues:a}of i){if(n===-1||r===e)continue;const o=typeof a=="string"?a:null,l=document.querySelector(`[data-element-id="${r}"]`);if(l&&!ce.has(l)){z(`_getElementsByName - element not allowed: ${r}`);continue}s.push({id:r,exportValue:o,domElement:l})}return s}for(const i of document.getElementsByName(t)){const{exportValue:n}=i,r=i.getAttribute("data-element-id");r!==e&&ce.has(i)&&s.push({id:r,exportValue:n,domElement:i})}return s}show(){this.container&&(this.container.hidden=!1),this.popup?.maybeShow()}hide(){this.container&&(this.container.hidden=!0),this.popup?.forceHide()}getElementsToTriggerPopup(){return this.container}addHighlightArea(){const t=this.getElementsToTriggerPopup();if(Array.isArray(t))for(const e of t)e.classList.add("highlightArea");else t.classList.add("highlightArea")}_editOnDoubleClick(){if(!this._isEditable)return;const{annotationEditorType:t,data:{id:e}}=this;this.container.addEventListener("dblclick",()=>{this.linkService.eventBus?.dispatch("switchannotationeditormode",{source:this,mode:t,editId:e,mustEnterInEditMode:!0})})}get width(){return this.data.rect[2]-this.data.rect[0]}get height(){return this.data.rect[3]-this.data.rect[1]}}class sa extends ut{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.editor=t.editor}render(){return this.container.className="editorAnnotation",this.container}createOrUpdatePopup(){const{editor:t}=this;t.hasComment&&this._createPopup(t.comment)}get hasCommentButton(){return this.enableComment&&this.editor.hasComment}get commentButtonPosition(){return this.editor.commentButtonPositionInPage}get commentText(){return this.editor.comment.text}set commentText(t){this.editor.comment=t,t||this.removePopup()}get commentData(){return this.editor.getData()}remove(){this.parent.removeAnnotation(this.data.id),this.container.remove(),this.container=null,this.removePopup()}}class ei extends ut{constructor(t,e=null){super(t,{isRenderable:!0,ignoreBorder:!!e?.ignoreBorder,createQuadrilaterals:!0}),this.isTooltipOnly=t.data.isTooltipOnly}render(){const{data:t,linkService:e}=this,s=document.createElement("a");s.setAttribute("data-element-id",t.id);let i=!1;return t.url?(e.addLinkAttributes(s,t.url,t.newWindow),i=!0):t.action?(this._bindNamedAction(s,t.action,t.overlaidText),i=!0):t.attachment?(this.#e(s,t.attachment,t.overlaidText,t.attachmentDest),i=!0):t.setOCGState?(this.#s(s,t.setOCGState,t.overlaidText),i=!0):t.dest?(this._bindLink(s,t.dest,t.overlaidText),i=!0):(t.actions&&(t.actions.Action||t.actions["Mouse Up"]||t.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(s,t),i=!0),t.resetForm?(this._bindResetFormAction(s,t.resetForm),i=!0):this.isTooltipOnly&&!i&&(this._bindLink(s,""),i=!0)),this.container.classList.add("linkAnnotation"),i&&(this.contentElement=s,this.container.append(s)),this.container}#t(){this.container.setAttribute("data-internal-link","")}_bindLink(t,e,s=""){t.href=this.linkService.getDestinationHash(e),t.onclick=()=>(e&&this.linkService.goToDestination(e),!1),(e||e==="")&&this.#t(),s&&(t.title=s)}_bindNamedAction(t,e,s=""){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeNamedAction(e),!1),s&&(t.title=s),this.#t()}#e(t,e,s="",i=null){t.href=this.linkService.getAnchorUrl(""),e.description?t.title=e.description:s&&(t.title=s),t.onclick=()=>(this.downloadManager?.openOrDownloadData(e.content,e.filename,i),!1),this.#t()}#s(t,e,s=""){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeSetOCGState(e),!1),s&&(t.title=s),this.#t()}_bindJSAction(t,e){t.href=this.linkService.getAnchorUrl("");const s=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const i of Object.keys(e.actions)){const n=s.get(i);n&&(t[n]=()=>(this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e.id,name:i}}),!1))}e.overlaidText&&(t.title=e.overlaidText),t.onclick||(t.onclick=()=>!1),this.#t()}_bindResetFormAction(t,e){const s=t.onclick;if(s||(t.href=this.linkService.getAnchorUrl("")),this.#t(),!this._fieldObjects){z('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),s||(t.onclick=()=>!1);return}t.onclick=()=>{s?.();const{fields:i,refs:n,include:r}=e,a=[];if(i.length!==0||n.length!==0){const c=new Set(n);for(const d of i){const u=this._fieldObjects[d]||[];for(const{id:f}of u)c.add(f)}for(const d of Object.values(this._fieldObjects))for(const u of d)c.has(u.id)===r&&a.push(u)}else for(const c of Object.values(this._fieldObjects))a.push(...c);const o=this.annotationStorage,l=[];for(const c of a){const{id:d}=c;switch(l.push(d),c.type){case"text":{const f=c.defaultValue||"";o.setValue(d,{value:f});break}case"checkbox":case"radiobutton":{const f=c.defaultValue===c.exportValues;o.setValue(d,{value:f});break}case"combobox":case"listbox":{const f=c.defaultValue||"";o.setValue(d,{value:f});break}default:continue}const u=document.querySelector(`[data-element-id="${d}"]`);if(u){if(!ce.has(u)){z(`_bindResetFormAction - element not allowed: ${d}`);continue}}else continue;u.dispatchEvent(new Event("resetform"))}return this.enableScripting&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:l,name:"ResetForm"}}),!1}}}class ia extends ut{constructor(t){super(t,{isRenderable:!0})}render(){this.container.classList.add("textAnnotation");const t=document.createElement("img");return t.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",t.setAttribute("data-l10n-id","pdfjs-text-annotation-type"),t.setAttribute("data-l10n-args",JSON.stringify({type:this.data.name})),!this.data.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container.append(t),this.container}}class ue extends ut{render(){return this.container}showElementAndHideCanvas(t){this.data.hasOwnCanvas&&(t.previousSibling?.nodeName==="CANVAS"&&(t.previousSibling.hidden=!0),t.hidden=!1)}_getKeyModifier(t){return yt.platform.isMac?t.metaKey:t.ctrlKey}_setEventListener(t,e,s,i,n){s.includes("mouse")?t.addEventListener(s,r=>{this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:i,value:n(r),shift:r.shiftKey,modifier:this._getKeyModifier(r)}})}):t.addEventListener(s,r=>{if(s==="blur"){if(!e.focused||!r.relatedTarget)return;e.focused=!1}else if(s==="focus"){if(e.focused)return;e.focused=!0}n&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:i,value:n(r)}})})}_setEventListeners(t,e,s,i){for(const[n,r]of s)(r==="Action"||this.data.actions?.[r])&&((r==="Focus"||r==="Blur")&&(e||={focused:!1}),this._setEventListener(t,e,n,r,i),r==="Focus"&&!this.data.actions?.Blur?this._setEventListener(t,e,"blur","Blur",null):r==="Blur"&&!this.data.actions?.Focus&&this._setEventListener(t,e,"focus","Focus",null))}_setBackgroundColor(t){const e=this.data.backgroundColor||null;t.style.backgroundColor=e===null?"transparent":F.makeHexColor(...e)}_setTextStyle(t){const e=["left","center","right"],{fontColor:s}=this.data.defaultAppearanceData,i=this.data.defaultAppearanceData.fontSize||ta,n=t.style;let r;const a=2,o=l=>Math.round(10*l)/10;if(this.data.multiLine){const l=Math.abs(this.data.rect[3]-this.data.rect[1]-a),c=Math.round(l/(Es*i))||1,d=l/c;r=Math.min(i,o(d/Es))}else{const l=Math.abs(this.data.rect[3]-this.data.rect[1]-a);r=Math.min(i,o(l/Es))}n.fontSize=`calc(${r}px * var(--total-scale-factor))`,n.color=F.makeHexColor(...s),this.data.textAlignment!==null&&(n.textAlign=e[this.data.textAlignment])}_setRequired(t,e){e?t.setAttribute("required",!0):t.removeAttribute("required"),t.setAttribute("aria-required",e)}}class na extends ue{constructor(t){const e=t.renderForms||t.data.hasOwnCanvas||!t.data.hasAppearance&&!!t.data.fieldValue;super(t,{isRenderable:e})}setPropertyOnSiblings(t,e,s,i){const n=this.annotationStorage;for(const r of this._getElementsByName(t.name,t.id))r.domElement&&(r.domElement[e]=s),n.setValue(r.id,{[i]:s})}render(){const t=this.annotationStorage,e=this.data.id;this.container.classList.add("textWidgetAnnotation");let s=null;if(this.renderForms){const i=t.getValue(e,{value:this.data.fieldValue});let n=i.value||"";const r=t.getValue(e,{charLimit:this.data.maxLen}).charLimit;r&&n.length>r&&(n=n.slice(0,r));let a=i.formattedValue||this.data.textContent?.join(`
|
|
48
|
+
`)||null;a&&this.data.comb&&(a=a.replaceAll(/\s+/g,""));const o={userValue:n,formattedValue:a,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?(s=document.createElement("textarea"),s.textContent=a??n,this.data.doNotScroll&&(s.style.overflowY="hidden")):(s=document.createElement("input"),s.type=this.data.password?"password":"text",s.setAttribute("value",a??n),this.data.doNotScroll&&(s.style.overflowX="hidden")),this.data.hasOwnCanvas&&(s.hidden=!0),ce.add(s),this.contentElement=s,s.setAttribute("data-element-id",e),s.disabled=this.data.readOnly,s.name=this.data.fieldName,s.tabIndex=0;const{datetimeFormat:l,datetimeType:c,timeStep:d}=this.data,u=!!c&&this.enableScripting;l&&(s.title=l),this._setRequired(s,this.data.required),r&&(s.maxLength=r),s.addEventListener("input",g=>{t.setValue(e,{value:g.target.value}),this.setPropertyOnSiblings(s,"value",g.target.value,"value"),o.formattedValue=null}),s.addEventListener("resetform",g=>{const p=this.data.defaultFieldValue??"";s.value=o.userValue=p,o.formattedValue=null});let f=g=>{const{formattedValue:p}=o;p!=null&&(g.target.value=p),g.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){s.addEventListener("focus",p=>{if(o.focused)return;const{target:m}=p;if(u&&(m.type=c,d&&(m.step=d)),o.userValue){const v=o.userValue;if(u)if(c==="time"){const y=new Date(v),b=[y.getHours(),y.getMinutes(),y.getSeconds()];m.value=b.map(w=>w.toString().padStart(2,"0")).join(":")}else m.value=new Date(v-ea).toISOString().split(c==="date"?"T":".",1)[0];else m.value=v}o.lastCommittedValue=m.value,o.commitKey=1,this.data.actions?.Focus||(o.focused=!0)}),s.addEventListener("updatefromsandbox",p=>{this.showElementAndHideCanvas(p.target);const m={value(v){o.userValue=v.detail.value??"",u||t.setValue(e,{value:o.userValue.toString()}),v.target.value=o.userValue},formattedValue(v){const{formattedValue:y}=v.detail;o.formattedValue=y,y!=null&&v.target!==document.activeElement&&(v.target.value=y);const b={formattedValue:y};u&&(b.value=y),t.setValue(e,b)},selRange(v){v.target.setSelectionRange(...v.detail.selRange)},charLimit:v=>{const{charLimit:y}=v.detail,{target:b}=v;if(y===0){b.removeAttribute("maxLength");return}b.setAttribute("maxLength",y);let w=o.userValue;!w||w.length<=y||(w=w.slice(0,y),b.value=o.userValue=w,t.setValue(e,{value:w}),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:w,willCommit:!0,commitKey:1,selStart:b.selectionStart,selEnd:b.selectionEnd}}))}};this._dispatchEventFromSandbox(m,p)}),s.addEventListener("keydown",p=>{o.commitKey=1;let m=-1;if(p.key==="Escape"?m=0:p.key==="Enter"&&!this.data.multiLine?m=2:p.key==="Tab"&&(o.commitKey=3),m===-1)return;const{value:v}=p.target;o.lastCommittedValue!==v&&(o.lastCommittedValue=v,o.userValue=v,this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:v,willCommit:!0,commitKey:m,selStart:p.target.selectionStart,selEnd:p.target.selectionEnd}}))});const g=f;f=null,s.addEventListener("blur",p=>{if(!o.focused||!p.relatedTarget)return;this.data.actions?.Blur||(o.focused=!1);const{target:m}=p;let{value:v}=m;if(u){if(v&&c==="time"){const y=v.split(":").map(b=>parseInt(b,10));v=new Date(2e3,0,1,y[0],y[1],y[2]||0).valueOf(),m.step=""}else v.includes("T")||(v=`${v}T00:00`),v=new Date(v).valueOf();m.type="text"}o.userValue=v,o.lastCommittedValue!==v&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:v,willCommit:!0,commitKey:o.commitKey,selStart:p.target.selectionStart,selEnd:p.target.selectionEnd}}),g(p)}),this.data.actions?.Keystroke&&s.addEventListener("beforeinput",p=>{o.lastCommittedValue=null;const{data:m,target:v}=p,{value:y,selectionStart:b,selectionEnd:w}=v;let A=b,S=w;switch(p.inputType){case"deleteWordBackward":{const E=y.substring(0,b).match(/\w*[^\w]*$/);E&&(A-=E[0].length);break}case"deleteWordForward":{const E=y.substring(b).match(/^[^\w]*\w*/);E&&(S+=E[0].length);break}case"deleteContentBackward":b===w&&(A-=1);break;case"deleteContentForward":b===w&&(S+=1);break}p.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:y,change:m||"",willCommit:!1,selStart:A,selEnd:S}})}),this._setEventListeners(s,o,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],p=>p.target.value)}if(f&&s.addEventListener("blur",f),this.data.comb){const p=(this.data.rect[2]-this.data.rect[0])/r;s.classList.add("comb"),s.style.letterSpacing=`calc(${p}px * var(--total-scale-factor) - 1ch)`}}else s=document.createElement("div"),s.textContent=this.data.fieldValue,s.style.verticalAlign="middle",s.style.display="table-cell",this.data.hasOwnCanvas&&(s.hidden=!0);return this._setTextStyle(s),this._setBackgroundColor(s),this._setDefaultPropertiesFromJS(s),this.container.append(s),this.container}}class ra extends ue{constructor(t){super(t,{isRenderable:!!t.data.hasOwnCanvas})}}class aa extends ue{constructor(t){super(t,{isRenderable:t.renderForms})}render(){const t=this.annotationStorage,e=this.data,s=e.id;let i=t.getValue(s,{value:e.exportValue===e.fieldValue}).value;typeof i=="string"&&(i=i!=="Off",t.setValue(s,{value:i})),this.container.classList.add("buttonWidgetAnnotation","checkBox");const n=document.createElement("input");return ce.add(n),n.setAttribute("data-element-id",s),n.disabled=e.readOnly,this._setRequired(n,this.data.required),n.type="checkbox",n.name=e.fieldName,i&&n.setAttribute("checked",!0),n.setAttribute("exportValue",e.exportValue),n.tabIndex=0,n.addEventListener("change",r=>{const{name:a,checked:o}=r.target;for(const l of this._getElementsByName(a,s)){const c=o&&l.exportValue===e.exportValue;l.domElement&&(l.domElement.checked=c),t.setValue(l.id,{value:c})}t.setValue(s,{value:o})}),n.addEventListener("resetform",r=>{const a=e.defaultFieldValue||"Off";r.target.checked=a===e.exportValue}),this.enableScripting&&this.hasJSActions&&(n.addEventListener("updatefromsandbox",r=>{const a={value(o){o.target.checked=o.detail.value!=="Off",t.setValue(s,{value:o.target.checked})}};this._dispatchEventFromSandbox(a,r)}),this._setEventListeners(n,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],r=>r.target.checked)),this._setBackgroundColor(n),this._setDefaultPropertiesFromJS(n),this.container.append(n),this.container}}class ln extends ue{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.classList.add("buttonWidgetAnnotation","radioButton");const t=this.annotationStorage,e=this.data,s=e.id;let i=t.getValue(s,{value:e.fieldValue===e.buttonValue}).value;if(typeof i=="string"&&(i=i!==e.buttonValue,t.setValue(s,{value:i})),i)for(const r of this._getElementsByName(e.fieldName,s))t.setValue(r.id,{value:!1});const n=document.createElement("input");if(ce.add(n),n.setAttribute("data-element-id",s),n.disabled=e.readOnly,this._setRequired(n,this.data.required),n.type="radio",n.name=e.fieldName,i&&n.setAttribute("checked",!0),n.tabIndex=0,n.addEventListener("change",r=>{const{name:a,checked:o}=r.target;for(const l of this._getElementsByName(a,s))t.setValue(l.id,{value:!1});t.setValue(s,{value:o})}),n.addEventListener("resetform",r=>{const a=e.defaultFieldValue;r.target.checked=a!=null&&a===e.buttonValue}),this.enableScripting&&this.hasJSActions){const r=e.buttonValue;n.addEventListener("updatefromsandbox",a=>{const o={value:l=>{const c=r===l.detail.value;for(const d of this._getElementsByName(l.target.name)){const u=c&&d.id===s;d.domElement&&(d.domElement.checked=u),t.setValue(d.id,{value:u})}}};this._dispatchEventFromSandbox(o,a)}),this._setEventListeners(n,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],a=>a.target.checked)}return this._setBackgroundColor(n),this._setDefaultPropertiesFromJS(n),this.container.append(n),this.container}}class oa extends ei{constructor(t){super(t,{ignoreBorder:t.data.hasAppearance})}render(){const t=super.render();t.classList.add("buttonWidgetAnnotation","pushButton");const e=t.lastChild;return this.enableScripting&&this.hasJSActions&&e&&(this._setDefaultPropertiesFromJS(e),e.addEventListener("updatefromsandbox",s=>{this._dispatchEventFromSandbox({},s)})),t}}class la extends ue{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");const t=this.annotationStorage,e=this.data.id,s=t.getValue(e,{value:this.data.fieldValue}),i=document.createElement("select");ce.add(i),i.setAttribute("data-element-id",e),i.disabled=this.data.readOnly,this._setRequired(i,this.data.required),i.name=this.data.fieldName,i.tabIndex=0;let n=this.data.combo&&this.data.options.length>0;this.data.combo||(i.size=this.data.options.length,this.data.multiSelect&&(i.multiple=!0)),i.addEventListener("resetform",d=>{const u=this.data.defaultFieldValue;for(const f of i.options)f.selected=f.value===u});const r=(d,u)=>{const f=u.replaceAll(" "," ");d.textContent=f,f!==u&&d.setAttribute("display-value",u)};for(const d of this.data.options){const u=document.createElement("option");r(u,d.displayValue),u.value=d.exportValue,s.value.includes(d.exportValue)&&(u.setAttribute("selected",!0),n=!1),i.append(u)}let a=null;if(n){const d=document.createElement("option");d.value=" ",d.setAttribute("hidden",!0),d.setAttribute("selected",!0),i.prepend(d),a=()=>{d.remove(),i.removeEventListener("input",a),a=null},i.addEventListener("input",a)}const o=d=>{const u=d?"value":"textContent",{options:f,multiple:g}=i;return g?Array.prototype.filter.call(f,p=>p.selected).map(p=>p[u]):f.selectedIndex===-1?null:f[f.selectedIndex][u]};let l=o(!1);const c=d=>{const u=d.target.options;return Array.prototype.map.call(u,f=>({displayValue:f.getAttribute("display-value")||f.textContent,exportValue:f.value}))};return this.enableScripting&&this.hasJSActions?(i.addEventListener("updatefromsandbox",d=>{const u={value(f){a?.();const g=f.detail.value,p=new Set(Array.isArray(g)?g:[g]);for(const m of i.options)m.selected=p.has(m.value);t.setValue(e,{value:o(!0)}),l=o(!1)},multipleSelection(f){i.multiple=!0},remove(f){const g=i.options,p=f.detail.remove;g[p].selected=!1,i.remove(p),g.length>0&&Array.prototype.findIndex.call(g,v=>v.selected)===-1&&(g[0].selected=!0),t.setValue(e,{value:o(!0),items:c(f)}),l=o(!1)},clear(f){for(;i.length!==0;)i.remove(0);t.setValue(e,{value:null,items:[]}),l=o(!1)},insert(f){const{index:g,displayValue:p,exportValue:m}=f.detail.insert,v=i.children[g],y=document.createElement("option");r(y,p),y.value=m,v?v.before(y):i.append(y),t.setValue(e,{value:o(!0),items:c(f)}),l=o(!1)},items(f){const{items:g}=f.detail;for(;i.length!==0;)i.remove(0);for(const p of g){const{displayValue:m,exportValue:v}=p,y=document.createElement("option");r(y,m),y.value=v,i.append(y)}i.options.length>0&&(i.options[0].selected=!0),t.setValue(e,{value:o(!0),items:c(f)}),l=o(!1)},indices(f){const g=new Set(f.detail.indices);for(const p of f.target.options)p.selected=g.has(p.index);t.setValue(e,{value:o(!0)}),l=o(!1)},editable(f){f.target.disabled=!f.detail.editable}};this._dispatchEventFromSandbox(u,d)}),i.addEventListener("input",d=>{const u=o(!0),f=o(!1);t.setValue(e,{value:u}),d.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:l,change:f,changeEx:u,willCommit:!1,commitKey:1,keyDown:!1}})}),this._setEventListeners(i,null,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],d=>d.target.value)):i.addEventListener("input",function(d){t.setValue(e,{value:o(!0)})}),this.data.combo&&this._setTextStyle(i),this._setBackgroundColor(i),this._setDefaultPropertiesFromJS(i),this.container.append(i),this.container}}class Us extends ut{constructor(t){const{data:e,elements:s,parent:i}=t,n=!!i._commentManager;if(super(t,{isRenderable:!n&&ut._hasPopupData(e)}),this.elements=s,n&&ut._hasPopupData(e)){const r=this.popup=this.#t();for(const a of s)a.popup=r}else this.popup=null}#t(){return new ha({container:this.container,color:this.data.color,titleObj:this.data.titleObj,modificationDate:this.data.modificationDate||this.data.creationDate,contentsObj:this.data.contentsObj,richText:this.data.richText,rect:this.data.rect,parentRect:this.data.parentRect||null,parent:this.parent,elements:this.elements,open:this.data.open,commentManager:this.parent._commentManager})}render(){const{container:t}=this;t.classList.add("popupAnnotation"),t.role="comment";const e=this.popup=this.#t(),s=[];for(const i of this.elements)i.popup=e,i.container.ariaHasPopup="dialog",s.push(i.data.id),i.addHighlightArea();return this.container.setAttribute("aria-controls",s.map(i=>`${ye}${i}`).join(",")),this.container}}class ha{#t=null;#e=this.#U.bind(this);#s=this.#k.bind(this);#i=this.#A.bind(this);#n=this.#T.bind(this);#r=null;#a=null;#o=null;#h=null;#l=null;#u=null;#d=null;#f=!1;#m=null;#g=null;#c=null;#p=null;#v=null;#w=null;#b=null;#E=null;#P=null;#y=null;#x=!1;#S=null;#C=null;constructor({container:t,color:e,elements:s,titleObj:i,modificationDate:n,contentsObj:r,richText:a,parent:o,rect:l,parentRect:c,open:d,commentManager:u=null}){this.#a=t,this.#P=i,this.#o=r,this.#E=a,this.#u=o,this.#r=e,this.#b=l,this.#d=c,this.#l=s,this.#t=u,this.#S=s[0],this.#h=Fs.toDateObject(n),this.trigger=s.flatMap(f=>f.getElementsToTriggerPopup()),u||(this.#R(),this.#a.hidden=!0,d&&this.#T())}#R(){if(this.#g)return;this.#g=new AbortController;const{signal:t}=this.#g;for(const e of this.trigger)e.addEventListener("click",this.#n,{signal:t}),e.addEventListener("pointerenter",this.#i,{signal:t}),e.addEventListener("pointerleave",this.#s,{signal:t}),e.classList.add("popupTriggerArea");for(const e of this.#l)e.container?.addEventListener("keydown",this.#e,{signal:t})}#O(){const t=this.#l.find(e=>e.hasCommentButton);t&&(this.#v=t._normalizePoint(t.commentButtonPosition))}renderCommentButton(){if(this.#p){this.#p.parentNode||this.#S.container.after(this.#p);return}if(this.#v||this.#O(),!this.#v)return;const{signal:t}=this.#g=new AbortController,e=this.#S.hasOwnCommentButton,s=()=>{this.#t.toggleCommentPopup(this,!0,void 0,!e)},i=()=>{this.#t.toggleCommentPopup(this,!1,!0,!e)},n=()=>{this.#t.toggleCommentPopup(this,!1,!1)};if(e){this.#p=this.#S.container;for(const r of this.trigger)r.ariaHasPopup="dialog",r.ariaControls="commentPopup",r.addEventListener("keydown",this.#e,{signal:t}),r.addEventListener("click",s,{signal:t}),r.addEventListener("pointerenter",i,{signal:t}),r.addEventListener("pointerleave",n,{signal:t}),r.classList.add("popupTriggerArea")}else{const r=this.#p=document.createElement("button");r.className="annotationCommentButton";const a=this.#S.container;r.style.zIndex=parseInt(a.style.zIndex,10)+1,r.tabIndex=0,r.ariaHasPopup="dialog",r.ariaControls="commentPopup",r.setAttribute("data-l10n-id","pdfjs-show-comment-button"),this.#F(),this.#I(),r.addEventListener("keydown",this.#e,{signal:t}),r.addEventListener("click",s,{signal:t}),r.addEventListener("pointerenter",i,{signal:t}),r.addEventListener("pointerleave",n,{signal:t}),a.after(r)}}#I(){if(this.#S.extraPopupElement&&!this.#S.editor)return;this.#p||this.renderCommentButton();const[t,e]=this.#v,{style:s}=this.#p;s.left=`calc(${t}%)`,s.top=`calc(${e}% - var(--comment-button-dim))`}#F(){this.#S.extraPopupElement||(this.#p||this.renderCommentButton(),this.#p.style.backgroundColor=this.commentButtonColor||"")}get commentButtonColor(){const{color:t,opacity:e}=this.#S.commentData;return t?this.#u._commentManager.makeCommentColor(t,e):null}focusCommentButton(){setTimeout(()=>{this.#p?.focus()},0)}getData(){const{richText:t,color:e,opacity:s,creationDate:i,modificationDate:n}=this.#S.commentData;return{contentsObj:{str:this.comment},richText:t,color:e,opacity:s,creationDate:i,modificationDate:n}}get elementBeforePopup(){return this.#p}get comment(){return this.#C||=this.#S.commentText,this.#C}set comment(t){t!==this.comment&&(this.#S.commentText=this.#C=t)}focus(){this.#S.container?.focus()}get parentBoundingClientRect(){return this.#S.layer.getBoundingClientRect()}setCommentButtonStates({selected:t,hasPopup:e}){this.#p&&(this.#p.classList.toggle("selected",t),this.#p.ariaExpanded=e)}setSelectedCommentButton(t){this.#p.classList.toggle("selected",t)}get commentPopupPosition(){if(this.#w)return this.#w;const{x:t,y:e,height:s}=this.#p.getBoundingClientRect(),{x:i,y:n,width:r,height:a}=this.#S.layer.getBoundingClientRect();return[(t-i)/r,(e+s-n)/a]}set commentPopupPosition(t){this.#w=t}hasDefaultPopupPosition(){return this.#w===null}get commentButtonPosition(){return this.#v}get commentButtonWidth(){return this.#p.getBoundingClientRect().width/this.parentBoundingClientRect.width}editComment(t){const[e,s]=this.#w||this.commentButtonPosition.map(l=>l/100),i=this.parentBoundingClientRect,{x:n,y:r,width:a,height:o}=i;this.#t.showDialog(null,this,n+e*a,r+s*o,{...t,parentDimensions:i})}render(){if(this.#m)return;const t=this.#m=document.createElement("div");if(t.className="popup",this.#r){const s=t.style.outlineColor=F.makeHexColor(...this.#r);t.style.backgroundColor=`color-mix(in srgb, ${s} 30%, white)`}const e=document.createElement("span");if(e.className="header",this.#P?.str){const s=document.createElement("span");s.className="title",e.append(s),{dir:s.dir,str:s.textContent}=this.#P}if(t.append(e),this.#h){const s=document.createElement("time");s.className="popupDate",s.setAttribute("data-l10n-id","pdfjs-annotation-date-time-string"),s.setAttribute("data-l10n-args",JSON.stringify({dateObj:this.#h.valueOf()})),s.dateTime=this.#h.toISOString(),e.append(s)}Gi({html:this.#L||this.#o.str,dir:this.#o?.dir,className:"popupContent"},t),this.#a.append(t)}get#L(){const t=this.#E,e=this.#o;return t?.str&&(!e?.str||e.str===t.str)&&this.#E.html||null}get#D(){return this.#L?.attributes?.style?.fontSize||0}get#N(){return this.#L?.attributes?.style?.color||null}#B(t){const e=[],s={str:t,html:{name:"div",attributes:{dir:"auto"},children:[{name:"p",children:e}]}},i={style:{color:this.#N,fontSize:this.#D?`calc(${this.#D}px * var(--total-scale-factor))`:""}};for(const n of t.split(`
|
|
49
|
+
`))e.push({name:"span",value:n,attributes:i});return s}#U(t){t.altKey||t.shiftKey||t.ctrlKey||t.metaKey||(t.key==="Enter"||t.key==="Escape"&&this.#f)&&this.#T()}updateEdited({rect:t,popup:e,deleted:s}){if(this.#t){s?(this.remove(),this.#C=null):e&&(e.deleted?this.remove():(this.#F(),this.#C=e.text)),t&&(this.#v=null,this.#O(),this.#I());return}if(s||e?.deleted){this.remove();return}this.#R(),this.#y||={contentsObj:this.#o,richText:this.#E},t&&(this.#c=null),e&&e.text&&(this.#E=this.#B(e.text),this.#h=Fs.toDateObject(e.date),this.#o=null),this.#m?.remove(),this.#m=null}resetEdited(){this.#y&&({contentsObj:this.#o,richText:this.#E}=this.#y,this.#y=null,this.#m?.remove(),this.#m=null,this.#c=null)}remove(){if(this.#g?.abort(),this.#g=null,this.#m?.remove(),this.#m=null,this.#x=!1,this.#f=!1,this.#p?.remove(),this.#p=null,this.trigger)for(const t of this.trigger)t.classList.remove("popupTriggerArea")}#V(){if(this.#c!==null)return;const{page:{view:t},viewport:{rawDims:{pageWidth:e,pageHeight:s,pageX:i,pageY:n}}}=this.#u;let r=!!this.#d,a=r?this.#d:this.#b;for(const g of this.#l)if(!a||F.intersect(g.data.rect,a)!==null){a=g.data.rect,r=!0;break}const o=F.normalizeRect([a[0],t[3]-a[1]+t[1],a[2],t[3]-a[3]+t[1]]),c=r?a[2]-a[0]+5:0,d=o[0]+c,u=o[1];this.#c=[100*(d-i)/e,100*(u-n)/s];const{style:f}=this.#a;f.left=`${this.#c[0]}%`,f.top=`${this.#c[1]}%`}#T(){if(this.#t){this.#t.toggleCommentPopup(this,!1);return}this.#f=!this.#f,this.#f?(this.#A(),this.#a.addEventListener("click",this.#n),this.#a.addEventListener("keydown",this.#e)):(this.#k(),this.#a.removeEventListener("click",this.#n),this.#a.removeEventListener("keydown",this.#e))}#A(){this.#m||this.render(),this.isVisible?this.#f&&this.#a.classList.add("focused"):(this.#V(),this.#a.hidden=!1,this.#a.style.zIndex=parseInt(this.#a.style.zIndex,10)+1e3)}#k(){this.#a.classList.remove("focused"),!(this.#f||!this.isVisible)&&(this.#a.hidden=!0,this.#a.style.zIndex=parseInt(this.#a.style.zIndex,10)-1e3)}forceHide(){this.#x=this.isVisible,this.#x&&(this.#a.hidden=!0)}maybeShow(){this.#t||(this.#R(),this.#x&&(this.#m||this.#A(),this.#x=!1,this.#a.hidden=!1))}get isVisible(){return this.#t?!1:this.#a.hidden===!1}}class hn extends ut{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.textContent=t.data.textContent,this.textPosition=t.data.textPosition,this.annotationEditorType=Y.FREETEXT}render(){if(this.container.classList.add("freeTextAnnotation"),this.textContent){const t=this.contentElement=document.createElement("div");t.classList.add("annotationTextContent"),t.setAttribute("role","comment");for(const e of this.textContent){const s=document.createElement("span");s.textContent=e,t.append(s)}this.container.append(t)}return!this.data.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this._editOnDoubleClick(),this.container}}class ca extends ut{#t=null;constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("lineAnnotation");const{data:t,width:e,height:s}=this,i=this.svgFactory.create(e,s,!0),n=this.#t=this.svgFactory.createElement("svg:line");return n.setAttribute("x1",t.rect[2]-t.lineCoordinates[0]),n.setAttribute("y1",t.rect[3]-t.lineCoordinates[1]),n.setAttribute("x2",t.rect[2]-t.lineCoordinates[2]),n.setAttribute("y2",t.rect[3]-t.lineCoordinates[3]),n.setAttribute("stroke-width",t.borderStyle.width||1),n.setAttribute("stroke","transparent"),n.setAttribute("fill","transparent"),i.append(n),this.container.append(i),!t.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container}getElementsToTriggerPopup(){return this.#t}addHighlightArea(){this.container.classList.add("highlightArea")}}class da extends ut{#t=null;constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("squareAnnotation");const{data:t,width:e,height:s}=this,i=this.svgFactory.create(e,s,!0),n=t.borderStyle.width,r=this.#t=this.svgFactory.createElement("svg:rect");return r.setAttribute("x",n/2),r.setAttribute("y",n/2),r.setAttribute("width",e-n),r.setAttribute("height",s-n),r.setAttribute("stroke-width",n||1),r.setAttribute("stroke","transparent"),r.setAttribute("fill","transparent"),i.append(r),this.container.append(i),!t.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container}getElementsToTriggerPopup(){return this.#t}addHighlightArea(){this.container.classList.add("highlightArea")}}class ua extends ut{#t=null;constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("circleAnnotation");const{data:t,width:e,height:s}=this,i=this.svgFactory.create(e,s,!0),n=t.borderStyle.width,r=this.#t=this.svgFactory.createElement("svg:ellipse");return r.setAttribute("cx",e/2),r.setAttribute("cy",s/2),r.setAttribute("rx",e/2-n/2),r.setAttribute("ry",s/2-n/2),r.setAttribute("stroke-width",n||1),r.setAttribute("stroke","transparent"),r.setAttribute("fill","transparent"),i.append(r),this.container.append(i),!t.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container}getElementsToTriggerPopup(){return this.#t}addHighlightArea(){this.container.classList.add("highlightArea")}}class cn extends ut{#t=null;constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.containerClassName="polylineAnnotation",this.svgElementName="svg:polyline"}render(){this.container.classList.add(this.containerClassName);const{data:{rect:t,vertices:e,borderStyle:s,popupRef:i},width:n,height:r}=this;if(!e)return this.container;const a=this.svgFactory.create(n,r,!0);let o=[];for(let c=0,d=e.length;c<d;c+=2){const u=e[c]-t[0],f=t[3]-e[c+1];o.push(`${u},${f}`)}o=o.join(" ");const l=this.#t=this.svgFactory.createElement(this.svgElementName);return l.setAttribute("points",o),l.setAttribute("stroke-width",s.width||1),l.setAttribute("stroke","transparent"),l.setAttribute("fill","transparent"),a.append(l),this.container.append(a),!i&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container}getElementsToTriggerPopup(){return this.#t}addHighlightArea(){this.container.classList.add("highlightArea")}}class fa extends cn{constructor(t){super(t),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}}class pa extends ut{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("caretAnnotation"),!this.data.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container}}class si extends ut{#t=null;#e=[];constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline",this.annotationEditorType=this.data.it==="InkHighlight"?Y.HIGHLIGHT:Y.INK}#s(t,e){switch(t){case 90:return{transform:`rotate(90) translate(${-e[0]},${e[1]}) scale(1,-1)`,width:e[3]-e[1],height:e[2]-e[0]};case 180:return{transform:`rotate(180) translate(${-e[2]},${e[1]}) scale(1,-1)`,width:e[2]-e[0],height:e[3]-e[1]};case 270:return{transform:`rotate(270) translate(${-e[2]},${e[3]}) scale(1,-1)`,width:e[3]-e[1],height:e[2]-e[0]};default:return{transform:`translate(${-e[0]},${e[3]}) scale(1,-1)`,width:e[2]-e[0],height:e[3]-e[1]}}}render(){this.container.classList.add(this.containerClassName);const{data:{rect:t,rotation:e,inkLists:s,borderStyle:i,popupRef:n}}=this,{transform:r,width:a,height:o}=this.#s(e,t),l=this.svgFactory.create(a,o,!0),c=this.#t=this.svgFactory.createElement("svg:g");l.append(c),c.setAttribute("stroke-width",i.width||1),c.setAttribute("stroke-linecap","round"),c.setAttribute("stroke-linejoin","round"),c.setAttribute("stroke-miterlimit",10),c.setAttribute("stroke","transparent"),c.setAttribute("fill","transparent"),c.setAttribute("transform",r);for(let d=0,u=s.length;d<u;d++){const f=this.svgFactory.createElement(this.svgElementName);this.#e.push(f),f.setAttribute("points",s[d].join(",")),c.append(f)}return!n&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container.append(l),this._editOnDoubleClick(),this.container}updateEdited(t){super.updateEdited(t);const{thickness:e,points:s,rect:i}=t,n=this.#t;if(e>=0&&n.setAttribute("stroke-width",e||1),s)for(let r=0,a=this.#e.length;r<a;r++)this.#e[r].setAttribute("points",s[r].join(","));if(i){const{transform:r,width:a,height:o}=this.#s(this.data.rotation,i);n.parentElement.setAttribute("viewBox",`0 0 ${a} ${o}`),n.setAttribute("transform",r)}}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add("highlightArea")}}class dn extends ut{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0}),this.annotationEditorType=Y.HIGHLIGHT}render(){const{data:{overlaidText:t,popupRef:e}}=this;if(!e&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container.classList.add("highlightAnnotation"),this._editOnDoubleClick(),t){const s=document.createElement("mark");s.classList.add("overlaidText"),s.textContent=t,this.container.append(s)}return this.container}}class ga extends ut{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){const{data:{overlaidText:t,popupRef:e}}=this;if(!e&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container.classList.add("underlineAnnotation"),t){const s=document.createElement("u");s.classList.add("overlaidText"),s.textContent=t,this.container.append(s)}return this.container}}class ma extends ut{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){const{data:{overlaidText:t,popupRef:e}}=this;if(!e&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container.classList.add("squigglyAnnotation"),t){const s=document.createElement("u");s.classList.add("overlaidText"),s.textContent=t,this.container.append(s)}return this.container}}class va extends ut{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){const{data:{overlaidText:t,popupRef:e}}=this;if(!e&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container.classList.add("strikeoutAnnotation"),t){const s=document.createElement("s");s.classList.add("overlaidText"),s.textContent=t,this.container.append(s)}return this.container}}class un extends ut{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.annotationEditorType=Y.STAMP}render(){return this.container.classList.add("stampAnnotation"),this.container.setAttribute("role","img"),!this.data.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this._editOnDoubleClick(),this.container}}class ya extends ut{#t=null;constructor(t){super(t,{isRenderable:!0});const{file:e}=this.data;this.filename=e.filename,this.content=e.content,this.linkService.eventBus?.dispatch("fileattachmentannotation",{source:this,...e})}render(){this.container.classList.add("fileAttachmentAnnotation");const{container:t,data:e}=this;let s;e.hasAppearance||e.fillAlpha===0?s=document.createElement("div"):(s=document.createElement("img"),s.src=`${this.imageResourcesPath}annotation-${/paperclip/i.test(e.name)?"paperclip":"pushpin"}.svg`,e.fillAlpha&&e.fillAlpha<1&&(s.style=`filter: opacity(${Math.round(e.fillAlpha*100)}%);`)),s.addEventListener("dblclick",this.#e.bind(this)),this.#t=s;const{isMac:i}=yt.platform;return t.addEventListener("keydown",n=>{n.key==="Enter"&&(i?n.metaKey:n.ctrlKey)&&this.#e()}),!e.popupRef&&this.hasPopupData?(this.hasOwnCommentButton=!0,this._createPopup()):s.classList.add("popupTriggerArea"),t.append(s),t}getElementsToTriggerPopup(){return this.#t}addHighlightArea(){this.container.classList.add("highlightArea")}#e(){this.downloadManager?.openOrDownloadData(this.content,this.filename)}}class ii{#t=null;#e=null;#s=null;#i=new Map;#n=null;#r=null;#a=[];#o=!1;zIndex=0;constructor({div:t,accessibilityManager:e,annotationCanvasMap:s,annotationEditorUIManager:i,page:n,viewport:r,structTreeLayer:a,commentManager:o,linkService:l,annotationStorage:c}){this.div=t,this.#t=e,this.#e=s,this.#n=a||null,this.#r=l||null,this.#s=c||new Qs,this.page=n,this.viewport=r,this._annotationEditorUIManager=i,this._commentManager=o||null}hasEditableAnnotations(){return this.#i.size>0}async render(t){const{annotations:e}=t,s=this.div;he(s,this.viewport);const i=new Map,n=[],r={data:null,layer:s,linkService:this.#r,downloadManager:t.downloadManager,imageResourcesPath:t.imageResourcesPath||"",renderForms:t.renderForms!==!1,svgFactory:new ns,annotationStorage:this.#s,enableComment:t.enableComment===!0,enableScripting:t.enableScripting===!0,hasJSActions:t.hasJSActions,fieldObjects:t.fieldObjects,parent:this,elements:null};for(const a of e){if(a.noHTML)continue;const o=a.annotationType===vt.POPUP;if(o){const d=i.get(a.id);if(!d)continue;if(!this._commentManager){n.push(a);continue}r.elements=d}else if(a.rect[2]===a.rect[0]||a.rect[3]===a.rect[1])continue;r.data=a;const l=Is.create(r);if(!l.isRenderable)continue;o||(this.#a.push(l),a.popupRef&&i.getOrInsertComputed(a.popupRef,Gs).push(l));const c=l.render();a.hidden&&(c.style.visibility="hidden"),l._isEditable&&(this.#i.set(l.data.id,l),this._annotationEditorUIManager?.renderAnnotationElement(l))}await this.#h();for(const a of n){const o=r.elements=i.get(a.id);r.data=a;const l=Is.create(r);if(!l.isRenderable)continue;const c=l.render();l.contentElement.id=`${ye}${a.id}`,a.hidden&&(c.style.visibility="hidden"),o.at(-1).container.after(c)}this.#l()}async#h(){if(this.#a.length===0)return;this.div.replaceChildren();const t=[];if(!this.#o){this.#o=!0;for(const{contentElement:s,data:{id:i}}of this.#a){const n=s.id=`${ye}${i}`;t.push(this.#n?.getAriaAttributes(n).then(r=>{if(r)for(const[a,o]of r)s.setAttribute(a,o)}))}}this.#a.sort(({data:{rect:[s,i,n,r]}},{data:{rect:[a,o,l,c]}})=>{if(s===n&&i===r)return 1;if(a===l&&o===c)return-1;const d=r,u=i,f=(i+r)/2,g=c,p=o,m=(o+c)/2;if(f>=g&&m<=u)return-1;if(m>=d&&f<=p)return 1;const v=(s+n)/2,y=(a+l)/2;return v-y});const e=document.createDocumentFragment();for(const s of this.#a)e.append(s.container),this._commentManager?(s.extraPopupElement?.popup||s.popup)?.renderCommentButton():s.extraPopupElement&&e.append(s.extraPopupElement.render());if(this.div.append(e),await Promise.all(t),this.#t)for(const s of this.#a)this.#t.addPointerInTextLayer(s.contentElement,!1)}async addLinkAnnotations(t){const e={data:null,layer:this.div,linkService:this.#r,svgFactory:new ns,parent:this};for(const s of t){s.borderStyle||=ii._defaultBorderStyle,e.data=s;const i=Is.create(e);i.isRenderable&&(i.render(),i.contentElement.id=`${ye}${s.id}`,this.#a.push(i))}await this.#h()}update({viewport:t}){const e=this.div;this.viewport=t,he(e,{rotation:t.rotation}),this.#l(),e.hidden=!1}#l(){if(!this.#e)return;const t=this.div;for(const[e,s]of this.#e){const i=t.querySelector(`[data-annotation-id="${e}"]`);if(!i)continue;s.className="annotationContent";const{firstChild:n}=i;n?n.nodeName==="CANVAS"?n.replaceWith(s):n.classList.contains("annotationContent")?n.after(s):n.before(s):i.append(s);const r=this.#i.get(e);r&&(r._hasNoCanvas?(this._annotationEditorUIManager?.setMissingCanvas(e,i.id,s),r._hasNoCanvas=!1):r.canvas=s)}this.#e.clear()}getEditableAnnotations(){return this.#i.values()}getEditableAnnotation(t){return this.#i.get(t)}addFakeAnnotation(t){const{div:e}=this,{id:s,rotation:i}=t,n=new sa({data:{id:s,rect:t.getPDFRect(),rotation:i},editor:t,layer:e,parent:this,enableComment:!!this._commentManager,linkService:this.#r,annotationStorage:this.#s});return n.render(),n.contentElement.id=`${ye}${s}`,n.createOrUpdatePopup(),this.#a.push(n),n}removeAnnotation(t){const e=this.#a.findIndex(i=>i.data.id===t);if(e<0)return;const[s]=this.#a.splice(e,1);this.#t?.removePointerInTextLayer(s.contentElement)}updateFakeAnnotations(t){if(t.length!==0){for(const e of t)e.updateFakeAnnotationElement(this);this.#h()}}togglePointerEvents(t=!1){this.div.classList.toggle("disabled",!t)}static get _defaultBorderStyle(){return K(this,"_defaultBorderStyle",Object.freeze({width:1,rawWidth:1,style:pe.SOLID,dashArray:[3],horizontalCornerRadius:0,verticalCornerRadius:0}))}}const Ke=/\r\n?|\n/g;class St extends H{#t="";#e=`${this.id}-editor`;#s=null;#i;_colorPicker=null;static _freeTextDefaultContent="";static _internalPadding=0;static _defaultColor=null;static _defaultFontSize=10;static get _keyboardManager(){const t=St.prototype,e=n=>n.isEmpty(),s=ee.TRANSLATE_SMALL,i=ee.TRANSLATE_BIG;return K(this,"_keyboardManager",new $e([[["ctrl+s","mac+meta+s","ctrl+p","mac+meta+p"],t.commitOrRemove,{bubbles:!0}],[["ctrl+Enter","mac+meta+Enter","Escape","mac+Escape"],t.commitOrRemove],[["ArrowLeft","mac+ArrowLeft"],t._translateEmpty,{args:[-s,0],checker:e}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t._translateEmpty,{args:[-i,0],checker:e}],[["ArrowRight","mac+ArrowRight"],t._translateEmpty,{args:[s,0],checker:e}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t._translateEmpty,{args:[i,0],checker:e}],[["ArrowUp","mac+ArrowUp"],t._translateEmpty,{args:[0,-s],checker:e}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t._translateEmpty,{args:[0,-i],checker:e}],[["ArrowDown","mac+ArrowDown"],t._translateEmpty,{args:[0,s],checker:e}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t._translateEmpty,{args:[0,i],checker:e}]]))}static _type="freetext";static _editorType=Y.FREETEXT;constructor(t){super({...t,name:"freeTextEditor"}),this.color=t.color||St._defaultColor||H._defaultLineColor,this.#i=t.fontSize||St._defaultFontSize,this.annotationElementId||this._uiManager.a11yAlert("pdfjs-editor-freetext-added-alert"),this.canAddComment=!1}static initialize(t,e){H.initialize(t,e);const s=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(s.getPropertyValue("--freetext-padding"))}static updateDefaultParams(t,e){switch(t){case J.FREETEXT_SIZE:St._defaultFontSize=e;break;case J.FREETEXT_COLOR:St._defaultColor=e;break}}updateParams(t,e){switch(t){case J.FREETEXT_SIZE:this.#n(e);break;case J.FREETEXT_COLOR:this.#r(e);break}}static get defaultPropertiesToUpdate(){return[[J.FREETEXT_SIZE,St._defaultFontSize],[J.FREETEXT_COLOR,St._defaultColor||H._defaultLineColor]]}get propertiesToUpdate(){return[[J.FREETEXT_SIZE,this.#i],[J.FREETEXT_COLOR,this.color]]}get toolbarButtons(){return this._colorPicker||=new _e(this),[["colorPicker",this._colorPicker]]}get colorType(){return J.FREETEXT_COLOR}#n(t){const e=i=>{this.editorDiv.style.fontSize=`calc(${i}px * var(--total-scale-factor))`,this.translate(0,-(i-this.#i)*this.parentScale),this.#i=i,this.#o()},s=this.#i;this.addCommands({cmd:e.bind(this,t),undo:e.bind(this,s),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:J.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})}onUpdatedColor(){this.editorDiv.style.color=this.color,this._colorPicker?.update(this.color),super.onUpdatedColor()}#r(t){const e=i=>{this.color=i,this.onUpdatedColor()},s=this.color;this.addCommands({cmd:e.bind(this,t),undo:e.bind(this,s),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:J.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})}_translateEmpty(t,e){this._uiManager.translateSelectedEditors(t,e,!0)}getInitialTranslation(){const t=this.parentScale;return[-St._internalPadding*t,-(St._internalPadding+this.#i)*t]}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(this.isAttachedToDOM||this.parent.add(this)))}enableEditMode(){if(!super.enableEditMode())return!1;this.overlayDiv.classList.remove("enabled"),this.editorDiv.contentEditable=!0,this._isDraggable=!1,this.div.removeAttribute("aria-activedescendant"),this.#s=new AbortController;const t=this._uiManager.combinedSignal(this.#s);return this.editorDiv.addEventListener("keydown",this.editorDivKeydown.bind(this),{signal:t}),this.editorDiv.addEventListener("focus",this.editorDivFocus.bind(this),{signal:t}),this.editorDiv.addEventListener("blur",this.editorDivBlur.bind(this),{signal:t}),this.editorDiv.addEventListener("input",this.editorDivInput.bind(this),{signal:t}),this.editorDiv.addEventListener("paste",this.editorDivPaste.bind(this),{signal:t}),!0}disableEditMode(){return super.disableEditMode()?(this.overlayDiv.classList.add("enabled"),this.editorDiv.contentEditable=!1,this.div.setAttribute("aria-activedescendant",this.#e),this._isDraggable=!0,this.#s?.abort(),this.#s=null,this.div.focus({preventScroll:!0}),this.isEditing=!1,this.parent.div.classList.add("freetextEditing"),!0):!1}focusin(t){this._focusEventsAllowed&&(super.focusin(t),t.target!==this.editorDiv&&this.editorDiv.focus())}onceAdded(t){this.width||(this.enableEditMode(),t&&this.editorDiv.focus(),this._initialOptions?.isCentered&&this.center(),this._initialOptions=null)}isEmpty(){return!this.editorDiv||this.editorDiv.innerText.trim()===""}remove(){this.isEditing=!1,this.parent&&(this.parent.setEditingState(!0),this.parent.div.classList.add("freetextEditing")),super.remove()}#a(){const t=[];this.editorDiv.normalize();let e=null;for(const s of this.editorDiv.childNodes)e?.nodeType===Node.TEXT_NODE&&s.nodeName==="BR"||(t.push(St.#h(s)),e=s);return t.join(`
|
|
50
|
+
`)}#o(){const[t,e]=this.parentDimensions;let s;if(this.isAttachedToDOM)s=this.div.getBoundingClientRect();else{const{currentLayer:i,div:n}=this,r=n.style.display,a=n.classList.contains("hidden");n.classList.remove("hidden"),n.style.display="hidden",i.div.append(this.div),s=n.getBoundingClientRect(),n.remove(),n.style.display=r,n.classList.toggle("hidden",a)}this.rotation%180===this.parentRotation%180?(this.width=s.width/t,this.height=s.height/e):(this.width=s.height/t,this.height=s.width/e),this.fixAndSetPosition()}commit(){if(!this.isInEditMode())return;super.commit(),this.disableEditMode();const t=this.#t,e=this.#t=this.#a().trimEnd();if(t===e)return;const s=i=>{if(this.#t=i,!i){this.remove();return}this.#l(),this._uiManager.rebuild(this),this.#o()};this.addCommands({cmd:()=>{s(e)},undo:()=>{s(t)},mustExec:!1}),this.#o()}shouldGetKeyboardEvents(){return this.isInEditMode()}enterInEditMode(){this.enableEditMode(),this.editorDiv.focus()}keydown(t){t.target===this.div&&t.key==="Enter"&&(this.enterInEditMode(),t.preventDefault())}editorDivKeydown(t){St._keyboardManager.exec(this,t)}editorDivFocus(t){this.isEditing=!0}editorDivBlur(t){this.isEditing=!1}editorDivInput(t){this.parent.div.classList.toggle("freetextEditing",this.isEmpty())}disableEditing(){this.editorDiv.setAttribute("role","comment"),this.editorDiv.removeAttribute("aria-multiline")}enableEditing(){this.editorDiv.setAttribute("role","textbox"),this.editorDiv.setAttribute("aria-multiline",!0)}get canChangeContent(){return!0}render(){if(this.div)return this.div;let t,e;(this._isCopy||this.annotationElementId)&&(t=this.x,e=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",this.#e),this.editorDiv.setAttribute("data-l10n-id","pdfjs-free-text2"),this.editorDiv.setAttribute("data-l10n-attrs","default-content"),this.enableEditing(),this.editorDiv.contentEditable=!0;const{style:s}=this.editorDiv;if(s.fontSize=`calc(${this.#i}px * var(--total-scale-factor))`,s.color=this.color,this.div.append(this.editorDiv),this.overlayDiv=document.createElement("div"),this.overlayDiv.classList.add("overlay","enabled"),this.div.append(this.overlayDiv),this._isCopy||this.annotationElementId){const[i,n]=this.parentDimensions;if(this.annotationElementId){const{position:r}=this._initialData;let[a,o]=this.getInitialTranslation();[a,o]=this.pageTranslationToScreen(a,o);const[l,c]=this.pageDimensions,[d,u]=this.pageTranslation;let f,g;switch(this.rotation){case 0:f=t+(r[0]-d)/l,g=e+this.height-(r[1]-u)/c;break;case 90:f=t+(r[0]-d)/l,g=e-(r[1]-u)/c,[a,o]=[o,-a];break;case 180:f=t-this.width+(r[0]-d)/l,g=e-(r[1]-u)/c,[a,o]=[-a,-o];break;case 270:f=t+(r[0]-d-this.height*c)/l,g=e+(r[1]-u-this.width*l)/c,[a,o]=[-o,a];break}this.setAt(f*i,g*n,a,o)}else this._moveAfterPaste(t,e);this.#l(),this._isDraggable=!0,this.editorDiv.contentEditable=!1}else this._isDraggable=!1,this.editorDiv.contentEditable=!0;return this.div}static#h(t){return(t.nodeType===Node.TEXT_NODE?t.nodeValue:t.innerText).replaceAll(Ke,"")}editorDivPaste(t){const e=t.clipboardData||window.clipboardData,{types:s}=e;if(s.length===1&&s[0]==="text/plain")return;t.preventDefault();const i=St.#d(e.getData("text")||"").replaceAll(Ke,`
|
|
51
|
+
`);if(!i)return;const n=window.getSelection();if(!n.rangeCount)return;this.editorDiv.normalize(),n.deleteFromDocument();const r=n.getRangeAt(0);if(!i.includes(`
|
|
52
|
+
`)){r.insertNode(document.createTextNode(i)),this.editorDiv.normalize(),n.collapseToStart();return}const{startContainer:a,startOffset:o}=r,l=[],c=[];if(a.nodeType===Node.TEXT_NODE){const f=a.parentElement;if(c.push(a.nodeValue.slice(o).replaceAll(Ke,"")),f!==this.editorDiv){let g=l;for(const p of this.editorDiv.childNodes){if(p===f){g=c;continue}g.push(St.#h(p))}}l.push(a.nodeValue.slice(0,o).replaceAll(Ke,""))}else if(a===this.editorDiv){let f=l,g=0;for(const p of this.editorDiv.childNodes)g++===o&&(f=c),f.push(St.#h(p))}this.#t=`${l.join(`
|
|
53
|
+
`)}${i}${c.join(`
|
|
54
|
+
`)}`,this.#l();const d=new Range;let u=Math.sumPrecise(l.map(f=>f.length));for(const{firstChild:f}of this.editorDiv.childNodes)if(f.nodeType===Node.TEXT_NODE){const g=f.nodeValue.length;if(u<=g){d.setStart(f,u),d.setEnd(f,u);break}u-=g}n.removeAllRanges(),n.addRange(d)}#l(){if(this.editorDiv.replaceChildren(),!!this.#t)for(const t of this.#t.split(`
|
|
55
|
+
`)){const e=document.createElement("div");e.append(t?document.createTextNode(t):document.createElement("br")),this.editorDiv.append(e)}}#u(){return this.#t.replaceAll(" "," ")}static#d(t){return t.replaceAll(" "," ")}get contentDiv(){return this.editorDiv}getPDFRect(){const t=St._internalPadding*this.parentScale;return this.getRect(t,t)}static async deserialize(t,e,s){let i=null;if(t instanceof hn){const{data:{defaultAppearanceData:{fontSize:r,fontColor:a},rect:o,rotation:l,id:c,popupRef:d,richText:u,contentsObj:f,creationDate:g,modificationDate:p},textContent:m,textPosition:v,parent:{page:{pageNumber:y}}}=t;if(!m||m.length===0)return null;i=t={annotationType:Y.FREETEXT,color:Array.from(a),fontSize:r,value:m.join(`
|
|
56
|
+
`),position:v,pageIndex:y-1,rect:o.slice(0),rotation:l,annotationElementId:c,id:c,deleted:!1,popupRef:d,comment:f?.str||null,richText:u,creationDate:g,modificationDate:p}}const n=await super.deserialize(t,e,s);return n.#i=t.fontSize,n.color=F.makeHexColor(...t.color),n.#t=St.#d(t.value),n._initialData=i,t.comment&&n.setCommentData(t),n}serialize(t=!1){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const e=H._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:this.color),s=Object.assign(super.serialize(t),{color:e,fontSize:this.#i,value:this.#u()});return this.addComment(s),t?(s.isCopy=!0,s):this.annotationElementId&&!this.#f(s)?null:(s.id=this.annotationElementId,s)}#f(t){const{value:e,fontSize:s,color:i,pageIndex:n}=this._initialData;return this.hasEditedComment||this._hasBeenMoved||t.value!==e||t.fontSize!==s||t.color.some((r,a)=>r!==i[a])||t.pageIndex!==n}renderAnnotationElement(t){const e=super.renderAnnotationElement(t);if(!e)return null;const{style:s}=e;s.fontSize=`calc(${this.#i}px * var(--total-scale-factor))`,s.color=this.color,e.replaceChildren();for(const i of this.#t.split(`
|
|
57
|
+
`)){const n=document.createElement("div");n.append(i?document.createTextNode(i):document.createElement("br")),e.append(n)}return t.updateEdited({rect:this.getPDFRect(),popup:this._uiManager.hasCommentManager()||this.hasEditedComment?this.comment:{text:this.#t}}),e}resetAnnotationElement(t){super.resetAnnotationElement(t),t.resetEdited()}}class B{static PRECISION=1e-4;toSVGPath(){nt("Abstract method `toSVGPath` must be implemented.")}get box(){nt("Abstract getter `box` must be implemented.")}serialize(t,e){nt("Abstract method `serialize` must be implemented.")}static _rescale(t,e,s,i,n,r){r||=new Float32Array(t.length);for(let a=0,o=t.length;a<o;a+=2)r[a]=e+t[a]*i,r[a+1]=s+t[a+1]*n;return r}static _rescaleAndSwap(t,e,s,i,n,r){r||=new Float32Array(t.length);for(let a=0,o=t.length;a<o;a+=2)r[a]=e+t[a+1]*i,r[a+1]=s+t[a]*n;return r}static _translate(t,e,s,i){i||=new Float32Array(t.length);for(let n=0,r=t.length;n<r;n+=2)i[n]=e+t[n],i[n+1]=s+t[n+1];return i}static svgRound(t){return Math.round(t*1e4)}static _normalizePoint(t,e,s,i,n){switch(n){case 90:return[1-e/s,t/i];case 180:return[1-t/s,1-e/i];case 270:return[e/s,1-t/i];default:return[t/s,e/i]}}static _normalizePagePoint(t,e,s){switch(s){case 90:return[1-e,t];case 180:return[1-t,1-e];case 270:return[e,1-t];default:return[t,e]}}static createBezierPoints(t,e,s,i,n,r){return[(t+5*s)/6,(e+5*i)/6,(5*s+n)/6,(5*i+r)/6,(s+n)/2,(i+r)/2]}}class re{#t;#e=[];#s;#i;#n=[];#r=new Float32Array(18);#a;#o;#h;#l;#u;#d;#f=[];static#m=8;static#g=2;static#c=re.#m+re.#g;constructor({x:t,y:e},s,i,n,r,a=0){this.#t=s,this.#d=n*i,this.#i=r,this.#r.set([NaN,NaN,NaN,NaN,t,e],6),this.#s=a,this.#l=re.#m*i,this.#h=re.#c*i,this.#u=i,this.#f.push(t,e)}isEmpty(){return isNaN(this.#r[8])}#p(){const t=this.#r.subarray(4,6),e=this.#r.subarray(16,18),[s,i,n,r]=this.#t;return[(this.#a+(t[0]-e[0])/2-s)/n,(this.#o+(t[1]-e[1])/2-i)/r,(this.#a+(e[0]-t[0])/2-s)/n,(this.#o+(e[1]-t[1])/2-i)/r]}add({x:t,y:e}){this.#a=t,this.#o=e;const[s,i,n,r]=this.#t;let[a,o,l,c]=this.#r.subarray(8,12);const d=t-l,u=e-c,f=Math.hypot(d,u);if(f<this.#h)return!1;const g=f-this.#l,p=g/f,m=p*d,v=p*u;let y=a,b=o;a=l,o=c,l+=m,c+=v,this.#f?.push(t,e);const w=-v/g,A=m/g,S=w*this.#d,E=A*this.#d;return this.#r.set(this.#r.subarray(2,8),0),this.#r.set([l+S,c+E],4),this.#r.set(this.#r.subarray(14,18),12),this.#r.set([l-S,c-E],16),isNaN(this.#r[6])?(this.#n.length===0&&(this.#r.set([a+S,o+E],2),this.#n.push(NaN,NaN,NaN,NaN,(a+S-s)/n,(o+E-i)/r),this.#r.set([a-S,o-E],14),this.#e.push(NaN,NaN,NaN,NaN,(a-S-s)/n,(o-E-i)/r)),this.#r.set([y,b,a,o,l,c],6),!this.isEmpty()):(this.#r.set([y,b,a,o,l,c],6),Math.abs(Math.atan2(b-o,y-a)-Math.atan2(v,m))<Math.PI/2?([a,o,l,c]=this.#r.subarray(2,6),this.#n.push(NaN,NaN,NaN,NaN,((a+l)/2-s)/n,((o+c)/2-i)/r),[a,o,y,b]=this.#r.subarray(14,18),this.#e.push(NaN,NaN,NaN,NaN,((y+a)/2-s)/n,((b+o)/2-i)/r),!0):([y,b,a,o,l,c]=this.#r.subarray(0,6),this.#n.push(((y+5*a)/6-s)/n,((b+5*o)/6-i)/r,((5*a+l)/6-s)/n,((5*o+c)/6-i)/r,((a+l)/2-s)/n,((o+c)/2-i)/r),[l,c,a,o,y,b]=this.#r.subarray(12,18),this.#e.push(((y+5*a)/6-s)/n,((b+5*o)/6-i)/r,((5*a+l)/6-s)/n,((5*o+c)/6-i)/r,((a+l)/2-s)/n,((o+c)/2-i)/r),!0))}toSVGPath(){if(this.isEmpty())return"";const t=this.#n,e=this.#e;if(isNaN(this.#r[6])&&!this.isEmpty())return this.#v();const s=[];s.push(`M${t[4]} ${t[5]}`);for(let i=6;i<t.length;i+=6)isNaN(t[i])?s.push(`L${t[i+4]} ${t[i+5]}`):s.push(`C${t[i]} ${t[i+1]} ${t[i+2]} ${t[i+3]} ${t[i+4]} ${t[i+5]}`);this.#b(s);for(let i=e.length-6;i>=6;i-=6)isNaN(e[i])?s.push(`L${e[i+4]} ${e[i+5]}`):s.push(`C${e[i]} ${e[i+1]} ${e[i+2]} ${e[i+3]} ${e[i+4]} ${e[i+5]}`);return this.#w(s),s.join(" ")}#v(){const[t,e,s,i]=this.#t,[n,r,a,o]=this.#p();return`M${(this.#r[2]-t)/s} ${(this.#r[3]-e)/i} L${(this.#r[4]-t)/s} ${(this.#r[5]-e)/i} L${n} ${r} L${a} ${o} L${(this.#r[16]-t)/s} ${(this.#r[17]-e)/i} L${(this.#r[14]-t)/s} ${(this.#r[15]-e)/i} Z`}#w(t){const e=this.#e;t.push(`L${e[4]} ${e[5]} Z`)}#b(t){const[e,s,i,n]=this.#t,r=this.#r.subarray(4,6),a=this.#r.subarray(16,18),[o,l,c,d]=this.#p();t.push(`L${(r[0]-e)/i} ${(r[1]-s)/n} L${o} ${l} L${c} ${d} L${(a[0]-e)/i} ${(a[1]-s)/n}`)}newFreeDrawOutline(t,e,s,i,n,r){return new fn(t,e,s,i,n,r)}getOutlines(){const t=this.#n,e=this.#e,s=this.#r,[i,n,r,a]=this.#t,o=new Float32Array((this.#f?.length??0)+2);for(let d=0,u=o.length-2;d<u;d+=2)o[d]=(this.#f[d]-i)/r,o[d+1]=(this.#f[d+1]-n)/a;if(o[o.length-2]=(this.#a-i)/r,o[o.length-1]=(this.#o-n)/a,isNaN(s[6])&&!this.isEmpty())return this.#E(o);const l=new Float32Array(this.#n.length+24+this.#e.length);let c=t.length;for(let d=0;d<c;d+=2){if(isNaN(t[d])){l[d]=l[d+1]=NaN;continue}l[d]=t[d],l[d+1]=t[d+1]}c=this.#y(l,c);for(let d=e.length-6;d>=6;d-=6)for(let u=0;u<6;u+=2){if(isNaN(e[d+u])){l[c]=l[c+1]=NaN,c+=2;continue}l[c]=e[d+u],l[c+1]=e[d+u+1],c+=2}return this.#P(l,c),this.newFreeDrawOutline(l,o,this.#t,this.#u,this.#s,this.#i)}#E(t){const e=this.#r,[s,i,n,r]=this.#t,[a,o,l,c]=this.#p(),d=new Float32Array(36);return d.set([NaN,NaN,NaN,NaN,(e[2]-s)/n,(e[3]-i)/r,NaN,NaN,NaN,NaN,(e[4]-s)/n,(e[5]-i)/r,NaN,NaN,NaN,NaN,a,o,NaN,NaN,NaN,NaN,l,c,NaN,NaN,NaN,NaN,(e[16]-s)/n,(e[17]-i)/r,NaN,NaN,NaN,NaN,(e[14]-s)/n,(e[15]-i)/r],0),this.newFreeDrawOutline(d,t,this.#t,this.#u,this.#s,this.#i)}#P(t,e){const s=this.#e;return t.set([NaN,NaN,NaN,NaN,s[4],s[5]],e),e+=6}#y(t,e){const s=this.#r.subarray(4,6),i=this.#r.subarray(16,18),[n,r,a,o]=this.#t,[l,c,d,u]=this.#p();return t.set([NaN,NaN,NaN,NaN,(s[0]-n)/a,(s[1]-r)/o,NaN,NaN,NaN,NaN,l,c,NaN,NaN,NaN,NaN,d,u,NaN,NaN,NaN,NaN,(i[0]-n)/a,(i[1]-r)/o],e),e+=24}}class fn extends B{#t;#e=new Float32Array(4);#s;#i;#n;#r;#a;constructor(t,e,s,i,n,r){super(),this.#a=t,this.#n=e,this.#t=s,this.#r=i,this.#s=n,this.#i=r,this.firstPoint=[NaN,NaN],this.lastPoint=[NaN,NaN],this.#o(r);const[a,o,l,c]=this.#e;for(let d=0,u=t.length;d<u;d+=2)t[d]=(t[d]-a)/l,t[d+1]=(t[d+1]-o)/c;for(let d=0,u=e.length;d<u;d+=2)e[d]=(e[d]-a)/l,e[d+1]=(e[d+1]-o)/c}toSVGPath(){const t=[`M${this.#a[4]} ${this.#a[5]}`];for(let e=6,s=this.#a.length;e<s;e+=6){if(isNaN(this.#a[e])){t.push(`L${this.#a[e+4]} ${this.#a[e+5]}`);continue}t.push(`C${this.#a[e]} ${this.#a[e+1]} ${this.#a[e+2]} ${this.#a[e+3]} ${this.#a[e+4]} ${this.#a[e+5]}`)}return t.push("Z"),t.join(" ")}serialize([t,e,s,i],n){const r=s-t,a=i-e;let o,l;switch(n){case 0:o=B._rescale(this.#a,t,i,r,-a),l=B._rescale(this.#n,t,i,r,-a);break;case 90:o=B._rescaleAndSwap(this.#a,t,e,r,a),l=B._rescaleAndSwap(this.#n,t,e,r,a);break;case 180:o=B._rescale(this.#a,s,e,-r,a),l=B._rescale(this.#n,s,e,-r,a);break;case 270:o=B._rescaleAndSwap(this.#a,s,i,-r,-a),l=B._rescaleAndSwap(this.#n,s,i,-r,-a);break}return{outline:Array.from(o),points:[Array.from(l)]}}#o(t){const e=this.#a;let s=e[4],i=e[5];const n=[s,i,s,i];let r=s,a=i,o=s,l=i;const c=t?Math.max:Math.min,d=new Float32Array(4);for(let f=6,g=e.length;f<g;f+=6){const p=e[f+4],m=e[f+5];isNaN(e[f])?(F.pointBoundingBox(p,m,n),a>m?(r=p,a=m):a===m&&(r=c(r,p)),l<m?(o=p,l=m):l===m&&(o=c(o,p))):(d.set(Qt,0),F.bezierBoundingBox(s,i,...e.slice(f,f+6),d),F.rectBoundingBox(...d,n),a>d[1]?(r=d[0],a=d[1]):a===d[1]&&(r=c(r,d[0])),l<d[3]?(o=d[2],l=d[3]):l===d[3]&&(o=c(o,d[2]))),s=p,i=m}const u=this.#e;u[0]=n[0]-this.#s,u[1]=n[1]-this.#s,u[2]=n[2]-n[0]+2*this.#s,u[3]=n[3]-n[1]+2*this.#s,this.firstPoint=[r,a],this.lastPoint=[o,l]}get box(){return this.#e}newOutliner(t,e,s,i,n,r=0){return new re(t,e,s,i,n,r)}getNewOutline(t,e){const[s,i,n,r]=this.#e,[a,o,l,c]=this.#t,d=n*l,u=r*c,f=s*l+a,g=i*c+o,p=this.newOutliner({x:this.#n[0]*d+f,y:this.#n[1]*u+g},this.#t,this.#r,t,this.#i,e??this.#s);for(let m=2;m<this.#n.length;m+=2)p.add({x:this.#n[m]*d+f,y:this.#n[m+1]*u+g});return p.getOutlines()}}class Hs{#t;#e;#s;#i=[];#n=[];constructor(t,e=0,s=0,i=!0){const n=Qt.slice(),r=10**-4;for(const{x:p,y:m,width:v,height:y}of t){const b=Math.floor((p-e)/r)*r,w=Math.ceil((p+v+e)/r)*r,A=Math.floor((m-e)/r)*r,S=Math.ceil((m+y+e)/r)*r,E=[b,A,S,!0],C=[w,A,S,!1];this.#i.push(E,C),F.rectBoundingBox(b,A,w,S,n)}const a=n[2]-n[0]+2*s,o=n[3]-n[1]+2*s,l=n[0]-s,c=n[1]-s;let d=i?-1/0:1/0,u=1/0;const f=this.#i.at(i?-1:-2),g=[f[0],f[2]];for(const p of this.#i){const[m,v,y,b]=p;!b&&i?v<u?(u=v,d=m):v===u&&(d=Math.max(d,m)):b&&!i&&(v<u?(u=v,d=m):v===u&&(d=Math.min(d,m))),p[0]=(m-l)/a,p[1]=(v-c)/o,p[2]=(y-c)/o}this.#t=new Float32Array([l,c,a,o]),this.#e=[d,u],this.#s=g}getOutlines(){this.#i.sort((e,s)=>e[0]-s[0]||e[1]-s[1]||e[2]-s[2]);const t=[];for(const e of this.#i)e[3]?(t.push(...this.#l(e)),this.#o(e)):(this.#h(e),t.push(...this.#l(e)));return this.#r(t)}#r(t){const e=[],s=new Set;for(const r of t){const[a,o,l]=r;e.push([a,o,r],[a,l,r])}e.sort((r,a)=>r[1]-a[1]||r[0]-a[0]);for(let r=0,a=e.length;r<a;r+=2){const o=e[r][2],l=e[r+1][2];o.push(l),l.push(o),s.add(o),s.add(l)}const i=[];let n;for(;s.size>0;){const r=s.values().next().value;let[a,o,l,c,d]=r;s.delete(r);let u=a,f=o;for(n=[a,l],i.push(n);;){let g;if(s.has(c))g=c;else if(s.has(d))g=d;else break;s.delete(g),[a,o,l,c,d]=g,u!==a&&(n.push(u,f,a,f===o?o:l),u=a),f=f===o?l:o}n.push(u,f)}return new ba(i,this.#t,this.#e,this.#s)}#a(t){const e=this.#n;let s=0,i=e.length-1;for(;s<=i;){const n=s+i>>1,r=e[n][0];if(r===t)return n;r<t?s=n+1:i=n-1}return i+1}#o([,t,e]){const s=this.#a(t);this.#n.splice(s,0,[t,e])}#h([,t,e]){const s=this.#a(t);for(let i=s;i<this.#n.length;i++){const[n,r]=this.#n[i];if(n!==t)break;if(n===t&&r===e){this.#n.splice(i,1);return}}for(let i=s-1;i>=0;i--){const[n,r]=this.#n[i];if(n!==t)break;if(n===t&&r===e){this.#n.splice(i,1);return}}}#l(t){const[e,s,i]=t,n=[[e,s,i]],r=this.#a(i);for(let a=0;a<r;a++){const[o,l]=this.#n[a];for(let c=0,d=n.length;c<d;c++){const[,u,f]=n[c];if(!(l<=u||f<=o)){if(u>=o){if(f>l)n[c][1]=l;else{if(d===1)return[];n.splice(c,1),c--,d--}continue}n[c][2]=o,f>l&&n.push([e,l,f])}}}return n}}class ba extends B{#t;#e;constructor(t,e,s,i){super(),this.#e=t,this.#t=e,this.firstPoint=s,this.lastPoint=i}toSVGPath(){const t=[];for(const e of this.#e){let[s,i]=e;t.push(`M${s} ${i}`);for(let n=2;n<e.length;n+=2){const r=e[n],a=e[n+1];r===s?(t.push(`V${a}`),i=a):a===i&&(t.push(`H${r}`),s=r)}t.push("Z")}return t.join(" ")}serialize([t,e,s,i],n){const r=[],a=s-t,o=i-e;for(const l of this.#e){const c=new Array(l.length);for(let d=0;d<l.length;d+=2)c[d]=t+l[d]*a,c[d+1]=i-l[d+1]*o;r.push(c)}return r}get box(){return this.#t}get classNamesForOutlining(){return["highlightOutline"]}}class $s extends re{newFreeDrawOutline(t,e,s,i,n,r){return new Aa(t,e,s,i,n,r)}}class Aa extends fn{newOutliner(t,e,s,i,n,r=0){return new $s(t,e,s,i,n,r)}}class pt extends H{#t=null;#e=0;#s;#i=null;#n=null;#r=null;#a=null;#o=0;#h=null;#l=null;#u=null;#d=!1;#f=null;#m=null;#g=null;#c="";#p;#v="";static _defaultColor=null;static _defaultOpacity=1;static _defaultThickness=12;static _type="highlight";static _editorType=Y.HIGHLIGHT;static _freeHighlightId=-1;static _freeHighlight=null;static _freeHighlightClipId="";static get _keyboardManager(){const t=pt.prototype;return K(this,"_keyboardManager",new $e([[["ArrowLeft","mac+ArrowLeft"],t._moveCaret,{args:[0]}],[["ArrowRight","mac+ArrowRight"],t._moveCaret,{args:[1]}],[["ArrowUp","mac+ArrowUp"],t._moveCaret,{args:[2]}],[["ArrowDown","mac+ArrowDown"],t._moveCaret,{args:[3]}]]))}constructor(t){super({...t,name:"highlightEditor"}),this.color=t.color||pt._defaultColor,this.#p=t.thickness||pt._defaultThickness,this.opacity=t.opacity||pt._defaultOpacity,this.#s=t.boxes||null,this.#v=t.methodOfCreation||"",this.#c=t.text||"",this._isDraggable=!1,this.defaultL10nId="pdfjs-editor-highlight-editor",t.highlightId>-1?(this.#d=!0,this.#b(t),this.#S()):this.#s&&(this.#t=t.anchorNode,this.#e=t.anchorOffset,this.#a=t.focusNode,this.#o=t.focusOffset,this.#w(),this.#S(),this.rotate(this.rotation)),this.annotationElementId||this._uiManager.a11yAlert("pdfjs-editor-highlight-added-alert")}get telemetryInitialData(){return{action:"added",type:this.#d?"free_highlight":"highlight",color:this._uiManager.getNonHCMColorName(this.color),thickness:this.#p,methodOfCreation:this.#v}}get telemetryFinalData(){return{type:"highlight",color:this._uiManager.getNonHCMColorName(this.color)}}static computeTelemetryFinalData(t){return{numberOfColors:t.get("color").size}}#w(){const t=new Hs(this.#s,.001);this.#l=t.getOutlines(),[this.x,this.y,this.width,this.height]=this.#l.box;const e=new Hs(this.#s,.0025,.001,this._uiManager.direction==="ltr");this.#r=e.getOutlines();const{firstPoint:s}=this.#l;this.#f=[(s[0]-this.x)/this.width,(s[1]-this.y)/this.height];const{lastPoint:i}=this.#r;this.#m=[(i[0]-this.x)/this.width,(i[1]-this.y)/this.height]}#b({highlightOutlines:t,highlightId:e,clipPathId:s}){this.#l=t;const i=1.5;if(this.#r=t.getNewOutline(this.#p/2+i,.0025),e>=0)this.#u=e,this.#i=s,this.parent.drawLayer.finalizeDraw(e,{bbox:t.box,path:{d:t.toSVGPath()}}),this.#g=this.parent.drawLayer.drawOutline({rootClass:{highlightOutline:!0,free:!0},bbox:this.#r.box,path:{d:this.#r.toSVGPath()}},!0);else if(this.parent){const d=this.parent.viewport.rotation;this.parent.drawLayer.updateProperties(this.#u,{bbox:pt.#C(this.#l.box,(d-this.rotation+360)%360),path:{d:t.toSVGPath()}}),this.parent.drawLayer.updateProperties(this.#g,{bbox:pt.#C(this.#r.box,d),path:{d:this.#r.toSVGPath()}})}const[n,r,a,o]=t.box;switch(this.rotation){case 0:this.x=n,this.y=r,this.width=a,this.height=o;break;case 90:{const[d,u]=this.parentDimensions;this.x=r,this.y=1-n,this.width=a*u/d,this.height=o*d/u;break}case 180:this.x=1-n,this.y=1-r,this.width=a,this.height=o;break;case 270:{const[d,u]=this.parentDimensions;this.x=1-r,this.y=n,this.width=a*u/d,this.height=o*d/u;break}}const{firstPoint:l}=t;this.#f=[(l[0]-n)/a,(l[1]-r)/o];const{lastPoint:c}=this.#r;this.#m=[(c[0]-n)/a,(c[1]-r)/o]}static initialize(t,e){H.initialize(t,e),pt._defaultColor||=e.highlightColors?.values().next().value||"#fff066"}static updateDefaultParams(t,e){switch(t){case J.HIGHLIGHT_COLOR:pt._defaultColor=e;break;case J.HIGHLIGHT_THICKNESS:pt._defaultThickness=e;break}}translateInPage(t,e){}get toolbarPosition(){return this.#m}get commentButtonPosition(){return this.#f}updateParams(t,e){switch(t){case J.HIGHLIGHT_COLOR:this.#E(e);break;case J.HIGHLIGHT_THICKNESS:this.#P(e);break}}static get defaultPropertiesToUpdate(){return[[J.HIGHLIGHT_COLOR,pt._defaultColor],[J.HIGHLIGHT_THICKNESS,pt._defaultThickness]]}get propertiesToUpdate(){return[[J.HIGHLIGHT_COLOR,this.color||pt._defaultColor],[J.HIGHLIGHT_THICKNESS,this.#p||pt._defaultThickness],[J.HIGHLIGHT_FREE,this.#d]]}onUpdatedColor(){this.parent?.drawLayer.updateProperties(this.#u,{root:{fill:this.color,"fill-opacity":this.opacity}}),this.#n?.updateColor(this.color),super.onUpdatedColor()}#E(t){const e=(n,r)=>{this.color=n,this.opacity=r,this.onUpdatedColor()},s=this.color,i=this.opacity;this.addCommands({cmd:e.bind(this,t,pt._defaultOpacity),undo:e.bind(this,s,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:J.HIGHLIGHT_COLOR,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"color_changed",color:this._uiManager.getNonHCMColorName(t)},!0)}#P(t){const e=this.#p,s=i=>{this.#p=i,this.#y(i)};this.addCommands({cmd:s.bind(this,t),undo:s.bind(this,e),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:J.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"thickness_changed",thickness:t},!0)}get toolbarButtons(){return this._uiManager.highlightColors?[["colorPicker",this.#n=new Nt({editor:this})]]:super.toolbarButtons}disableEditing(){super.disableEditing(),this.div.classList.toggle("disabled",!0)}enableEditing(){super.enableEditing(),this.div.classList.toggle("disabled",!1)}fixAndSetPosition(){return super.fixAndSetPosition(this.#I())}getBaseTranslation(){return[0,0]}getRect(t,e){return super.getRect(t,e,this.#I())}onceAdded(t){this.annotationElementId||this.parent.addUndoableEditor(this),t&&this.div.focus()}remove(){this.#x(),this._reportTelemetry({action:"deleted"}),super.remove()}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(this.#S(),this.isAttachedToDOM||this.parent.add(this)))}setParent(t){let e=!1;this.parent&&!t?this.#x():t&&(this.#S(t),e=!this.parent&&this.div?.classList.contains("selectedEditor")),super.setParent(t),this.show(this._isVisible),e&&this.select()}#y(t){this.#d&&(this.#b({highlightOutlines:this.#l.getNewOutline(t/2)}),this.fixAndSetPosition(),this.setDims())}#x(){this.#u===null||!this.parent||(this.parent.drawLayer.remove(this.#u),this.#u=null,this.parent.drawLayer.remove(this.#g),this.#g=null)}#S(t=this.parent){this.#u===null&&({id:this.#u,clipPathId:this.#i}=t.drawLayer.draw({bbox:this.#l.box,root:{viewBox:"0 0 1 1",fill:this.color,"fill-opacity":this.opacity},rootClass:{highlight:!0,free:this.#d},path:{d:this.#l.toSVGPath()}},!1,!0),this.#g=t.drawLayer.drawOutline({rootClass:{highlightOutline:!0,free:this.#d},bbox:this.#r.box,path:{d:this.#r.toSVGPath()}},this.#d),this.#h&&(this.#h.style.clipPath=this.#i))}static#C([t,e,s,i],n){switch(n){case 90:return[1-e-i,t,i,s];case 180:return[1-t-s,1-e-i,s,i];case 270:return[e,1-t-s,i,s]}return[t,e,s,i]}rotate(t){const{drawLayer:e}=this.parent;let s;this.#d?(t=(t-this.rotation+360)%360,s=pt.#C(this.#l.box,t)):s=pt.#C([this.x,this.y,this.width,this.height],t),e.updateProperties(this.#u,{bbox:s,root:{"data-main-rotation":t}}),e.updateProperties(this.#g,{bbox:pt.#C(this.#r.box,t),root:{"data-main-rotation":t}})}render(){if(this.div)return this.div;const t=super.render();this.#c&&(t.setAttribute("aria-label",this.#c),t.setAttribute("role","mark")),this.#d?t.classList.add("free"):this.div.addEventListener("keydown",this.#R.bind(this),{signal:this._uiManager._signal});const e=this.#h=document.createElement("div");return t.append(e),e.setAttribute("aria-hidden","true"),e.className="internal",e.style.clipPath=this.#i,this.setDims(),Vi(this,this.#h,["pointerover","pointerleave"]),this.enableEditing(),t}pointerover(){this.isSelected||this.parent?.drawLayer.updateProperties(this.#g,{rootClass:{hovered:!0}})}pointerleave(){this.isSelected||this.parent?.drawLayer.updateProperties(this.#g,{rootClass:{hovered:!1}})}#R(t){pt._keyboardManager.exec(this,t)}_moveCaret(t){switch(this.parent.unselect(this),t){case 0:case 2:this.#O(!0);break;case 1:case 3:this.#O(!1);break}}#O(t){if(!this.#t)return;const e=window.getSelection();t?e.setPosition(this.#t,this.#e):e.setPosition(this.#a,this.#o)}select(){super.select(),this.#g&&this.parent?.drawLayer.updateProperties(this.#g,{rootClass:{hovered:!1,selected:!0}})}unselect(){super.unselect(),this.#g&&(this.parent?.drawLayer.updateProperties(this.#g,{rootClass:{selected:!1}}),this.#d||this.#O(!1))}get _mustFixPosition(){return!this.#d}show(t=this._isVisible){super.show(t),this.parent&&(this.parent.drawLayer.updateProperties(this.#u,{rootClass:{hidden:!t}}),this.parent.drawLayer.updateProperties(this.#g,{rootClass:{hidden:!t}}))}#I(){return this.#d?this.rotation:0}#F(){if(this.#d)return null;const[t,e]=this.pageDimensions,[s,i]=this.pageTranslation,n=this.#s,r=new Float32Array(n.length*8);let a=0;for(const{x:o,y:l,width:c,height:d}of n){const u=o*t+s,f=(1-l)*e+i;r[a]=r[a+4]=u,r[a+1]=r[a+3]=f,r[a+2]=r[a+6]=u+c*t,r[a+5]=r[a+7]=f-d*e,a+=8}return r}#L(t){return this.#l.serialize(t,this.#I())}static startHighlighting(t,e,{target:s,x:i,y:n}){const{x:r,y:a,width:o,height:l}=s.getBoundingClientRect(),c=new AbortController,d=t.combinedSignal(c),u=f=>{c.abort(),this.#N(t,f)};window.addEventListener("blur",u,{signal:d}),window.addEventListener("pointerup",u,{signal:d}),window.addEventListener("pointerdown",ct,{capture:!0,passive:!1,signal:d}),window.addEventListener("contextmenu",kt,{signal:d}),s.addEventListener("pointermove",this.#D.bind(this,t),{signal:d}),this._freeHighlight=new $s({x:i,y:n},[r,a,o,l],t.scale,this._defaultThickness/2,e,.001),{id:this._freeHighlightId,clipPathId:this._freeHighlightClipId}=t.drawLayer.draw({bbox:[0,0,1,1],root:{viewBox:"0 0 1 1",fill:this._defaultColor,"fill-opacity":this._defaultOpacity},rootClass:{highlight:!0,free:!0},path:{d:this._freeHighlight.toSVGPath()}},!0,!0)}static#D(t,e){this._freeHighlight.add(e)&&t.drawLayer.updateProperties(this._freeHighlightId,{path:{d:this._freeHighlight.toSVGPath()}})}static#N(t,e){this._freeHighlight.isEmpty()?t.drawLayer.remove(this._freeHighlightId):t.createAndAddNewEditor(e,!1,{highlightId:this._freeHighlightId,highlightOutlines:this._freeHighlight.getOutlines(),clipPathId:this._freeHighlightClipId,methodOfCreation:"main_toolbar"}),this._freeHighlightId=-1,this._freeHighlight=null,this._freeHighlightClipId=""}static async deserialize(t,e,s){let i=null;if(t instanceof dn){const{data:{quadPoints:p,rect:m,rotation:v,id:y,color:b,opacity:w,popupRef:A,richText:S,contentsObj:E,creationDate:C,modificationDate:x},parent:{page:{pageNumber:P}}}=t;i=t={annotationType:Y.HIGHLIGHT,color:Array.from(b),opacity:w,quadPoints:p,boxes:null,pageIndex:P-1,rect:m.slice(0),rotation:v,annotationElementId:y,id:y,deleted:!1,popupRef:A,richText:S,comment:E?.str||null,creationDate:C,modificationDate:x}}else if(t instanceof si){const{data:{inkLists:p,rect:m,rotation:v,id:y,color:b,borderStyle:{rawWidth:w},popupRef:A,richText:S,contentsObj:E,creationDate:C,modificationDate:x},parent:{page:{pageNumber:P}}}=t;i=t={annotationType:Y.HIGHLIGHT,color:Array.from(b),thickness:w,inkLists:p,boxes:null,pageIndex:P-1,rect:m.slice(0),rotation:v,annotationElementId:y,id:y,deleted:!1,popupRef:A,richText:S,comment:E?.str||null,creationDate:C,modificationDate:x}}const{color:n,quadPoints:r,inkLists:a,outlines:o,opacity:l}=t,c=await super.deserialize(t,e,s);c.color=F.makeHexColor(...n),c.opacity=l||1,a&&(c.#p=t.thickness),c._initialData=i,t.comment&&c.setCommentData(t);const[d,u]=c.pageDimensions,[f,g]=c.pageTranslation;if(r){const p=c.#s=[];for(let m=0;m<r.length;m+=8)p.push({x:(r[m]-f)/d,y:1-(r[m+1]-g)/u,width:(r[m+2]-r[m])/d,height:(r[m+1]-r[m+5])/u});c.#w(),c.#S(),c.rotate(c.rotation)}else if(a||o){c.#d=!0;const p=(a||o.points)[0],m={x:p[0]-f,y:u-(p[1]-g)},v=new $s(m,[0,0,d,u],1,c.#p/2,!0,.001);for(let w=0,A=p.length;w<A;w+=2)m.x=p[w]-f,m.y=u-(p[w+1]-g),v.add(m);const{id:y,clipPathId:b}=e.drawLayer.draw({bbox:[0,0,1,1],root:{viewBox:"0 0 1 1",fill:c.color,"fill-opacity":c._defaultOpacity},rootClass:{highlight:!0,free:!0},path:{d:v.toSVGPath()}},!0,!0);c.#b({highlightOutlines:v.getOutlines(),highlightId:y,clipPathId:b}),c.#S(),c.rotate(c.parentRotation)}return c}serialize(t=!1){if(this.isEmpty()||t)return null;if(this.deleted)return this.serializeDeleted();const e=H._colorManager.convert(this._uiManager.getNonHCMColor(this.color)),s=super.serialize(t);return Object.assign(s,{color:e,opacity:this.opacity,thickness:this.#p,quadPoints:this.#F(),outlines:this.#L(s.rect)}),this.addComment(s),this.annotationElementId&&!this.#B(s)?null:(s.id=this.annotationElementId,s)}#B(t){const{color:e}=this._initialData;return this.hasEditedComment||t.color.some((s,i)=>s!==e[i])}renderAnnotationElement(t){return this.deleted?(t.hide(),null):(t.updateEdited({rect:this.getPDFRect(),popup:this.comment}),null)}static canCreateNewEmptyEditor(){return!1}}class pn{#t=Object.create(null);updateProperty(t,e){this[t]=e,this.updateSVGProperty(t,e)}updateProperties(t){if(t)for(const[e,s]of Object.entries(t))e.startsWith("_")||this.updateProperty(e,s)}updateSVGProperty(t,e){this.#t[t]=e}toSVGProperties(){const t=this.#t;return this.#t=Object.create(null),{root:t}}reset(){this.#t=Object.create(null)}updateAll(t=this){this.updateProperties(t)}clone(){nt("Not implemented")}}class st extends H{#t=null;#e;_colorPicker=null;_drawId=null;static _currentDrawId=-1;static _currentParent=null;static#s=null;static#i=null;static#n=null;static _INNER_MARGIN=3;constructor(t){super(t),this.#e=t.mustBeCommitted||!1,this._addOutlines(t)}onUpdatedColor(){this._colorPicker?.update(this.color),super.onUpdatedColor()}onUpdatedOpacity(){this._colorPicker?.updateOpacity?.(this.opacity)}_addOutlines(t){t.drawOutlines&&(this.#r(t),this.#h())}#r({drawOutlines:t,drawId:e,drawingOptions:s}){this.#t=t,this._drawingOptions||=s,this.annotationElementId||this._uiManager.a11yAlert(`pdfjs-editor-${this.editorType}-added-alert`),e>=0?(this._drawId=e,this.parent.drawLayer.finalizeDraw(e,t.defaultProperties)):this._drawId=this.#a(t,this.parent),this.#d(t.box)}#a(t,e){const{id:s}=e.drawLayer.draw(st._mergeSVGProperties(this._drawingOptions.toSVGProperties(),t.defaultSVGProperties),!1,!1);return s}static _mergeSVGProperties(t,e){const s=new Set(Object.keys(t));for(const[i,n]of Object.entries(e))s.has(i)?Object.assign(t[i],n):t[i]=n;return t}static getDefaultDrawingOptions(t){nt("Not implemented")}static get typesMap(){nt("Not implemented")}static get isDrawer(){return!0}static get supportMultipleDrawings(){return!1}static updateDefaultParams(t,e){const s=this.typesMap.get(t);s&&this._defaultDrawingOptions.updateProperty(s,e),this._currentParent&&(st.#s.updateProperty(s,e),this._currentParent.drawLayer.updateProperties(this._currentDrawId,this._defaultDrawingOptions.toSVGProperties()))}updateParams(t,e){const s=this.constructor.typesMap.get(t);s&&this._updateProperty(t,s,e)}static get defaultPropertiesToUpdate(){const t=[],e=this._defaultDrawingOptions;for(const[s,i]of this.typesMap)t.push([s,e[i]]);return t}get propertiesToUpdate(){const t=[],{_drawingOptions:e}=this;for(const[s,i]of this.constructor.typesMap)t.push([s,e[i]]);return t}_updateProperty(t,e,s){const i=this._drawingOptions,n=i[e],r=a=>{i.updateProperty(e,a);const o=this.#t.updateProperty(e,a);o&&this.#d(o),this.parent?.drawLayer.updateProperties(this._drawId,i.toSVGProperties()),t===this.colorType?this.onUpdatedColor():t===this.opacityType&&this.onUpdatedOpacity()};this.addCommands({cmd:r.bind(this,s),undo:r.bind(this,n),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:t,overwriteIfSameType:!0,keepUndo:!0})}_updateColorAndOpacity(t,e){const s=this.constructor.typesMap.get(this.colorType),i=this.constructor.typesMap.get(this.opacityType),n=this._drawingOptions,r=n[s],a=n[i],o=(l,c)=>{n.updateProperty(s,l),n.updateProperty(i,c),this.#t.updateProperty(s,l),this.#t.updateProperty(i,c),this.parent?.drawLayer.updateProperties(this._drawId,n.toSVGProperties()),this.onUpdatedColor(),this.onUpdatedOpacity()};this.addCommands({cmd:o.bind(this,t,e),undo:o.bind(this,r,a),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:J.INK_COLOR_AND_OPACITY,overwriteIfSameType:!0,keepUndo:!0})}_onResizing(){this.parent?.drawLayer.updateProperties(this._drawId,st._mergeSVGProperties(this.#t.getPathResizingSVGProperties(this.#u()),{bbox:this.#f()}))}_onResized(){this.parent?.drawLayer.updateProperties(this._drawId,st._mergeSVGProperties(this.#t.getPathResizedSVGProperties(this.#u()),{bbox:this.#f()}))}_onTranslating(t,e){this.parent?.drawLayer.updateProperties(this._drawId,{bbox:this.#f()})}_onTranslated(){this.parent?.drawLayer.updateProperties(this._drawId,st._mergeSVGProperties(this.#t.getPathTranslatedSVGProperties(this.#u(),this.parentDimensions),{bbox:this.#f()}))}_onStartDragging(){this.parent?.drawLayer.updateProperties(this._drawId,{rootClass:{moving:!0}})}_onStopDragging(){this.parent?.drawLayer.updateProperties(this._drawId,{rootClass:{moving:!1}})}commit(){super.commit(),this.disableEditMode(),this.disableEditing()}disableEditing(){super.disableEditing(),this.div.classList.toggle("disabled",!0)}enableEditing(){super.enableEditing(),this.div.classList.toggle("disabled",!1)}getBaseTranslation(){return[0,0]}get isResizable(){return!0}onceAdded(t){this.annotationElementId||this.parent.addUndoableEditor(this),this._isDraggable=!0,this.#e&&(this.#e=!1,this.commit(),this.parent.setSelected(this),t&&this.isOnScreen&&this.div.focus())}remove(){this.#o(),super.remove()}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(this.#h(),this.#d(this.#t.box),this.isAttachedToDOM||this.parent.add(this)))}setParent(t){let e=!1;this.parent&&!t?(this._uiManager.removeShouldRescale(this),this.#o()):t&&(this._uiManager.addShouldRescale(this),this.#h(t),e=!this.parent&&this.div?.classList.contains("selectedEditor")),super.setParent(t),e&&this.select()}#o(){this._drawId===null||!this.parent||(this.parent.drawLayer.remove(this._drawId),this._drawId=null,this._drawingOptions.reset())}#h(t=this.parent){if(!(this._drawId!==null&&this.parent===t)){if(this._drawId!==null){this.parent.drawLayer.updateParent(this._drawId,t.drawLayer);return}this._drawingOptions.updateAll(),this._drawId=this.#a(this.#t,t)}}#l([t,e,s,i]){const{parentDimensions:[n,r],rotation:a}=this;switch(a){case 90:return[e,1-t,s*(r/n),i*(n/r)];case 180:return[1-t,1-e,s,i];case 270:return[1-e,t,s*(r/n),i*(n/r)];default:return[t,e,s,i]}}#u(){const{x:t,y:e,width:s,height:i,parentDimensions:[n,r],rotation:a}=this;switch(a){case 90:return[1-e,t,s*(n/r),i*(r/n)];case 180:return[1-t,1-e,s,i];case 270:return[e,1-t,s*(n/r),i*(r/n)];default:return[t,e,s,i]}}#d(t){[this.x,this.y,this.width,this.height]=this.#l(t),this.div&&(this.fixAndSetPosition(),this.setDims()),this._onResized()}#f(){const{x:t,y:e,width:s,height:i,rotation:n,parentRotation:r,parentDimensions:[a,o]}=this;switch((n*4+r)/90){case 1:return[1-e-i,t,i,s];case 2:return[1-t-s,1-e-i,s,i];case 3:return[e,1-t-s,i,s];case 4:return[t,e-s*(a/o),i*(o/a),s*(a/o)];case 5:return[1-e,t,s*(a/o),i*(o/a)];case 6:return[1-t-i*(o/a),1-e,i*(o/a),s*(a/o)];case 7:return[e-s*(a/o),1-t-i*(o/a),s*(a/o),i*(o/a)];case 8:return[t-s,e-i,s,i];case 9:return[1-e,t-s,i,s];case 10:return[1-t,1-e,s,i];case 11:return[e-i,1-t,i,s];case 12:return[t-i*(o/a),e,i*(o/a),s*(a/o)];case 13:return[1-e-s*(a/o),t-i*(o/a),s*(a/o),i*(o/a)];case 14:return[1-t,1-e-s*(a/o),i*(o/a),s*(a/o)];case 15:return[e,1-t,s*(a/o),i*(o/a)];default:return[t,e,s,i]}}rotate(){this.parent&&this.parent.drawLayer.updateProperties(this._drawId,st._mergeSVGProperties({bbox:this.#f()},this.#t.updateRotation((this.parentRotation-this.rotation+360)%360)))}onScaleChanging(){this.parent&&this.#d(this.#t.updateParentDimensions(this.parentDimensions,this.parent.scale))}static onScaleChangingWhenDrawing(){}render(){if(this.div)return this.div;let t,e;this._isCopy&&(t=this.x,e=this.y);const s=super.render();s.classList.add("draw");const i=document.createElement("div");return s.append(i),i.setAttribute("aria-hidden","true"),i.className="internal",this.setDims(),this._uiManager.addShouldRescale(this),this.disableEditing(),this._isCopy&&this._moveAfterPaste(t,e),s}static createDrawerInstance(t,e,s,i,n){nt("Not implemented")}static startDrawing(t,e,s,i){const{target:n,offsetX:r,offsetY:a,pointerId:o,pointerType:l}=i;if(it.isInitializedAndDifferentPointerType(l))return;const{viewport:{rotation:c}}=t,{width:d,height:u}=n.getBoundingClientRect(),f=st.#i=new AbortController,g=t.combinedSignal(f);if(it.setPointer(l,o),window.addEventListener("pointerup",p=>{it.isSamePointerIdOrRemove(p.pointerId)&&this._endDraw(p)},{signal:g}),window.addEventListener("pointercancel",p=>{it.isSamePointerIdOrRemove(p.pointerId)&&this._currentParent.endDrawingSession()},{signal:g}),window.addEventListener("pointerdown",p=>{it.isSamePointerType(p.pointerType)&&(it.initializeAndAddPointerId(p.pointerId),st.#s.isCancellable()&&(st.#s.removeLastElement(),st.#s.isEmpty()?this._currentParent.endDrawingSession(!0):this._endDraw(null)))},{capture:!0,passive:!1,signal:g}),window.addEventListener("contextmenu",kt,{signal:g}),n.addEventListener("pointermove",this._drawMove.bind(this),{signal:g}),n.addEventListener("touchmove",p=>{it.isSameTimeStamp(p.timeStamp)&&ct(p)},{signal:g}),t.toggleDrawing(),e._editorUndoBar?.hide(),st.#s){t.drawLayer.updateProperties(this._currentDrawId,st.#s.startNew(r,a,d,u,c));return}e.updateUIForDefaultProperties(this),st.#s=this.createDrawerInstance(r,a,d,u,c),st.#n=this.getDefaultDrawingOptions(),this._currentParent=t,{id:this._currentDrawId}=t.drawLayer.draw(this._mergeSVGProperties(st.#n.toSVGProperties(),st.#s.defaultSVGProperties),!0,!1)}static _drawMove(t){if(it.isSameTimeStamp(t.timeStamp),!st.#s)return;const{offsetX:e,offsetY:s,pointerId:i}=t;if(it.isSamePointerId(i)){if(it.isUsingMultiplePointers()){this._endDraw(t);return}this._currentParent.drawLayer.updateProperties(this._currentDrawId,st.#s.add(e,s)),it.setTimeStamp(t.timeStamp),ct(t)}}static _cleanup(t){t&&(this._currentDrawId=-1,this._currentParent=null,st.#s=null,st.#n=null,it.clearTimeStamp()),st.#i&&(st.#i.abort(),st.#i=null,it.clearPointerIds())}static _endDraw(t){const e=this._currentParent;if(e){if(e.toggleDrawing(!0),this._cleanup(!1),t?.target===e.div&&e.drawLayer.updateProperties(this._currentDrawId,st.#s.end(t.offsetX,t.offsetY)),this.supportMultipleDrawings){const s=st.#s,i=this._currentDrawId,n=s.getLastElement();e.addCommands({cmd:()=>{e.drawLayer.updateProperties(i,s.setLastElement(n))},undo:()=>{e.drawLayer.updateProperties(i,s.removeLastElement())},mustExec:!1,type:J.DRAW_STEP});return}this.endDrawing(!1)}}static endDrawing(t){const e=this._currentParent;if(!e)return null;if(e.toggleDrawing(!0),e.cleanUndoStack(J.DRAW_STEP),!st.#s.isEmpty()){const{pageDimensions:[s,i],scale:n}=e,r=e.createAndAddNewEditor({offsetX:0,offsetY:0},!1,{drawId:this._currentDrawId,drawOutlines:st.#s.getOutlines(s*n,i*n,n,this._INNER_MARGIN),drawingOptions:st.#n,mustBeCommitted:!t});return this._cleanup(!0),r}return e.drawLayer.remove(this._currentDrawId),this._cleanup(!0),null}createDrawingOptions(t){}static deserializeDraw(t,e,s,i,n,r){nt("Not implemented")}static async deserialize(t,e,s){const{rawDims:{pageWidth:i,pageHeight:n,pageX:r,pageY:a}}=e.viewport,o=this.deserializeDraw(r,a,i,n,this._INNER_MARGIN,t),l=await super.deserialize(t,e,s);return l.createDrawingOptions(t),l.#r({drawOutlines:o}),l.#h(),l.onScaleChanging(),l.rotate(),l}serializeDraw(t){const[e,s]=this.pageTranslation,[i,n]=this.pageDimensions;return this.#t.serialize([e,s,i,n],t)}renderAnnotationElement(t){return t.updateEdited({rect:this.getPDFRect()}),null}static canCreateNewEmptyEditor(){return!1}}class wa{#t=new Float64Array(6);#e;#s;#i;#n;#r;#a="";#o=0;#h=new je;#l;#u;constructor(t,e,s,i,n,r){this.#l=s,this.#u=i,this.#i=n,this.#n=r,[t,e]=this.#d(t,e);const a=this.#e=[NaN,NaN,NaN,NaN,t,e];this.#r=[t,e],this.#s=[{line:a,points:this.#r}],this.#t.set(a,0)}updateProperty(t,e){t==="stroke-width"&&(this.#n=e)}#d(t,e){return B._normalizePoint(t,e,this.#l,this.#u,this.#i)}isEmpty(){return!this.#s||this.#s.length===0}isCancellable(){return this.#r.length<=10}add(t,e){[t,e]=this.#d(t,e);const[s,i,n,r]=this.#t.subarray(2,6),a=t-n,o=e-r;return Math.hypot(this.#l*a,this.#u*o)<=2?null:(this.#r.push(t,e),isNaN(s)?(this.#t.set([n,r,t,e],2),this.#e.push(NaN,NaN,NaN,NaN,t,e),{path:{d:this.toSVGPath()}}):(isNaN(this.#t[0])&&this.#e.splice(6,6),this.#t.set([s,i,n,r,t,e],0),this.#e.push(...B.createBezierPoints(s,i,n,r,t,e)),{path:{d:this.toSVGPath()}}))}end(t,e){const s=this.add(t,e);return s||(this.#r.length===2?{path:{d:this.toSVGPath()}}:null)}startNew(t,e,s,i,n){this.#l=s,this.#u=i,this.#i=n,[t,e]=this.#d(t,e);const r=this.#e=[NaN,NaN,NaN,NaN,t,e];this.#r=[t,e];const a=this.#s.at(-1);return a&&(a.line=new Float32Array(a.line),a.points=new Float32Array(a.points)),this.#s.push({line:r,points:this.#r}),this.#t.set(r,0),this.#o=0,this.toSVGPath(),null}getLastElement(){return this.#s.at(-1)}setLastElement(t){return this.#s?(this.#s.push(t),this.#e=t.line,this.#r=t.points,this.#o=0,{path:{d:this.toSVGPath()}}):this.#h.setLastElement(t)}removeLastElement(){if(!this.#s)return this.#h.removeLastElement();this.#s.pop(),this.#a="";for(let t=0,e=this.#s.length;t<e;t++){const{line:s,points:i}=this.#s[t];this.#e=s,this.#r=i,this.#o=0,this.toSVGPath()}return{path:{d:this.#a}}}toSVGPath(){const t=B.svgRound(this.#e[4]),e=B.svgRound(this.#e[5]);if(this.#r.length===2)return this.#a=`${this.#a} M ${t} ${e} Z`,this.#a;if(this.#r.length<=6){const i=this.#a.lastIndexOf("M");this.#a=`${this.#a.slice(0,i)} M ${t} ${e}`,this.#o=6}if(this.#r.length===4){const i=B.svgRound(this.#e[10]),n=B.svgRound(this.#e[11]);return this.#a=`${this.#a} L ${i} ${n}`,this.#o=12,this.#a}const s=[];this.#o===0&&(s.push(`M ${t} ${e}`),this.#o=6);for(let i=this.#o,n=this.#e.length;i<n;i+=6){const[r,a,o,l,c,d]=this.#e.slice(i,i+6).map(B.svgRound);s.push(`C${r} ${a} ${o} ${l} ${c} ${d}`)}return this.#a+=s.join(" "),this.#o=this.#e.length,this.#a}getOutlines(t,e,s,i){const n=this.#s.at(-1);return n.line=new Float32Array(n.line),n.points=new Float32Array(n.points),this.#h.build(this.#s,t,e,s,this.#i,this.#n,i),this.#t=null,this.#e=null,this.#s=null,this.#a=null,this.#h}get defaultSVGProperties(){return{root:{viewBox:"0 0 10000 10000"},rootClass:{draw:!0},bbox:[0,0,1,1]}}}class je extends B{#t;#e=0;#s;#i;#n;#r;#a;#o;#h;build(t,e,s,i,n,r,a){this.#n=e,this.#r=s,this.#a=i,this.#o=n,this.#h=r,this.#s=a??0,this.#i=t,this.#d()}get thickness(){return this.#h}setLastElement(t){return this.#i.push(t),{path:{d:this.toSVGPath()}}}removeLastElement(){return this.#i.pop(),{path:{d:this.toSVGPath()}}}toSVGPath(){const t=[];for(const{line:e}of this.#i){if(t.push(`M${B.svgRound(e[4])} ${B.svgRound(e[5])}`),e.length===6){t.push("Z");continue}if(e.length===12&&isNaN(e[6])){t.push(`L${B.svgRound(e[10])} ${B.svgRound(e[11])}`);continue}for(let s=6,i=e.length;s<i;s+=6){const[n,r,a,o,l,c]=e.subarray(s,s+6).map(B.svgRound);t.push(`C${n} ${r} ${a} ${o} ${l} ${c}`)}}return t.join("")}serialize([t,e,s,i],n){const r=[],a=[],[o,l,c,d]=this.#u();let u,f,g,p,m,v,y,b,w;switch(this.#o){case 0:w=B._rescale,u=t,f=e+i,g=s,p=-i,m=t+o*s,v=e+(1-l-d)*i,y=t+(o+c)*s,b=e+(1-l)*i;break;case 90:w=B._rescaleAndSwap,u=t,f=e,g=s,p=i,m=t+l*s,v=e+o*i,y=t+(l+d)*s,b=e+(o+c)*i;break;case 180:w=B._rescale,u=t+s,f=e,g=-s,p=i,m=t+(1-o-c)*s,v=e+l*i,y=t+(1-o)*s,b=e+(l+d)*i;break;case 270:w=B._rescaleAndSwap,u=t+s,f=e+i,g=-s,p=-i,m=t+(1-l-d)*s,v=e+(1-o-c)*i,y=t+(1-l)*s,b=e+(1-o)*i;break}for(const{line:A,points:S}of this.#i)r.push(w(A,u,f,g,p,n?new Array(A.length):null)),a.push(w(S,u,f,g,p,n?new Array(S.length):null));return{lines:r,points:a,rect:[m,v,y,b]}}static deserialize(t,e,s,i,n,{paths:{lines:r,points:a},rotation:o,thickness:l}){const c=[];let d,u,f,g,p;switch(o){case 0:p=B._rescale,d=-t/s,u=e/i+1,f=1/s,g=-1/i;break;case 90:p=B._rescaleAndSwap,d=-e/i,u=-t/s,f=1/i,g=1/s;break;case 180:p=B._rescale,d=t/s+1,u=-e/i,f=-1/s,g=1/i;break;case 270:p=B._rescaleAndSwap,d=e/i+1,u=t/s+1,f=-1/i,g=-1/s;break}if(!r){r=[];for(const v of a){const y=v.length;if(y===2){r.push(new Float32Array([NaN,NaN,NaN,NaN,v[0],v[1]]));continue}if(y===4){r.push(new Float32Array([NaN,NaN,NaN,NaN,v[0],v[1],NaN,NaN,NaN,NaN,v[2],v[3]]));continue}const b=new Float32Array(3*(y-2));r.push(b);let[w,A,S,E]=v.subarray(0,4);b.set([NaN,NaN,NaN,NaN,w,A],0);for(let C=4;C<y;C+=2){const x=v[C],P=v[C+1];b.set(B.createBezierPoints(w,A,S,E,x,P),(C-2)*3),[w,A,S,E]=[S,E,x,P]}}}for(let v=0,y=r.length;v<y;v++)c.push({line:p(r[v].map(b=>b??NaN),d,u,f,g),points:p(a[v].map(b=>b??NaN),d,u,f,g)});const m=new this.prototype.constructor;return m.build(c,s,i,1,o,l,n),m}#l(t=this.#h){const e=this.#s+t/2*this.#a;return this.#o%180===0?[e/this.#n,e/this.#r]:[e/this.#r,e/this.#n]}#u(){const[t,e,s,i]=this.#t,[n,r]=this.#l(0);return[t+n,e+r,s-2*n,i-2*r]}#d(){const t=this.#t=ne.slice();for(const{line:i}of this.#i){if(i.length<=12){for(let a=4,o=i.length;a<o;a+=6)F.pointBoundingBox(i[a],i[a+1],t);continue}let n=i[4],r=i[5];for(let a=6,o=i.length;a<o;a+=6){const[l,c,d,u,f,g]=i.subarray(a,a+6);F.bezierBoundingBox(n,r,l,c,d,u,f,g,t),n=f,r=g}}const[e,s]=this.#l();t[0]=ht(t[0]-e,0,1),t[1]=ht(t[1]-s,0,1),t[2]=ht(t[2]+e,0,1),t[3]=ht(t[3]+s,0,1),t[2]-=t[0],t[3]-=t[1]}get box(){return this.#t}updateProperty(t,e){return t==="stroke-width"?this.#f(e):null}#f(t){const[e,s]=this.#l();this.#h=t;const[i,n]=this.#l(),[r,a]=[i-e,n-s],o=this.#t;return o[0]-=r,o[1]-=a,o[2]+=2*r,o[3]+=2*a,o}updateParentDimensions([t,e],s){const[i,n]=this.#l();this.#n=t,this.#r=e,this.#a=s;const[r,a]=this.#l(),o=r-i,l=a-n,c=this.#t;return c[0]-=o,c[1]-=l,c[2]+=2*o,c[3]+=2*l,c}updateRotation(t){return this.#e=t,{path:{transform:this.rotationTransform}}}get viewBox(){return this.#t.map(B.svgRound).join(" ")}get defaultProperties(){const[t,e]=this.#t;return{root:{viewBox:this.viewBox},path:{"transform-origin":`${B.svgRound(t)} ${B.svgRound(e)}`}}}get rotationTransform(){const[,,t,e]=this.#t;let s=0,i=0,n=0,r=0,a=0,o=0;switch(this.#e){case 90:i=e/t,n=-t/e,a=t;break;case 180:s=-1,r=-1,a=t,o=e;break;case 270:i=-e/t,n=t/e,o=e;break;default:return""}return`matrix(${s} ${i} ${n} ${r} ${B.svgRound(a)} ${B.svgRound(o)})`}getPathResizingSVGProperties([t,e,s,i]){const[n,r]=this.#l(),[a,o,l,c]=this.#t;if(Math.abs(l-n)<=B.PRECISION||Math.abs(c-r)<=B.PRECISION){const p=t+s/2-(a+l/2),m=e+i/2-(o+c/2);return{path:{"transform-origin":`${B.svgRound(t)} ${B.svgRound(e)}`,transform:`${this.rotationTransform} translate(${p} ${m})`}}}const d=(s-2*n)/(l-2*n),u=(i-2*r)/(c-2*r),f=l/s,g=c/i;return{path:{"transform-origin":`${B.svgRound(a)} ${B.svgRound(o)}`,transform:`${this.rotationTransform} scale(${f} ${g}) translate(${B.svgRound(n)} ${B.svgRound(r)}) scale(${d} ${u}) translate(${B.svgRound(-n)} ${B.svgRound(-r)})`}}}getPathResizedSVGProperties([t,e,s,i]){const[n,r]=this.#l(),a=this.#t,[o,l,c,d]=a;if(a[0]=t,a[1]=e,a[2]=s,a[3]=i,Math.abs(c-n)<=B.PRECISION||Math.abs(d-r)<=B.PRECISION){const m=t+s/2-(o+c/2),v=e+i/2-(l+d/2);for(const{line:y,points:b}of this.#i)B._translate(y,m,v,y),B._translate(b,m,v,b);return{root:{viewBox:this.viewBox},path:{"transform-origin":`${B.svgRound(t)} ${B.svgRound(e)}`,transform:this.rotationTransform||null,d:this.toSVGPath()}}}const u=(s-2*n)/(c-2*n),f=(i-2*r)/(d-2*r),g=-u*(o+n)+t+n,p=-f*(l+r)+e+r;if(u!==1||f!==1||g!==0||p!==0)for(const{line:m,points:v}of this.#i)B._rescale(m,g,p,u,f,m),B._rescale(v,g,p,u,f,v);return{root:{viewBox:this.viewBox},path:{"transform-origin":`${B.svgRound(t)} ${B.svgRound(e)}`,transform:this.rotationTransform||null,d:this.toSVGPath()}}}getPathTranslatedSVGProperties([t,e],s){const[i,n]=s,r=this.#t,a=t-r[0],o=e-r[1];if(this.#n===i&&this.#r===n)for(const{line:l,points:c}of this.#i)B._translate(l,a,o,l),B._translate(c,a,o,c);else{const l=this.#n/i,c=this.#r/n;this.#n=i,this.#r=n;for(const{line:d,points:u}of this.#i)B._rescale(d,a,o,l,c,d),B._rescale(u,a,o,l,c,u);r[2]*=l,r[3]*=c}return r[0]=t,r[1]=e,{root:{viewBox:this.viewBox},path:{d:this.toSVGPath(),"transform-origin":`${B.svgRound(t)} ${B.svgRound(e)}`}}}get defaultSVGProperties(){const t=this.#t;return{root:{viewBox:this.viewBox},rootClass:{draw:!0},path:{d:this.toSVGPath(),"transform-origin":`${B.svgRound(t[0])} ${B.svgRound(t[1])}`,transform:this.rotationTransform||null},bbox:t}}}class ws extends pn{constructor(t){super(),this._viewParameters=t,super.updateProperties({fill:"none",stroke:H._defaultLineColor,"stroke-opacity":1,"stroke-width":1,"stroke-linecap":"round","stroke-linejoin":"round","stroke-miterlimit":10})}updateSVGProperty(t,e){t==="stroke-width"&&(e??=this["stroke-width"],e*=this._viewParameters.realScale),super.updateSVGProperty(t,e)}clone(){const t=new ws(this._viewParameters);return t.updateAll(this),t}}class ni extends st{static _type="ink";static _editorType=Y.INK;static _defaultDrawingOptions=null;constructor(t){super({...t,name:"inkEditor"}),this._willKeepAspectRatio=!0,this.defaultL10nId="pdfjs-editor-ink-editor"}static initialize(t,e){H.initialize(t,e),this._defaultDrawingOptions=new ws(e.viewParameters)}static getDefaultDrawingOptions(t){const e=this._defaultDrawingOptions.clone();return e.updateProperties(t),e}static get supportMultipleDrawings(){return!0}static get typesMap(){return K(this,"typesMap",new Map([[J.INK_THICKNESS,"stroke-width"],[J.INK_COLOR,"stroke"],[J.INK_OPACITY,"stroke-opacity"]]))}static createDrawerInstance(t,e,s,i,n){return new wa(t,e,s,i,n,this._defaultDrawingOptions["stroke-width"])}static deserializeDraw(t,e,s,i,n,r){return je.deserialize(t,e,s,i,n,r)}static async deserialize(t,e,s){let i=null;if(t instanceof si){const{data:{inkLists:r,rect:a,rotation:o,id:l,color:c,opacity:d,borderStyle:{rawWidth:u},popupRef:f,richText:g,contentsObj:p,creationDate:m,modificationDate:v},parent:{page:{pageNumber:y}}}=t;i=t={annotationType:Y.INK,color:Array.from(c),thickness:u,opacity:d,paths:{points:r},boxes:null,pageIndex:y-1,rect:a.slice(0),rotation:o,annotationElementId:l,id:l,deleted:!1,popupRef:f,richText:g,comment:p?.str||null,creationDate:m,modificationDate:v}}const n=await super.deserialize(t,e,s);return n._initialData=i,t.comment&&n.setCommentData(t),n}get toolbarButtons(){return this._colorPicker||=new _e(this),[["colorPicker",this._colorPicker]]}get colorType(){return J.INK_COLOR}get colorAndOpacityType(){return J.INK_COLOR_AND_OPACITY}get opacityType(){return J.INK_OPACITY}updateParams(t,e){if(t===J.INK_COLOR_AND_OPACITY){this._updateColorAndOpacity(e.color,e.opacity);return}super.updateParams(t,e)}static updateDefaultParams(t,e){if(t===J.INK_COLOR_AND_OPACITY){super.updateDefaultParams(J.INK_COLOR,e.color),super.updateDefaultParams(J.INK_OPACITY,e.opacity);return}super.updateDefaultParams(t,e)}get color(){return this._drawingOptions.stroke}get opacity(){return this._drawingOptions["stroke-opacity"]}onScaleChanging(){if(!this.parent)return;super.onScaleChanging();const{_drawId:t,_drawingOptions:e,parent:s}=this;e.updateSVGProperty("stroke-width"),s.drawLayer.updateProperties(t,e.toSVGProperties())}static onScaleChangingWhenDrawing(){const t=this._currentParent;t&&(super.onScaleChangingWhenDrawing(),this._defaultDrawingOptions.updateSVGProperty("stroke-width"),t.drawLayer.updateProperties(this._currentDrawId,this._defaultDrawingOptions.toSVGProperties()))}createDrawingOptions({color:t,thickness:e,opacity:s}){this._drawingOptions=ni.getDefaultDrawingOptions({stroke:F.makeHexColor(...t),"stroke-width":e,"stroke-opacity":s})}serialize(t=!1){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const{lines:e,points:s}=this.serializeDraw(t),{_drawingOptions:{stroke:i,"stroke-opacity":n,"stroke-width":r}}=this,a=Object.assign(super.serialize(t),{color:H._colorManager.convert(i),opacity:n,thickness:r,paths:{lines:e,points:s}});return this.addComment(a),t?(a.isCopy=!0,a):this.annotationElementId&&!this.#t(a)?null:(a.id=this.annotationElementId,a)}#t(t){const{color:e,thickness:s,opacity:i,pageIndex:n}=this._initialData;return this.hasEditedComment||this._hasBeenMoved||this._hasBeenResized||t.color.some((r,a)=>r!==e[a])||t.thickness!==s||t.opacity!==i||t.pageIndex!==n}renderAnnotationElement(t){if(this.deleted)return t.hide(),null;const{points:e,rect:s}=this.serializeDraw(!1);return t.updateEdited({rect:s,thickness:this._drawingOptions["stroke-width"],points:e,popup:this.comment}),null}}class js extends je{toSVGPath(){let t=super.toSVGPath();return t.endsWith("Z")||(t+="Z"),t}}V(5213);const Je=8,Ce=3;class ve{static#t={maxDim:512,sigmaSFactor:.02,sigmaR:25,kernelSize:16};static#e(t,e,s,i){return s-=t,i-=e,s===0?i>0?0:4:s===1?i+6:2-i}static#s=new Int32Array([0,1,-1,1,-1,0,-1,-1,0,-1,1,-1,1,0,1,1]);static#i(t,e,s,i,n,r,a){const o=this.#e(s,i,n,r);for(let l=0;l<8;l++){const c=(-l+o-a+16)%8,d=this.#s[2*c],u=this.#s[2*c+1];if(t[(s+d)*e+(i+u)]!==0)return c}return-1}static#n(t,e,s,i,n,r,a){const o=this.#e(s,i,n,r);for(let l=0;l<8;l++){const c=(l+o+a+16)%8,d=this.#s[2*c],u=this.#s[2*c+1];if(t[(s+d)*e+(i+u)]!==0)return c}return-1}static#r(t,e,s,i){const n=t.length,r=new Int32Array(n);for(let c=0;c<n;c++)r[c]=t[c]<=i?1:0;for(let c=1;c<s-1;c++)r[c*e]=r[c*e+e-1]=0;for(let c=0;c<e;c++)r[c]=r[e*s-1-c]=0;let a=1,o;const l=[];for(let c=1;c<s-1;c++){o=1;for(let d=1;d<e-1;d++){const u=c*e+d,f=r[u];if(f===0)continue;let g=c,p=d;if(f===1&&r[u-1]===0)a+=1,p-=1;else if(f>=1&&r[u+1]===0)a+=1,p+=1,f>1&&(o=f);else{f!==1&&(o=Math.abs(f));continue}const m=[d,c],v=p===d+1,y={isHole:v,points:m,id:a,parent:0};l.push(y);let b;for(const T of l)if(T.id===o){b=T;break}b?b.isHole?y.parent=v?b.parent:o:y.parent=v?o:b.parent:y.parent=v?o:0;const w=this.#i(r,e,c,d,g,p,0);if(w===-1){r[u]=-a,r[u]!==1&&(o=Math.abs(r[u]));continue}let A=this.#s[2*w],S=this.#s[2*w+1];const E=c+A,C=d+S;g=E,p=C;let x=c,P=d;for(;;){const T=this.#n(r,e,x,P,g,p,1);A=this.#s[2*T],S=this.#s[2*T+1];const k=x+A,R=P+S;m.push(R,k);const D=x*e+P;if(r[D+1]===0?r[D]=-a:r[D]===1&&(r[D]=a),k===c&&R===d&&x===E&&P===C){r[u]!==1&&(o=Math.abs(r[u]));break}else g=x,p=P,x=k,P=R}}}return l}static#a(t,e,s,i){if(s-e<=4){for(let E=e;E<s-2;E+=2)i.push(t[E],t[E+1]);return}const n=t[e],r=t[e+1],a=t[s-4]-n,o=t[s-3]-r,l=Math.hypot(a,o),c=a/l,d=o/l,u=c*r-d*n,f=o/a,g=1/l,p=Math.atan(f),m=Math.cos(p),v=Math.sin(p),y=g*(Math.abs(m)+Math.abs(v)),b=g*(1-y+y**2),w=Math.max(Math.atan(Math.abs(v+m)*b),Math.atan(Math.abs(v-m)*b));let A=0,S=e;for(let E=e+2;E<s-2;E+=2){const C=Math.abs(u-c*t[E+1]+d*t[E]);C>A&&(S=E,A=C)}A>(l*w)**2?(this.#a(t,e,S+2,i),this.#a(t,S,s,i)):i.push(n,r)}static#o(t){const e=[],s=t.length;return this.#a(t,0,s,e),e.push(t[s-2],t[s-1]),e.length<=4?null:e}static#h(t,e,s,i,n,r){const a=new Float32Array(r**2),o=-2*i**2,l=r>>1;for(let p=0;p<r;p++){const m=(p-l)**2;for(let v=0;v<r;v++)a[p*r+v]=Math.exp((m+(v-l)**2)/o)}const c=new Float32Array(256),d=-2*n**2;for(let p=0;p<256;p++)c[p]=Math.exp(p**2/d);const u=t.length,f=new Uint8Array(u),g=new Uint32Array(256);for(let p=0;p<s;p++)for(let m=0;m<e;m++){const v=p*e+m,y=t[v];let b=0,w=0;for(let S=0;S<r;S++){const E=p+S-l;if(!(E<0||E>=s))for(let C=0;C<r;C++){const x=m+C-l;if(x<0||x>=e)continue;const P=t[E*e+x],T=a[S*r+C]*c[Math.abs(P-y)];b+=P*T,w+=T}}const A=f[v]=Math.round(b/w);g[A]++}return[f,g]}static#l(t){const e=new Uint32Array(256);for(const s of t)e[s]++;return e}static#u(t){const e=t.length,s=new Uint8ClampedArray(e>>2);let i=-1/0,n=1/0;for(let a=0,o=s.length;a<o;a++){const l=s[a]=t[a<<2];i=Math.max(i,l),n=Math.min(n,l)}const r=255/(i-n);for(let a=0,o=s.length;a<o;a++)s[a]=(s[a]-n)*r;return s}static#d(t){let e,s=-1/0,i=-1/0;const n=t.findIndex(o=>o!==0);let r=n,a=n;for(e=n;e<256;e++){const o=t[e];o>s&&(e-r>i&&(i=e-r,a=e-1),s=o,r=e)}for(e=a-1;e>=0&&!(t[e]>t[e+1]);e--);return e}static#f(t){const e=t,{width:s,height:i}=t,{maxDim:n}=this.#t;let r=s,a=i;if(s>n||i>n){let u=s,f=i,g=Math.log2(Math.max(s,i)/n);const p=Math.floor(g);g=g===p?p-1:p;for(let v=0;v<g;v++){r=Math.ceil(u/2),a=Math.ceil(f/2);const y=new OffscreenCanvas(r,a);y.getContext("2d").drawImage(t,0,0,u,f,0,0,r,a),u=r,f=a,t!==e&&t.close(),t=y.transferToImageBitmap()}const m=Math.min(n/r,n/a);r=Math.round(r*m),a=Math.round(a*m)}const l=new OffscreenCanvas(r,a).getContext("2d",{willReadFrequently:!0});l.fillStyle="white",l.fillRect(0,0,r,a),l.filter="grayscale(1)",l.drawImage(t,0,0,t.width,t.height,0,0,r,a);const c=l.getImageData(0,0,r,a).data;return[this.#u(c),r,a]}static extractContoursFromText(t,{fontFamily:e,fontStyle:s,fontWeight:i},n,r,a,o){let l=new OffscreenCanvas(1,1),c=l.getContext("2d",{alpha:!1});const d=200,u=c.font=`${s} ${i} ${d}px ${e}`,{actualBoundingBoxLeft:f,actualBoundingBoxRight:g,actualBoundingBoxAscent:p,actualBoundingBoxDescent:m,fontBoundingBoxAscent:v,fontBoundingBoxDescent:y,width:b}=c.measureText(t),w=1.5,A=Math.ceil(Math.max(Math.abs(f)+Math.abs(g)||0,b)*w),S=Math.ceil(Math.max(Math.abs(p)+Math.abs(m)||d,Math.abs(v)+Math.abs(y)||d)*w);l=new OffscreenCanvas(A,S),c=l.getContext("2d",{alpha:!0,willReadFrequently:!0}),c.font=u,c.filter="grayscale(1)",c.fillStyle="white",c.fillRect(0,0,A,S),c.fillStyle="black",c.fillText(t,A*(w-1)/2,S*(3-w)/2);const E=this.#u(c.getImageData(0,0,A,S).data),C=this.#l(E),x=this.#d(C),P=this.#r(E,A,S,x);return this.processDrawnLines({lines:{curves:P,width:A,height:S},pageWidth:n,pageHeight:r,rotation:a,innerMargin:o,mustSmooth:!0,areContours:!0})}static process(t,e,s,i,n){const[r,a,o]=this.#f(t),[l,c]=this.#h(r,a,o,Math.hypot(a,o)*this.#t.sigmaSFactor,this.#t.sigmaR,this.#t.kernelSize),d=this.#d(c),u=this.#r(l,a,o,d);return this.processDrawnLines({lines:{curves:u,width:a,height:o},pageWidth:e,pageHeight:s,rotation:i,innerMargin:n,mustSmooth:!0,areContours:!0})}static processDrawnLines({lines:t,pageWidth:e,pageHeight:s,rotation:i,innerMargin:n,mustSmooth:r,areContours:a}){i%180!==0&&([e,s]=[s,e]);const{curves:o,width:l,height:c}=t,d=t.thickness??0,u=[],f=Math.min(e/l,s/c),g=f/e,p=f/s,m=[];for(const{points:y}of o){const b=r?this.#o(y):y;if(!b)continue;m.push(b);const w=b.length,A=new Float32Array(w),S=new Float32Array(3*(w===2?2:w-2));if(u.push({line:S,points:A}),w===2){A[0]=b[0]*g,A[1]=b[1]*p,S.set([NaN,NaN,NaN,NaN,A[0],A[1]],0);continue}let[E,C,x,P]=b;E*=g,C*=p,x*=g,P*=p,A.set([E,C,x,P],0),S.set([NaN,NaN,NaN,NaN,E,C],0);for(let T=4;T<w;T+=2){const k=A[T]=b[T]*g,R=A[T+1]=b[T+1]*p;S.set(B.createBezierPoints(E,C,x,P,k,R),(T-2)*3),[E,C,x,P]=[x,P,k,R]}}if(u.length===0)return null;const v=a?new js:new je;return v.build(u,e,s,1,i,a?0:d,n),{outline:v,newCurves:m,areContours:a,thickness:d,width:l,height:c}}static async compressSignature({outlines:t,areContours:e,thickness:s,width:i,height:n}){let r=1/0,a=-1/0,o=0;for(const y of t){o+=y.length;for(let b=2,w=y.length;b<w;b++){const A=y[b]-y[b-2];r=Math.min(r,A),a=Math.max(a,A)}}let l;r>=-128&&a<=127?l=Int8Array:r>=-32768&&a<=32767?l=Int16Array:l=Int32Array;const c=t.length,d=Je+Ce*c,u=new Uint32Array(d);let f=0;u[f++]=d*Uint32Array.BYTES_PER_ELEMENT+(o-2*c)*l.BYTES_PER_ELEMENT,u[f++]=0,u[f++]=i,u[f++]=n,u[f++]=e?0:1,u[f++]=Math.max(0,Math.floor(s??0)),u[f++]=c,u[f++]=l.BYTES_PER_ELEMENT;for(const y of t)u[f++]=y.length-2,u[f++]=y[0],u[f++]=y[1];const g=new CompressionStream("deflate-raw"),p=g.writable.getWriter();await p.ready,p.write(u);const m=l.prototype.constructor;for(const y of t){const b=new m(y.length-2);for(let w=2,A=y.length;w<A;w++)b[w-2]=y[w]-y[w-2];p.write(b)}return p.close(),(await new Response(g.readable).bytes()).toBase64()}static async decompressSignature(t){try{const e=Uint8Array.fromBase64(t),{readable:s,writable:i}=new DecompressionStream("deflate-raw"),n=i.getWriter();await n.ready,n.write(e).then(async()=>{await n.ready,await n.close()}).catch(()=>{});let r=null,a=0;for await(const b of s)r||=new Uint8Array(new Uint32Array(b.buffer,0,4)[0]),r.set(b,a),a+=b.length;const o=new Uint32Array(r.buffer,0,r.length>>2),l=o[1];if(l!==0)throw new Error(`Invalid version: ${l}`);const c=o[2],d=o[3],u=o[4]===0,f=o[5],g=o[6],p=o[7],m=[],v=(Je+Ce*g)*Uint32Array.BYTES_PER_ELEMENT;let y;switch(p){case Int8Array.BYTES_PER_ELEMENT:y=new Int8Array(r.buffer,v);break;case Int16Array.BYTES_PER_ELEMENT:y=new Int16Array(r.buffer,v);break;case Int32Array.BYTES_PER_ELEMENT:y=new Int32Array(r.buffer,v);break}a=0;for(let b=0;b<g;b++){const w=o[Ce*b+Je],A=new Float32Array(w+2);m.push(A);for(let S=0;S<Ce-1;S++)A[S]=o[Ce*b+Je+S+1];for(let S=0;S<w;S++)A[S+2]=A[S]+y[a++]}return{areContours:u,thickness:f,outlines:m,width:c,height:d}}catch(e){return z(`decompressSignature: ${e}`),null}}}class ri extends pn{constructor(){super(),super.updateProperties({fill:H._defaultLineColor,"stroke-width":0})}clone(){const t=new ri;return t.updateAll(this),t}}class ai extends ws{constructor(t){super(t),super.updateProperties({stroke:H._defaultLineColor,"stroke-width":1})}clone(){const t=new ai(this._viewParameters);return t.updateAll(this),t}}class Gt extends st{#t=!1;#e=null;#s=null;#i=null;static _type="signature";static _editorType=Y.SIGNATURE;static _defaultDrawingOptions=null;constructor(t){super({...t,mustBeCommitted:!0,name:"signatureEditor"}),this._willKeepAspectRatio=!0,this.#s=t.signatureData||null,this.#e=null,this.defaultL10nId="pdfjs-editor-signature-editor1"}static initialize(t,e){H.initialize(t,e),this._defaultDrawingOptions=new ri,this._defaultDrawnSignatureOptions=new ai(e.viewParameters)}static getDefaultDrawingOptions(t){const e=this._defaultDrawingOptions.clone();return e.updateProperties(t),e}static get supportMultipleDrawings(){return!1}static get typesMap(){return K(this,"typesMap",new Map)}static get isDrawer(){return!1}get telemetryFinalData(){return{type:"signature",hasDescription:!!this.#e}}static computeTelemetryFinalData(t){const e=t.get("hasDescription");return{hasAltText:e.get(!0)??0,hasNoAltText:e.get(!1)??0}}get isResizable(){return!0}onScaleChanging(){this._drawId!==null&&super.onScaleChanging()}render(){if(this.div)return this.div;let t,e;const{_isCopy:s}=this;if(s&&(this._isCopy=!1,t=this.x,e=this.y),super.render(),this._drawId===null)if(this.#s){const{lines:i,mustSmooth:n,areContours:r,description:a,uuid:o,heightInPage:l}=this.#s,{rawDims:{pageWidth:c,pageHeight:d},rotation:u}=this.parent.viewport,f=ve.processDrawnLines({lines:i,pageWidth:c,pageHeight:d,rotation:u,innerMargin:Gt._INNER_MARGIN,mustSmooth:n,areContours:r});this.addSignature(f,l,a,o)}else this.div.setAttribute("data-l10n-args",JSON.stringify({description:""})),this.div.hidden=!0,this._uiManager.getSignature(this);else this.div.setAttribute("data-l10n-args",JSON.stringify({description:this.#e||""}));return s&&(this._isCopy=!0,this._moveAfterPaste(t,e)),this.div}setUuid(t){this.#i=t,this.addEditToolbar()}getUuid(){return this.#i}get description(){return this.#e}set description(t){this.#e=t,this.div&&(this.div.setAttribute("data-l10n-args",JSON.stringify({description:t})),super.addEditToolbar().then(e=>{e?.updateEditSignatureButton(t)}))}getSignaturePreview(){const{newCurves:t,areContours:e,thickness:s,width:i,height:n}=this.#s,r=Math.max(i,n),a=ve.processDrawnLines({lines:{curves:t.map(o=>({points:o})),thickness:s,width:i,height:n},pageWidth:r,pageHeight:r,rotation:0,innerMargin:0,mustSmooth:!1,areContours:e});return{areContours:e,outline:a.outline}}get toolbarButtons(){return this._uiManager.signatureManager?[["editSignature",this._uiManager.signatureManager]]:super.toolbarButtons}addSignature(t,e,s,i){const{x:n,y:r}=this,{outline:a}=this.#s=t;this.#t=a instanceof js,this.description=s;let o;this.#t?o=Gt.getDefaultDrawingOptions():(o=Gt._defaultDrawnSignatureOptions.clone(),o.updateProperties({"stroke-width":a.thickness})),this._addOutlines({drawOutlines:a,drawingOptions:o});const[,l]=this.pageDimensions;let c=e/l;c=c>=1?.5:c,this.width*=c/this.height,this.width>=1&&(c*=.9/this.width,this.width=.9),this.height=c,this.setDims(),this.x=n,this.y=r,this.center(),this._onResized(),this.onScaleChanging(),this.rotate(),this._uiManager.addToAnnotationStorage(this),this.setUuid(i),this._reportTelemetry({action:"pdfjs.signature.inserted",data:{hasBeenSaved:!!i,hasDescription:!!s}}),this.div.hidden=!1}getFromImage(t){const{rawDims:{pageWidth:e,pageHeight:s},rotation:i}=this.parent.viewport;return ve.process(t,e,s,i,Gt._INNER_MARGIN)}getFromText(t,e){const{rawDims:{pageWidth:s,pageHeight:i},rotation:n}=this.parent.viewport;return ve.extractContoursFromText(t,e,s,i,n,Gt._INNER_MARGIN)}getDrawnSignature(t){const{rawDims:{pageWidth:e,pageHeight:s},rotation:i}=this.parent.viewport;return ve.processDrawnLines({lines:t,pageWidth:e,pageHeight:s,rotation:i,innerMargin:Gt._INNER_MARGIN,mustSmooth:!1,areContours:!1})}createDrawingOptions({areContours:t,thickness:e}){t?this._drawingOptions=Gt.getDefaultDrawingOptions():(this._drawingOptions=Gt._defaultDrawnSignatureOptions.clone(),this._drawingOptions.updateProperties({"stroke-width":e}))}serialize(t=!1){if(this.isEmpty())return null;const{lines:e,points:s}=this.serializeDraw(t),{_drawingOptions:{"stroke-width":i}}=this,n=Object.assign(super.serialize(t),{isSignature:!0,areContours:this.#t,color:[0,0,0],thickness:this.#t?0:i});return this.addComment(n),t?(n.paths={lines:e,points:s},n.uuid=this.#i,n.isCopy=!0):n.lines=e,this.#e&&(n.accessibilityData={type:"Figure",alt:this.#e}),n}static deserializeDraw(t,e,s,i,n,r){return r.areContours?js.deserialize(t,e,s,i,n,r):je.deserialize(t,e,s,i,n,r)}static async deserialize(t,e,s){const i=await super.deserialize(t,e,s);return i.#t=t.areContours,i.description=t.accessibilityData?.alt||"",i.#i=t.uuid,i}}class Sa extends H{#t=null;#e=null;#s=null;#i=null;#n=null;#r="";#a=null;#o=!1;#h=null;#l=!1;#u=!1;static _type="stamp";static _editorType=Y.STAMP;constructor(t){super({...t,name:"stampEditor"}),this.#i=t.bitmapUrl,this.#n=t.bitmapFile,this.defaultL10nId="pdfjs-editor-stamp-editor"}static initialize(t,e){H.initialize(t,e)}static isHandlingMimeForPasting(t){return Ls.includes(t)}static paste(t,e){e.pasteEditor({mode:Y.STAMP},{bitmapFile:t.getAsFile()})}altTextFinish(){this._uiManager.useNewAltTextFlow&&(this.div.hidden=!1),super.altTextFinish()}get telemetryFinalData(){return{type:"stamp",hasAltText:!!this.altTextData?.altText}}static computeTelemetryFinalData(t){const e=t.get("hasAltText");return{hasAltText:e.get(!0)??0,hasNoAltText:e.get(!1)??0}}#d(t,e=!1){if(!t){this.remove();return}this.#t=t.bitmap,e||(this.#e=t.id,this.#l=t.isSvg),t.file&&(this.#r=t.file.name),this.#g()}#f(){if(this.#s=null,this._uiManager.enableWaiting(!1),!!this.#a){if(this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&this.#t){this.addEditToolbar().then(()=>{this._editToolbar.hide(),this._uiManager.editAltText(this,!0)});return}if(!this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&this.#t){this._reportTelemetry({action:"pdfjs.image.image_added",data:{alt_text_modal:!1,alt_text_type:"empty"}});try{this.mlGuessAltText()}catch{}}this.div.focus()}}async mlGuessAltText(t=null,e=!0){if(this.hasAltTextData())return null;const{mlManager:s}=this._uiManager;if(!s)throw new Error("No ML.");if(!await s.isEnabledFor("altText"))throw new Error("ML isn't enabled for alt text.");const{data:i,width:n,height:r}=t||this.copyCanvas(null,null,!0).imageData,a=await s.guess({name:"altText",request:{data:i,width:n,height:r,channels:i.length/(n*r)}});if(!a)throw new Error("No response from the AI service.");if(a.error)throw new Error("Error from the AI service.");if(a.cancel)return null;if(!a.output)throw new Error("No valid response from the AI service.");const o=a.output;return await this.setGuessedAltText(o),e&&!this.hasAltTextData()&&(this.altTextData={alt:o,decorative:!1}),o}#m(){if(this.#e){this._uiManager.enableWaiting(!0),this._uiManager.imageManager.getFromId(this.#e).then(s=>this.#d(s,!0)).finally(()=>this.#f());return}if(this.#i){const s=this.#i;this.#i=null,this._uiManager.enableWaiting(!0),this.#s=this._uiManager.imageManager.getFromUrl(s).then(i=>this.#d(i)).finally(()=>this.#f());return}if(this.#n){const s=this.#n;this.#n=null,this._uiManager.enableWaiting(!0),this.#s=this._uiManager.imageManager.getFromFile(s).then(i=>this.#d(i)).finally(()=>this.#f());return}const t=document.createElement("input");t.type="file",t.accept=Ls.join(",");const e=this._uiManager._signal;this.#s=new Promise(s=>{t.addEventListener("change",async()=>{if(!t.files||t.files.length===0)this.remove();else{this._uiManager.enableWaiting(!0);const i=await this._uiManager.imageManager.getFromFile(t.files[0]);this._reportTelemetry({action:"pdfjs.image.image_selected",data:{alt_text_modal:this._uiManager.useNewAltTextFlow}}),this.#d(i)}s()},{signal:e}),t.addEventListener("cancel",()=>{this.remove(),s()},{signal:e})}).finally(()=>this.#f()),t.click()}remove(){this.#e&&(this.#t=null,this._uiManager.imageManager.deleteId(this.#e),this.#a?.remove(),this.#a=null,this.#h&&(clearTimeout(this.#h),this.#h=null)),super.remove()}rebuild(){if(!this.parent){this.#e&&this.#m();return}super.rebuild(),this.div!==null&&(this.#e&&this.#a===null&&this.#m(),this.isAttachedToDOM||this.parent.add(this))}onceAdded(t){this._isDraggable=!0,t&&this.div.focus()}isEmpty(){return!(this.#s||this.#t||this.#i||this.#n||this.#e||this.#o)}get toolbarButtons(){return[["altText",this.createAltText()]]}get isResizable(){return!0}render(){if(this.div)return this.div;let t,e;return this._isCopy&&(t=this.x,e=this.y),super.render(),this.div.hidden=!0,this.createAltText(),this.#o||(this.#t?this.#g():this.#m()),this._isCopy&&this._moveAfterPaste(t,e),this._uiManager.addShouldRescale(this),this.div}setCanvas(t,e){const{id:s,bitmap:i}=this._uiManager.imageManager.getFromCanvas(t,e);e.remove(),s&&this._uiManager.imageManager.isValidId(s)&&(this.#e=s,i&&(this.#t=i),this.#o=!1,this.#g())}_onResized(){this.onScaleChanging()}onScaleChanging(){if(!this.parent)return;this.#h!==null&&clearTimeout(this.#h);const t=200;this.#h=setTimeout(()=>{this.#h=null,this.#p()},t)}#g(){const{div:t}=this;let{width:e,height:s}=this.#t;const[i,n]=this.pageDimensions,r=.75;if(this.width)e=this.width*i,s=this.height*n;else if(e>r*i||s>r*n){const o=Math.min(r*i/e,r*n/s);e*=o,s*=o}this._uiManager.enableWaiting(!1);const a=this.#a=document.createElement("canvas");a.setAttribute("role","img"),this.addContainer(a),this.width=e/i,this.height=s/n,this.setDims(),this._initialOptions?.isCentered?this.center():this.fixAndSetPosition(),this._initialOptions=null,(!this._uiManager.useNewAltTextWhenAddingImage||!this._uiManager.useNewAltTextFlow||this.annotationElementId)&&(t.hidden=!1),this.#p(),this.#u||(this.parent.addUndoableEditor(this),this.#u=!0),this._reportTelemetry({action:"inserted_image"}),this.#r&&this.div.setAttribute("aria-description",this.#r),this.annotationElementId||this._uiManager.a11yAlert("pdfjs-editor-stamp-added-alert")}copyCanvas(t,e,s=!1){t||(t=224);const{width:i,height:n}=this.#t,r=new Vt;let a=this.#t,o=i,l=n,c=null;if(e){if(i>e||n>e){const S=Math.min(e/i,e/n);o=Math.floor(i*S),l=Math.floor(n*S)}c=document.createElement("canvas");const u=c.width=Math.ceil(o*r.sx),f=c.height=Math.ceil(l*r.sy);this.#l||(a=this.#c(u,f));const g=c.getContext("2d");g.filter=this._uiManager.hcmFilter;let p="white",m="#cfcfd8";this._uiManager.hcmFilter!=="none"?m="black":Dn.isDarkMode&&(p="#8f8f9d",m="#42414d");const v=15,y=v*r.sx,b=v*r.sy,w=new OffscreenCanvas(y*2,b*2),A=w.getContext("2d");A.fillStyle=p,A.fillRect(0,0,y*2,b*2),A.fillStyle=m,A.fillRect(0,0,y,b),A.fillRect(y,b,y,b),g.fillStyle=g.createPattern(w,"repeat"),g.fillRect(0,0,u,f),g.drawImage(a,0,0,a.width,a.height,0,0,u,f)}let d=null;if(s){let u,f;if(r.symmetric&&a.width<t&&a.height<t)u=a.width,f=a.height;else if(a=this.#t,i>t||n>t){const m=Math.min(t/i,t/n);u=Math.floor(i*m),f=Math.floor(n*m),this.#l||(a=this.#c(u,f))}const p=new OffscreenCanvas(u,f).getContext("2d",{willReadFrequently:!0});p.drawImage(a,0,0,a.width,a.height,0,0,u,f),d={width:u,height:f,data:p.getImageData(0,0,u,f).data}}return{canvas:c,width:o,height:l,imageData:d}}#c(t,e){const{width:s,height:i}=this.#t;let n=s,r=i,a=this.#t;for(;n>2*t||r>2*e;){const o=n,l=r;n>2*t&&(n=Math.ceil(n/2)),r>2*e&&(r=Math.ceil(r/2));const c=new OffscreenCanvas(n,r);c.getContext("2d").drawImage(a,0,0,o,l,0,0,n,r),a=c.transferToImageBitmap()}return a}#p(){const[t,e]=this.parentDimensions,{width:s,height:i}=this,n=new Vt,r=Math.ceil(s*t*n.sx),a=Math.ceil(i*e*n.sy),o=this.#a;if(!o||o.width===r&&o.height===a)return;o.width=r,o.height=a;const l=this.#l?this.#t:this.#c(r,a),c=o.getContext("2d");c.filter=this._uiManager.hcmFilter,c.drawImage(l,0,0,l.width,l.height,0,0,r,a)}#v(t){if(t){if(this.#l){const i=this._uiManager.imageManager.getSvgUrl(this.#e);if(i)return i}const e=document.createElement("canvas");return{width:e.width,height:e.height}=this.#t,e.getContext("2d").drawImage(this.#t,0,0),e.toDataURL()}if(this.#l){const[e,s]=this.pageDimensions,i=Math.round(this.width*e*Se.PDF_TO_CSS_UNITS),n=Math.round(this.height*s*Se.PDF_TO_CSS_UNITS),r=new OffscreenCanvas(i,n);return r.getContext("2d").drawImage(this.#t,0,0,this.#t.width,this.#t.height,0,0,i,n),r.transferToImageBitmap()}return structuredClone(this.#t)}static async deserialize(t,e,s){let i=null,n=!1;if(t instanceof un){const{data:{rect:p,rotation:m,id:v,structParent:y,popupRef:b,richText:w,contentsObj:A,creationDate:S,modificationDate:E},container:C,parent:{page:{pageNumber:x}},canvas:P}=t;let T,k;P?(delete t.canvas,{id:T,bitmap:k}=s.imageManager.getFromCanvas(C.id,P),P.remove()):(n=!0,t._hasNoCanvas=!0);const R=(await e._structTree.getAriaAttributes(`${ye}${v}`))?.get("aria-label")||"";i=t={annotationType:Y.STAMP,bitmapId:T,bitmap:k,pageIndex:x-1,rect:p.slice(0),rotation:m,annotationElementId:v,id:v,deleted:!1,accessibilityData:{decorative:!1,altText:R},isSvg:!1,structParent:y,popupRef:b,richText:w,comment:A?.str||null,creationDate:S,modificationDate:E}}const r=await super.deserialize(t,e,s),{rect:a,bitmap:o,bitmapUrl:l,bitmapId:c,isSvg:d,accessibilityData:u}=t;n?(s.addMissingCanvas(t.id,r),r.#o=!0):c&&s.imageManager.isValidId(c)?(r.#e=c,o&&(r.#t=o)):r.#i=l,r.#l=d;const[f,g]=r.pageDimensions;return r.width=(a[2]-a[0])/f,r.height=(a[3]-a[1])/g,u&&(r.altTextData=u),r._initialData=i,t.comment&&r.setCommentData(t),r.#u=!!i,r}serialize(t=!1,e=null){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const s=Object.assign(super.serialize(t),{bitmapId:this.#e,isSvg:this.#l});if(this.addComment(s),t)return s.bitmapUrl=this.#v(!0),s.accessibilityData=this.serializeAltText(!0),s.isCopy=!0,s;const{decorative:i,altText:n}=this.serializeAltText(!1);if(!i&&n&&(s.accessibilityData={type:"Figure",alt:n}),this.annotationElementId){const a=this.#w(s);return a.isSame?null:(a.isSameAltText?delete s.accessibilityData:s.accessibilityData.structParent=this._initialData.structParent??-1,s.id=this.annotationElementId,delete s.bitmapId,s)}if(e===null)return s;e.stamps||=new Map;const r=this.#l?(s.rect[2]-s.rect[0])*(s.rect[3]-s.rect[1]):null;if(!e.stamps.has(this.#e))e.stamps.set(this.#e,{area:r,serialized:s}),s.bitmap=this.#v(!1);else if(this.#l){const a=e.stamps.get(this.#e);r>a.area&&(a.area=r,a.serialized.bitmap.close(),a.serialized.bitmap=this.#v(!1))}return s}#w(t){const{pageIndex:e,accessibilityData:{altText:s}}=this._initialData,i=t.pageIndex===e,n=(t.accessibilityData?.alt||"")===s;return{isSame:!this.hasEditedComment&&!this._hasBeenMoved&&!this._hasBeenResized&&i&&n,isSameAltText:n}}renderAnnotationElement(t){return this.deleted?(t.hide(),null):(t.updateEdited({rect:this.getPDFRect(),popup:this.comment}),null)}}class Yt{#t;#e=!1;#s=null;#i=null;#n=null;#r=new Map;#a=!1;#o=!1;#h=!1;#l=null;#u=null;#d=null;#f=null;#m=null;#g=-1;#c;static _initialized=!1;static#p=new Map([St,ni,Sa,pt,Gt].map(t=>[t._editorType,t]));constructor({uiManager:t,pageIndex:e,div:s,structTreeLayer:i,accessibilityManager:n,annotationLayer:r,drawLayer:a,textLayer:o,viewport:l,l10n:c}){const d=[...Yt.#p.values()];if(!Yt._initialized){Yt._initialized=!0;for(const u of d)u.initialize(c,t)}t.registerEditorTypes(d),this.#c=t,this.pageIndex=e,this.div=s,this.#t=n,this.#s=r,this.viewport=l,this.#d=o,this.drawLayer=a,this._structTree=i,this.#c.addLayer(this)}get isEmpty(){return this.#r.size===0}get isInvisible(){return this.isEmpty&&this.#c.getMode()===Y.NONE}updateToolbar(t){this.#c.updateToolbar(t)}updateMode(t=this.#c.getMode()){switch(this.#y(),t){case Y.NONE:this.div.classList.toggle("nonEditing",!0),this.disableTextSelection(),this.togglePointerEvents(!1),this.toggleAnnotationLayerPointerEvents(!0),this.disableClick();return;case Y.INK:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick();break;case Y.HIGHLIGHT:this.enableTextSelection(),this.togglePointerEvents(!1),this.disableClick();break;default:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick()}this.toggleAnnotationLayerPointerEvents(!1);const{classList:e}=this.div;if(e.toggle("nonEditing",!1),t===Y.POPUP)e.toggle("commentEditing",!0);else{e.toggle("commentEditing",!1);for(const s of Yt.#p.values())e.toggle(`${s._type}Editing`,t===s._editorType)}this.div.hidden=!1}hasTextLayer(t){return t===this.#d?.div}setEditingState(t){this.#c.setEditingState(t)}addCommands(t){this.#c.addCommands(t)}cleanUndoStack(t){this.#c.cleanUndoStack(t)}toggleDrawing(t=!1){this.div.classList.toggle("drawing",!t)}togglePointerEvents(t=!1){this.div.classList.toggle("disabled",!t)}toggleAnnotationLayerPointerEvents(t=!1){this.#s?.togglePointerEvents(t)}get#v(){return this.#r.size!==0?this.#r.values():this.#c.getEditors(this.pageIndex)}async enable(){this.#h=!0,this.div.tabIndex=0,this.togglePointerEvents(!0),this.div.classList.toggle("nonEditing",!1),this.#m?.abort(),this.#m=null;const t=new Set;for(const s of this.#v)s.enableEditing(),s.show(!0),s.annotationElementId&&(this.#c.removeChangedExistingAnnotation(s),t.add(s.annotationElementId));const e=this.#s;if(e)for(const s of e.getEditableAnnotations()){if(s.hide(),this.#c.isDeletedAnnotationElement(s.data.id)||t.has(s.data.id))continue;const i=await this.deserialize(s);i&&(this.addOrRebuild(i),i.enableEditing())}this.#h=!1,this.#c._eventBus.dispatch("editorsrendered",{source:this,pageNumber:this.pageIndex+1})}disable(){if(this.#o=!0,this.div.tabIndex=-1,this.togglePointerEvents(!1),this.div.classList.toggle("nonEditing",!0),this.#d&&!this.#m){this.#m=new AbortController;const i=this.#c.combinedSignal(this.#m);this.#d.div.addEventListener("pointerdown",n=>{const{clientX:a,clientY:o,timeStamp:l}=n,c=this.#g;if(l-c>500){this.#g=l;return}this.#g=-1;const{classList:d}=this.div;d.toggle("getElements",!0);const u=document.elementsFromPoint(a,o);if(d.toggle("getElements",!1),!this.div.contains(u[0]))return;let f;const g=new RegExp(`^${Fe}[0-9]+$`);for(const m of u)if(g.test(m.id)){f=m.id;break}if(!f)return;const p=this.#r.get(f);p?.annotationElementId===null&&(ct(n),p.dblclick(n))},{signal:i,capture:!0})}const t=this.#s,e=[];if(t){const i=new Map,n=new Map;for(const r of this.#v){if(r.disableEditing(),!r.annotationElementId){e.push(r);continue}if(r.serialize()!==null){i.set(r.annotationElementId,r);continue}else n.set(r.annotationElementId,r);this.getEditableAnnotation(r.annotationElementId)?.show(),r.remove()}for(const r of t.getEditableAnnotations()){const{id:a}=r.data;if(this.#c.isDeletedAnnotationElement(a)){r.updateEdited({deleted:!0});continue}let o=n.get(a);if(o){o.resetAnnotationElement(r),o.show(!1),r.show();continue}o=i.get(a),o&&(this.#c.addChangedExistingAnnotation(o),o.renderAnnotationElement(r)&&o.show(!1)),r.show()}}this.#y(),this.isEmpty&&(this.div.hidden=!0);const{classList:s}=this.div;for(const i of Yt.#p.values())s.remove(`${i._type}Editing`);this.disableTextSelection(),this.toggleAnnotationLayerPointerEvents(!0),t?.updateFakeAnnotations(e),this.#o=!1}getEditableAnnotation(t){return this.#s?.getEditableAnnotation(t)||null}setActiveEditor(t){this.#c.getActive()!==t&&this.#c.setActiveEditor(t)}enableTextSelection(){if(this.div.tabIndex=-1,this.#d?.div&&!this.#f){this.#f=new AbortController;const t=this.#c.combinedSignal(this.#f);this.#d.div.addEventListener("pointerdown",this.#w.bind(this),{signal:t}),this.#d.div.classList.add("highlighting")}}disableTextSelection(){this.div.tabIndex=0,this.#d?.div&&this.#f&&(this.#f.abort(),this.#f=null,this.#d.div.classList.remove("highlighting"))}#w(t){this.#c.unselectAll();const{target:e}=t;if(e===this.#d.div||(e.getAttribute("role")==="img"||e.classList.contains("endOfContent")||e.classList.contains("textLayerImagePlaceholder"))&&this.#d.div.contains(e)){const{isMac:s}=yt.platform;if(t.button!==0||t.ctrlKey&&s)return;this.#c.showAllEditors("highlight",!0,!0),this.#d.div.classList.add("free"),this.toggleDrawing(),pt.startHighlighting(this,this.#c.direction==="ltr",{target:this.#d.div,x:t.x,y:t.y}),this.#d.div.addEventListener("pointerup",()=>{this.#d.div.classList.remove("free"),this.toggleDrawing(!0)},{once:!0,signal:this.#c._signal}),t.preventDefault()}}enableClick(){if(this.#i)return;this.#i=new AbortController;const t=this.#c.combinedSignal(this.#i);this.div.addEventListener("pointerdown",this.pointerdown.bind(this),{signal:t});const e=this.pointerup.bind(this);this.div.addEventListener("pointerup",e,{signal:t}),this.div.addEventListener("pointercancel",e,{signal:t})}disableClick(){this.#i?.abort(),this.#i=null}attach(t){this.#r.set(t.id,t);const{annotationElementId:e}=t;e&&this.#c.isDeletedAnnotationElement(e)&&this.#c.removeDeletedAnnotationElement(t)}detach(t){this.#r.delete(t.id),this.#t?.removePointerInTextLayer(t.contentDiv),!this.#o&&t.annotationElementId&&this.#c.addDeletedAnnotationElement(t)}remove(t){this.detach(t),this.#c.removeEditor(t),t.div.remove(),t.isAttachedToDOM=!1}changeParent(t){t.parent!==this&&(t.parent&&t.annotationElementId&&(this.#c.addDeletedAnnotationElement(t),H.deleteAnnotationElement(t),t.annotationElementId=null),this.attach(t),t.parent?.detach(t),t.setParent(this),t.div&&t.isAttachedToDOM&&(t.div.remove(),this.div.append(t.div)))}add(t){if(!(t.parent===this&&t.isAttachedToDOM)){if(this.changeParent(t),this.#c.addEditor(t),this.attach(t),!t.isAttachedToDOM){const e=t.render();this.div.append(e),t.isAttachedToDOM=!0}t.fixAndSetPosition(),t.onceAdded(!this.#h),this.#c.addToAnnotationStorage(t),t._reportTelemetry(t.telemetryInitialData)}}moveEditorInDOM(t){if(!t.isAttachedToDOM)return;const{activeElement:e}=document;t.div.contains(e)&&!this.#n&&(t._focusEventsAllowed=!1,this.#n=setTimeout(()=>{this.#n=null,t.div.contains(document.activeElement)?t._focusEventsAllowed=!0:(t.div.addEventListener("focusin",()=>{t._focusEventsAllowed=!0},{once:!0,signal:this.#c._signal}),e.focus())},0)),t._structTreeParentId=this.#t?.moveElementInDOM(this.div,t.div,t.contentDiv,!0)}addOrRebuild(t){t.needsToBeRebuilt()?(t.parent||=this,t.rebuild(),t.show()):this.add(t)}addUndoableEditor(t){const e=()=>t._uiManager.rebuild(t),s=()=>{t.remove()};this.addCommands({cmd:e,undo:s,mustExec:!1})}getEditorByUID(t){for(const e of this.#r.values())if(e.uid===t)return e;return null}get#b(){return Yt.#p.get(this.#c.getMode())}combinedSignal(t){return this.#c.combinedSignal(t)}#E(t){const e=this.#b;return e?new e.prototype.constructor(t):null}canCreateNewEmptyEditor(){return this.#b?.canCreateNewEmptyEditor()}async pasteEditor(t,e){this.updateToolbar(t),await this.#c.updateMode(t.mode);const{offsetX:s,offsetY:i}=this.#P(),n=this.#c.getId(),r=this.#E({parent:this,id:n,x:s,y:i,uiManager:this.#c,isCentered:!0,...e});r&&this.add(r)}async deserialize(t){return await Yt.#p.get(t.annotationType??t.annotationEditorType)?.deserialize(t,this,this.#c)||null}createAndAddNewEditor(t,e,s={}){const i=this.#c.getId(),n=this.#E({parent:this,id:i,x:t.offsetX,y:t.offsetY,uiManager:this.#c,isCentered:e,...s});return n&&this.add(n),n}get boundingClientRect(){return this.div.getBoundingClientRect()}#P(){const{x:t,y:e,width:s,height:i}=this.boundingClientRect,n=Math.max(0,t),r=Math.max(0,e),a=Math.min(window.innerWidth,t+s),o=Math.min(window.innerHeight,e+i),l=(n+a)/2-t,c=(r+o)/2-e,[d,u]=this.viewport.rotation%180===0?[l,c]:[c,l];return{offsetX:d,offsetY:u}}addNewEditor(t={}){this.createAndAddNewEditor(this.#P(),!0,t)}setSelected(t){this.#c.setSelected(t)}toggleSelected(t){this.#c.toggleSelected(t)}unselect(t){this.#c.unselect(t)}pointerup(t){const{isMac:e}=yt.platform;if(t.button!==0||t.ctrlKey&&e||t.target!==this.div||!this.#a||(this.#a=!1,this.#b?.isDrawer&&this.#b.supportMultipleDrawings))return;if(!this.#e){this.#e=!0;return}const s=this.#c.getMode();if(s===Y.STAMP||s===Y.POPUP||s===Y.SIGNATURE){this.#c.unselectAll();return}this.createAndAddNewEditor(t,!1)}pointerdown(t){if(this.#c.getMode()===Y.HIGHLIGHT&&this.enableTextSelection(),this.#a){this.#a=!1;return}const{isMac:e}=yt.platform;if(t.button!==0||t.ctrlKey&&e||t.target!==this.div)return;if(this.#a=!0,this.#b?.isDrawer){this.startDrawingSession(t);return}const s=this.#c.getActive();this.#e=!s||s.isEmpty()}startDrawingSession(t){if(this.div.focus({preventScroll:!0}),this.#l){this.#b.startDrawing(this,this.#c,!1,t);return}this.#c.setCurrentDrawingSession(this),this.#l=new AbortController;const e=this.#c.combinedSignal(this.#l);this.div.addEventListener("blur",({relatedTarget:s})=>{s&&!this.div.contains(s)&&(this.#u=null,this.commitOrRemove())},{signal:e}),this.#b.startDrawing(this,this.#c,!1,t)}pause(t){if(t){const{activeElement:e}=document;this.div.contains(e)&&(this.#u=e);return}this.#u&&setTimeout(()=>{this.#u?.focus(),this.#u=null},0)}endDrawingSession(t=!1){return this.#l?(this.#c.setCurrentDrawingSession(null),this.#l.abort(),this.#l=null,this.#u=null,this.#b.endDrawing(t)):null}findNewParent(t,e,s){const i=this.#c.findParent(e,s);return i===null||i===this?!1:(i.changeParent(t),!0)}commitOrRemove(){return this.#l?(this.endDrawingSession(),!0):!1}onScaleChanging(){this.#l&&this.#b.onScaleChangingWhenDrawing(this)}destroy(){this.commitOrRemove(),this.#c.getActive()?.parent===this&&(this.#c.commitOrRemove(),this.#c.setActiveEditor(null)),this.#n&&(clearTimeout(this.#n),this.#n=null);for(const t of this.#r.values())this.#t?.removePointerInTextLayer(t.contentDiv),t.setParent(null),t.isAttachedToDOM=!1,t.div.remove();this.div=null,this.#r.clear(),this.#c.removeLayer(this)}#y(){for(const t of this.#r.values())t.isEmpty()&&t.remove()}async render({viewport:t}){this.viewport=t,he(this.div,t);for(const e of this.#c.getEditors(this.pageIndex))this.add(e),e.rebuild();await this.#c.findClonesForPage(this),this.div.hidden=this.isEmpty,this.updateMode()}update({viewport:t}){this.#c.commitOrRemove(),this.#y();const e=this.viewport.rotation,s=t.rotation;if(this.viewport=t,he(this.div,{rotation:s}),e!==s)for(const i of this.#r.values())i.rotate(s)}get pageDimensions(){const{pageWidth:t,pageHeight:e}=this.viewport.rawDims;return[t,e]}get scale(){return this.#c.viewParameters.realScale}}class Et{#t=null;#e=new Map;#s=new Map;static#i=0;setParent(t){if(!this.#t){this.#t=t;return}if(this.#t!==t){if(this.#e.size>0)for(const e of this.#e.values())e.remove(),t.append(e);this.#t=t}}static get _svgFactory(){return K(this,"_svgFactory",new ns)}static#n(t,[e,s,i,n]){const{style:r}=t;r.top=`${100*s}%`,r.left=`${100*e}%`,r.width=`${100*i}%`,r.height=`${100*n}%`}#r(){const t=Et._svgFactory.create(1,1,!0);return this.#t.append(t),t.setAttribute("aria-hidden",!0),t}#a(t,e){const s=Et._svgFactory.createElement("clipPath");t.append(s);const i=`clip_${e}`;s.setAttribute("id",i),s.setAttribute("clipPathUnits","objectBoundingBox");const n=Et._svgFactory.createElement("use");return s.append(n),n.setAttribute("href",`#${e}`),n.classList.add("clip"),i}#o(t,e){for(const[s,i]of Object.entries(e))i===null?t.removeAttribute(s):t.setAttribute(s,i)}draw(t,e=!1,s=!1){const i=Et.#i++,n=this.#r(),r=Et._svgFactory.createElement("defs");n.append(r);const a=Et._svgFactory.createElement("path");r.append(a);const o=`path_${i}`;a.setAttribute("id",o),a.setAttribute("vector-effect","non-scaling-stroke"),e&&this.#s.set(i,a);const l=s?this.#a(r,o):null,c=Et._svgFactory.createElement("use");return n.append(c),c.setAttribute("href",`#${o}`),this.updateProperties(n,t),this.#e.set(i,n),{id:i,clipPathId:`url(#${l})`}}drawOutline(t,e){const s=Et.#i++,i=this.#r(),n=Et._svgFactory.createElement("defs");i.append(n);const r=Et._svgFactory.createElement("path");n.append(r);const a=`path_${s}`;r.setAttribute("id",a),r.setAttribute("vector-effect","non-scaling-stroke");let o;if(e){const d=Et._svgFactory.createElement("mask");n.append(d),o=`mask_${s}`,d.setAttribute("id",o),d.setAttribute("maskUnits","objectBoundingBox");const u=Et._svgFactory.createElement("rect");d.append(u),u.setAttribute("width","1"),u.setAttribute("height","1"),u.setAttribute("fill","white");const f=Et._svgFactory.createElement("use");d.append(f),f.setAttribute("href",`#${a}`),f.setAttribute("stroke","none"),f.setAttribute("fill","black"),f.setAttribute("fill-rule","nonzero"),f.classList.add("mask")}const l=Et._svgFactory.createElement("use");i.append(l),l.setAttribute("href",`#${a}`),o&&l.setAttribute("mask",`url(#${o})`);const c=l.cloneNode();return i.append(c),l.classList.add("mainOutline"),c.classList.add("secondaryOutline"),this.updateProperties(i,t),this.#e.set(s,i),s}finalizeDraw(t,e){this.#s.delete(t),this.updateProperties(t,e)}updateProperties(t,e){if(!e)return;const{root:s,bbox:i,rootClass:n,path:r}=e,a=typeof t=="number"?this.#e.get(t):t;if(a){if(s&&this.#o(a,s),i&&Et.#n(a,i),n){const{classList:o}=a;for(const[l,c]of Object.entries(n))o.toggle(l,c)}if(r){const l=a.firstElementChild.firstElementChild;this.#o(l,r)}}}updateParent(t,e){if(e===this)return;const s=this.#e.get(t);s&&(e.#t.append(s),this.#e.delete(t),e.#e.set(t,s))}remove(t){this.#s.delete(t),this.#t!==null&&(this.#e.get(t).remove(),this.#e.delete(t))}destroy(){this.#t=null;for(const t of this.#e.values())t.remove();this.#e.clear(),this.#s.clear()}}function Qe(h){return`${(h*100).toFixed(2)}%`}class rs{#t=[];#e=new Map;#s=null;#i=0;#n=0;#r=0;static#a=null;constructor(t,e,s,i){this.#i=t,this.#t=e,this.#n=s.rawDims.pageWidth,this.#r=s.rawDims.pageHeight,this.#s=i}render(){const t=document.createElement("div");t.className="textLayerImages";for(let e=0;e<this.#t.length;e+=6){const s=this.#o(this.#t.subarray(e,e+6));s&&t.append(s)}return t.addEventListener("contextmenu",e=>{if(!(e.target instanceof HTMLCanvasElement))return;const s=e.target,i=this.#e.get(s);if(!i)return;const n=rs.#a?.deref();if(n===s)return;n&&(n.width=0,n.height=0),rs.#a=new WeakRef(s);const{inverseTransform:r,x1:a,y1:o,width:l,height:c}=i,d=this.#s(),u=Math.ceil(a*d.width),f=Math.ceil(o*d.height),g=Math.floor((a+l/this.#n)*d.width),p=Math.floor((o+c/this.#r)*d.height);s.width=g-u,s.height=p-f;const m=s.getContext("2d");m.setTransform(...r),m.translate(-u,-f),m.drawImage(d,0,0)}),t}#o([t,e,s,i,n,r]){const a=Math.hypot((n-t)*this.#n,(r-e)*this.#r),o=Math.hypot((s-t)*this.#n,(i-e)*this.#r);if(a<this.#i||o<this.#i)return null;const l=[(n-t)*this.#n/a,(r-e)*this.#r/a,(s-t)*this.#n/o,(i-e)*this.#r/o,0,0],c=F.inverseTransform(l),d=document.createElement("canvas");return d.className="textLayerImagePlaceholder",d.width=0,d.height=0,Object.assign(d.style,{opacity:0,position:"absolute",left:Qe(t),top:Qe(e),width:Qe(a/this.#n),height:Qe(o/this.#r),transformOrigin:"0% 0%",transform:`matrix(${l.join(",")})`}),this.#e.set(d,{inverseTransform:c,width:a,height:o,x1:t,y1:e}),d}}globalThis._pdfjsTestingUtils={HighlightOutliner:Hs};globalThis.pdfjsLib={AbortException:te,AnnotationEditorLayer:Yt,AnnotationEditorParamsType:J,AnnotationEditorType:Y,AnnotationEditorUIManager:ee,AnnotationLayer:ii,AnnotationMode:Zt,AnnotationType:vt,applyOpacity:Ln,build:Zr,ColorPicker:Nt,createValidAbsoluteUrl:Ui,CSSConstants:Fn,DOMSVGFactory:ns,DrawLayer:Et,FeatureTest:yt,fetchData:Vs,findContrastColor:Nn,getDocument:Xr,getFilenameFromUrl:Pn,getPdfFilenameFromUrl:In,getRGB:He,getRGBA:Ys,getUuid:$i,getXfaPageViewport:On,GlobalWorkerOptions:De,ImageKind:Ze,InvalidPDFException:Ms,isDataScheme:ds,isPdfFile:Xs,isValidExplicitDest:er,makeArr:Gs,makeMap:zs,makeObj:Ds,MathClamp:ht,noContextMenu:kt,normalizeUnicode:Tn,OPS:Kt,OutputScale:Vt,PasswordResponses:vn,PDFDataRangeTransport:rn,PDFDateString:Fs,PDFWorker:Be,PermissionFlag:mn,PixelsPerInch:Se,RenderingCancelledException:Ws,renderRichText:Gi,ResponseException:ss,setLayerDimensions:he,shadow:K,SignatureExtractor:ve,stopEvent:ct,SupportedImageMimeTypes:Ls,TextLayer:Ot,TextLayerImages:rs,TouchManager:us,updateUrlHash:Hi,Util:F,VerbosityLevel:os,version:Qr,XfaLayer:ji};export{te as AbortException,Yt as AnnotationEditorLayer,J as AnnotationEditorParamsType,Y as AnnotationEditorType,ee as AnnotationEditorUIManager,ii as AnnotationLayer,Zt as AnnotationMode,vt as AnnotationType,Fn as CSSConstants,Nt as ColorPicker,ns as DOMSVGFactory,Et as DrawLayer,yt as FeatureTest,De as GlobalWorkerOptions,Ze as ImageKind,Ms as InvalidPDFException,ht as MathClamp,Kt as OPS,Vt as OutputScale,rn as PDFDataRangeTransport,Fs as PDFDateString,Be as PDFWorker,vn as PasswordResponses,mn as PermissionFlag,Se as PixelsPerInch,Ws as RenderingCancelledException,ss as ResponseException,ve as SignatureExtractor,Ls as SupportedImageMimeTypes,Ot as TextLayer,rs as TextLayerImages,us as TouchManager,F as Util,os as VerbosityLevel,ji as XfaLayer,Ln as applyOpacity,Zr as build,Ui as createValidAbsoluteUrl,Vs as fetchData,Nn as findContrastColor,Xr as getDocument,Pn as getFilenameFromUrl,In as getPdfFilenameFromUrl,He as getRGB,Ys as getRGBA,$i as getUuid,On as getXfaPageViewport,ds as isDataScheme,Xs as isPdfFile,er as isValidExplicitDest,Gs as makeArr,zs as makeMap,Ds as makeObj,kt as noContextMenu,Tn as normalizeUnicode,Gi as renderRichText,he as setLayerDimensions,K as shadow,ct as stopEvent,Hi as updateUrlHash,Qr as version};
|