@arbidocs/blocks 0.5.107 → 0.5.108
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/dist/{ConnectedCallDock-TDYRHPAK.js → ConnectedCallDock-DV4FU376.js} +8 -8
- package/dist/{ConnectedCallDock-TDYRHPAK.js.map → ConnectedCallDock-DV4FU376.js.map} +1 -1
- package/dist/{ConnectedCallDock-H3WWFGXF.cjs → ConnectedCallDock-EM2VVGZK.cjs} +10 -10
- package/dist/{ConnectedCallDock-H3WWFGXF.cjs.map → ConnectedCallDock-EM2VVGZK.cjs.map} +1 -1
- package/dist/{ConnectedCallRoom-55O5OUN7.cjs → ConnectedCallRoom-7WEPEWUJ.cjs} +9 -9
- package/dist/{ConnectedCallRoom-55O5OUN7.cjs.map → ConnectedCallRoom-7WEPEWUJ.cjs.map} +1 -1
- package/dist/{ConnectedCallRoom-Z6F6WCLH.js → ConnectedCallRoom-RYTZP34O.js} +8 -8
- package/dist/{ConnectedCallRoom-Z6F6WCLH.js.map → ConnectedCallRoom-RYTZP34O.js.map} +1 -1
- package/dist/{ConnectedNativeDocxComparison-NVZRVNOS.js → ConnectedNativeDocxComparison-2NDXXZLQ.js} +15 -15
- package/dist/{ConnectedNativeDocxComparison-NVZRVNOS.js.map → ConnectedNativeDocxComparison-2NDXXZLQ.js.map} +1 -1
- package/dist/{ConnectedNativeDocxComparison-DGBZJ4XA.cjs → ConnectedNativeDocxComparison-7HOY3AVI.cjs} +16 -16
- package/dist/{ConnectedNativeDocxComparison-DGBZJ4XA.cjs.map → ConnectedNativeDocxComparison-7HOY3AVI.cjs.map} +1 -1
- package/dist/{ConnectedNativeDocxEditor-R4WINUUB.cjs → ConnectedNativeDocxEditor-CUWDPHXN.cjs} +16 -16
- package/dist/{ConnectedNativeDocxEditor-R4WINUUB.cjs.map → ConnectedNativeDocxEditor-CUWDPHXN.cjs.map} +1 -1
- package/dist/{ConnectedNativeDocxEditor-RSVBN7DY.js → ConnectedNativeDocxEditor-SPZB6Y27.js} +14 -14
- package/dist/{ConnectedNativeDocxEditor-RSVBN7DY.js.map → ConnectedNativeDocxEditor-SPZB6Y27.js.map} +1 -1
- package/dist/{ConnectedProductionSetDialog-2DFBXE2X.js → ConnectedProductionSetDialog-N3EDG3SU.js} +4 -4
- package/dist/{ConnectedProductionSetDialog-2DFBXE2X.js.map → ConnectedProductionSetDialog-N3EDG3SU.js.map} +1 -1
- package/dist/{ConnectedProductionSetDialog-KYDPQ7SG.cjs → ConnectedProductionSetDialog-XAEFEN3N.cjs} +4 -4
- package/dist/{ConnectedProductionSetDialog-KYDPQ7SG.cjs.map → ConnectedProductionSetDialog-XAEFEN3N.cjs.map} +1 -1
- package/dist/{ConnectedStreamedWordArtifact-HLJ5IIOU.js → ConnectedStreamedWordArtifact-6LTGEAJO.js} +15 -15
- package/dist/ConnectedStreamedWordArtifact-6LTGEAJO.js.map +1 -0
- package/dist/{ConnectedStreamedWordArtifact-JQ34AOUU.cjs → ConnectedStreamedWordArtifact-HNCRKZTV.cjs} +16 -16
- package/dist/ConnectedStreamedWordArtifact-HNCRKZTV.cjs.map +1 -0
- package/dist/{DocumentReviewCard-7JSXRJZ2.js → DocumentReviewCard-RJD3CO32.js} +8 -8
- package/dist/{DocumentReviewCard-7JSXRJZ2.js.map → DocumentReviewCard-RJD3CO32.js.map} +1 -1
- package/dist/{DocumentReviewCard-C4HVT3WM.cjs → DocumentReviewCard-VON7LOOY.cjs} +8 -8
- package/dist/{DocumentReviewCard-C4HVT3WM.cjs.map → DocumentReviewCard-VON7LOOY.cjs.map} +1 -1
- package/dist/{FilesViewerDialog-IMQTZWKD.js → FilesViewerDialog-7SJGY72Q.js} +21 -21
- package/dist/{FilesViewerDialog-IMQTZWKD.js.map → FilesViewerDialog-7SJGY72Q.js.map} +1 -1
- package/dist/{FilesViewerDialog-UP7GFHYN.cjs → FilesViewerDialog-VIPTC6OT.cjs} +27 -27
- package/dist/{FilesViewerDialog-UP7GFHYN.cjs.map → FilesViewerDialog-VIPTC6OT.cjs.map} +1 -1
- package/dist/{RechartsRenderer-GIRCW7DB.cjs → RechartsRenderer-THES2SE5.cjs} +6 -5
- package/dist/RechartsRenderer-THES2SE5.cjs.map +1 -0
- package/dist/{RechartsRenderer-23OF4H6X.js → RechartsRenderer-XIZLV6GH.js} +6 -5
- package/dist/RechartsRenderer-XIZLV6GH.js.map +1 -0
- package/dist/{WorkspaceTableView-PJM47B5F.cjs → WorkspaceTableView-FNME7TL6.cjs} +9 -9
- package/dist/{WorkspaceTableView-PJM47B5F.cjs.map → WorkspaceTableView-FNME7TL6.cjs.map} +1 -1
- package/dist/{WorkspaceTableView-YDA7A4UJ.js → WorkspaceTableView-XQ6J2JKI.js} +7 -7
- package/dist/{WorkspaceTableView-YDA7A4UJ.js.map → WorkspaceTableView-XQ6J2JKI.js.map} +1 -1
- package/dist/agents/index.cjs +202 -202
- package/dist/agents/index.js +8 -8
- package/dist/{ai-ADS6YSS2.cjs → ai-3SAMEYBB.cjs} +20 -20
- package/dist/ai-3SAMEYBB.cjs.map +1 -0
- package/dist/{ai-KHWTGBT5.js → ai-OTQWSYVK.js} +12 -12
- package/dist/ai-OTQWSYVK.js.map +1 -0
- package/dist/calls/index.cjs +57 -57
- package/dist/calls/index.js +9 -9
- package/dist/chat/index.cjs +3 -3
- package/dist/chat/index.js +3 -3
- package/dist/{chunk-O27K7KTZ.cjs → chunk-2TBQBF4Y.cjs} +5 -5
- package/dist/{chunk-O27K7KTZ.cjs.map → chunk-2TBQBF4Y.cjs.map} +1 -1
- package/dist/{chunk-YJWAGXYM.js → chunk-4ZA2RSQH.js} +3 -3
- package/dist/{chunk-YJWAGXYM.js.map → chunk-4ZA2RSQH.js.map} +1 -1
- package/dist/{chunk-6A4GNM4T.cjs → chunk-5D2ZINOJ.cjs} +16 -16
- package/dist/{chunk-6A4GNM4T.cjs.map → chunk-5D2ZINOJ.cjs.map} +1 -1
- package/dist/{chunk-BFVCYBND.cjs → chunk-5HXQOM3I.cjs} +5 -5
- package/dist/{chunk-BFVCYBND.cjs.map → chunk-5HXQOM3I.cjs.map} +1 -1
- package/dist/{chunk-GSD5U553.cjs → chunk-5KKT65WU.cjs} +3 -3
- package/dist/{chunk-GSD5U553.cjs.map → chunk-5KKT65WU.cjs.map} +1 -1
- package/dist/{chunk-AVGHTUPE.js → chunk-5PWLXLHY.js} +5 -5
- package/dist/chunk-5PWLXLHY.js.map +1 -0
- package/dist/{chunk-BBWLFK3C.js → chunk-5XIMUQ63.js} +3 -3
- package/dist/{chunk-BBWLFK3C.js.map → chunk-5XIMUQ63.js.map} +1 -1
- package/dist/{chunk-AHMRYY7J.cjs → chunk-6DAJXQZZ.cjs} +13 -13
- package/dist/{chunk-AHMRYY7J.cjs.map → chunk-6DAJXQZZ.cjs.map} +1 -1
- package/dist/{chunk-3PV25ICC.js → chunk-6KKVJ2V6.js} +3 -3
- package/dist/{chunk-3PV25ICC.js.map → chunk-6KKVJ2V6.js.map} +1 -1
- package/dist/{chunk-OLAYDOPC.js → chunk-6LUHNFEE.js} +6 -6
- package/dist/{chunk-OLAYDOPC.js.map → chunk-6LUHNFEE.js.map} +1 -1
- package/dist/{chunk-FSXQHEFQ.cjs → chunk-7CDV7Y4U.cjs} +25 -25
- package/dist/{chunk-FSXQHEFQ.cjs.map → chunk-7CDV7Y4U.cjs.map} +1 -1
- package/dist/{chunk-OAIOOVFN.cjs → chunk-7SJXYEZI.cjs} +36 -36
- package/dist/chunk-7SJXYEZI.cjs.map +1 -0
- package/dist/{chunk-LFYKB7KF.cjs → chunk-7V6APLF7.cjs} +19 -19
- package/dist/{chunk-LFYKB7KF.cjs.map → chunk-7V6APLF7.cjs.map} +1 -1
- package/dist/{chunk-4WMGFGYP.cjs → chunk-AJZ66VJC.cjs} +4 -4
- package/dist/{chunk-4WMGFGYP.cjs.map → chunk-AJZ66VJC.cjs.map} +1 -1
- package/dist/{chunk-KCP42W67.cjs → chunk-ARGQ5YZ5.cjs} +3 -3
- package/dist/{chunk-KCP42W67.cjs.map → chunk-ARGQ5YZ5.cjs.map} +1 -1
- package/dist/{chunk-BH6IKGZ3.js → chunk-AUAHGQY6.js} +5 -5
- package/dist/{chunk-BH6IKGZ3.js.map → chunk-AUAHGQY6.js.map} +1 -1
- package/dist/{chunk-KIXFXCHL.js → chunk-CEOCA7ID.js} +3 -3
- package/dist/{chunk-KIXFXCHL.js.map → chunk-CEOCA7ID.js.map} +1 -1
- package/dist/{chunk-TNKPQ3EF.js → chunk-CIRSOYGK.js} +12 -12
- package/dist/{chunk-TNKPQ3EF.js.map → chunk-CIRSOYGK.js.map} +1 -1
- package/dist/{chunk-BAUZUIHB.js → chunk-COL2TJGO.js} +83 -83
- package/dist/chunk-COL2TJGO.js.map +1 -0
- package/dist/{chunk-XHN5KOI2.cjs → chunk-DRLD4P2C.cjs} +8 -8
- package/dist/{chunk-XHN5KOI2.cjs.map → chunk-DRLD4P2C.cjs.map} +1 -1
- package/dist/{chunk-5AC52BHL.cjs → chunk-DYPFNQTQ.cjs} +140 -140
- package/dist/chunk-DYPFNQTQ.cjs.map +1 -0
- package/dist/{chunk-SCLGUHLU.cjs → chunk-E7TGSOPR.cjs} +4 -4
- package/dist/{chunk-SCLGUHLU.cjs.map → chunk-E7TGSOPR.cjs.map} +1 -1
- package/dist/{chunk-CRLFLMTK.cjs → chunk-EOXA4VJH.cjs} +3 -3
- package/dist/{chunk-CRLFLMTK.cjs.map → chunk-EOXA4VJH.cjs.map} +1 -1
- package/dist/{chunk-DBKZANTC.js → chunk-GA47YVW5.js} +3 -3
- package/dist/{chunk-DBKZANTC.js.map → chunk-GA47YVW5.js.map} +1 -1
- package/dist/{chunk-RCZRI72J.cjs → chunk-GMODJT4N.cjs} +4 -4
- package/dist/{chunk-RCZRI72J.cjs.map → chunk-GMODJT4N.cjs.map} +1 -1
- package/dist/{chunk-22KAKJ3W.cjs → chunk-GS5MFUPC.cjs} +4 -4
- package/dist/{chunk-22KAKJ3W.cjs.map → chunk-GS5MFUPC.cjs.map} +1 -1
- package/dist/{chunk-62OMGQHS.js → chunk-H6W3VXHU.js} +3 -3
- package/dist/{chunk-62OMGQHS.js.map → chunk-H6W3VXHU.js.map} +1 -1
- package/dist/{chunk-DX3Z2COD.cjs → chunk-HUYKO2ES.cjs} +3 -3
- package/dist/{chunk-DX3Z2COD.cjs.map → chunk-HUYKO2ES.cjs.map} +1 -1
- package/dist/{chunk-U5F5P4YU.js → chunk-IK234EFX.js} +12 -12
- package/dist/{chunk-U5F5P4YU.js.map → chunk-IK234EFX.js.map} +1 -1
- package/dist/{chunk-UQ2OBHMV.js → chunk-JUGEFTRC.js} +1010 -1010
- package/dist/chunk-JUGEFTRC.js.map +1 -0
- package/dist/{chunk-CHQMVIHR.js → chunk-LPGBRMYS.js} +36 -36
- package/dist/chunk-LPGBRMYS.js.map +1 -0
- package/dist/{chunk-D35EHOK5.cjs → chunk-M23W7IID.cjs} +12 -12
- package/dist/chunk-M23W7IID.cjs.map +1 -0
- package/dist/{chunk-FPOKWML2.js → chunk-MIVNNQO3.js} +21 -4
- package/dist/chunk-MIVNNQO3.js.map +1 -0
- package/dist/{chunk-WI3BVKEC.cjs → chunk-MNFI66H5.cjs} +5 -5
- package/dist/{chunk-WI3BVKEC.cjs.map → chunk-MNFI66H5.cjs.map} +1 -1
- package/dist/{chunk-T5ZMG6MC.js → chunk-NF4M7PUB.js} +3 -3
- package/dist/{chunk-T5ZMG6MC.js.map → chunk-NF4M7PUB.js.map} +1 -1
- package/dist/{chunk-ZNY5W3VX.js → chunk-NPSFPBIB.js} +3 -3
- package/dist/{chunk-ZNY5W3VX.js.map → chunk-NPSFPBIB.js.map} +1 -1
- package/dist/{chunk-LYW5A35J.js → chunk-OMIYTUVR.js} +12 -12
- package/dist/{chunk-LYW5A35J.js.map → chunk-OMIYTUVR.js.map} +1 -1
- package/dist/{chunk-ZMVF7EYJ.cjs → chunk-PBPO54KZ.cjs} +21 -3
- package/dist/chunk-PBPO54KZ.cjs.map +1 -0
- package/dist/{chunk-7V4OCZS6.cjs → chunk-RA3EGF6K.cjs} +6 -6
- package/dist/{chunk-7V4OCZS6.cjs.map → chunk-RA3EGF6K.cjs.map} +1 -1
- package/dist/{chunk-PL7O3RJJ.cjs → chunk-RKBAY7GZ.cjs} +3 -3
- package/dist/{chunk-PL7O3RJJ.cjs.map → chunk-RKBAY7GZ.cjs.map} +1 -1
- package/dist/{chunk-J3E5CSSC.js → chunk-RKFWBIKS.js} +3 -3
- package/dist/{chunk-J3E5CSSC.js.map → chunk-RKFWBIKS.js.map} +1 -1
- package/dist/{chunk-YLKHTBYA.js → chunk-RRP7MQAO.js} +3 -3
- package/dist/{chunk-YLKHTBYA.js.map → chunk-RRP7MQAO.js.map} +1 -1
- package/dist/{chunk-U6LQ6Z3P.cjs → chunk-SP3IKIPA.cjs} +6 -6
- package/dist/{chunk-U6LQ6Z3P.cjs.map → chunk-SP3IKIPA.cjs.map} +1 -1
- package/dist/{chunk-GX75YCWJ.cjs → chunk-SQUOXOY3.cjs} +560 -560
- package/dist/chunk-SQUOXOY3.cjs.map +1 -0
- package/dist/{chunk-6ZYOUT73.js → chunk-T5LORFHL.js} +7 -7
- package/dist/{chunk-6ZYOUT73.js.map → chunk-T5LORFHL.js.map} +1 -1
- package/dist/{chunk-45OU2UAA.cjs → chunk-TEMTKBBL.cjs} +10 -10
- package/dist/{chunk-45OU2UAA.cjs.map → chunk-TEMTKBBL.cjs.map} +1 -1
- package/dist/{chunk-PHDUN4SG.cjs → chunk-THCMGAFX.cjs} +41 -41
- package/dist/{chunk-PHDUN4SG.cjs.map → chunk-THCMGAFX.cjs.map} +1 -1
- package/dist/{chunk-HTGEAQOA.js → chunk-TOMDMKOD.js} +7 -7
- package/dist/{chunk-HTGEAQOA.js.map → chunk-TOMDMKOD.js.map} +1 -1
- package/dist/{chunk-WJHRWXWJ.js → chunk-TXIAF4PX.js} +3 -3
- package/dist/{chunk-WJHRWXWJ.js.map → chunk-TXIAF4PX.js.map} +1 -1
- package/dist/{chunk-6M5NAAWX.js → chunk-UCSEE52D.js} +3 -3
- package/dist/{chunk-6M5NAAWX.js.map → chunk-UCSEE52D.js.map} +1 -1
- package/dist/{chunk-I7CJDF3V.cjs → chunk-UHMP6S7M.cjs} +104 -103
- package/dist/chunk-UHMP6S7M.cjs.map +1 -0
- package/dist/{chunk-PGCKTXYH.js → chunk-UHUI6A36.js} +3 -3
- package/dist/{chunk-PGCKTXYH.js.map → chunk-UHUI6A36.js.map} +1 -1
- package/dist/{chunk-6KQVTMRL.cjs → chunk-UOGXKHTJ.cjs} +3 -3
- package/dist/{chunk-6KQVTMRL.cjs.map → chunk-UOGXKHTJ.cjs.map} +1 -1
- package/dist/{chunk-7S7YVBFK.js → chunk-VDSDG4FR.js} +3 -3
- package/dist/{chunk-7S7YVBFK.js.map → chunk-VDSDG4FR.js.map} +1 -1
- package/dist/{chunk-3GFQNJYE.js → chunk-VGWCHX6G.js} +104 -103
- package/dist/chunk-VGWCHX6G.js.map +1 -0
- package/dist/{chunk-VY3HTT37.js → chunk-VUH547VQ.js} +3 -3
- package/dist/{chunk-VY3HTT37.js.map → chunk-VUH547VQ.js.map} +1 -1
- package/dist/{chunk-AZCMKGDG.js → chunk-W37PFYFL.js} +4 -4
- package/dist/{chunk-AZCMKGDG.js.map → chunk-W37PFYFL.js.map} +1 -1
- package/dist/{chunk-JGUM4EXE.cjs → chunk-W3IX3GZS.cjs} +8 -8
- package/dist/{chunk-JGUM4EXE.cjs.map → chunk-W3IX3GZS.cjs.map} +1 -1
- package/dist/{chunk-UCA4JLLJ.cjs → chunk-X7GT57KW.cjs} +3 -3
- package/dist/{chunk-UCA4JLLJ.cjs.map → chunk-X7GT57KW.cjs.map} +1 -1
- package/dist/{chunk-IXL2KJOZ.cjs → chunk-XBEGD33U.cjs} +40 -40
- package/dist/{chunk-IXL2KJOZ.cjs.map → chunk-XBEGD33U.cjs.map} +1 -1
- package/dist/{chunk-FDNIK5YS.cjs → chunk-XBKIFGBB.cjs} +8 -8
- package/dist/{chunk-FDNIK5YS.cjs.map → chunk-XBKIFGBB.cjs.map} +1 -1
- package/dist/{chunk-HZE5MHQO.js → chunk-XT7HKQ4H.js} +3 -3
- package/dist/{chunk-HZE5MHQO.js.map → chunk-XT7HKQ4H.js.map} +1 -1
- package/dist/{chunk-M3OK6KGR.js → chunk-ZGQKED5T.js} +3 -3
- package/dist/{chunk-M3OK6KGR.js.map → chunk-ZGQKED5T.js.map} +1 -1
- package/dist/{chunk-NWBCZ4PA.js → chunk-ZKBYG6MN.js} +4 -4
- package/dist/{chunk-NWBCZ4PA.js.map → chunk-ZKBYG6MN.js.map} +1 -1
- package/dist/collaboration/index.cjs +1 -1
- package/dist/collaboration/index.js +1 -1
- package/dist/connect/docx.cjs +19 -19
- package/dist/connect/docx.js +15 -15
- package/dist/connect/index.cjs +762 -762
- package/dist/connect/index.js +63 -63
- package/dist/connect/viewer.cjs +14 -14
- package/dist/connect/viewer.js +13 -13
- package/dist/connection/dashboards/ConnectedDashboardsPage.d.ts +6 -0
- package/dist/dashboards/chartModel.d.ts +12 -0
- package/dist/dashboards/index.cjs +113 -42
- package/dist/dashboards/index.cjs.map +1 -1
- package/dist/dashboards/index.js +95 -24
- package/dist/dashboards/index.js.map +1 -1
- package/dist/embed/index.cjs +29 -29
- package/dist/embed/index.js +23 -23
- package/dist/facts/index.cjs +43 -43
- package/dist/facts/index.js +2 -2
- package/dist/files/index.cjs +1 -1
- package/dist/files/index.js +1 -1
- package/dist/home/index.cjs +31 -31
- package/dist/home/index.js +3 -3
- package/dist/index.cjs +383 -383
- package/dist/index.js +21 -21
- package/dist/settings/index.cjs +153 -153
- package/dist/settings/index.js +4 -4
- package/dist/shell/index.cjs +36 -36
- package/dist/shell/index.js +4 -4
- package/dist/site/index.cjs +5 -5
- package/dist/site/index.js +1 -1
- package/dist/studio/index.cjs +19 -19
- package/dist/studio/index.js +14 -14
- package/dist/styles.css +1 -1
- package/dist/workflow-canvas/index.cjs +33 -33
- package/dist/workflow-canvas/index.js +22 -22
- package/node_modules/@arbidocs/coedit/package.json +2 -2
- package/node_modules/@docx-editor.dev/core/dist/automation.cjs +1 -1
- package/node_modules/@docx-editor.dev/core/dist/automation.d.ts +60 -13
- package/node_modules/@docx-editor.dev/core/dist/automation.js +1 -1
- package/node_modules/@docx-editor.dev/core/dist/binding.cjs +1 -1
- package/node_modules/@docx-editor.dev/core/dist/binding.d.ts +21 -13
- package/node_modules/@docx-editor.dev/core/dist/binding.js +1 -1
- package/node_modules/@docx-editor.dev/core/dist/{index-Bsg7oIKP.d.ts → chrome-print-CAs51cpq.d.ts} +31 -21
- package/node_modules/@docx-editor.dev/core/dist/{chunk-VDNNLG6X.js → chunk-236O4YQW.js} +1 -1
- package/node_modules/@docx-editor.dev/core/dist/chunk-4HENIAFG.js +1 -0
- package/node_modules/@docx-editor.dev/core/dist/{chunk-SRPILEWV.cjs → chunk-6JPL6ZAS.cjs} +5 -5
- package/node_modules/@docx-editor.dev/core/dist/{chunk-2RC2EPND.js → chunk-6ZQP4HQ7.js} +1 -1
- package/node_modules/@docx-editor.dev/core/dist/{chunk-ZUHOMK52.cjs → chunk-7WQ7AAHW.cjs} +1 -1
- package/node_modules/@docx-editor.dev/core/dist/{chunk-Z6WBFXJU.js → chunk-BCXH4BXB.js} +3 -3
- package/node_modules/@docx-editor.dev/core/dist/{chunk-QMLCVPCD.cjs → chunk-BY2ACZZ6.cjs} +1 -1
- package/node_modules/@docx-editor.dev/core/dist/chunk-CAJEXXVG.cjs +4 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-CPWLFPWC.js +30 -0
- package/node_modules/@docx-editor.dev/core/dist/{chunk-6APGXLBB.cjs → chunk-D7ZMDMPX.cjs} +2 -2
- package/node_modules/@docx-editor.dev/core/dist/chunk-DOHF6FA7.cjs +30 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-DVX32P2P.js +27 -0
- package/node_modules/@docx-editor.dev/core/dist/{chunk-6EYYL7FL.js → chunk-E4LOMDNL.js} +1 -1
- package/node_modules/@docx-editor.dev/core/dist/chunk-EKLM7NWB.cjs +7 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-G3K63G7P.cjs +27 -0
- package/node_modules/@docx-editor.dev/core/dist/{chunk-5CSUYANV.js → chunk-G4HOFIKJ.js} +1 -1
- package/node_modules/@docx-editor.dev/core/dist/{chunk-K5U2PLDP.cjs → chunk-JLVBDYVQ.cjs} +1 -1
- package/node_modules/@docx-editor.dev/core/dist/chunk-LQX36Z5P.js +7 -0
- package/node_modules/@docx-editor.dev/core/dist/{chunk-TSLBZ26X.js → chunk-LSZ6KPKK.js} +1 -1
- package/node_modules/@docx-editor.dev/core/dist/{chunk-O2AL2HSJ.cjs → chunk-MM5QBMTE.cjs} +1 -1
- package/node_modules/@docx-editor.dev/core/dist/{chunk-ETTO6GK3.js → chunk-OMCG63ZF.js} +1 -1
- package/node_modules/@docx-editor.dev/core/dist/chunk-OSFOJTHU.cjs +18 -0
- package/node_modules/@docx-editor.dev/core/dist/{chunk-E7BQA6UP.js → chunk-RCLZXP3B.js} +1 -1
- package/node_modules/@docx-editor.dev/core/dist/chunk-T6K2QYNZ.cjs +2 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-TRGAVV2Y.js +4 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-U4JZVSOE.js +2 -0
- package/node_modules/@docx-editor.dev/core/dist/{chunk-2GO5T2JU.cjs → chunk-UHHYFIDT.cjs} +1 -1
- package/node_modules/@docx-editor.dev/core/dist/chunk-V3N4SOAK.cjs +1 -0
- package/node_modules/@docx-editor.dev/core/dist/{chunk-6AWEKBLB.cjs → chunk-W35WTWAO.cjs} +1 -1
- package/node_modules/@docx-editor.dev/core/dist/chunk-YQ5G6LC7.js +18 -0
- package/node_modules/@docx-editor.dev/core/dist/collaboration/replication.cjs +1 -1
- package/node_modules/@docx-editor.dev/core/dist/collaboration/replication.d.ts +5 -5
- package/node_modules/@docx-editor.dev/core/dist/collaboration/replication.js +1 -1
- package/node_modules/@docx-editor.dev/core/dist/collaboration.d.ts +4 -4
- package/node_modules/@docx-editor.dev/core/dist/contracts/document.d.ts +3 -3
- package/node_modules/@docx-editor.dev/core/dist/contracts/editor.d.ts +9 -10
- package/node_modules/@docx-editor.dev/core/dist/contracts/interaction.d.ts +2 -2
- package/node_modules/@docx-editor.dev/core/dist/contracts/modules.cjs +1 -1
- package/node_modules/@docx-editor.dev/core/dist/contracts/modules.d.ts +33 -9
- package/node_modules/@docx-editor.dev/core/dist/contracts/modules.js +1 -1
- package/node_modules/@docx-editor.dev/core/dist/contracts/types.d.ts +2 -2
- package/node_modules/@docx-editor.dev/core/dist/{custom-node-writes-cvL5rhcD.d.ts → custom-node-writes-Bn6uciLb.d.ts} +2 -2
- package/node_modules/@docx-editor.dev/core/dist/diagnostic-context-B8M79cfK.d.ts +30 -0
- package/node_modules/@docx-editor.dev/core/dist/diagnostic-hints-BeVjfNOv.d.ts +113 -0
- package/node_modules/@docx-editor.dev/core/dist/{document-protection-BAGVGqaP.d.ts → document-protection-CUb55pl_.d.ts} +2 -2
- package/node_modules/@docx-editor.dev/core/dist/{editor-Ci7IZGmG.d.ts → editor-CZQZmTIU.d.ts} +386 -9
- package/node_modules/@docx-editor.dev/core/dist/{editor-scope-OHPwVQ5l.d.ts → editor-scope-7o9xweiJ.d.ts} +1 -1
- package/node_modules/@docx-editor.dev/core/dist/editor.cjs +1 -1
- package/node_modules/@docx-editor.dev/core/dist/editor.d.ts +54 -33
- package/node_modules/@docx-editor.dev/core/dist/editor.js +1 -1
- package/node_modules/@docx-editor.dev/core/dist/export.cjs +2 -2
- package/node_modules/@docx-editor.dev/core/dist/export.d.ts +13 -14
- package/node_modules/@docx-editor.dev/core/dist/export.js +1 -1
- package/node_modules/@docx-editor.dev/core/dist/{font-resolver-BVQB14qT.d.ts → font-resolver-lSBLirLR.d.ts} +3 -3
- package/node_modules/@docx-editor.dev/core/dist/{headless-document-view-qH331moE.d.ts → headless-document-view-pp3q7wIh.d.ts} +2 -2
- package/node_modules/@docx-editor.dev/core/dist/{image-resources-BN-hUgCn.d.ts → image-resources-tXLQShoC.d.ts} +2 -2
- package/node_modules/@docx-editor.dev/core/dist/index.cjs +1 -1
- package/node_modules/@docx-editor.dev/core/dist/index.d.ts +65 -20
- package/node_modules/@docx-editor.dev/core/dist/index.js +1 -1
- package/node_modules/@docx-editor.dev/core/dist/{layout-shaping-BEyuiQOk.d.ts → layout-shaping-BD-dF_rn.d.ts} +1 -1
- package/node_modules/@docx-editor.dev/core/dist/layout.cjs +1 -1
- package/node_modules/@docx-editor.dev/core/dist/layout.d.ts +17 -20
- package/node_modules/@docx-editor.dev/core/dist/layout.js +1 -1
- package/node_modules/@docx-editor.dev/core/dist/{note-properties-4Y9o6Gyk.d.ts → note-properties-qQUjO1GQ.d.ts} +3 -3
- package/node_modules/@docx-editor.dev/core/dist/{omml-equation-CuzBL5DD.d.ts → omml-equation-BUbU0utM.d.ts} +1 -1
- package/node_modules/@docx-editor.dev/core/dist/output.cjs +1 -1
- package/node_modules/@docx-editor.dev/core/dist/output.d.ts +8 -9
- package/node_modules/@docx-editor.dev/core/dist/output.js +1 -1
- package/node_modules/@docx-editor.dev/core/dist/{protocol-Bqk4Izjc.d.ts → protocol-DYzzz2ej.d.ts} +2 -2
- package/node_modules/@docx-editor.dev/core/dist/{review-paragraph-order-DT-n6ouC.d.ts → review-paragraph-order-CN_0l2Cb.d.ts} +1 -1
- package/node_modules/@docx-editor.dev/core/dist/{semantic-cell-selection-D9D1KSXq.d.ts → semantic-cell-selection-eYag3P47.d.ts} +4 -211
- package/node_modules/@docx-editor.dev/core/dist/{semantic-interaction-CIC-PooQ.d.ts → semantic-interaction-kR_QB845.d.ts} +1 -1
- package/node_modules/@docx-editor.dev/core/dist/{semantic-paint-BME37OMv.d.ts → semantic-paint-ZayFF3tD.d.ts} +17 -5
- package/node_modules/@docx-editor.dev/core/dist/{semantic-record-queries-CBlZqZNa.d.ts → semantic-record-queries-Bsgth6lv.d.ts} +1 -1
- package/node_modules/@docx-editor.dev/core/dist/{semantic-records-4B3WwFAi.d.ts → semantic-records-DQmumPgL.d.ts} +1279 -828
- package/node_modules/@docx-editor.dev/core/dist/store.cjs +1 -1
- package/node_modules/@docx-editor.dev/core/dist/store.d.ts +1466 -1464
- package/node_modules/@docx-editor.dev/core/dist/store.js +1 -1
- package/node_modules/@docx-editor.dev/core/dist/{tree-package-fragment-BeeKxDw8.d.ts → tree-package-store-CovjNARF.d.ts} +83 -83
- package/node_modules/@docx-editor.dev/core/dist/{tree-session-contract-CVbmlMlq.d.ts → tree-session-contract-CZVAGl51.d.ts} +6 -6
- package/node_modules/@docx-editor.dev/core/dist/{types-barrel-D3xCgQX6.d.ts → types-barrel-DuC5QBNC.d.ts} +548 -527
- package/node_modules/@docx-editor.dev/core/package.json +3 -3
- package/node_modules/@docx-editor.dev/react/dist/index.js +3 -3
- package/node_modules/@docx-editor.dev/react/dist/index.mjs +3 -3
- package/node_modules/@docx-editor.dev/react/package.json +4 -4
- package/package.json +8 -8
- package/dist/ConnectedStreamedWordArtifact-HLJ5IIOU.js.map +0 -1
- package/dist/ConnectedStreamedWordArtifact-JQ34AOUU.cjs.map +0 -1
- package/dist/RechartsRenderer-23OF4H6X.js.map +0 -1
- package/dist/RechartsRenderer-GIRCW7DB.cjs.map +0 -1
- package/dist/ai-ADS6YSS2.cjs.map +0 -1
- package/dist/ai-KHWTGBT5.js.map +0 -1
- package/dist/chunk-3GFQNJYE.js.map +0 -1
- package/dist/chunk-5AC52BHL.cjs.map +0 -1
- package/dist/chunk-AVGHTUPE.js.map +0 -1
- package/dist/chunk-BAUZUIHB.js.map +0 -1
- package/dist/chunk-CHQMVIHR.js.map +0 -1
- package/dist/chunk-D35EHOK5.cjs.map +0 -1
- package/dist/chunk-FPOKWML2.js.map +0 -1
- package/dist/chunk-GX75YCWJ.cjs.map +0 -1
- package/dist/chunk-I7CJDF3V.cjs.map +0 -1
- package/dist/chunk-OAIOOVFN.cjs.map +0 -1
- package/dist/chunk-UQ2OBHMV.js.map +0 -1
- package/dist/chunk-ZMVF7EYJ.cjs.map +0 -1
- package/node_modules/@docx-editor.dev/core/dist/chunk-4GBTELJV.cjs +0 -28
- package/node_modules/@docx-editor.dev/core/dist/chunk-4R3TEXMN.js +0 -18
- package/node_modules/@docx-editor.dev/core/dist/chunk-EO4C5QJW.cjs +0 -2
- package/node_modules/@docx-editor.dev/core/dist/chunk-FIJZIQXA.cjs +0 -18
- package/node_modules/@docx-editor.dev/core/dist/chunk-FRXAOVTB.js +0 -28
- package/node_modules/@docx-editor.dev/core/dist/chunk-J6BVWIDB.js +0 -2
- package/node_modules/@docx-editor.dev/core/dist/chunk-JGNVNT2A.cjs +0 -2
- package/node_modules/@docx-editor.dev/core/dist/chunk-KKIJG3C6.js +0 -2
- package/node_modules/@docx-editor.dev/core/dist/chunk-LWDSDCMO.js +0 -27
- package/node_modules/@docx-editor.dev/core/dist/chunk-NBCVVZOM.cjs +0 -1
- package/node_modules/@docx-editor.dev/core/dist/chunk-O5INAWZQ.js +0 -1
- package/node_modules/@docx-editor.dev/core/dist/chunk-RCHS4ZEH.cjs +0 -27
- package/node_modules/@docx-editor.dev/core/dist/chunk-VHAVHCQY.js +0 -7
- package/node_modules/@docx-editor.dev/core/dist/chunk-VX43VBAX.cjs +0 -7
- package/node_modules/@docx-editor.dev/core/dist/review-pane-D9jm8DcY.d.ts +0 -128
- package/node_modules/@docx-editor.dev/core/dist/revision-projection-DZ4kKVev.d.ts +0 -242
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
'use strict';var chunkV3N4SOAK_cjs=require('./chunk-V3N4SOAK.cjs'),chunkCAJEXXVG_cjs=require('./chunk-CAJEXXVG.cjs'),chunkJLVBDYVQ_cjs=require('./chunk-JLVBDYVQ.cjs'),chunkD7ZMDMPX_cjs=require('./chunk-D7ZMDMPX.cjs'),chunkEKLM7NWB_cjs=require('./chunk-EKLM7NWB.cjs'),chunkW35WTWAO_cjs=require('./chunk-W35WTWAO.cjs'),chunkDOHF6FA7_cjs=require('./chunk-DOHF6FA7.cjs'),chunk6JPL6ZAS_cjs=require('./chunk-6JPL6ZAS.cjs'),chunkBY2ACZZ6_cjs=require('./chunk-BY2ACZZ6.cjs'),chunkT6K2QYNZ_cjs=require('./chunk-T6K2QYNZ.cjs'),chunkBTQKU64Q_cjs=require('./chunk-BTQKU64Q.cjs'),chunkUHHYFIDT_cjs=require('./chunk-UHHYFIDT.cjs'),chunkOSFOJTHU_cjs=require('./chunk-OSFOJTHU.cjs'),chunkUKVVUHZL_cjs=require('./chunk-UKVVUHZL.cjs'),fflate=require('fflate'),i18n=require('@docx-editor.dev/i18n');function OA(e){return Object.freeze({family:e.family,weight:e.weight,style:e.style})}var Y0=false;function Q0(e){if(Y0)return;Y0=true;let t=e.diagnostic?`: ${e.diagnostic}`:".";console.error(`[@docx-editor.dev/core] text shaping is disabled${t}
|
|
2
|
+
Text is being measured with fallback metrics, so line and page breaks will not match Word.`);}function Mi(e){if(e instanceof chunkUKVVUHZL_cjs.a)return e;if(e instanceof chunkDOHF6FA7_cjs.d)return new chunkUKVVUHZL_cjs.a(e.code,e.message,{request:OA(e.request),diagnostic:e.diagnostic});if(e instanceof chunkD7ZMDMPX_cjs.j)return new chunkUKVVUHZL_cjs.a("overLimit",e.message,{diagnostic:e.message});if(e instanceof chunkD7ZMDMPX_cjs.f){let t=e.code==="wasmUnavailable"||e.code==="shapingLibraryMismatch"?"wasmUnavailable":"initializationFailed";return new chunkUKVVUHZL_cjs.a(t,e.message,{diagnostic:e.diagnostic??e.message,cause:e})}return new chunkUKVVUHZL_cjs.a("initializationFailed",e instanceof Error?e.message:"Font initialization failed",{diagnostic:e instanceof Error?e.message:String(e)})}async function as(e,t){try{return await chunkD7ZMDMPX_cjs.q(e,t)}catch(n){throw Mi(n)}}var rd=Object.freeze({opening:"auto",overflow:"float",revisionsIn:"pane",commentMarkers:"icon"}),Af={opening:["auto","manual"],overflow:["float","shrinkPage","scroll"],revisionsIn:["pane","balloons"],commentMarkers:["initials","icon"]};function od(e,t=rd){if(e===void 0)return t;if(e===null||typeof e!="object")throw new TypeError("review pane settings must be an object");let n=t;for(let[r,o]of Object.entries(e)){if(o===void 0)continue;if(!Object.hasOwn(Af,r))throw new TypeError(`unknown review pane setting ${r}`);let i=r;if(typeof o!="string"||!Af[i].includes(o))throw new TypeError(`review pane ${i} must be ${Af[i].join(" or ")}`);n[i]!==o&&(n={...n,[i]:o});}return n===t?t:Object.freeze(n)}function Ff(e,t){return e==="pane"?true:t.kind==="revision"?false:!(t.kind==="comment"&&t.parentRevisionId!==void 0)}var MA=Object.freeze({revisionMarkup:chunkDOHF6FA7_cjs.Ua,reviewPane:rd,scope:Object.freeze({kind:"body"}),isLoading:true,isOpening:false,parseError:null,editable:false,zoom:1,selection:null,selectionCollapsed:true,formatting:null,table:null,tocContext:null,image:null,page:Object.freeze({current:0,total:0}),canUndo:false,canRedo:false,collaborationStatus:"inactive"});var J0="http://schemas.openxmlformats.org/wordprocessingml/2006/main",FA="http://schemas.openxmlformats.org/package/2006/content-types",ex="http://schemas.openxmlformats.org/package/2006/relationships",LA="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",NA="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",DA=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Types xmlns="${FA}"><Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/><Default Extension="xml" ContentType="application/xml"/><Override PartName="/word/document.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml"/><Override PartName="/word/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml"/></Types>`,HA=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Relationships xmlns="${ex}"><Relationship Id="rId1" Type="${LA}" Target="word/document.xml"/></Relationships>`,_A=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Relationships xmlns="${ex}"><Relationship Id="rId1" Type="${NA}" Target="styles.xml"/></Relationships>`,BA=[{level:1,before:240,color:"2F5496",halfPoints:32,italic:false},{level:2,before:40,color:"2F5496",halfPoints:26,italic:false},{level:3,before:40,color:"1F3763",halfPoints:24,italic:false},{level:4,before:40,color:"2F5496",halfPoints:null,italic:true},{level:5,before:40,color:"2F5496",halfPoints:null,italic:false},{level:6,before:40,color:"1F3763",halfPoints:null,italic:false},{level:7,before:40,color:"1F3763",halfPoints:null,italic:true},{level:8,before:40,color:"272727",halfPoints:21,italic:false},{level:9,before:40,color:"272727",halfPoints:21,italic:true}],$A=e=>`<w:style w:type="paragraph" w:styleId="Heading${e.level}"><w:name w:val="heading ${e.level}"/><w:basedOn w:val="Normal"/><w:next w:val="Normal"/><w:uiPriority w:val="9"/><w:qFormat/><w:pPr><w:keepNext/><w:keepLines/><w:spacing w:before="${e.before}" w:after="0"/><w:outlineLvl w:val="${e.level-1}"/></w:pPr><w:rPr>`+(e.italic?"<w:i/><w:iCs/>":"")+`<w:color w:val="${e.color}"/>`+(e.halfPoints===null?"":`<w:sz w:val="${e.halfPoints}"/><w:szCs w:val="${e.halfPoints}"/>`)+"</w:rPr></w:style>",qA=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?><w:styles xmlns:w="${J0}"><w:docDefaults><w:rPrDefault><w:rPr><w:rFonts w:ascii="Calibri" w:hAnsi="Calibri" w:eastAsia="Calibri" w:cs="Calibri"/><w:sz w:val="22"/><w:szCs w:val="22"/></w:rPr></w:rPrDefault><w:pPrDefault><w:pPr><w:spacing w:after="160" w:line="259" w:lineRule="auto"/></w:pPr></w:pPrDefault></w:docDefaults><w:style w:type="paragraph" w:default="1" w:styleId="Normal"><w:name w:val="Normal"/><w:qFormat/></w:style>`+BA.map($A).join("")+'<w:style w:type="character" w:default="1" w:styleId="DefaultParagraphFont"><w:name w:val="Default Paragraph Font"/><w:uiPriority w:val="1"/><w:semiHidden/><w:unhideWhenUsed/></w:style><w:style w:type="table" w:default="1" w:styleId="TableNormal"><w:name w:val="Normal Table"/><w:uiPriority w:val="99"/><w:semiHidden/><w:unhideWhenUsed/><w:tblPr><w:tblInd w:w="0" w:type="dxa"/><w:tblCellMar><w:top w:w="0" w:type="dxa"/><w:left w:w="108" w:type="dxa"/><w:bottom w:w="0" w:type="dxa"/><w:right w:w="108" w:type="dxa"/></w:tblCellMar></w:tblPr></w:style><w:style w:type="numbering" w:default="1" w:styleId="NoList"><w:name w:val="No List"/><w:uiPriority w:val="99"/><w:semiHidden/><w:unhideWhenUsed/></w:style><w:style w:type="paragraph" w:styleId="Title"><w:name w:val="Title"/><w:basedOn w:val="Normal"/><w:next w:val="Normal"/><w:uiPriority w:val="10"/><w:qFormat/><w:pPr><w:spacing w:after="0" w:line="240" w:lineRule="auto"/><w:contextualSpacing/></w:pPr><w:rPr><w:spacing w:val="-10"/><w:kern w:val="28"/><w:sz w:val="56"/><w:szCs w:val="56"/></w:rPr></w:style><w:style w:type="paragraph" w:styleId="Subtitle"><w:name w:val="Subtitle"/><w:basedOn w:val="Normal"/><w:next w:val="Normal"/><w:uiPriority w:val="11"/><w:qFormat/><w:rPr><w:color w:val="5A5A5A"/><w:spacing w:val="15"/></w:rPr></w:style><w:style w:type="paragraph" w:styleId="Quote"><w:name w:val="Quote"/><w:basedOn w:val="Normal"/><w:next w:val="Normal"/><w:uiPriority w:val="29"/><w:qFormat/><w:pPr><w:spacing w:before="160"/><w:jc w:val="center"/></w:pPr><w:rPr><w:i/><w:iCs/><w:color w:val="404040"/></w:rPr></w:style><w:style w:type="paragraph" w:styleId="Caption"><w:name w:val="caption"/><w:basedOn w:val="Normal"/><w:next w:val="Normal"/><w:uiPriority w:val="35"/><w:semiHidden/><w:unhideWhenUsed/><w:pPr><w:spacing w:after="0"/></w:pPr><w:rPr><w:i/><w:iCs/><w:color w:val="404040"/><w:sz w:val="18"/><w:szCs w:val="18"/></w:rPr></w:style><w:style w:type="paragraph" w:styleId="NoSpacing"><w:name w:val="No Spacing"/><w:uiPriority w:val="1"/><w:qFormat/><w:pPr><w:spacing w:after="0" w:line="240" w:lineRule="auto"/></w:pPr></w:style><w:style w:type="paragraph" w:styleId="ListParagraph"><w:name w:val="List Paragraph"/><w:basedOn w:val="Normal"/><w:uiPriority w:val="34"/><w:qFormat/><w:pPr><w:ind w:left="720"/><w:contextualSpacing/></w:pPr></w:style></w:styles>',KA=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?><w:document xmlns:w="${J0}"><w:body><w:p/><w:sectPr><w:pgSz w:w="12240" w:h="15840"/><w:pgMar w:top="1440" w:right="1440" w:bottom="1440" w:left="1440" w:header="720" w:footer="720" w:gutter="0"/></w:sectPr></w:body></w:document>`;function Lf(){return fflate.zipSync({"[Content_Types].xml":fflate.strToU8(DA),"_rels/.rels":fflate.strToU8(HA),"word/_rels/document.xml.rels":fflate.strToU8(_A),"word/document.xml":fflate.strToU8(KA),"word/styles.xml":fflate.strToU8(qA)})}var tx="http://schemas.microsoft.com/office/2004/12/omml",VA="http://www.w3.org/1998/Math/MathML",jA=4096,nx=32;function rx(e,t){return e.failed||t>nx||e.left<=0?(e.failed=true,false):(e.left-=1,true)}function ls(e,t){return e.kind!=="textValue"&&e.namespaceUri===chunkOSFOJTHU_cjs.Re&&(t===void 0||e.localName===t)}function Nf(e,t){if(e.kind!=="textValue")return e.attributes.find(n=>n.localName==="val"&&n.namespaceUri===t)?.value}function ox(e,t,n){if(!rx(t,n))return "";if(e.kind==="textValue")return e.value;let r="";for(let o of e.children)r+=ox(o,t,n+1);return r}function WA(e,t,n){if(e.kind==="textValue")return "";let r="",o,i=false,a;for(let c of e.children)if(ls(c,"t"))r+=ox(c,t,n+1);else if(ls(c,"rPr")&&c.kind!=="textValue")for(let u of c.children)ls(u,"sty")&&(o=Nf(u,chunkOSFOJTHU_cjs.Re)),ls(u,"nor")&&(i=true);else if(c.kind!=="textValue"&&c.namespaceUri===chunkOSFOJTHU_cjs.la&&c.localName==="rPr"){let u=c.children.find(m=>m.kind!=="textValue"&&m.localName==="color"),p=u?Nf(u,chunkOSFOJTHU_cjs.la):void 0;p&&/^[0-9A-Fa-f]{6}$/.test(p)&&(a=p.toUpperCase());}if(r.length===0)return "";let s=`<m:r>${chunkOSFOJTHU_cjs.R(r)}</m:r>`;a!==void 0&&(s=`<span style="color:#${a}">${s}</span>`);let l=!i&&(o===void 0||o==="i"||o==="bi"),d=o==="b"||o==="bi";return l&&(s=`<i>${s}</i>`),d&&(s=`<b>${s}</b>`),s}function ix(e,t,n){if(e.kind==="textValue"||!ls(e)||!rx(t,n))return "";if(e.localName==="r")return WA(e,t,n);if(e.localName==="ctrlPr")return "";let r=Nf(e,chunkOSFOJTHU_cjs.Re),o=r===void 0?"":` m:val="${chunkOSFOJTHU_cjs.S(r)}"`,i="";for(let a of e.children)i+=ix(a,t,n+1);return i.length>0?`<m:${e.localName}${o}>${i}</m:${e.localName}>`:`<m:${e.localName}${o}/>`}function ZA(e){let t="";for(let n of e.match(/\d+(?:\.\d+)?|\p{L}|\s+|./gu)??[]){if(/^\s+$/.test(n))continue;let r=chunkOSFOJTHU_cjs.R(n);/^\d/.test(n)?t+=`<mn>${r}</mn>`:/^\p{L}$/u.test(n)?t+=`<mi>${r}</mi>`:t+=`<mo>${r}</mo>`;}return t}function Df(e,t){if(t>nx)return "";let n=r=>`<mrow>${Df(r,t+1)}</mrow>`;switch(e.kind){case "text":return ZA(e.value);case "fallback":return `<mtext>${chunkOSFOJTHU_cjs.R(e.text)}</mtext>`;case "row":return e.items.map(r=>Df(r,t+1)).join("");case "fraction":return `<mfrac>${n(e.numerator)}${n(e.denominator)}</mfrac>`;case "radical":return e.degree===void 0?`<msqrt>${n(e.radicand)}</msqrt>`:`<mroot>${n(e.radicand)}${n(e.degree)}</mroot>`;case "script":{let r=n(e.base);return e.subscript&&e.superscript?`<msubsup>${r}${n(e.subscript)}${n(e.superscript)}</msubsup>`:e.subscript?`<msub>${r}${n(e.subscript)}</msub>`:e.superscript?`<msup>${r}${n(e.superscript)}</msup>`:r}case "nary":{let r=`<mo>${chunkOSFOJTHU_cjs.R(e.operator)}</mo>`,o=e.lowerLimit?n(e.lowerLimit):"",i=e.upperLimit?n(e.upperLimit):"";return `<mrow>${o&&i?`<munderover>${r}${o}${i}</munderover>`:o?`<munder>${r}${o}</munder>`:i?`<mover>${r}${i}</mover>`:r}${n(e.body)}</mrow>`}}}function ax(e){if(!chunkOSFOJTHU_cjs.Ye(e))return "";let t=chunkOSFOJTHU_cjs.Xe(e),n=t?chunkOSFOJTHU_cjs._e(e):chunkOSFOJTHU_cjs.Te(e),r={left:jA,failed:false},o=ix(e,r,0),i=n===null?"":`<math xmlns="${VA}"${t?' display="block"':""}>${Df(n.expression,0)}</math>`;return r.failed||o.length===0?i:`<!--[if gte msEquation 12]>${o}<![endif]--><![if !msEquation]>${i}<![endif]>`}function sx(e){return e.includes("<!--[if gte msEquation 12]>")}var Ai="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",zA=(()=>{let e=new Int16Array(128).fill(-1);for(let t=0;t<Ai.length;t+=1)e[Ai.charCodeAt(t)]=t;return e})();function id(e,t){if(e.length===0)return null;let n=e.length%4;if(n===1)return null;let r=n===0?e:e+"=".repeat(4-n),o=r.endsWith("==")?2:r.endsWith("=")?1:0,i=r.length/4*3-o;if(i<=0||i>t)return null;let a=new Uint8Array(i),s=0;for(let l=0;l<r.length;l+=4){let d=0,c=0;for(let u=0;u<4;u+=1){let p=r.charCodeAt(l+u);if(p===61){if(l+u<r.length-o)return null;continue}let m=p<128?zA[p]:-1;if(m<0)return null;d=d<<6|m,c+=6;}d<<=24-c,c>=12&&(a[s++]=d>>>16&255),c>=18&&(a[s++]=d>>>8&255),c>=24&&(a[s++]=d&255);}return s===i?a:null}function ad(e){let t=[],n="";for(let r=0;r<e.length;r+=3){let o=e[r],i=r+1<e.length?e[r+1]:0,a=r+2<e.length?e[r+2]:0;n+=Ai[o>>2]+Ai[(o&3)<<4|i>>4],n+=r+1<e.length?Ai[(i&15)<<2|a>>6]:"=",n+=r+2<e.length?Ai[a&63]:"=",n.length>=32768&&(t.push(n),n="");}return t.push(n),t.join("")}var UA=16*1024*1024,dx=64*1024*1024,cx="data-docx-fragment",ux="data-docx-fragment-end",GA=ad;function fx(e,t){let n=t?.lastMarkCovered?"covered":"open",r=t?`<div ${cx}="${GA(t.bytes)}" ${ux}="${n}">${e}</div>`:`<div>${e}</div>`;return sx(e)?`<html xmlns:m="${tx}"><body>${r}</body></html>`:r}function lx(e,t){let n=`${t}="`,r=e.indexOf(n);if(r===-1||r>dx)return null;let o=r+n.length,i=e.indexOf('"',o);return i===-1?null:e.slice(o,i)}function Fi(e,t=UA){if(e.length>dx)return null;let n=lx(e,cx);if(n===null||n.length===0)return null;let r=id(n,t);if(r===null||r.byteLength===0)return null;let o=lx(e,ux);return {bytes:r,lastMarkCovered:o==="covered"}}function No(e){if(e==null)return null;let t=e.trim();return /^[A-Za-z]{2,8}(?:-[A-Za-z0-9]{1,8}){0,3}$/.test(t)?t:null}var _f=["single","words","double","thick","dotted","dottedHeavy","dash","dashedHeavy","dashLong","dashLongHeavy","dotDash","dashDotHeavy","dotDotDash","dashDotDotHeavy","wave","wavyHeavy","wavyDouble"],Hf={Normal:"MsoNormal",ListParagraph:"MsoListParagraph",Title:"MsoTitle",Subtitle:"MsoSubtitle",Caption:"MsoCaption",Quote:"MsoQuote",IntenseQuote:"MsoIntenseQuote",BodyText:"MsoBodyText",FootnoteText:"MsoFootnoteText"},Bf=new Map([...Object.entries(Hf).filter(([e])=>e!=="Normal").map(([e,t])=>[t,e]),["MsoListParagraphCxSpFirst","ListParagraph"],["MsoListParagraphCxSpMiddle","ListParagraph"],["MsoListParagraphCxSpLast","ListParagraph"]]);function px(e){return e===void 0?null:/^Heading[7-9]$/.test(e)?`Mso${e}`:Object.hasOwn(Hf,e)?Hf[e]:null}var $f=Object.fromEntries(chunkCAJEXXVG_cjs.n),qf={left:"left",start:"left",center:"center",right:"right",end:"right",both:"justify",distribute:"justify"};function mx(e){let t=e.trim();if(t.length===0||t.length>255)return null;let n=t.replace(/[^\p{L}\p{N} _.,-]/gu,"");return n.length===0?null:`"${chunkOSFOJTHU_cjs.V(n)}"`}var XA=new Map([["single","solid"],["thick","solid"],["double","double"],["triple","double"],["dotted","dotted"],["dashed","dashed"],["dashSmallGap","dashed"],["dotDash","dashed"],["dotDotDash","dashed"],["wave","solid"],["hairline","solid"],["inset","solid"],["outset","solid"]]);function Do(e){if(e===null)return null;let t=chunkOSFOJTHU_cjs.Yf(e,"val",chunkOSFOJTHU_cjs.la);if(t===void 0||t==="nil"||t==="none")return null;let n=XA.get(t)??"solid",r=chunkOSFOJTHU_cjs.Yf(e,"sz",chunkOSFOJTHU_cjs.la),o=r!==void 0&&/^\d{1,4}$/.test(r)?Number.parseInt(r,10):0,i=o>0?o/8:.5,a=`${Math.round(i*100)/100}pt`,s=chunkOSFOJTHU_cjs.Yf(e,"color",chunkOSFOJTHU_cjs.la),l=s!==void 0&&/^[0-9A-Fa-f]{6}$/.test(s)?`#${s}`:"#000000";return `${a} ${n} ${l.toLowerCase()}`}function gx(e,t){return e===null||e<=0?[]:t==="exact"||t==="atLeast"?[`line-height:${`${Math.round(e/20*100)/100}pt`}`,`mso-line-height-rule:${t==="exact"?"exactly":"at-least"}`]:[`line-height:${Math.round(e/240*100)/100}`]}var YA=new Map([["double","double"],["wavyDouble","double"],["dotted","dotted"],["dottedHeavy","dotted"],["dash","dashed"],["dashedHeavy","dashed"],["dashLong","dashed"],["dashLongHeavy","dashed"],["dotDash","dashed"],["dashDotHeavy","dashed"],["dotDotDash","dashed"],["dashDotDotHeavy","dashed"],["wave","wavy"],["wavyHeavy","wavy"]]),QA=new Set(_f);function hx(e){if(e===null)return [];let t=chunkOSFOJTHU_cjs.Yf(e,"val",chunkOSFOJTHU_cjs.la),n=[],r=t===void 0?void 0:YA.get(t);r!==void 0&&n.push(`text-decoration-style:${r}`),t!==void 0&&t!=="single"&&QA.has(t)&&n.push(`text-underline:${t}`);let o=chunkOSFOJTHU_cjs.Yf(e,"color",chunkOSFOJTHU_cjs.la);return o!==void 0&&/^[0-9A-Fa-f]{6}$/.test(o)&&n.push(`text-decoration-color:#${o.toLowerCase()}`),t==="thick"&&n.push("text-decoration-thickness:2px"),n}function yx(e,t){return e===null||e<=0?"":`height:${Math.round(e/20*100)/100}pt;mso-height-rule:${t==="exact"?"exactly":"at-least"}`}function bx(e,t,n,r){if(e.namespaceUri!==chunkOSFOJTHU_cjs.la)return "";let o=e.localName==="footnoteRef"?"footnote":e.localName==="endnoteRef"?"endnote":null,i=e.localName==="footnoteReference"?"footnote":e.localName==="endnoteReference"?"endnote":null,a=o??i;if(a===null)return "";let s=chunkOSFOJTHU_cjs.Yf(e,"id",chunkOSFOJTHU_cjs.la),l=o===null?s!==void 0&&/^\d{1,10}$/.test(s)?Number.parseInt(s,10):void 0:t?.id;if(l===void 0||!Number.isInteger(l)||l<1||o!==null&&t?.kind!==o||l>2147483647||o===null&&!r(a,l))return "";let d=a==="footnote",c=o!==null,u=d?"MsoFootnoteReference":"MsoEndnoteReference",p=d?"ftn":"edn",m=c?`#_${p}ref${l}`:`#_${p}${l}`,g=c?`_${p}${l}`:`_${p}ref${l}`;return `<a style="mso-${d?"footnote":"endnote"}-id:${p}${l}" href="${m}" name="${g}"><span class="${u}"><span style="mso-special-character:footnote">[${n(a,l)}]</span></span></a>`}function vx(e){if(e.namespaceUri!==chunkOSFOJTHU_cjs.la||e.localName!=="ptab")return "";let t=chunkOSFOJTHU_cjs.Yf(e,"alignment",chunkOSFOJTHU_cjs.la),n=chunkOSFOJTHU_cjs.Yf(e,"relativeTo",chunkOSFOJTHU_cjs.la),r=chunkOSFOJTHU_cjs.Yf(e,"leader",chunkOSFOJTHU_cjs.la)??"none";if(t!=="left"&&t!=="center"&&t!=="right")return "";let o=n==="margin"||n==="leftMargin"?"margin":n==="indent"?"indent":null;return o===null||r!=="none"&&r!=="dot"&&r!=="hyphen"&&r!=="underscore"&&r!=="middleDot"&&r!=="heavy"?"":`<w:PTab Alignment="${t.toUpperCase()}" RelativeTo="${o.toUpperCase()}" Leader="${r.toUpperCase()}"></w:PTab>`}function wt(e){let t=e.trim().toLowerCase();if(/^-?0+(\.0+)?$/.test(t))return 0;let n=/^(-?(?:\d+(?:\.\d+)?|\.\d+))(px|pt|in|cm|mm|pc)$/.exec(t);if(!n)return null;let r=Number.parseFloat(n[1]);if(!Number.isFinite(r))return null;switch(n[2]){case "px":return r*.75;case "in":return r*72;case "cm":return r*72/2.54;case "mm":return r*72/25.4;case "pc":return r*12;default:return r}}function Sx(e){return e.includes("urn:schemas-microsoft-com:office")||e.includes("mso-")||e.includes("<o:p")||e.includes("class=Mso")||e.includes('class="Mso')||e.includes("class='Mso")}function Ix(e,t){for(let r of e.classList){let o=/^MsoHeading([1-9])$/.exec(r);if(o)return `Heading${o[1]}`;let i=/^Heading([1-9])$/.exec(r);if(i)return `Heading${i[1]}`;let a=Bf.get(r);if(a!==void 0)return a}if(e.classList.contains("docx-outline"))return;let n=t?/^h([1-6])$/.exec(Ge(e)):null;return n?`Heading${n[1]}`:void 0}var kx=262144,JA=4096,eF=256,tF=2048,nF=8,rF=new Set(["MsoNormal",...Bf.keys(),...Array.from({length:9},(e,t)=>`MsoHeading${t+1}`),...Array.from({length:9},(e,t)=>`Heading${t+1}`)]),oF=new Map([["left","left"],["start","start"],["center","center"],["right","right"],["end","end"],["justify","both"]]),iF=/^\s*(p|li|div)\.([A-Za-z][A-Za-z0-9]{0,31})\s*$/i;function aF(e){let t="";for(let n=0;n<e.length;n+=1){if(e.startsWith("<!--",n)){n+=3;continue}if(e.startsWith("-->",n)){n+=2;continue}t+=e[n];}return t}function sF(e,t){let n=0;for(let r=t;r<e.length;r+=1){let o=e[r];if(o==="{"){if(n+=1,n>4)return null}else if(o==="}"&&(n-=1,n===0))return r+1}return null}function lF(e,t){for(let n=t+1;n<e.length;n+=1){let r=e[n];if(r===";")return n+1;if(r==="{")return sF(e,n)}return null}function dF(e){let t=e.split(",");if(t.length===0||t.length>nF)return null;let n=[];for(let r of t){let o=iF.exec(r);if(!o)return null;let i=o[2];if(!rF.has(i))return null;n.includes(i)||n.push(i);}return n}function cF(e){let t;for(let n of e.split(";")){let r=n.indexOf(":");if(r<=0||n.slice(0,r).trim().toLowerCase()!=="text-align")continue;let i=n.slice(r+1).trim().toLowerCase();if(i.length===0||i.length>32||i.includes("("))continue;let a=0;for(;a<i.length&&i.charCodeAt(a)>32;)a+=1;let s=oF.get(i.slice(0,a));s!==void 0&&(t=s);}return t}function uF(e){let t=new Map,n=()=>({ok:false,alignments:new Map});if(e.length===0)return {ok:true,alignments:t};if(e.length>kx)return n();let r=aF(e),o=0,i=0;for(;o<r.length&&i<JA;){for(;o<r.length&&r.charCodeAt(o)<=32;)o+=1;if(o>=r.length)break;if(r[o]==="@"){let p=lF(r,o);if(p===null)return n();o=p;continue}let a=r.indexOf("{",o);if(a<0)return n();let s=r.slice(o,a),l=r.indexOf("}",a+1);if(l<0)return n();let d=r.slice(a+1,l);if(i+=1,o=l+1,s.length>eF||d.length>tF||d.includes("{"))return n();let c=dF(s),u=cF(d);if(!(!c||u===void 0))for(let p of c)t.set(p,u);}for(;o<r.length&&r.charCodeAt(o)<=32;)o+=1;return o<r.length?n():{ok:true,alignments:t}}function Rx(e){let t=new Map,n=e.getElementsByTagName("style");if(n.length>16)return new Map;for(let r=0;r<n.length;r+=1){let o=n[r]?.textContent??"";if(o.length>kx)return new Map;let i=uF(o);if(!i.ok)return new Map;for(let[a,s]of i.alignments)t.set(a,s);}return t}var fF=262144;function Px(e,t=fF){let n=e.getElementsByTagName("style"),r="";for(let o=0;o<n.length&&o<16;o+=1){let i=n[o]?.textContent??"";i.length>t||r.length+i.length>t||(r+=`
|
|
3
|
+
${i}`);}return r}function Tx(e,t,n){for(let o of t.classList){let i=n.get(o);if(i!==void 0){e.jc=i;break}}let r=t.getAttribute("align")?.trim().toLowerCase();r==="left"||r==="center"||r==="right"?e.jc=r:r==="justify"&&(e.jc="both");}function Kf(e,t,n,r){let o=wt(t.get(n)??"");if(o!==null&&o>0)return o/.75;let i=e.getAttribute(n)?.trim()??"";if(!/^[1-9]\d{0,4}$/.test(i))return null;let a=Number.parseInt(i,10);return r?a/.75:a}function Li(e){return e.nodeType===1}function Ge(e){return e.tagName.toLowerCase()}var pF=new Map("black:000000 white:FFFFFF red:FF0000 green:008000 blue:0000FF yellow:FFFF00 gray:808080 grey:808080 silver:C0C0C0 maroon:800000 navy:000080 purple:800080 orange:FFA500 aqua:00FFFF cyan:00FFFF fuchsia:FF00FF magenta:FF00FF lime:00FF00 olive:808000 windowtext:000000".split(" ").map(e=>e.split(":"))),mF=new Map([["yellow","yellow"],["aqua","cyan"],["cyan","cyan"],["fuchsia","magenta"],["magenta","magenta"],["lime","green"],["green","green"],["olive","darkYellow"],["red","red"],["blue","blue"],["black","black"],["white","white"],["darkblue","darkBlue"],["darkcyan","darkCyan"],["darkgray","darkGray"],["darkgrey","darkGray"],["darkgreen","darkGreen"],["darkmagenta","darkMagenta"],["darkred","darkRed"],["darkyellow","darkYellow"],["lightgray","lightGray"],["lightgrey","lightGray"]]),gF=/url\s*\(|image\s*\(|image-set\s*\(|element\s*\(|cross-fade\s*\(/i,hF=new Map(_f.map(e=>[e.toLowerCase(),e])),xx=new WeakMap;function ft(e){let t=xx.get(e);if(t!==void 0)return t;let n=new Map;xx.set(e,n);let r=e.getAttribute("style");if(!r||r.length>8192)return n;for(let o of r.split(";")){let i=o.indexOf(":");if(i<=0)continue;let a=o.slice(0,i).trim().toLowerCase(),s=o.slice(i+1).trim();a.length>0&&s.length>0&&(n.delete(a),n.set(a,s));}return n}function Qr(e){let t=e.trim().toLowerCase(),n=pF.get(t);if(n)return n;let r=/^#([0-9a-f]{6})$/.exec(t);if(r)return r[1].toUpperCase();let o=/^#([0-9a-f]{3})$/.exec(t);if(o){let[a,s,l]=o[1];return `${a}${a}${s}${s}${l}${l}`.toUpperCase()}let i=/^rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,[^)]*)?\)$/.exec(t);if(i){let a=s=>Math.min(255,Number.parseInt(s,10)).toString(16).padStart(2,"0");return `${a(i[1])}${a(i[2])}${a(i[3])}`.toUpperCase()}return null}function yF(e){if(e===void 0)return;let t=e.trim().toLowerCase();if(!(t.length===0||t.length>32||/[^a-z]/.test(t)))return mF.get(t)}function wx(e){if(e===void 0)return null;let t=e.trim();if(t.length===0||t.length>128||gF.test(t))return null;let n=t.toLowerCase();return n==="transparent"||n==="none"?null:Qr(t)}function bn(e,t,n){return Math.min(n,Math.max(t,e))}function ld(e){let t=null;for(let[n,r]of e)if(n==="background")t=wx(r);else if(n==="background-color"){let o=r.trim().toLowerCase();if(o==="transparent"||o==="none"||o==="initial"){t=null;continue}let i=wx(r);i!==null&&(t=i);}return t}var bF=new Set(["left","center","right","decimal","bar"]),vF=new Map([["dotted","dot"],["dot","dot"],["dashed","hyphen"],["hyphen","hyphen"],["lined","underscore"],["underscore","underscore"],["middledot","middleDot"],["heavy","heavy"]]);function xF(e){if(e===void 0||e.length===0||e.length>512)return;let t="left",n,r=[];for(let o of e.trim().toLowerCase().split(/\s+/)){if(bF.has(o)){t=o;continue}if(o==="list"){t="left";continue}let i=vF.get(o);if(i!==void 0){n=i;continue}let a=wt(o);if(!(a===null||a<0)){if(r.push({val:t,posTwips:bn(Math.round(a*20),0,31680),...n===void 0?{}:{leader:n}}),r.length>=32)break;t="left",n=void 0;}}return r.length>0?r:void 0}var wF=new Map([["solid","single"],["single","single"],["double","double"],["dotted","dotted"],["dashed","dashed"]]);function Vf(e){return e.trim().replace(/\([^)]*\)/g,t=>t.replace(/\s+/g,"")).split(/\s+/)}var SF=new Map([["thin",.75],["medium",2.25],["thick",3.75]]);function sd(e){if(e===void 0||e.length===0||e.length>128)return;let t,n=false,r,o;for(let i of Vf(e)){let a=i.toLowerCase();if(a==="none"||a==="hidden"){n=true;continue}let s=wF.get(a);if(s!==void 0){t=s;continue}let l=SF.get(i.toLowerCase())??wt(i);if(l!==null){r=l;continue}let d=Qr(i);if(d!==null){o=d;continue}return}if(n)return "suppressed";if(t!==void 0)return r===void 0?{val:t,szEighthPoints:4,color:o??"000000"}:r<=0?"suppressed":{val:t,szEighthPoints:bn(Math.round(r*8),2,96),color:o??"000000"}}function dd(e){let t=e.getAttribute("style");return t?/mso-list\s*:[^;]{0,128}ignore/i.test(t.slice(0,8192)):false}function ds(e,t){return t==="b"||t==="strong"?{...e,bold:true}:t==="i"||t==="em"?{...e,italic:true}:t==="u"||t==="ins"?{...e,underline:true}:t==="s"||t==="strike"||t==="del"?{...e,strike:true}:t==="sub"?{...e,vertAlign:"subscript"}:t==="sup"?{...e,vertAlign:"superscript"}:t==="code"||t==="tt"||t==="kbd"||t==="samp"?{...e,font:"Courier New"}:e}function jf(e,t){if(t.size===0)return e;let n={...e},r=t.get("font-weight")?.toLowerCase();if(r!==void 0){let x=Number.parseInt(r,10);r==="bold"||x>=600?n.bold=true:(r==="normal"||x<600)&&(n.bold=false);}let o=t.get("font-style");o!==void 0&&(n.italic=o.toLowerCase().includes("italic"));let i=(t.get("text-decoration")??t.get("text-decoration-line"))?.toLowerCase();i!==void 0&&(i.includes("underline")&&(n.underline=true),i.includes("line-through")&&(n.strike=true),i.includes("none")&&(n.underline=n.strike=false));let a=t.get("font-variant")?.toLowerCase();a!==void 0&&(a.includes("small-caps")?n.smallCaps=true:(a.includes("normal")||a.includes("none"))&&(n.smallCaps=false));let s=t.get("text-transform")?.trim().toLowerCase();s==="uppercase"?n.caps=true:s==="none"&&(n.caps=false);let l=t.get("text-underline");if(l!==void 0&&l.length<=128)for(let x of l.trim().split(/\s+/)){let I=x.toLowerCase(),R=hF.get(I);if(R!==void 0)n.underline=true,n.underlineVal=R;else {let T=Qr(x);T!==null&&(n.underlineColor=T);}}let d=t.get("text-decoration-style")?.trim().toLowerCase();if(d==="double"&&n.strike&&!n.underline&&(n.doubleStrike=true),n.underline){d==="double"?n.underlineVal="double":d==="dotted"?n.underlineVal="dotted":d==="dashed"?n.underlineVal="dash":d==="wavy"&&(n.underlineVal="wave");let x=Qr(t.get("text-decoration-color")??"");x!==null&&(n.underlineColor=x);}let c=Qr(t.get("color")??"");c&&(n.color=c);let u=yF(t.get("mso-highlight"));if(u)n.highlight=u,delete n.shdFill;else {let x=ld(t);x&&(n.shdFill=x);}let p=wt(t.get("font-size")??"");p!==null&&p>0&&(n.szHalfPoints=bn(Math.round(p*2),2,3276));let m=t.get("font-family");if(m!==void 0){let x=m.split(",")[0].trim().replace(/^['"]|['"]$/g,"");x.length>0&&x.length<=64&&(n.font=x);}let g=wt(t.get("letter-spacing")??"");g!==null&&(n.charSpacingTwentieths=bn(Math.round(g*20),-31680,31680));let b=t.get("vertical-align")?.trim().toLowerCase();b==="sub"?n.vertAlign="subscript":b==="super"&&(n.vertAlign="superscript");let h=No(t.get("mso-ansi-language")),y=No(t.get("mso-fareast-language")),S=No(t.get("mso-bidi-language"));return h!==null&&(n.langVal=h),y!==null&&(n.langEastAsia=y),S!==null&&(n.langBidi=S),t.get("direction")?.trim().toLowerCase()==="rtl"&&(n.rtl=true),n}function Ho(e,t){let n=jf(e,ft(t)),r=No(t.getAttribute("lang"));return r!==null&&(n={...n,lang:r}),t.getAttribute("dir")?.trim().toLowerCase()==="rtl"&&(n={...n,rtl:true}),n}function Cx(e,t){let n=t.get("text-align")?.toLowerCase();n==="left"||n==="right"||n==="start"||n==="end"?e.jc=n:n==="center"?e.jc="center":n==="justify"&&(e.jc="both"),t.get("direction")?.trim().toLowerCase()==="rtl"&&(e.bidi=true);let r={top:null,right:null,bottom:null,left:null},o=t.get("margin");if(o!==void 0&&o.length<=128){let y=o.trim().split(/\s+/).map(S=>wt(S));if(y.length>=1&&y.length<=4&&!y.some(S=>S===null)){let[S,x=S,I=S,R=x]=y.length===2?[y[0],y[1],y[0],y[1]]:y.length===3?[y[0],y[1],y[2],y[1]]:y;r.top=S??null,r.right=x??null,r.bottom=I??null,r.left=R??null;}}let i=wt(t.get("margin-left")??"")??r.left;i!==null&&(i>0||i===0&&!e.numPr)&&(e.indLeftTwips=bn(Math.round(i*20),0,31680));let a=wt(t.get("margin-right")??"")??r.right;a!==null&&a>=0&&(e.indRightTwips=bn(Math.round(a*20),0,31680));let s=wt(t.get("text-indent")??"");if(s!==null&&s!==0){let y=bn(Math.round(s*20),-31680,31680);y!==0&&(e.firstLineTwips=y);}let l=wt(t.get("margin-top")??"")??r.top;l!==null&&l>=0&&(e.spacingBeforeTwips=bn(Math.round(l*20),0,31680));let d=wt(t.get("margin-bottom")??"")??r.bottom;d!==null&&d>=0&&(e.spacingAfterTwips=bn(Math.round(d*20),0,31680));let c=t.get("line-height")?.trim()??"",u=t.get("mso-line-height-rule")?.trim().toLowerCase(),p=wt(c);if(p!==null&&p>0)e.lineTwentieths=bn(Math.round(p*20),24,31680),e.lineRule=u==="exactly"?"exact":"atLeast";else if(/^\d+(\.\d+)?$/.test(c)&&Number.parseFloat(c)>0)e.lineTwentieths=bn(Math.round(240*Number.parseFloat(c)),24,9600),e.lineRule="auto";else if(/^\d+(\.\d+)?%$/.test(c)){let y=Number.parseFloat(c);y>0&&(e.lineTwentieths=bn(Math.round(2.4*y),24,9600),e.lineRule="auto");}(t.get("page-break-before")?.trim().toLowerCase()==="always"||t.get("break-before")?.trim().toLowerCase()==="page")&&(e.pageBreakBefore=true),t.get("page-break-after")?.trim().toLowerCase()==="avoid"&&(e.keepNext=true),t.get("page-break-inside")?.trim().toLowerCase()==="avoid"&&(e.keepLines=true),(/^[2-9]\d?$/.test(t.get("widows")?.trim()??"")||/^[2-9]\d?$/.test(t.get("orphans")?.trim()??""))&&(e.widowControl=true);let m=ld(t);m&&(e.shdFill=m);let g=xF(t.get("tab-stops"));g!==void 0&&(e.tabs=g);let b=sd(t.get("mso-border-alt"))??sd(t.get("border")),h={};for(let y of ["top","left","bottom","right"]){let S=sd(t.get(`mso-border-${y}-alt`))??sd(t.get(`border-${y}`))??b;S!==void 0&&S!=="suppressed"&&(h[y]=S);}Object.keys(h).length>0&&(e.borders=h);}var IF="http://schemas.openxmlformats.org/drawingml/2006/picture",kF=/^data:image\/(?:png|jpeg|jpg|gif|bmp|webp|svg\+xml|tiff|tif|x-emf|emf|x-wmf|wmf);base64,([A-Za-z0-9+/=]+)$/i,RF=new Map([["image/png","png"],["image/jpeg","jpeg"],["image/gif","gif"],["image/bmp","bmp"],["image/webp","webp"],["image/svg+xml","svg"],["image/tiff","tiff"],["image/x-emf","emf"],["image/x-wmf","wmf"]]);function Ex(e,t,n){return Math.min(n,Math.max(t,e))}function Ox(e,t,n,r){let o=e.getAttribute("src");if(o===null||o.length>n.maxImageBytes*2)return;let i=kF.exec(o);if(!i)return;let a=n.mediaBySrc.get(o),s=a===void 0?void 0:n.media.get(a),l=s??id(i[1],n.maxImageBytes);if(l==null)return;let d=chunkOSFOJTHU_cjs.de(l),c=RF.get(d);if(c===void 0)return;let u=d==="image/png"||d==="image/jpeg"||d==="image/gif"||d==="image/bmp"||d==="image/webp"?chunkOSFOJTHU_cjs.ie(l,d):null,p=ft(e),m=Kf(e,p,"width",n.wordHtml),g=Kf(e,p,"height",n.wordHtml);u!==null?m===null&&g===null?(m=u.pixelWidth*96/(u.dpiX??96),g=u.pixelHeight*96/(u.dpiY??96)):m!==null&&g===null?g=m*u.pixelHeight/u.pixelWidth:m===null&&g!==null&&(m=g*u.pixelWidth/u.pixelHeight):m!==null&&g===null?g=m*2/3:m===null&&g!==null&&(m=g*3/2);let b=m===null?381e4:Ex(Math.round(m*9525),9525,3e7),h=g===null?254e4:Ex(Math.round(g*9525),9525,3e7),y=s===void 0?void 0:a;y===void 0&&(n.imageCount+=1,y=`word/media/image${n.imageCount}.${c}`,n.media.set(y,l),n.mediaBySrc.set(o,y),n.mediaExtensions.has(c)||n.mediaExtensions.set(c,d));let S=r(y.replace("word/",""));n.docPrId+=1,t.push(`<w:r><w:drawing><wp:inline distT="0" distB="0" distL="0" distR="0"><wp:extent cx="${b}" cy="${h}"/><wp:docPr id="${n.docPrId}" name=""/><wp:cNvGraphicFramePr/><a:graphic><a:graphicData uri="${IF}"><pic:pic><pic:nvPicPr><pic:cNvPr id="0" name="" descr=""/><pic:cNvPicPr/></pic:nvPicPr><pic:blipFill><a:blip r:embed="${S}"/><a:srcRect/><a:stretch><a:fillRect/></a:stretch></pic:blipFill><pic:spPr><a:xfrm><a:off x="0" y="0"/><a:ext cx="${b}" cy="${h}"/></a:xfrm><a:prstGeom prst="rect"><a:avLst/></a:prstGeom></pic:spPr></pic:pic></a:graphicData></a:graphic></wp:inline></w:drawing></w:r>`);}var PF="http://schemas.openxmlformats.org/wordprocessingml/2006/main",TF='<?xml version="1.0" encoding="UTF-8" standalone="yes"?>',Mx=[{text:"\uF0B7",font:"Symbol"},{text:"o",font:"Courier New"},{text:"\uF0A7",font:"Wingdings"}];function Ax(e,t,n){let r=720*(n+1);if(e==="bullet"){let i=Mx[n%Mx.length];return `<w:lvl w:ilvl="${n}"><w:start w:val="1"/><w:numFmt w:val="bullet"/><w:lvlText w:val="${chunkOSFOJTHU_cjs.S(i.text)}"/><w:lvlJc w:val="left"/><w:pPr><w:ind w:left="${r}" w:hanging="360"/></w:pPr><w:rPr><w:rFonts w:ascii="${i.font}" w:hAnsi="${i.font}" w:hint="default"/></w:rPr></w:lvl>`}let o=e==="lowerRoman"||e==="upperRoman";return `<w:lvl w:ilvl="${n}"><w:start w:val="${t}"/><w:numFmt w:val="${e}"/><w:lvlText w:val="%${n+1}."/><w:lvlJc w:val="${o?"right":"left"}"/><w:pPr><w:ind w:left="${r}" w:hanging="${o?180:360}"/></w:pPr></w:lvl>`}var CF=new Map([["i",1],["v",5],["x",10],["l",50],["c",100],["d",500],["m",1e3]]),EF=new Map([["alpha-lower","lowerLetter"],["alpha-upper","upperLetter"],["roman-lower","lowerRoman"],["roman-upper","upperRoman"],["bullet","bullet"],["image","bullet"],["decimal","decimal"],["arabic","decimal"]]),Fx=/@list\s+l(\d{1,4}):level([1-9])(?:[\s:]+lfo(\d{1,4}))?\s*\{([^{}]{0,2048})\}/g;function Lx(e){let t=new Map;if(e.length===0||e.length>262200)return t;Fx.lastIndex=0;let n,r=0;for(;(n=Fx.exec(e))!==null&&r<512;){r+=1;let o="decimal",i=null;for(let s of n[4].split(";")){let l=s.indexOf(":");if(l<=0)continue;let d=s.slice(0,l).trim().toLowerCase(),c=s.slice(l+1).trim().toLowerCase();d==="mso-level-number-format"?o=EF.get(c)??null:d==="mso-level-start-at"&&/^\d{1,5}$/.test(c)&&(i=Math.min(32767,Number.parseInt(c,10)));}if(o===null)continue;let a=n[3]===void 0?`l${n[1]}:level${n[2]}`:`l${n[1]}:level${n[2]}:lfo${n[3]}`;t.has(a)||t.set(a,{kind:o,start:i});}return t}function Nx(e,t){let n=e.trim().replace(/^\(/,"");if(t==="decimal"){let r=/^(\d{1,5}(?:\.\d{1,5})*)/.exec(n);if(!r)return null;let o=r[1].split(".");return Math.min(32767,Number.parseInt(o[o.length-1],10))}if(t==="lowerRoman"||t==="upperRoman"){let r=/^([A-Za-z]{1,8})/.exec(n);return r?Dx(r[1]):null}if(t==="lowerLetter"||t==="upperLetter"){let r=/^(([A-Za-z])\2{0,4})(?![A-Za-z])/.exec(n);if(!r)return null;let o=r[2].toLowerCase().charCodeAt(0);return Math.min(32767,(r[1].length-1)*26+(o-96))}return null}var OF=/^m{0,4}(cm|cd|d?c{0,3})(xc|xl|l?x{0,3})(ix|iv|v?i{0,3})$/;function Dx(e){let t=e.toLowerCase();if(!OF.test(t))return null;let n=0,r=0;for(let o of t){let i=CF.get(o);if(i===void 0)return null;n+=i,r>0&&r<i&&(n-=2*r),r=i;}return n>0&&n<=32767?n:null}function Hx(e){let t=e.trim().replace(/^\(/,""),n=/^(\d{1,5}(?:\.\d{1,5})*)[.)]/.exec(t);if(n){let a=n[1].split(".");return {kind:"decimal",start:Math.min(32767,Number.parseInt(a[a.length-1],10))}}let r=/^([A-Za-z])[.)]/.exec(t);if(r){let a=r[1].toLowerCase();if(a==="i"||a==="v"||a==="x"){let l=a==="i"?1:a==="v"?5:10;return {kind:r[1]===a?"lowerRoman":"upperRoman",start:l}}let s=r[1].charCodeAt(0);return s>=97?{kind:"lowerLetter",start:s-96}:{kind:"upperLetter",start:s-64}}let o=/^([A-Za-z]{2,8})[.)]/.exec(t);if(o){let a=o[1],s=a===a.toLowerCase(),l=/^([A-Za-z])\1+$/.test(a);if(!l||/^[iI]+$/.test(a)){let d=Dx(a);if(d!==null)return {kind:s?"lowerRoman":"upperRoman",start:d}}if(l){let d=a.toLowerCase().charCodeAt(0),c=Math.min(32767,(a.length-1)*26+(d-96));return {kind:s?"lowerLetter":"upperLetter",start:c}}}let i=/\d{1,5}/.exec(t);return i?{kind:"decimal",start:Math.min(32767,Number.parseInt(i[0],10))}:{kind:"bullet",start:1}}var MF=new Map([["none","none"],["decimal","decimal"],["upper-alpha","upperLetter"],["upper-latin","upperLetter"],["lower-alpha","lowerLetter"],["lower-latin","lowerLetter"],["upper-roman","upperRoman"],["lower-roman","lowerRoman"]]);function _x(e){if(e.localName.toLowerCase()!=="ol")return "bullet";let t=ft(e).get("list-style-type")?.trim().toLowerCase(),n=t===void 0?void 0:MF.get(t);if(n!==void 0)return n;let r=e.getAttribute("type");return r==="A"?"upperLetter":r==="a"?"lowerLetter":r==="I"?"upperRoman":r==="i"?"lowerRoman":"decimal"}function Wf(e){let t=e.getAttribute("start")?.trim();return t!==void 0&&/^\d{1,5}$/.test(t)?Math.min(32767,Number.parseInt(t,10)):1}function Bx(e){let t=e.map((r,o)=>{let i=r.levels.get(0)??r.levels.values().next().value??{kind:"decimal"},a=Array.from({length:9},(s,l)=>{let d=r.levels.get(l);return d?Ax(d.kind,d.start,l):Ax(i.kind==="bullet"?"bullet":"decimal",1,l)}).join("");return `<w:abstractNum w:abstractNumId="${o}"><w:multiLevelType w:val="hybridMultilevel"/>${a}</w:abstractNum>`}).join(""),n=e.map((r,o)=>`<w:num w:numId="${r.numId}"><w:abstractNumId w:val="${o}"/></w:num>`).join("");return `${TF}<w:numbering xmlns:w="${PF}">${t}${n}</w:numbering>`}function qn(e){if(e==null)return null;let t=e.trim();if(t.length===0||t.length>256)return null;if(/^[A-Za-z_][A-Za-z0-9_]{0,39}$/.test(t))return t;let n=t.replace(/[^A-Za-z0-9_]/g,"_");if(n.replace(/_/g,"").length===0)return null;let r=5381;for(let a=0;a<t.length;a+=1)r=(Math.imul(r,33)^t.charCodeAt(a))>>>0;let o=`_${r.toString(36)}`,i=n.slice(0,40-o.length);return /^[A-Za-z_]/.test(i)||(i=`_${i.slice(0,39-o.length)}`),`${i}${o}`}function $x(e){if(e===null)return false;if(e.startsWith("#"))return qn(e.slice(1))!==null;let t=chunkOSFOJTHU_cjs.Q(e);return t?.ok===true&&t.href.length>0}function qx(e,t){if(e!==void 0&&e.startsWith("#")){let o=qn(e.slice(1)),i=qn(t)??o;return i===null?null:`#${i}`}let n=e===void 0?null:chunkOSFOJTHU_cjs.Q(e),r=qn(t);return n?.ok===true&&n.href.length>0?r===null?n.href:`${n.href.split("#")[0]}#${r}`:r===null?null:`#${r}`}function Kx(){let e=null;return (t,n,r)=>{if(e!==null&&e.html===t&&e.key===n){let a=e.value;return e=null,a}let o=r(),i={html:t,key:n,value:o};return e=i,setTimeout(()=>{e===i&&(e=null);},0),o}}var AF=/^(ftn|edn)([1-9]\d{0,9})$/i,FF={footnote:"ftn",endnote:"edn"};function Vx(e,t){let n=e===null?null:AF.exec(e);if(!n||n[1].toLowerCase()!==FF[t])return null;let r=Number.parseInt(n[2],10);return r<=2147483647?r:null}function Zf(e){for(let t of ["footnote","endnote"]){let n=e.get(`mso-${t}-id`),r=Vx(n??null,t);if(r!==null)return {kind:t,id:r}}return null}function LF(e,t){let n=t.get("mso-element")?.trim().toLowerCase();if(n!=="footnote"&&n!=="endnote")return null;let r=Vx(e.getAttribute("id"),n);return r===null?null:{kind:n,id:r}}function jx(e){let t=[],n=e.getElementsByTagName("div");for(let r=0;r<n.length&&t.length<2048;r+=1){let o=n[r],i=LF(o,ft(o));i!==null&&t.push({...i,element:o});}return t}function Wx(e,t,n){let r=new Map(t.map(a=>[a.element,a])),o=a=>{let s=a.parentElement;for(let l=0;s!==null&&l<128;l+=1){let d=r.get(s);if(d!==void 0)return d;s=s.parentElement;}return null},i=e.getElementsByTagName("a");for(let a=0;a<i.length&&a<2e4;a+=1){let s=i[a],l=Zf(ft(s));if(l===null)continue;let d=o(s);d!==null&&d.kind===l.kind&&d.id===l.id||n[l.kind].add(l.id);}}function Zx(e){let t=e.get("mso-element")?.trim().toLowerCase();return t==="footnote-list"||t==="endnote-list"}var NF=/<w:r>(?:<w:rPr>(?:(?!<\/w:r>)[\s\S])*?<\/w:rPr>)?<w:(footnote|endnote)Reference w:id="(\d{1,10})"\/><\/w:r>/g;function Ni(e,t,n){return e.replace(NF,(r,o,i)=>{let a=`${o}:${i}`;return t.has(a)?n?.get(a)??"":r})}function zf(e,t){let n="";for(let[r,o]of t)n+=`<w:${e} w:id="${r}">${o.join("")}</w:${e}>`;return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?><w:${e}s xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math">${n}</w:${e}s>`}function zx(e,t,n,r){let o=new Set,i={footnote:new Set,endnote:new Set},a=()=>{i.footnote.clear(),i.endnote.clear();let s=[],l=(d,c)=>{o.has(`${d}:${c}`)||!e.notes[d].has(c)||i[d].has(c)||(i[d].add(c),s.push({kind:d,id:c}));};for(let d of ["footnote","endnote"])for(let c of e.bodyNoteRefs[d])l(d,c);for(let d of o)for(let c of e.noteNoteRefs.get(d)??[])l(c.kind,c.id);for(;s.length>0;){let d=s.pop();for(let c of e.noteNoteRefs.get(`${d.kind}:${d.id}`)??[])l(c.kind,c.id);}};for(;;){a();let s=false;for(let l of ["footnote","endnote"]){for(let d of e.notes[l].keys()){let c=`${l}:${d}`;if(!(i[l].has(d)||o.has(c))){o.add(c),s=true;break}}if(s)break}if(!s)break}if(o.size>0)for(let s of ["footnote","endnote"])for(let[l,d]of e.notes[s])o.has(`${s}:${l}`)||e.notes[s].set(l,d.map(c=>Ni(c,o,e.noteMarkFallbacks)));for(let s of ["footnote","endnote"])for(let[l,d]of [...e.notes[s]]){if(!o.has(`${s}:${l}`))continue;e.notes[s].delete(l),t[s].delete(l);let c=new Map;for(let u of d){let p=Ni(u.replace(/<w:r>(?:<w:rPr>(?:(?!<\/w:r>)[\s\S])*?<\/w:rPr>)?<w:(?:footnote|endnote)Ref\/><\/w:r>/g,""),o,e.noteMarkFallbacks).replace(/ r:(id|embed)="([^"]{1,32})"/g,(m,g,b)=>{let h=c.get(b);if(h===void 0){let y=e.noteRels[s].find(S=>S.id===b);if(y===void 0)return m;h=r(e,y.type,y.target,y.external),c.set(b,h);}return ` r:${g}="${h}"`});n.push(p),e.lastMarkCovered=false;}}}function Uf(e,t,n,r=1,o=0){let i=e.lists.get(t);if(i)return i.levels.has(o)||i.levels.set(o,{kind:n,start:r}),i.numId;let a=String(1001+e.lists.size),s={numId:a,levels:new Map([[o,{kind:n,start:r}]])};return e.lists.set(t,s),e.listsByNumId.set(a,s),a}function Ux(e,t,n,r){let o=t.get("mso-list");if(o===void 0)return;let i=/\bl(\d{1,4})\s+level(\d{1,2})\b/i.exec(o);if(!i)return;let a=Math.min(Math.max(Number.parseInt(i[2],10)-1,0),8),s=DF(e,n),l=/\blfo(\d{1,4})\b/i.exec(o),d=(l!==null?n.listDefinitions.get(`l${i[1]}:level${i[2]}:lfo${l[1]}`):void 0)??n.listDefinitions.get(`l${i[1]}:level${i[2]}`),c,u;d!==void 0?(c=d.kind,u=Nx(s,c)??d.start??1):{kind:c,start:u}=Hx(s);let m=`mso:${r===void 0?"":`${r.kind}${r.id}:`}l${i[1]}${l?`:lfo${l[1]}`:""}`;return {numId:Uf(n,m,c,u,a),ilvl:a}}function DF(e,t){let n="",r=(o,i)=>{if(!(n.length>0||i>8||t.nodesLeft<=0)&&Li(o)){if(dd(o)){n=(o.textContent??"").slice(0,16);return}for(let a of Array.from(o.childNodes))r(a,i+1);}};for(let o of Array.from(e.childNodes))r(o,0);return n}var HF="http://schemas.openxmlformats.org/package/2006/relationships",_F="http://schemas.openxmlformats.org/package/2006/content-types",BF="application/vnd.openxmlformats-package.relationships+xml",Yf='<?xml version="1.0" encoding="UTF-8" standalone="yes"?>',$F="http://schemas.openxmlformats.org/wordprocessingml/2006/main",Xf="http://schemas.openxmlformats.org/officeDocument/2006/relationships",qF="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing",KF="http://schemas.openxmlformats.org/drawingml/2006/main",VF="http://schemas.openxmlformats.org/drawingml/2006/picture",jF="http://schemas.openxmlformats.org/officeDocument/2006/math",Gx={document:"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml",numbering:"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml",footnotes:"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml",endnotes:"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml"};function Gf(e){let t=e.map(n=>`<Relationship Id="${chunkOSFOJTHU_cjs.S(n.id)}" Type="${chunkOSFOJTHU_cjs.S(n.type)}" Target="${chunkOSFOJTHU_cjs.S(n.target)}"${n.external?' TargetMode="External"':""}/>`).join("");return `${Yf}<Relationships xmlns="${HF}">${t}</Relationships>`}function WF(e){let t=new Map;t.set("word/document.xml",chunkOSFOJTHU_cjs.Td(e.documentXml)),t.set("word/_rels/document.xml.rels",chunkOSFOJTHU_cjs.Td(Gf(e.rels))),t.set("_rels/.rels",chunkOSFOJTHU_cjs.Td(Gf([{id:"rId1",type:`${Xf}/officeDocument`,target:"word/document.xml",external:false}])));let n=[["numbering",e.numberingXml],["footnotes",e.footnotesXml],["endnotes",e.endnotesXml]],r=`<Override PartName="/word/document.xml" ContentType="${Gx.document}"/>`;for(let[i,a]of n)a!==void 0&&(t.set(`word/${i}.xml`,chunkOSFOJTHU_cjs.Td(a)),r+=`<Override PartName="/word/${i}.xml" ContentType="${Gx[i]}"/>`);for(let[i,a]of [["footnotes",e.footnotesRels],["endnotes",e.endnotesRels]])a!==void 0&&a.length>0&&t.set(`word/_rels/${i}.xml.rels`,chunkOSFOJTHU_cjs.Td(Gf(a)));for(let[i,a]of e.media)t.set(i,a);let o=`<Default Extension="rels" ContentType="${BF}"/><Default Extension="xml" ContentType="application/xml"/>`;for(let[i,a]of e.mediaExtensions)o+=`<Default Extension="${chunkOSFOJTHU_cjs.S(i)}" ContentType="${chunkOSFOJTHU_cjs.S(a)}"/>`;return t.set("[Content_Types].xml",chunkOSFOJTHU_cjs.Td(`${Yf}<Types xmlns="${_F}">${o}${r}</Types>`)),chunkOSFOJTHU_cjs.Sd(t)}function Xx(e){let t=[...e.rels],n=o=>{t.push({id:`rId${t.length+1}`,type:`${Xf}/${o}`,target:`${o}.xml`,external:false});};e.lists.length>0&&n("numbering");for(let o of ["footnote","endnote"])e.notes[o].size>0&&n(`${o}s`);let r=`${Yf}<w:document xmlns:w="${$F}" xmlns:r="${Xf}" xmlns:wp="${qF}" xmlns:a="${KF}" xmlns:pic="${VF}" xmlns:m="${jF}"><w:body>${e.blocks.join("")}</w:body></w:document>`;return WF({documentXml:r,rels:t,...e.lists.length>0?{numberingXml:Bx(e.lists)}:{},...e.notes.footnote.size>0?{footnotesXml:zf("footnote",e.notes.footnote),footnotesRels:e.noteRels.footnote}:{},...e.notes.endnote.size>0?{endnotesXml:zf("endnote",e.notes.endnote),endnotesRels:e.noteRels.endnote}:{},media:e.media,mediaExtensions:e.mediaExtensions})}function Or(e){let t="";for(let n=0;n<e.length;n+=1){let r=e.charCodeAt(n);if(!(r!==9&&(r<32||r===65534||r===65535))){if(r>=55296&&r<=56319){let o=e.charCodeAt(n+1);o>=56320&&o<=57343&&(t+=e[n]+e[n+1],n+=1);continue}r>=56320&&r<=57343||(t+=e[n]);}}return t}function rr(e){let t="";if(e.rStyle!==void 0&&(t+=`<w:rStyle w:val="${chunkOSFOJTHU_cjs.S(e.rStyle)}"/>`),e.font!==void 0){let a=chunkOSFOJTHU_cjs.S(Or(e.font));t+=e.rtl?`<w:rFonts w:cs="${a}"/>`:`<w:rFonts w:ascii="${a}" w:hAnsi="${a}"/>`;}e.bold?t+="<w:b/>":e.bold===false&&(t+='<w:b w:val="0"/>'),e.italic?t+="<w:i/>":e.italic===false&&(t+='<w:i w:val="0"/>'),e.caps?t+="<w:caps/>":e.caps===false&&(t+='<w:caps w:val="0"/>'),e.smallCaps?t+="<w:smallCaps/>":e.smallCaps===false&&(t+='<w:smallCaps w:val="0"/>'),e.doubleStrike?t+="<w:dstrike/>":e.strike?t+="<w:strike/>":e.strike===false&&(t+='<w:strike w:val="0"/>'),e.color!==void 0&&(t+=`<w:color w:val="${e.color}"/>`),e.charSpacingTwentieths!==void 0&&(t+=`<w:spacing w:val="${e.charSpacingTwentieths}"/>`),e.szHalfPoints!==void 0&&(t+=`<w:sz w:val="${e.szHalfPoints}"/>`),e.highlight!==void 0&&(t+=`<w:highlight w:val="${chunkOSFOJTHU_cjs.S(e.highlight)}"/>`),e.underline?t+=`<w:u w:val="${e.underlineVal??"single"}"${e.underlineColor===void 0?"":` w:color="${e.underlineColor}"`}/>`:e.underline===false&&(t+='<w:u w:val="none"/>'),e.shdFill!==void 0&&(t+=`<w:shd w:val="clear" w:color="auto" w:fill="${e.shdFill}"/>`),e.vertAlign!==void 0&&(t+=`<w:vertAlign w:val="${e.vertAlign}"/>`),e.rtl&&(t+="<w:rtl/>");let n=e.langVal,r=e.langEastAsia,o=e.langBidi;e.lang!==void 0&&(e.rtl?o??=e.lang:/^(?:zh|ja|ko)(?:-|$)/i.test(e.lang)?r??=e.lang:n??=e.lang);let i=`${n===void 0?"":` w:val="${chunkOSFOJTHU_cjs.S(n)}"`}${r===void 0?"":` w:eastAsia="${chunkOSFOJTHU_cjs.S(r)}"`}${o===void 0?"":` w:bidi="${chunkOSFOJTHU_cjs.S(o)}"`}`;return i.length>0&&(t+=`<w:lang${i}/>`),t.length>0?`<w:rPr>${t}</w:rPr>`:""}function cd(e,t){return `<w:r>${rr(t)}<w:t xml:space="preserve">${chunkOSFOJTHU_cjs.R(Or(e))}</w:t></w:r>`}function ZF(e){let t="";if(e.styleId!==void 0&&(t+=`<w:pStyle w:val="${chunkOSFOJTHU_cjs.S(e.styleId)}"/>`),e.keepNext&&(t+="<w:keepNext/>"),e.keepLines&&(t+="<w:keepLines/>"),e.pageBreakBefore&&(t+="<w:pageBreakBefore/>"),e.widowControl&&(t+="<w:widowControl/>"),e.numPr&&(t+=`<w:numPr><w:ilvl w:val="${e.numPr.ilvl}"/><w:numId w:val="${chunkOSFOJTHU_cjs.S(e.numPr.numId)}"/></w:numPr>`),e.borders!==void 0){let a="";for(let s of ["top","left","bottom","right"]){let l=e.borders[s];l!==void 0&&(a+=`<w:${s} w:val="${l.val}" w:sz="${l.szEighthPoints}" w:space="0" w:color="${l.color}"/>`);}a.length>0&&(t+=`<w:pBdr>${a}</w:pBdr>`);}if(e.shdFill!==void 0&&(t+=`<w:shd w:val="clear" w:color="auto" w:fill="${e.shdFill}"/>`),e.tabs!==void 0&&e.tabs.length>0&&(t+=`<w:tabs>${e.tabs.map(a=>`<w:tab w:val="${a.val}" w:pos="${a.posTwips}"`+(a.leader===void 0?"/>":` w:leader="${a.leader}"/>`)).join("")}</w:tabs>`),e.bidi&&(t+="<w:bidi/>"),e.spacingBeforeTwips!==void 0||e.spacingAfterTwips!==void 0||e.lineTwentieths!==void 0){let a="<w:spacing";e.spacingBeforeTwips!==void 0&&(a+=` w:before="${e.spacingBeforeTwips}"`),e.spacingAfterTwips!==void 0&&(a+=` w:after="${e.spacingAfterTwips}"`),e.lineTwentieths!==void 0&&(a+=` w:line="${e.lineTwentieths}" w:lineRule="${e.lineRule??"auto"}"`),t+=`${a}/>`;}let n=e.firstLineTwips,[r,o]=e.bidi?[e.indRightTwips,e.indLeftTwips]:[e.indLeftTwips,e.indRightTwips];if(r!==void 0||o!==void 0||n!==void 0){let a="<w:ind";r!==void 0&&(a+=` w:left="${r}"`),o!==void 0&&(a+=` w:right="${o}"`),n!==void 0&&(a+=n>=0?` w:firstLine="${n}"`:` w:hanging="${-n}"`),t+=`${a}/>`;}let i=e.jc==="start"?"left":e.jc==="end"?"right":e.bidi&&(e.jc==="left"||e.jc==="right")?e.jc==="left"?"right":"left":e.jc;return i!==void 0&&(t+=`<w:jc w:val="${i}"/>`),t.length>0?`<w:pPr>${t}</w:pPr>`:""}function _o(e,t){return `<w:p>${ZF(e)}${t.join("")}</w:p>`}var Qx={h1:64,h2:52,h3:44,h4:36,h5:32,h6:28};function ud(e){let t=e[e.length-1];if(t?.endsWith("</w:p>")){e[e.length-1]=`${t.slice(0,-6)}<w:r><w:br w:type="page"/></w:r></w:p>`;return}e.push('<w:p><w:r><w:br w:type="page"/></w:r></w:p>');}var zF=/^(?:<w:bookmark(?:Start|End)\b[^>]*\/>)+$/,Yx=new WeakMap;function Qf(e){let t=Yx.get(e);for(t||(t={checked:0,furniture:true},Yx.set(e,t));t.furniture&&t.checked<e.length;)t.furniture=zF.test(e[t.checked]),t.checked+=1;return t.furniture}var Bo=32;function vn(e){return e.left<=0?(e.truncated=true,false):(e.left-=1,e.visited+=1,true)}var Jx=Object.freeze({});function ew(e,t){let n={...t};return e.bold!==void 0&&(n.bold=e.bold),e.italic!==void 0&&(n.italic=e.italic),e.color!==void 0&&(n.color=e.color),e.highlight!==void 0&&(n.highlight=e.highlight),e.shdFill!==void 0&&(n.shdFill=e.shdFill),e.szHalfPoints!==void 0&&(n.szHalfPoints=e.szHalfPoints),n}function UF(e){return e.replace(/ /g," ").replace(/[-]/g,"").replace(/[ \t\r\n\f\v]+/g," ")}function Mr(e,t,n){let r=chunkOSFOJTHU_cjs.R(Or(UF(e)));if(r.length===0)return "";let i=n.uprightUnlessItalic===true&&n.italic!==true?n.bold?"b":"p":n.bold?"bi":null,a=t.length>0?t:i?`<m:sty m:val="${i}"/>`:"",s=rr({...n.color!==void 0?{color:n.color}:{},...n.highlight!==void 0?{highlight:n.highlight}:{},...n.shdFill!==void 0?{shdFill:n.shdFill}:{},...n.szHalfPoints!==void 0?{szHalfPoints:n.szHalfPoints}:{}});return `<m:r>${a.length>0?`<m:rPr>${a}</m:rPr>`:""}${s}<m:t xml:space="preserve">${r}</m:t></m:r>`}var GF=512,tw=new Set(["\u2211","\u220F","\u2210","\u222B","\u222C","\u222D","\u222E","\u222F","\u2230","\u22C0","\u22C1","\u22C2","\u22C3","\u2A00","\u2A01","\u2A02","\u2A04","\u2A06"]),XF=new Map([["^","\u0302"],["\u02C6","\u0302"],["\u0302","\u0302"],["~","\u0303"],["\u02DC","\u0303"],["\u0303","\u0303"],["\u02D9","\u0307"],["\u0307","\u0307"],["\xA8","\u0308"],["\u0308","\u0308"],["\u2192","\u20D7"],["\u20D7","\u20D7"],["\xB4","\u0301"],["`","\u0300"],["\u02C7","\u030C"],["\u02D8","\u0306"]]),nw=new Set(["\xAF","\u203E","_","\u2015","\u2014","\u0305","-"]),rw=new Map([["(",")"],["[","]"],["{","}"],["|","|"],["\u2016","\u2016"],["\u27E8","\u27E9"],["\u2329","\u232A"],["\u230A","\u230B"],["\u2308","\u2309"]]),YF=new Set(["annotation","annotation-xml","none","mprescripts","mspace","maligngroup","malignmark","mphantom"]),QF=new Set(["msub","msup","msubsup","munder","mover","munderover"]);function Ar(e){return e.localName.toLowerCase()}function us(e){return Array.from(e.children)}function Jr(e){return (e.textContent??"").replace(/[ \t\r\n\f\v]+/g," ").trim().slice(0,GF)}function $o(e){return chunkOSFOJTHU_cjs.S(Or(e))}function $e(e,t){return t.length>0?`<m:${e}>${t}</m:${e}>`:`<m:${e}/>`}function ow(e,t){let n=t,r=e.getAttribute("mathcolor")?.trim()??"",o=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(r)?.[1];if(o!==void 0){let a=o.length===3?o.replace(/./g,s=>s+s):o;n={...n,color:a.toUpperCase()};}let i=e.getAttribute("mathvariant")?.trim().toLowerCase();return (i==="bold"||i==="bold-italic")&&(n={...n,bold:true}),n}function cs(e){if(e===void 0||Ar(e)!=="mo")return null;let t=Jr(e);return [...t].length===1?t:null}var Jf=class{constructor(t){this.state=t;}state;node(t,n,r){if(n>Bo)return this.state.truncated=true,"";if(!vn(this.state))return "";let o=Ar(t),i=ow(t,r),a=us(t),s=l=>a[l]?this.node(a[l],n+1,i):"";if(YF.has(o))return "";switch(o){case "semantics":return s(0);case "mi":return this.identifier(t,i);case "mn":case "mo":return Mr(Jr(t),"",i);case "mtext":return Mr(Jr(t),"<m:nor/>",i);case "ms":return Mr(`"${Jr(t)}"`,"<m:nor/>",i);case "msub":return `<m:sSub>${$e("e",s(0))}${$e("sub",s(1))}</m:sSub>`;case "msup":return `<m:sSup>${$e("e",s(0))}${$e("sup",s(1))}</m:sSup>`;case "msubsup":return `<m:sSubSup>${$e("e",s(0))}${$e("sub",s(1))}${$e("sup",s(2))}</m:sSubSup>`;case "mfrac":return this.fraction(t,s(0),s(1));case "msqrt":return `<m:rad><m:radPr><m:degHide m:val="1"/></m:radPr><m:deg/>${$e("e",this.row(a,n+1,i))}</m:rad>`;case "mroot":return `<m:rad>${$e("deg",s(1))}${$e("e",s(0))}</m:rad>`;case "munder":return this.under(a[1],s(0),s(1));case "mover":return this.over(t,a[1],s(0),s(1));case "munderover":return `<m:limUpp>${$e("e",`<m:limLow>${$e("e",s(0))}${$e("lim",s(1))}</m:limLow>`)}${$e("lim",s(2))}</m:limUpp>`;case "mfenced":return this.fenced(t,a,n,i);case "menclose":return `<m:borderBox>${$e("e",this.row(a,n+1,i))}</m:borderBox>`;case "mtable":return this.table(a,n,i);case "mmultiscripts":return this.multiscripts(a,n,i);default:return this.row(a,n+1,i)}}identifier(t,n){let r=Jr(t),o=t.getAttribute("mathvariant")?.trim().toLowerCase(),i="";return o==="normal"||o===void 0&&[...r].length>1?i='<m:sty m:val="p"/>':o==="bold"?i='<m:sty m:val="b"/>':o==="bold-italic"&&(i='<m:sty m:val="bi"/>'),Mr(r,i,n)}fraction(t,n,r){let o=t.getAttribute("linethickness")?.trim().toLowerCase(),i=t.getAttribute("bevelled")?.trim().toLowerCase()==="true",a=o!==void 0&&/^0(?:\.0*)?(?:px|pt|em|ex|%)?$/.test(o)?"noBar":i?"skw":null;return `<m:f>${a===null?"":`<m:fPr><m:type m:val="${a}"/></m:fPr>`}${$e("num",n)}${$e("den",r)}</m:f>`}under(t,n,r){let o=cs(t);return o!==null&&nw.has(o)?`<m:bar><m:barPr><m:pos m:val="bot"/></m:barPr>${$e("e",n)}</m:bar>`:`<m:limLow>${$e("e",n)}${$e("lim",r)}</m:limLow>`}over(t,n,r,o){let i=cs(n);if(i!==null&&nw.has(i))return `<m:bar><m:barPr><m:pos m:val="top"/></m:barPr>${$e("e",r)}</m:bar>`;let a=i===null?void 0:XF.get(i);return a!==void 0||i!==null&&t.getAttribute("accent")?.trim()==="true"?`<m:acc><m:accPr><m:chr m:val="${$o(a??i)}"/></m:accPr>${$e("e",r)}</m:acc>`:`<m:limUpp>${$e("e",r)}${$e("lim",o)}</m:limUpp>`}fenced(t,n,r,o){let i=[...t.getAttribute("open")??"("].slice(0,1).join(""),a=[...t.getAttribute("close")??")"].slice(0,1).join(""),s=[...(t.getAttribute("separators")??",").trim()][0]??"",l=n.map(d=>$e("e",this.node(d,r+1,o)));return `<m:d><m:dPr><m:begChr m:val="${$o(i)}"/>${s.length>0?`<m:sepChr m:val="${$o(s)}"/>`:""}<m:endChr m:val="${$o(a)}"/></m:dPr>${l.join("")||"<m:e/>"}</m:d>`}table(t,n,r){let o="";for(let i of t){if(!vn(this.state))break;let a=Ar(i);if(a!=="mtr"&&a!=="mlabeledtr")continue;let s=us(i).slice(a==="mlabeledtr"?1:0);o+="<m:mr>"+s.map(l=>$e("e",Ar(l)==="mtd"?this.row(us(l),n+2,r):this.node(l,n+2,r))).join("")+"</m:mr>";}return o.length>0?`<m:m>${o}</m:m>`:""}multiscripts(t,n,r){let o=d=>d===void 0||Ar(d)==="none"?"":this.node(d,n+1,r),i=t.findIndex(d=>Ar(d)==="mprescripts"),a=i<0?t.slice(1):t.slice(1,i),s=i<0?[]:t.slice(i+1),l=o(t[0]);return a.length>0&&(l=`<m:sSubSup>${$e("e",l)}${$e("sub",o(a[0]))}${$e("sup",o(a[1]))}</m:sSubSup>`),s.length>0?`<m:sPre>${$e("sub",o(s[0]))}${$e("sup",o(s[1]))}${$e("e",l)}</m:sPre>`:l}nary(t,n,r,o){let i=Ar(t),a=us(t),s=Jr(i==="mo"?t:a[0]),l=g=>a[g]?this.node(a[g],r+1,o):"",d="",c="";i==="msub"||i==="munder"?d=l(1):i==="msup"||i==="mover"?c=l(1):(i==="msubsup"||i==="munderover")&&(d=l(1),c=l(2));let u=i==="munder"||i==="mover"||i==="munderover"?"undOvr":"subSup",p=`<m:chr m:val="${$o(s)}"/><m:limLoc m:val="${u}"/>${d.length===0?'<m:subHide m:val="1"/>':""}${c.length===0?'<m:supHide m:val="1"/>':""}`,m=n?this.node(n,r+1,o):"";return `<m:nary><m:naryPr>${p}</m:naryPr>${$e("sub",d)}${$e("sup",c)}${$e("e",m)}</m:nary>`}isNary(t){let n=Ar(t);if(n==="mo")return tw.has(Jr(t));if(!QF.has(n))return false;let r=t.children[0];return r!==void 0&&tw.has(cs(r)??"")}row(t,n,r){if(n>Bo)return this.state.truncated=true,"";let o=cs(t[0]),i=cs(t[t.length-1]);if(t.length>=2&&o!==null&&i!==null&&rw.has(o)&&[...rw.values()].includes(i)){let l=this.row(t.slice(1,-1),n+1,r);return `<m:d><m:dPr><m:begChr m:val="${$o(o)}"/><m:endChr m:val="${$o(i)}"/></m:dPr>${$e("e",l)}</m:d>`}let a="";for(let s=0;s<t.length;s+=1){let l=t[s];if(this.isNary(l)){let d=t[s+1];a+=this.nary(l,d,n,r),d!==void 0&&(s+=1);continue}a+=this.node(l,n,r);}return a}};function ep(e){return Ar(e)==="math"}function iw(e){return e.getAttribute("display")?.trim().toLowerCase()==="block"||e.getAttribute("mode")?.trim().toLowerCase()==="display"}function aw(e,t,n){return new Jf(t).row(us(e),1,ow(e,n))}var JF="acc accPr aln alnScr argPr argSz bar barPr baseJc begChr borderBox borderBoxPr box boxPr brk brkBin brkBinSub cGp cGpRule chr count cSp ctrlPr d defJc deg degHide den diff dispDef dPr e endChr eqArr eqArrPr f fName fPr func funcPr groupChr groupChrPr grow hideBot hideLeft hideRight hideTop interSp intLim intraSp jc lim limLoc limLow limLowPr limUpp limUppPr lit lMargin m mathFont mathPr maxDist mc mcJc mcPr mcs mPr mr nary naryLim naryPr noBreak nor num objDist oMath oMathPara oMathParaPr opEmu phant phantPr plcHide pos postSp preSp r rad radPr rMargin rPr rSp rSpRule scr sepChr show shp smallFrac sPre sPrePr sSub sSubPr sSubSup sSubSupPr sSup sSupPr strikeBLTR strikeH strikeTLBR strikeV sty sub subHide sup supHide t transp type vertJc wrapIndent wrapRight zeroAsc zeroDesc zeroWid".split(" "),lw=new Map(JF.map(e=>[`m:${e.toLowerCase()}`,e])),e1=new Set(["oMath","e","num","den","sub","sup","deg","lim","fName"]),t1=512,n1=512,r1=64,o1=64,i1=2,a1=256,sw=/^\[if\s+gte\s+msEquation\b[^\]]*\]>([\s\S]*)<!\[endif\]$/i,s1=/^\[if\s+!msEquation\s*\]$/i,l1=/^\[if\b[^\]]*\]$/i,d1=/^\[endif\]$/i,c1=Object.freeze({byElement:new Map,visited:0,truncated:false});function dw(e){return /<m:omath|msEquation|<math[\s>]/i.test(e)}function fs(e){return e.nodeType===1?lw.get(Ge(e)):void 0}function cw(e,t,n,r){if(!(n>Bo||!vn(t))){if(e.nodeType===3){r.push(e.nodeValue??"");return}if(!(e.nodeType!==1||Ge(e)==="o:p"))for(let o of Array.from(e.childNodes))cw(o,t,n+1,r);}}function tp(e,t){return ew(Ho(ds({},Ge(e)),e),t)}function u1(e,t,n,r){let o="",i=[],a=r;for(let s of Array.from(e.childNodes)){let l=fs(s);if(l==="rPr")o+=fd(s,"rPr",t,n+1,r);else {if(s.nodeType===1&&Ge(s)==="w:rpr")continue;s.nodeType===1&&l===void 0&&(a=tp(s,a)),cw(s,t,n+1,i);}}return Mr(i.join(""),o,a)}function fd(e,t,n,r,o){let i="",a="",s=e1.has(t);for(let l of Array.from(e.childNodes)){if(l.nodeType===3){if(!vn(n))break;s&&(a+=l.nodeValue??"");continue}l.nodeType===1&&(a.trim().length>0&&(i+=Mr(a,"",o)),a="",i+=uw(l,t,n,r+1,o));}return a.trim().length>0&&(i+=Mr(a,"",o)),i}function uw(e,t,n,r,o){if(r>Bo)return n.truncated=true,"";if(!vn(n))return "";let i=lw.get(Ge(e));if(i===void 0)return Ge(e)==="o:p"?"":fd(e,t,n,r,tp(e,o));if(i==="ctrlPr"||i==="oMathPara"||i==="oMath")return "";if(i==="r"||i==="t")return u1(e,n,r,o);let a=e.getAttribute("m:val"),s=a!==null&&a.length<=r1?` m:val="${chunkOSFOJTHU_cjs.S(Or(a))}"`:"",l=fd(e,i,n,r,o);return l.length>0?`<m:${i}${s}>${l}</m:${i}>`:`<m:${i}${s}/>`}function fw(e,t,n){if(!vn(t))return null;let r=fd(e,"oMath",t,1,n);return r.length>0?`<m:oMath>${r}</m:oMath>`:null}function pw(e,t,n,r,o){if(!(n>Bo||!vn(t)))for(let i of Array.from(e.children)){let a=fs(i);if(a==="oMath"){let s=fw(i,t,r);s!==null&&o.equations.push(s);}else a==="oMathParaPr"&&o.properties.length===0?o.properties=uw(i,"oMathPara",t,n+1,r):a===void 0&&pw(i,t,n+1,tp(i,r),o);}}function f1(e){let t=fs(e);return t==="oMath"||t==="oMathPara"||ep(e)}function p1(e){let t=0;for(let n=e.parentElement;n!==null;n=n.parentElement)if((t+=1)>a1||f1(n))return true;return false}function m1(e,t){if(typeof e.createTreeWalker!="function")return;let n=e.createTreeWalker(e.body,128),r=[];for(let o=n.nextNode();o!==null;o=n.nextNode()){if(!vn(t))return;let i=o.data;if(/<m:omath|<math[\s>]/i.test(i)&&sw.test(i)){if(r.length>=n1){t.truncated=true;break}r.push(o);}}for(let o of r){let i=sw.exec(o.data)?.[1]??"",a;try{a=new DOMParser().parseFromString(i,"text/html");}catch{continue}let s=o.parentNode;if(!(s===null||a.body===null)){for(let l of Array.from(a.body.childNodes))s.insertBefore(e.importNode(l,true),o);s.removeChild(o);}}}function g1(e){return e.nodeType===3?(e.nodeValue??"").replace(/[\s ]/g,"").length>0:e.nodeType===1||e.nodeType===8}function h1(e){let t=e;for(let n=0;n<=i1;n+=1){let r=t.nextSibling;for(;r!==null&&!g1(r);)r=r.nextSibling;if(r!==null){if(r.nodeType!==8||!s1.test(r.data.trim()))return;let a=[r],s=1;for(let l=r.nextSibling;l!==null&&a.length<=o1;l=l.nextSibling)if(a.push(l),l.nodeType===8){let d=l.data.trim();if(d1.test(d)?s-=1:l1.test(d)&&(s+=1),s===0){for(let c of a)c.parentNode?.removeChild(c);return}}return}let o=t.parentElement;if(o===null||fs(o)!==void 0)return;let i=Ge(o);if(i!=="span"&&i!=="i"&&i!=="b"&&i!=="font")return;t=o;}}function y1(e,t){let n=e.getElementsByTagName("i").length>0?{uprightUnlessItalic:true}:Jx;if(ep(e)){if(!vn(t))return null;let r=aw(e,t,n);return r.length===0?null:iw(e)?`<m:oMathPara><m:oMath>${r}</m:oMath></m:oMathPara>`:`<m:oMath>${r}</m:oMath>`}if(fs(e)==="oMathPara"){let r={properties:"",equations:[]};return pw(e,t,1,n,r),r.equations.length===0?null:`<m:oMathPara>${r.properties}${r.equations.join("")}</m:oMathPara>`}return fw(e,t,n)}function mw(e,t){if(e.body===null||t<=0)return c1;let n={left:t,visited:0,truncated:false};m1(e,n);let r=new Map,o=[];for(let i of ["m:omathpara","m:omath","math"]){let a=e.body.getElementsByTagName(i);for(let s=0;s<a.length;s+=1){if(o.length>=t1){n.truncated=true;break}if(!vn(n))break;let l=a[s];p1(l)||o.push(l);}}for(let i of o){if(n.left<=0){n.truncated=true;break}let a=y1(i,n);a===null||n.truncated||(r.set(i,[a]),h1(i));}return {byElement:r,visited:n.visited,truncated:n.truncated}}function np(e){return e.startsWith("<m:oMath>")||e.startsWith("<m:oMathPara>")}function Kn(e,t){return t?e==="left"?"right":e==="right"?"left":e:e}var eo=31680;function Fr(e,t,n){return Math.min(n,Math.max(t,e))}function gw(e){let t=wt(ft(e).get("width")??"");if(t!==null&&t>0)return t;let n=e.getAttribute("width")?.trim();if(n===void 0||!/^\d{1,6}(\.\d+)?$/.test(n))return null;let r=Number.parseFloat(n);return Number.isFinite(r)&&r>0?r*.75:null}function b1(e){return qo(e,"colspan",63)}function hw(e){return Array.from(e.children).flatMap(t=>{let n=Ge(t);return n==="tr"?[t]:n!=="thead"&&n!=="tbody"&&n!=="tfoot"?[]:Array.from(t.children).filter(r=>Ge(r)==="tr")})}function qo(e,t,n){let r=e.getAttribute(t);return r===null||!/^\d{1,4}$/.test(r.trim())?1:Fr(Number.parseInt(r,10),1,n)}function yw(e,t){let n=(ft(e).get("width")??e.getAttribute("width")??"").trim(),r=/^(\d{1,3}(?:\.\d+)?)%$/.exec(n);if(r)return {xml:`<w:tblW w:w="${Fr(Math.round(Number.parseFloat(r[1])*50),50,5e3)}" w:type="pct"/>`,twips:t};let o=gw(e);if(o===null)return {xml:'<w:tblW w:w="0" w:type="auto"/>',twips:t};let i=Fr(Math.round(o*20),1,eo);return {xml:`<w:tblW w:w="${i}" w:type="dxa"/>`,twips:i}}function bw(e){let n=ft(e).get("mso-table-left")?.trim().toLowerCase(),r=(n==="left"||n==="center"||n==="right"?n:void 0)??e.getAttribute("align")?.trim().toLowerCase();return r==="left"||r==="center"||r==="right"?r:void 0}function vw(e){let t=ft(e),n=t.get("mso-table-anchor-horizontal")?.trim().toLowerCase(),r=t.get("mso-table-anchor-vertical")?.trim().toLowerCase();if(n===void 0&&r===void 0)return "";let o=l=>l==="margin"||l==="page"?l:"text",i=` w:horzAnchor="${o(n)}" w:vertAnchor="${o(r)}"`,a=t.get("mso-table-left")?.trim().toLowerCase();if(a==="left"||a==="center"||a==="right")i+=` w:tblpXSpec="${a}"`;else {let l=wt(a??"");l!==null&&(i+=` w:tblpX="${Fr(Math.round(l*20),-eo,eo)}"`);}let s=wt(t.get("mso-table-top")??"");return s!==null&&(i+=` w:tblpY="${Fr(Math.round(s*20),-eo,eo)}"`),`<w:tblpPr${i}/>`}function xw(e,t,n){let r=Math.max(1,Math.floor(n/t)),o=-1,i=Array.from({length:t},()=>r),a=new Array(t).fill(null);for(let c of e){let u=Array.from({length:t},()=>r),p=0,m=0,g=a.map(y=>y?y.span:null);for(let y=0;y<t;y+=1){let S=a[y];S&&(S.remaining-=1,S.remaining<=0&&(a[y]=null));}let b=Array.from(c.children).filter(y=>/^t[dh]$/.test(Ge(y))),h=0;for(;m<t;){let y=g[m];if(y!==null){m+=y;continue}let S=b[h];if(S===void 0)break;h+=1;let x=Math.min(b1(S),t-m);for(let T=m+1;T<m+x;T+=1)if(g[T]!==null){x=T-m;break}let I=qo(S,"rowspan",1e3);I>1&&(a[m]={remaining:I-1,span:x});let R=gw(S);if(R!==null){let T=Fr(Math.round(R*20/x),1,eo);for(let P=0;P<x;P+=1)u[m+P]=T;p+=x;}m+=x;}p>o&&(o=p,i=u);}let s=i.reduce((c,u)=>c+u,0);if(s<=0)return i;let l=i.map(c=>Math.max(1,Math.round(c*n/s))),d=n-l.reduce((c,u)=>c+u,0);return l[l.length-1]=Math.max(1,l[l.length-1]+d),l}function rp(e,t,n){let r=0;for(let o=0;o<n;o+=1)r+=e[t+o]??0;return Math.max(1,r)}var ww=new Map([["solid","single"],["double","double"],["dotted","dotted"],["dashed","dashed"],["none","nil"],["hidden","nil"]]),Sw=new Map([["thin",.75],["medium",2.25],["thick",3.75]]);function Iw(e){return Fr(Math.round(e*8),2,96)}function or(e){if(e===void 0||e.length===0||e.length>128)return;let t,n,r;for(let o of Vf(e)){let i=ww.get(o.toLowerCase());if(i!==void 0){t=i;continue}let a=Sw.get(o.toLowerCase())??wt(o);if(a!==null){n=a;continue}let s=Qr(o);if(s!==null){r=s;continue}return}if(t!==void 0){if(t==="nil")return {val:t,size:0,color:r??"auto"};if(n===void 0)return {val:t,size:4,color:r??"000000"};if(!(n<=0))return {val:t,size:Iw(n),color:r??"000000"}}}function pd(e,t){let n=e.get(`${t}-style`)?.trim();if(n===void 0||n.length===0||n.length>64)return;let r=ww.get(n.split(/\s+/)[0].toLowerCase());if(r===void 0)return;if(r==="nil")return {val:r,size:0,color:"auto"};let o=e.get(`${t}-width`)?.trim().split(/\s+/)[0],i=o===void 0||o.length>64?null:Sw.get(o.toLowerCase())??wt(o);if(i!==null&&i<=0)return;let a=e.get(`${t}-color`)?.trim().split(/\s+/)[0],s=a===void 0||a.length>64?null:Qr(a);return {val:r,size:i===null?4:Iw(i),color:s??"000000"}}function kw(e,t){return `<w:${e} w:val="${t.val}" w:sz="${t.size}" w:space="0" w:color="${t.color}"/>`}function Rw(e,t=false){let n=ft(e),o=or(n.get("mso-border-alt"))??or(n.get("border"))??pd(n,"border")??(e.getAttribute("border")?.trim()&&e.getAttribute("border")?.trim()!=="0"?{val:"single",size:4,color:"auto"}:void 0),i=[["top","top"],["left","left"],["bottom","bottom"],["right","right"],["insideH","insideh"],["insideV","insidev"]],a="";for(let[s,l]of i){let d=Kn(l,t),c=or(n.get(`mso-border-${d}-alt`))??or(n.get(`mso-border-${d}`))??or(n.get(`border-${d}`))??pd(n,`border-${d}`)??o;c!==void 0&&(a+=kw(s,c));}return a.length>0?`<w:tblBorders>${a}</w:tblBorders>`:""}function Pw(e){let t=ft(e),n=wt(t.get("height")??"");if(n===null||n<=0)return "";let r=Fr(Math.round(n*20),1,eo),i=t.get("mso-height-rule")?.trim().toLowerCase()==="exactly"?"exact":"atLeast";return `<w:trPr><w:trHeight w:val="${r}" w:hRule="${i}"/></w:trPr>`}function v1(e,t){let n={top:null,right:null,bottom:null,left:null},r=e.get("padding");if(r!==void 0&&r.length<=128){let i=r.trim().split(/\s+/).map(a=>wt(a));if(i.length>=1&&i.length<=4&&!i.some(a=>a===null||a<0)){let[a,s=a,l=a,d=s]=i.length===2?[i[0],i[1],i[0],i[1]]:i.length===3?[i[0],i[1],i[2],i[1]]:i;n.top=a??null,n.right=s??null,n.bottom=l??null,n.left=d??null;}}for(let i of ["top","right","bottom","left"]){let a=wt(e.get(`padding-${i}`)??"");a!==null&&a>=0&&(n[i]=a);}let o="";for(let i of ["top","left","bottom","right"]){let a=Kn(i,t),s=n[a];s!==null&&(o+=`<w:${i} w:w="${Fr(Math.round(s*20),0,eo)}" w:type="dxa"/>`);}return o.length>0?`<w:tcMar>${o}</w:tcMar>`:""}function Tw(e,t=false){let n=ft(e),r=or(n.get("mso-border-alt"))??or(n.get("border"))??pd(n,"border"),o="";for(let l of ["top","left","bottom","right"]){let d=Kn(l,t),c=or(n.get(`mso-border-${d}-alt`))??or(n.get(`mso-border-${d}`))??or(n.get(`border-${d}`))??pd(n,`border-${d}`)??r;c!==void 0&&(o+=kw(l,c));}let i=o.length>0?`<w:tcBorders>${o}</w:tcBorders>`:"",a=ld(n);a&&(i+=`<w:shd w:val="clear" w:color="auto" w:fill="${a}"/>`),i+=v1(n,t);let s=n.get("vertical-align")?.toLowerCase()??e.getAttribute("valign")?.toLowerCase();return s==="top"?i+='<w:vAlign w:val="top"/>':s==="middle"||s==="center"?i+='<w:vAlign w:val="center"/>':s==="bottom"&&(i+='<w:vAlign w:val="bottom"/>'),i}var x1=9360;function Cw(e,t,n,r,o,i){if(r.nodesLeft<=0){r.truncated=true;return}if(t>r.maxDepth)return;r.nodesLeft-=1;for(let P of Array.from(e.children))Ge(P)==="caption"&&i(Array.from(P.childNodes),t+1,n,r,o,true);let a=hw(e);if(a.length===0)return;let s=1,l=r.nodesLeft,d=[];for(let P of a){if(l<=0||s>=63)break;let O=d.map(A=>A?A.span:null);for(let A=0;A<d.length;A+=1){let q=d[A];q&&(q.remaining-=1,q.remaining<=0&&(d[A]=null));}let v=Array.from(P.children).filter(A=>/^t[dh]$/.test(Ge(A))),C=0,L=0;for(;L<63&&(l-=1,!(l<=0));){let A=L<O.length?O[L]:null;if(A!=null){L+=A;continue}let q=v[C];if(q===void 0)break;C+=1;let K=Math.min(qo(q,"colspan",63),63-L);for(let _=L+1;_<L+K;_+=1)if(_<O.length&&O[_]!=null){K=_-L;break}let E=qo(q,"rowspan",1e3);if(E>1){for(;d.length<=L;)d.push(null);d[L]={remaining:E-1,span:K};}L+=K;}for(let A=L;A<O.length&&A<63;A+=1){let q=O[A];q!=null&&(L=Math.max(L,A+q));}s=Math.max(s,L);}s=Math.min(Math.max(s,1),63);let c=yw(e,x1),u=c.twips,p=a.length>r.nodesLeft?a.slice(0,Math.max(1,r.nodesLeft)):a,m=xw(p,s,u),b=(ft(e).get("direction")??e.getAttribute("dir"))?.trim().toLowerCase()==="rtl",h=Rw(e,b),y=vw(e),S=bw(e)??(b?"left":void 0),x=S===void 0?"":`<w:jc w:val="${Kn(S,b)}"/>`,I=m.map(P=>`<w:gridCol w:w="${P}"/>`).join(""),R=new Array(s).fill(null),T=[];for(let P of a){if(r.nodesLeft<=0){r.truncated=true;break}r.nodesLeft-=1;let O=R.map(K=>K?K.span:null);for(let K=0;K<s;K+=1){let E=R[K];E&&(E.remaining-=1,E.remaining<=0&&(R[K]=null));}let v=Array.from(P.children).filter(K=>/^t[dh]$/.test(Ge(K))),C=0,L=[],A=0,q=true;for(;A<s;){if(r.nodesLeft-=1,r.nodesLeft<=0){r.truncated=true,q=false;break}let K=O[A];if(K!==null){let z=K>1?`<w:gridSpan w:val="${K}"/>`:"";L.push(`<w:tc><w:tcPr><w:tcW w:w="${rp(m,A,K)}" w:type="dxa"/>${z}<w:vMerge/></w:tcPr><w:p/></w:tc>`),A+=K;continue}let E=v[C];if(E===void 0){L.push(`<w:tc><w:tcPr><w:tcW w:w="${m[A]}" w:type="dxa"/></w:tcPr><w:p/></w:tc>`),A+=1;continue}C+=1;let _=Math.min(qo(E,"colspan",63),s-A);for(let z=A+1;z<A+_;z+=1)if(O[z]!==null){_=z-A;break}let X=qo(E,"rowspan",1e3);X>1&&(R[A]={remaining:X-1,span:_}),L.push(w1(E,_,rp(m,A,_),X>1,t,n,r,i,b)),A+=_;}if(!q)break;T.push(`<w:tr>${Pw(P)}${L.join("")}</w:tr>`);}T.length!==0&&(o.push(`<w:tbl><w:tblPr>${b?"<w:bidiVisual/>":""}${y}${c.xml}${x}${h}</w:tblPr><w:tblGrid>${I}</w:tblGrid>${T.join("")}</w:tbl>`),r.lastMarkCovered=false);}function w1(e,t,n,r,o,i,a,s,l){let d=Ge(e)==="th",c=`<w:tcW w:w="${n}" w:type="dxa"/>`;t>1&&(c+=`<w:gridSpan w:val="${t}"/>`),r&&(c+='<w:vMerge w:val="restart"/>'),c+=Tw(e,l);let u={run:d?{...i.run,bold:true}:i.run,para:d?{jc:"center"}:{},paragraphMarkCovered:false,pre:false,list:null,...i.noteBody?{noteBody:i.noteBody}:{},...i.rels?{rels:i.rels}:{}},p=[];return s(Array.from(e.childNodes),o+2,u,a,p,true),(p.length===0||p[p.length-1].endsWith("</w:tbl>"))&&p.push("<w:p/>"),`<w:tc><w:tcPr>${c}</w:tcPr>${p.join("")}</w:tc>`}function Ew(e){if(e===void 0)return "";let t=e.trim();return /^\d{1,4}$/.test(t)?"<w:tab/>".repeat(Math.min(Number.parseInt(t,10),64)):""}function Ow(e){let t=e.getAttribute("alignment")?.trim().toLowerCase(),n=e.getAttribute("relativeto")?.trim().toLowerCase(),r=e.getAttribute("leader")?.trim().toLowerCase();return t!=="left"&&t!=="center"&&t!=="right"||n!=="margin"&&n!=="indent"||r!=="none"&&r!=="dot"&&r!=="hyphen"&&r!=="underscore"&&r!=="middledot"?"":`<w:ptab w:alignment="${t}" w:relativeTo="${n}" w:leader="${r==="middledot"?"middleDot":r}"/>`}function Mw(e){if(Ge(e)!=="br")return false;let t=ft(e);return t.get("page-break-before")?.trim().toLowerCase()==="always"||t.get("break-before")?.trim().toLowerCase()==="page"}function Aw(e){if(Mw(e))return true;if(Ge(e)!=="span"||e.childNodes.length>8)return false;let t=false;for(let n=0;n<e.childNodes.length;n+=1){let r=e.childNodes[n];if(!(r.nodeType===3&&(r.nodeValue??"").trim().length===0)){if(r.nodeType!==1||t||!Mw(r))return false;t=true;}}return t}function Fw(e){if(Ge(e)!=="p")return false;let t=null;for(let o=0;o<e.childNodes.length;o+=1){let i=e.childNodes[o];if(i.nodeType===3){if((i.nodeValue??"").replace(/[\s\u00a0]/g,"").length===0)continue;return false}if(i.nodeType!==1||t!==null)return false;t=i;}if(t===null)return false;let n=ft(e);for(let o of n.keys())if(o==="background"||o==="background-color"||o.startsWith("border"))return false;if(Ge(t)!=="o:p"||t.childNodes.length>3)return false;let r="";for(let o=0;o<t.childNodes.length;o+=1){let i=t.childNodes[o];if(i.nodeType!==3)return false;r+=i.nodeValue??"";}return r.includes("\xA0")&&r.replace(/[\s\u00a0]/g,"").length===0}function op(e){let t=0,n=e.parentElement;for(;n!==null&&t<256;)t+=1,n=n.parentElement;return t}var ip=new Set("script style head template iframe object embed noscript svg math meta link title base select textarea hr w:sdtpr".split(" ")),ap=new Set("p div h1 h2 h3 h4 h5 h6 li blockquote pre".split(" ")),sp=new Set("thead tbody tfoot tr section article main header footer aside nav figure form body html".split(" ")),S1=new Set([...ap,...sp,"table","ol","ul","w:sdt"]);function lp(e){for(let t=0;t<e.children.length;t+=1)if(S1.has(Ge(e.children[t])))return true;return false}var I1=new Set(["p","div","table","ol","ul","section","article","main","h1","h2","h3","h4","h5","h6"]);function Lw(e){if(Ge(e)!=="w:sdt")return null;let t=[e],n=0;for(let r=0;r<t.length&&n<64;r+=1){let o=t[r];for(let i=0;i<o.children.length&&n<64;i+=1){let a=o.children[i];n+=1;let s=Ge(a);if(I1.has(s))return Array.from(e.childNodes);s!=="w:sdtpr"&&t.push(a);}}return null}var k1=4*1024*1024,R1=1e5,P1=64,T1=2*1024*1024,Nw="http://schemas.openxmlformats.org/officeDocument/2006/relationships";function dp(e,t,n,r,o=e.rels){let i=`rId${o.length+1}`;return o.push({id:i,type:t,target:n,external:r}),i}function md(e,t,n,r,o){if(o.nodesLeft<=0){o.truncated=true;return}if(t>o.maxDepth)return;if(o.nodesLeft-=1,e.nodeType===3){let b=e.nodeValue??"";if(n.pre){let y=b.replace(/\r\n?/g,`
|
|
4
|
+
`).split(`
|
|
5
|
+
`);for(let S=0;S<y.length;S+=1){if(S>0){if(o.nodesLeft-=1,o.nodesLeft<=0){o.truncated=true;return}r.push(`<w:r>${rr(n.run)}<w:br/></w:r>`);}let x=y[S];x.length>0&&r.push(cd(x,n.run));}return}let h=b.replace(/[ \t\r\n\f\v]+/g," ");if(h.length===0||h===" "&&Qf(r))return;r.push(cd(h,n.run));return}if(!Li(e))return;let i=o.equations.get(e);if(i!==void 0){for(let b of i)r.push(b);return}let a=Ge(e);if(ip.has(a))return;let s=ft(e);if(dd(e)&&n.para.numPr!==void 0||s.get("mso-element")?.trim().toLowerCase()==="comment-reference"||s.get("mso-special-character")?.trim().toLowerCase()==="comment"||e.classList.contains("msocomanchor")||o.definedNoteElements.has(e))return;if(a==="w:ptab"){let b=Ow(e);b.length>0&&r.push(`<w:r>${rr(n.run)}${b}</w:r>`);return}let d=Ew(s.get("mso-tab-count"));if(d.length>0){if(o.nodesLeft-=d.split("<w:tab/>").length-2,o.nodesLeft<=0){o.truncated=true;return}let b=jf(ds(n.run,a),s);if(r.push(`<w:r>${rr(b)}${d}</w:r>`),(e.textContent??"").trim().length===0&&e.children.length===0)return}if(a==="br"){let b=s.get("page-break-before")?.trim().toLowerCase()==="always"||s.get("break-before")?.trim().toLowerCase()==="page";r.push(`<w:r>${rr(n.run)}${b?'<w:br w:type="page"/>':"<w:br/>"}</w:r>`);return}if(a==="img"){Ox(e,r,o,b=>dp(o,`${Nw}/image`,b,false,n.rels??o.rels));return}let c=ds(n.run,a),u=a==="a"?e.getAttribute("href"):null,p=a==="a"?Zf(s):null;p===null&&$x(u)&&(c={...c,rStyle:"Hyperlink"});let m=Ho(c,e),g={...n,run:m,pre:n.pre||a==="pre"};if(p!==null){let b={...g.run,vertAlign:"superscript"};if(n.noteBody!==void 0&&n.noteBody.kind===p.kind&&n.noteBody.id===p.id){let h=p.kind==="footnote"?"footnoteRef":"endnoteRef";r.push(`<w:r>${rr(b)}<w:${h}/></w:r>`);return}if(o.definedNotes[p.kind].has(p.id)){let h=p.kind==="footnote"?"footnoteReference":"endnoteReference";r.push(`<w:r>${rr(b)}<w:${h} w:id="${p.id}"/></w:r>`);let y=(e.textContent??"").replace(/[ \t\r\n\f\v]+/g," ").trim(),S=`${p.kind}:${p.id}`;if(y.length>0&&!o.noteMarkFallbacks.has(S)&&o.noteMarkFallbacks.set(S,cd(y,b)),n.noteBody===void 0)o.bodyNoteRefs[p.kind].add(p.id);else {let x=`${n.noteBody.kind}:${n.noteBody.id}`,I=o.noteNoteRefs.get(x)??[];I.push({kind:p.kind,id:p.id}),o.noteNoteRefs.set(x,I);}return}for(let h of Array.from(e.childNodes))md(h,t+1,g,r,o);return}if(a==="a"){let b=e.getAttribute("href"),h=qn(e.getAttribute("name")||e.getAttribute("id")),y=[];for(let I of Array.from(e.childNodes))md(I,t+1,g,y,o);let S=b?.startsWith("#")?qn(b.slice(1)):null,x=y.join("");if(S!==null)x=`<w:hyperlink w:anchor="${chunkOSFOJTHU_cjs.S(S)}">${x}</w:hyperlink>`;else if(b!==null&&!b.startsWith("#")){let I=chunkOSFOJTHU_cjs.Q(b);I.ok&&I.href.length>0&&(x=`<w:hyperlink r:id="${dp(o,`${Nw}/hyperlink`,I.href,true,n.rels??o.rels)}">${x}</w:hyperlink>`);}if(h!==null){let I=String(o.nextBookmarkId++);x=`<w:bookmarkStart w:id="${I}" w:name="${chunkOSFOJTHU_cjs.S(h)}"/>${x}<w:bookmarkEnd w:id="${I}"/>`;}x.length>0&&r.push(x);return}for(let b of Array.from(e.childNodes))md(b,t+1,g,r,o);}function Dw(e,t,n,r){let o=Ge(e),i=ft(e),a={};r&&(a.pageBreakBefore=true);let s=Ix(e,n.wordHtml);s!==void 0&&(a.styleId=s),t.para.numPr&&(a.numPr=t.para.numPr),t.para.jc&&(a.jc=t.para.jc),t.para.bidi&&(a.bidi=true);let l={...t.run},d=Qx[o];d!==void 0&&s===void 0&&!e.classList.contains("docx-outline")&&(l.bold=true,l.szHalfPoints=d);let c=t.pre||o==="pre";o==="pre"&&(l.font="Courier New");let u=Ux(e,i,n,t.noteBody);return u&&(a.numPr=u),Tx(a,e,n.classAlignments),Cx(a,i),l=Ho(l,e),e.getAttribute("dir")?.trim().toLowerCase()==="rtl"&&(a.bidi=true),{run:l,para:a,paragraphMarkCovered:a.styleId!==void 0||a.numPr!==void 0,pre:c,list:t.list,...t.noteBody?{noteBody:t.noteBody}:{},...t.rels?{rels:t.rels}:{}}}function Hw(e,t,n,r,o,i=false){if(r.nodesLeft<=0){r.truncated=true;return}if(t>r.maxDepth)return;let a=Dw(e,n,r,i);to(Array.from(e.childNodes),t+1,a,r,o,true,void 0,false);}function _w(e,t,n,r,o,i=false){if(r.nodesLeft<=0){r.truncated=true;return}if(t>r.maxDepth)return;r.nodesLeft-=1;let a=_x(e);n.list||(r.semanticListCount+=1);let s=n.list?{numId:n.list.numId,level:Math.min(n.list.level+1,8)}:{numId:Uf(r,`sem:${r.semanticListCount}`,a,Wf(e)),level:0};if(n.list){let c=r.listsByNumId.get(s.numId);c!==void 0&&!c.levels.has(s.level)&&c.levels.set(s.level,{kind:a,start:Wf(e)});}let l={...n,list:s,para:{numPr:{numId:s.numId,ilvl:s.level}}},d=i;for(let c of Array.from(e.childNodes)){if(r.nodesLeft<=0){r.truncated=true;break}if(!Li(c))continue;let u=Ge(c);if(u==="li")r.nodesLeft-=1,Hw(c,t+1,l,r,o,d),d=false;else if(u==="ol"||u==="ul"){let p=o.length;_w(c,t+1,{...n,list:s},r,o,d),o.length>p&&(d=false);}}}function to(e,t,n,r,o,i=false,a,s=true){if(t>r.maxDepth)return;let l=o.length,d=a===void 0,c=[],u=[],p=n.para,m=a??{pending:false,skipSpacer:false},g=()=>({...p,pageBreakBefore:void 0,numPr:void 0}),b=()=>{if(c.length===0)return;if(!c.some(y=>y.includes("<w:r")||np(y))){if(o.length===l){u=u.concat(c),c=[];return}let y=o[o.length-1];y?.endsWith("</w:p>")?(o[o.length-1]=`${y.slice(0,-6)}${c.join("")}</w:p>`,c=[]):y!==void 0&&c.length>0&&(o.push(_o(g(),c)),c=[],r.lastMarkCovered=false);return}let h=m.pending?{...p,pageBreakBefore:true}:p;o.push(_o(h,c)),p.pageBreakBefore&&(p={...p,pageBreakBefore:void 0}),m.pending=false,m.skipSpacer=false,r.lastMarkCovered=n.paragraphMarkCovered,c=[];};for(let h of e){if(r.nodesLeft<=0){r.truncated=true;break}if(Li(h)){let y=Ge(h),S=y==="w:sdt"?Lw(h):null;if(s&&Aw(h)){b(),r.nodesLeft-=1,m.pending&&ud(o),m.pending=true,m.skipSpacer=true;continue}if(ip.has(y)&&!r.equations.has(h)){r.nodesLeft-=1;continue}let x=ft(h);if(x.get("mso-element")?.trim().toLowerCase()==="comment-list"){r.nodesLeft-=1;continue}if(Zx(x)){b(),r.nodesLeft-=1,to(Array.from(h.childNodes),t+1,n,r,o,false,m,s);continue}if(r.definedNoteElements.has(h)){r.nodesLeft-=1;continue}if(ap.has(y)){if(b(),r.nodesLeft-=1,m.pending&&m.skipSpacer&&Fw(h)){m.skipSpacer=false;continue}if(y==="div"&&lp(h)){let R=Dw(h,n,r,false);R.para.pageBreakBefore&&(m.pending=true),to(Array.from(h.childNodes),t+1,R,r,o,false,m,s);continue}let I=o.length;Hw(h,t,n,r,o,m.pending),o.length>I&&(m.pending=false,m.skipSpacer=false);continue}if(y==="ol"||y==="ul"){b();let I=o.length;_w(h,t,n,r,o,m.pending),o.length>I&&(m.pending=false,m.skipSpacer=false);continue}if(y==="table"){b(),m.pending&&ud(o),C1(h,t,n,r,o),m.pending=false,m.skipSpacer=false;continue}if(sp.has(y)||S!==null||y==="span"&&lp(h)){b(),r.nodesLeft-=1,to(S??Array.from(h.childNodes),t+1,n,r,o,false,m,s);continue}}if(h.nodeType===3&&/^[\s\u00a0]+$/.test(h.nodeValue??"")&&Qf(c)){r.nodesLeft-=1;continue}md(h,t,n,c,r);}if(i&&o.length===l&&c.length>0&&!c.some(h=>h.includes("<w:r")||np(h))&&(o.push(_o(p,c)),c=[],r.lastMarkCovered=n.paragraphMarkCovered),b(),u.length>0){let h=o[l];h!==void 0&&h.startsWith("<w:p>")?o[l]=h.replace(/^(<w:p>(?:<w:pPr>(?:(?!<\/w:pPr>)[\s\S])*?<\/w:pPr>)?)/,`$1${u.join("")}`):h!==void 0?o.splice(l,0,_o(g(),u)):c=u.concat(c),u=[];}c.length>0&&(o.push(_o(g(),c)),c=[],r.lastMarkCovered=false),d&&m.pending&&(ud(o),m.pending=false,m.skipSpacer=false,r.lastMarkCovered=false),i&&o.length===l&&(o.push(_o(p,c)),c=[],r.lastMarkCovered=n.paragraphMarkCovered);}function C1(e,t,n,r,o){Cw(e,t,n,r,o,to);}function E1(e,t){return Xx({blocks:t,rels:e.rels,lists:[...e.lists.values()],notes:e.notes,noteRels:e.noteRels,media:e.media,mediaExtensions:e.mediaExtensions})}function O1(e,t){let n=t.maxHtmlBytes??k1;if(e.length>n)return {ok:false,reason:"too-large"};if(e.length*3>n&&new TextEncoder().encode(e).byteLength>n)return {ok:false,reason:"too-large"};if(typeof DOMParser>"u")return {ok:false,reason:"parse-unavailable"};let r;try{r=new DOMParser().parseFromString(e,"text/html");}catch{return {ok:false,reason:"parse-unavailable"}}let o=r.body;if(!o)return {ok:false,reason:"no-content"};let i=t.maxNodes??R1,a=dw(e)?mw(r,i):null,s=jx(r),l={footnote:new Set,endnote:new Set},d=new Set,c={footnote:new Set,endnote:new Set};Wx(r,s,c);let u={nodesLeft:i-(a?.visited??0),maxDepth:t.maxDepth??P1,maxImageBytes:t.maxImageBytes??T1,wordHtml:Sx(e),truncated:false,lastMarkCovered:false,rels:[],media:new Map,mediaExtensions:new Map,mediaBySrc:new Map,lists:new Map,listsByNumId:new Map,semanticListCount:0,imageCount:0,docPrId:0,nextBookmarkId:1,classAlignments:Rx(r),listDefinitions:Lx(Px(r)),notes:{footnote:new Map,endnote:new Map},noteRels:{footnote:[],endnote:[]},definedNotes:l,bodyNoteRefs:{footnote:new Set,endnote:new Set},noteNoteRefs:new Map,noteMarkFallbacks:new Map,definedNoteElements:d,equations:a?.byElement??new Map},p={};p=Ho(p,r.documentElement),p=Ho(p,o);let m={run:p,para:p.rtl?{bidi:true}:{},paragraphMarkCovered:false,pre:false,list:null},g=[];for(let x of s)c[x.kind].has(x.id)&&(l[x.kind].has(x.id)||(l[x.kind].add(x.id),d.add(x.element),g.push(x)));g.sort((x,I)=>op(I.element)-op(x.element)),u.lastMarkCovered=false;let b=[];to(Array.from(o.childNodes),0,m,u,b);let h=u.lastMarkCovered,y=u.truncated,S=false;for(let x=0;x<g.length;x+=1){let I=g[x];u.truncated=false;let R=u.nodesLeft,T=[];if(to(Array.from(I.element.childNodes),0,{...m,noteBody:{kind:I.kind,id:I.id},rels:u.noteRels[I.kind]},u,T,true),u.truncated||T.length===0){S=true;let P=new Set;for(let O=x;O<g.length;O+=1){let v=g[O];l[v.kind].delete(v.id),d.delete(v.element),u.notes[v.kind].delete(v.id),u.bodyNoteRefs[v.kind].delete(v.id),P.add(`${v.kind}:${v.id}`);}if(P.size>0){for(let O=0;O<b.length;O+=1)b[O]=Ni(b[O],P,u.noteMarkFallbacks);for(let O of ["footnote","endnote"])for(let[v,C]of u.notes[O])u.notes[O].set(v,C.map(L=>Ni(L,P,u.noteMarkFallbacks)));}u.nodesLeft=R;for(let O=x;O<g.length&&u.nodesLeft>0;O+=1)to(Array.from(g[O].element.childNodes),0,m,u,b);break}u.notes[I.kind].set(I.id,T);}return u.truncated=y||S,u.lastMarkCovered=h,zx(u,l,b,dp),b.length===0?{ok:false,reason:"no-content"}:{ok:true,projection:u,blocks:b}}var M1=Kx();function Bw(e,t){let n=`${t.maxHtmlBytes??""}:${t.maxNodes??""}:${t.maxDepth??""}:${t.maxImageBytes??""}`;return M1(e,n,()=>O1(e,t))}function $w(e,t={}){let n=Bw(e,t);return n.ok?{ok:true,fragmentBytes:E1(n.projection,n.blocks),lastMarkCovered:n.projection.lastMarkCovered,imageCount:n.projection.imageCount,truncated:n.projection.truncated}:n}function qw(e,t={}){let n=Bw(e,t);return n.ok?{lands:true,imageCount:n.projection.imageCount,truncated:n.projection.truncated}:{lands:false,imageCount:0,truncated:false}}var A1={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:"\xA0"};function Kw(e){return e.replace(/&(#x[0-9a-fA-F]+|#\d+|[a-zA-Z]+);/g,(t,n)=>{if(n.startsWith("#")){let r=n.startsWith("#x")?Number.parseInt(n.slice(2),16):Number.parseInt(n.slice(1),10);return !Number.isFinite(r)||r<0||r>1114111||r>=55296&&r<=57343?t:String.fromCodePoint(r)}return A1[n.toLowerCase()]??t})}var F1=new Set(["script","style","title","template"]),L1=new Set(["p","div","li","tr","h1","h2","h3","h4","h5","h6","blockquote","section","article","pre","table"]),N1=new Set(["td","th"]),Vw=e=>e!==void 0&&(e>="a"&&e<="z"||e>="A"&&e<="Z"),D1=e=>Vw(e)||e!==void 0&&e>="0"&&e<="9",jw=e=>e===" "||e===" "||e===`
|
|
6
|
+
`||e==="\r"||e==="\f";function H1(e,t){let n=t+1,r=e[n]==="/";if(r&&(n+=1),!Vw(e[n]))return null;let o=n;for(;n<e.length&&D1(e[n]);)n+=1;let i=e.slice(o,n).toLowerCase(),a="",s=false;for(;n<e.length;){let l=e[n];if(a!=="")l===a&&(a="");else if(l==="=")s=true;else if(s&&(l==='"'||l==="'"))a=l,s=false;else {if(l===">")return {name:i,closing:r,end:n+1};jw(l)||(s=false);}n+=1;}return {name:i,closing:r,end:e.length}}function _1(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===9;)t-=1;return t===e.length?e:e.slice(0,t)}function B1(e,t,n){for(let r=n;r<e.length;){let o=e.indexOf("</",r);if(o===-1)return e.length;let i=o+2;if(e.slice(i,i+t.length).toLowerCase()===t){for(i+=t.length;i<e.length&&jw(e[i]);)i+=1;if(e[i]===">")return i+1}r=o+2;}return e.length}function*Ww(e){let t=0;for(;t<e.length;){let n=e.indexOf("<",t);if(n===-1){yield e.slice(t);break}if(n>t&&(yield e.slice(t,n)),e.startsWith("<!--",n)){if(e[n+4]===">"){t=n+5;continue}if(e[n+4]==="-"&&e[n+5]===">"){t=n+6;continue}let o=e.indexOf("-->",n+4);t=o===-1?e.length:o+3;continue}if(e[n+1]==="!"||e[n+1]==="?"){let o=e.indexOf(">",n+1);t=o===-1?e.length:o+1;continue}let r=H1(e,n);if(r===null){yield "<",t=n+1;continue}t=r.end,!r.closing&&F1.has(r.name)?t=B1(e,r.name,r.end):!r.closing&&r.name==="br"?yield `
|
|
7
|
+
`:r.closing&&N1.has(r.name)?yield " ":r.closing&&L1.has(r.name)&&(yield `
|
|
8
|
+
`);}}function $1(e){let t=e.length>2e6?e.slice(0,2e6):e,n="";for(let r of Ww(t))n+=r;return Kw(n).replace(/\r\n?/g,`
|
|
9
|
+
`).split(`
|
|
10
|
+
`).map(_1).join(`
|
|
11
|
+
`).replace(/\n{3,}/g,`
|
|
12
|
+
|
|
13
|
+
`).trim()}function Zw(e){let t="";for(let n=0;n<e.length;n+=1){let r=e.charCodeAt(n);if(r===12){t+=`
|
|
14
|
+
`;continue}if(r===13){t+=`
|
|
15
|
+
`,e.charCodeAt(n+1)===10&&(n+=1);continue}if(r===9||r===10){t+=e[n];continue}if(!(r<32||r===65534||r===65535)){if(r>=55296&&r<=56319){let o=e.charCodeAt(n+1);o>=56320&&o<=57343&&(t+=e[n]+e[n+1],n+=1);continue}r>=56320&&r<=57343||(t+=e[n]);}}return t}var zw=/[^\s\u200B-\u200F\u2060\u2066-\u2069\u061C\uFEFF\u00AD]/;function Uw(e){return zw.test(e)}function cp(e){let t=e.length>2e6?e.slice(0,2e6):e;for(let n of Ww(t)){let r=n.includes("&")?Kw(n):n;if(zw.test(r))return true}return false}function up(e){if(!e)return "";let t=e.getData("text/plain");if(t.length>0)return t;let n=e.getData("text/html");return n.length>0?$1(n):""}function fp(e,t){if(typeof e.getData!="function")return "";try{return e.getData(t)??""}catch{return ""}}function q1(e){if(!e)return false;if(Uw(fp(e,"text/plain")))return true;let t=fp(e,"text/html");if(t.length===0)return false;if(cp(t))return true;let n=Fi(t);return n!==null&&n.bytes[0]===80&&n.bytes[1]===75?true:qw(t).imageCount>0}function K1(e){return e?cp(fp(e,"text/html")):false}var V1=Object.freeze({kind:"body"});function Me(e,t){let n=t?.indexOf("#")??-1;if(n===-1)return null;let r=t.slice(0,n);return r.length===0?null:e.currentPackage().parts.get(r)??null}function Rt(e,t,n){let r=t?.indexOf("#")??-1,o=r===-1?"":t.slice(0,r);if(o.length===0||o===e.part().name)return {kind:"body"};for(let i of e.headerFooterResolutionBySection())for(let a of [i.headers,i.footers])for(let s of a.values())if(s.partName===o)return {kind:"headerFooter",rId:s.rId};for(let i of ["footnote","endnote"])if(e.partFor({kind:"notesPart",noteKind:i})?.name===o)return {kind:"notesPart",noteKind:i};return n}function gd(e,t){if(e)return {kind:"headerFooter",rId:e.scope.rId};if(t){let n=chunkOSFOJTHU_cjs.pc(t.id);if(n)return {kind:"notesPart",noteKind:n.noteKind}}return {kind:"body"}}function Xw(e,t){return e?e.scope:t||V1}function j1(e,t,n){if(n){let o=[];for(let i of [e.footnotes,e.endnotes])if(i)for(let a of i.notes)a.scopeId===n&&o.push(...Gw(a.fragments));return o}if(!t)return chunkDOHF6FA7_cjs.xa(e);let r=Di(e,t);return r?Gw(r.fragments):[]}function Di(e,t){let n=t.kind==="header"?e.header:e.footer;if(n&&(n.rId&&n.rId===t.scope.rId||!n.rId&&n.partName===t.partName))return n}function Yw(e,t){for(let n of e.pages)for(let r of ["header","footer"]){let o=n[r];if(o?.rId===t)return {pageIndex:n.index,kind:r,story:o}}return null}function hd(e,t){return !!(e.rId&&e.rId===t.scope.rId||!e.rId&&e.partName===t.partName&&e.kind===t.kind)}function pp(e,t,n){let r=chunkDOHF6FA7_cjs.Xd(e,t.y),o=e.pages[r];if(!o)return false;let i=t.x-n(r),a=t.y,s=o.contentBox;return i>=s.x&&i<s.x+s.width&&a>=s.y&&a<s.y+s.height}function mp(e,t,n,r,o={}){return chunkDOHF6FA7_cjs.$d(e,t,n.fragments,r,o)}function W1(e,t,n){let r=e.pages[t.pageIndex]??e.pages[0];if(!r)return null;let o=Di(r,t);return o?chunkDOHF6FA7_cjs.me(e,t.pageIndex,o.fragments,n):null}function Z1(e,t,n){let r=[];for(let o of e.pages)for(let i of [o.footnotes,o.endnotes]){let a=i?.notes.find(s=>s.scopeId===t);a&&r.push(...chunkDOHF6FA7_cjs.me(e,o.index,a.fragments,n));}return r.length>0?r:null}function Qw(e,t){return e.querySelector(`[data-page-index="${t}"] > [data-docx-hf-active]`)??e.querySelector("[data-docx-hf-active]")}function Jw(e,t,n){let r=e.querySelectorAll("[data-docx-note-scope]"),o=null;for(let i of r){if(i.dataset.docxNoteScope!==t||!i.matches("[data-docx-note]"))continue;o??=i;let a=Number(i.closest("[data-page-index]")?.dataset.pageIndex);if(n!==null&&a===n)return i}return o}function eS(e,t,n){if((i=>{let a=e.pages[i];return !!a&&!!Di(a,t)})(t.pageIndex)&&(n===void 0||n.has(t.pageIndex)))return t.pageIndex;let o=null;for(let i of e.pages)if(Di(i,t)&&(o===null&&(o=i.index),n===void 0||n.has(i.index)))return i.index;return o??t.pageIndex}function tS(e){return e?{rId:e.scope.rId,pageIndex:e.pageIndex,kind:e.kind,partName:e.partName,variant:e.variant}:null}function nS(e,t,n){e.classList.toggle("docx-paginated-surface--hf-editing",n),t.classList.toggle("docx-pages--hf-editing",n);}function gp(e,t){e.classList.toggle("docx-paginated-surface--viewing",t==="view");}function hp(e,t,n,r,o,i,a,s){let l=o?W1(e,o,a):i?Z1(e,i,a):null,d=chunkDOHF6FA7_cjs.re(e,t,n,r,{...a?{measurer:a}:{},...l?{stops:l}:{},...s!==void 0?{lineId:s}:{}});if(!d)return null;let u=(l?.find(m=>m.position.paragraphId===d.position.paragraphId&&m.position.offset===d.position.offset&&(d.lineId===void 0||m.lineId===d.lineId))??l?.find(m=>m.position.paragraphId===d.position.paragraphId&&m.position.offset===d.position.offset))?.pageIndex,p=d.lineId===void 0?null:chunkDOHF6FA7_cjs.ne(e,d.position,{...a?{measurer:a}:{},...u!==void 0?{preferredPageIndex:u}:{},preferredLineId:d.lineId});return {position:d.position,desiredX:d.desiredX,...u!==void 0?{pageIndex:u}:{},...p?{caret:p}:{}}}function yd(e,t,n){for(let r of e.pages){let o=n(r.index);for(let i of [r.footnotes,r.endnotes])if(i)for(let a of i.notes){let s=a.box,l=s.x+o,d=s.y;if(t.x>=l&&t.x<l+s.width&&t.y>=d&&t.y<d+s.height)return {pageIndex:r.index,scopeId:a.scopeId,noteKind:a.noteKind,noteId:a.noteId,local:{x:t.x-l,y:t.y-d},fragments:a.fragments}}}return null}function rS(e,t){let n=e[t],r=e.contentBox,o=e.box;if(t==="header"){let d=o.y,c=r.y,u=n?Math.max(c,n.box.y+n.box.height):c,p=n?Math.min(d,n.box.y):d;return u<=p?null:{x:r.x,y:p,width:r.width,height:u-p}}let i=r.y+r.height,a=o.y+o.height,s=n?Math.min(i,n.box.y):i,l=n?Math.max(a,n.box.y+n.box.height):a;return l<=s?null:{x:r.x,y:s,width:r.width,height:l-s}}function yp(e,t,n){for(let r of e.pages){if(r.parityBlank)continue;let o=n(r.index);for(let i of ["header","footer"]){if(r[i])continue;let a=rS(r,i);if(!a)continue;let s=a.x+o;if(t.x>=s&&t.x<s+a.width&&t.y>=a.y&&t.y<a.y+a.height)return {pageIndex:r.index,kind:i}}}return null}function bp(e,t,n){for(let r of e.pages){let o=n(r.index);for(let i of ["header","footer"]){let a=r[i];if(!a)continue;let s=a.box,l=rS(r,i)??s,d=l.x+o,c=l.y;if(t.x>=d&&t.x<d+l.width&&t.y>=c&&t.y<c+l.height)return {pageIndex:r.index,kind:i,story:a,local:{x:t.x-(s.x+o),y:t.y-s.y}}}}return null}function oS(e,t,n,r,o,i){let a=e.pages[t.pageIndex];if(!a)return false;let s=a.contentBox,l=n.x-r(a.index)-s.x,d=n.y-s.y;if(l<0||l>=s.width||d<0||d>=s.height)return false;let c=i?{measurer:i}:{},{story:u,local:p}=t,m=chunkDOHF6FA7_cjs.Zd(u.anchoredDrawings,p,a.index)!==null||chunkDOHF6FA7_cjs.$d(e,a.index,u.fragments,p,c)?.onGlyphs===true;if(o&&m)return false;let g=chunkDOHF6FA7_cjs._d(e,a.index,{x:l,y:d},c),b=yd(e,n,r),h=g?.onGlyphs===true&&g.pageIndex===a.index||b?.pageIndex===a.index&&chunkDOHF6FA7_cjs.$d(e,a.index,b.fragments,b.local,c)?.onGlyphs===true;return o?h:h||!m}function Hi(e,t,n){if(!t&&!n)return chunkDOHF6FA7_cjs.Ra(e);let r=new Set,o=[];for(let i of e.pages)for(let a of j1(i,t,n)){for(let s of a.lines)for(let l of chunkDOHF6FA7_cjs.Ma(s))r.has(l.paragraphId)||(r.add(l.paragraphId),o.push(l.paragraphId));a.lines.length===0&&!r.has(a.paragraphId)&&(r.add(a.paragraphId),o.push(a.paragraphId));}return o}function bd(e,t,n,r){let o=Hi(e,n,r);if(o.length===0)return t;let i=new Set(o),a=s=>i.has(s.paragraphId)?s:{paragraphId:o[0],offset:0};return {anchor:a(t.anchor),head:a(t.head)}}function Gw(e){let t=[],n=r=>{for(let o of r){if(o.kind==="paragraph"){t.push(o);continue}for(let i of o.rows)if(!i.isHeaderRepeat)for(let a of i.cells)n(a.blocks);}};return n(e),t}function iS(e){return e.family.trim().length===0?"font family must not be empty":!Number.isInteger(e.weight)||e.weight<1||e.weight>1e3?"font weight must be an integer from 1 through 1000":e.style!=="normal"&&e.style!=="italic"?"font style must be normal or italic":null}function z1(e){try{return typeof caches>"u"?Promise.resolve(null):caches.open(e).catch(()=>null)}catch{return Promise.resolve(null)}}async function U1(e,t){if(!e)return null;try{let n=await e.match(t);return n?new Uint8Array(await n.arrayBuffer()):null}catch{return null}}async function G1(e,t,n){if(e)try{await e.put(t,new Response(n.slice(),{headers:{"Content-Length":String(n.byteLength)}}));}catch{}}async function X1(e,t){if(e)try{await e.delete(t);}catch{}}async function vp(e){let t=()=>{if(e.signal?.aborted)throw e.signal.reason};t();let n=e.fetcher??fetch,r=e.maxFontBytes??chunkDOHF6FA7_cjs.a,o=await z1(e.cacheName??"docx-editor-fonts");t();async function i(d){t();let c=Object.freeze({family:d.family,weight:d.weight,style:d.style}),u=iS(c);if(u)return {failure:{url:d.url,request:c,reason:"invalidRequest",diagnostic:u}};let p=(y,S)=>{if(y.byteLength===0)return {url:d.url,request:c,reason:"emptyResponse"};if(y.byteLength>r)return {url:d.url,request:c,reason:"overLimit"};let x=chunkDOHF6FA7_cjs.l(y,d.faceIndex??0);if(!x.valid)return {url:d.url,request:c,reason:"malformed",diagnostic:x.diagnostic};let I=chunkOSFOJTHU_cjs.f(y);return d.hash!==void 0&&d.hash!==I?{url:d.url,request:c,reason:"hashMismatch",expectedHash:d.hash,actualHash:I,...S?{diagnostic:"cached bytes failed revalidation"}:{}}:{request:c,id:`url:${d.url}`,bytes:y,hash:I,faceIndex:d.faceIndex??0}},m=await U1(o,d.url);if(t(),m){let y=p(m,true);if(!("reason"in y))return {source:y};await X1(o,d.url),t();}let g;try{g=e.signal?await n(d.url,{signal:e.signal}):await n(d.url),t();}catch(y){return t(),{failure:{url:d.url,request:c,reason:"networkError",diagnostic:y instanceof Error?y.message:String(y)}}}if(!g.ok)return {failure:{url:d.url,request:c,reason:"httpError",status:g.status}};let b;try{b=new Uint8Array(await g.arrayBuffer()),t();}catch(y){return t(),{failure:{url:d.url,request:c,reason:"networkError",diagnostic:y instanceof Error?y.message:String(y)}}}let h=p(b,false);return "reason"in h?{failure:h}:(await G1(o,d.url,b),t(),{source:h})}let a=await Promise.all(e.sources.map(d=>i(d)));t();let s=[],l=[];for(let d of a)"source"in d?s.push(d.source):l.push(d.failure);return {sources:s,failures:l}}function Y1(e,t,n={}){let r=Object.freeze({family:t.family,weight:t.weight,style:t.style}),o=n.id??`bytes:${r.family}#${r.weight}#${r.style}`,i=iS(r);if(i)return {failure:{url:o,request:r,reason:"invalidRequest",diagnostic:i}};if(e.byteLength===0)return {failure:{url:o,request:r,reason:"emptyResponse"}};if(e.byteLength>(n.maxFontBytes??chunkDOHF6FA7_cjs.a))return {failure:{url:o,request:r,reason:"overLimit"}};let a=t.faceIndex??0,s=chunkDOHF6FA7_cjs.l(e,a);return s.valid?{source:{request:r,id:o,bytes:e,hash:chunkOSFOJTHU_cjs.f(e),faceIndex:a}}:{failure:{url:o,request:r,reason:"malformed",diagnostic:s.diagnostic}}}var Q1=e=>e.trim().toLowerCase(),aS=e=>JSON.stringify([Q1(e.family),e.weight,e.style]);function J1(e){return chunkJLVBDYVQ_cjs.j(async t=>{if(t.signal?.aborted)throw t.signal.reason;let n=new Set((t.resolvedFaces??[]).map(aS)),r=e.sources.filter(s=>!n.has(aS(s)));if(r.length===0)return {sources:[],failures:[]};let{onFailure:o,...i}=e,a=await vp({...i,sources:r,signal:t.signal});if(t.signal?.aborted)throw t.signal.reason;for(let s of a.failures)o?o(s):console.warn(`[fonts] ${s.request.family} (${s.url}): ${s.reason}`);return a})}var eL=96,sS=37.79527559055118;function tL(e,t){if(!Number.isFinite(e)||e<=0)return [];let n=[];if(t==="inch"){let a=Math.floor(e/12);for(let s=0;s<=a;s+=1){let l=s*12;if(s%8===0){let d=s/8;n.push({position:l,height:10,...d>0?{label:String(d)}:{}});}else s%4===0?n.push({position:l,height:6}):s%2===0?n.push({position:l,height:4}):n.push({position:l,height:2});}return n}let r=sS/10,o=Math.floor(e/r);for(let i=0;i<=o;i+=1){let a=i*r;if(i%10===0){let s=i/10;n.push({position:a,height:10,...s>0?{label:String(s)}:{}});}else i%5===0?n.push({position:a,height:6}):n.push({position:a,height:3});}return n}function nL(e){let t=[...e].sort((n,r)=>n.index-r.index)[0];return t?t.box:null}var rL=1440,oL=567,iL=180,aL=56.7,lS=e=>({pageWidth:e.pageWidth,leftMargin:e.rightMargin,rightMargin:e.leftMargin}),vd=(e,t,n)=>n<t||e<t?t:e>n?n:e;function dS(e,t,n){if(t.rtl)return n.pageWidth-dS(e,{...t,rtl:false},lS(n));switch(e){case "firstLine":return n.leftMargin+t.left+t.firstLine;case "hanging":case "left":return n.leftMargin+t.left;case "right":return n.pageWidth-n.rightMargin-t.right}}function cS(e,t,n){if(n)return Math.round(e);let r=t==="cm"?56.7:180;return Math.round(Math.round(e/r)*r)}function uS(e,t,n,r,o={}){if(n.rtl)return {...uS(e,r.pageWidth-t,{...n,rtl:false},lS(r),o),rtl:true};let i=cS(t,o.unit??"inch",o.precise??false),a=r.pageWidth-r.rightMargin-n.right,s=r.leftMargin+n.left+Math.max(0,n.firstLine);switch(e){case "firstLine":{let l=vd(i,0,a);return {...n,firstLine:l-r.leftMargin-n.left}}case "left":{let l=-r.leftMargin-Math.min(0,n.firstLine),d=a-r.leftMargin-Math.max(0,n.firstLine);return {...n,left:vd(i-r.leftMargin,l,d)}}case "hanging":{let l=vd(i-r.leftMargin,-r.leftMargin,a-r.leftMargin);return {...n,left:l,firstLine:n.firstLine+(n.left-l)}}case "right":{let l=vd(i,s,r.pageWidth);return {...n,right:r.pageWidth-r.rightMargin-l}}}}function fS(e,t){let n=e.snapshot().formatting;if(n)switch(t){case "text.color":return n.color?.kind==="hex"?n.color.value.replace(/^#/,""):void 0;case "text.highlight":return n.highlight;case "styles.style":return n.styleId;case "font.family":return n.fontFamily;case "font.size":return n.fontSizePt===void 0?void 0:String(n.fontSizePt*2);case "list.lineSpacing":return n.lineSpacing?.rule==="multiple"?String(n.lineSpacing.value):void 0;default:return}}function sL(e){if(!(!e||typeof e!="object"||"preventDefault"in e))return e}var pS="no formatting has been copied",xd="there is nothing at the selection to copy",xp="the selection has nothing to paint",wd=Object.freeze({mode:"off",level:"none"});function mS(e,t){let n=Math.round(t*12700),r=1143e3,o=`<w:document xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"><w:body><w:p><w:r>
|
|
16
|
+
<w:drawing xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:wps="http://schemas.microsoft.com/office/word/2010/wordprocessingShape">
|
|
17
|
+
<wp:anchor distT="0" distB="0" distL="91440" distR="91440" simplePos="0" relativeHeight="251658240" behindDoc="0" locked="0" layoutInCell="1" allowOverlap="1">
|
|
18
|
+
<wp:simplePos x="0" y="0"/><wp:positionH relativeFrom="column"><wp:posOffset>0</wp:posOffset></wp:positionH><wp:positionV relativeFrom="paragraph"><wp:posOffset>0</wp:posOffset></wp:positionV>
|
|
19
|
+
<wp:extent cx="${n}" cy="${r}"/><wp:effectExtent l="0" t="0" r="0" b="0"/><wp:wrapNone/><wp:docPr id="${e}" name="Text Box ${e}"/><wp:cNvGraphicFramePr/>
|
|
20
|
+
<a:graphic><a:graphicData uri="http://schemas.microsoft.com/office/word/2010/wordprocessingShape"><wps:wsp><wps:cNvSpPr txBox="1"/><wps:spPr><a:xfrm><a:off x="0" y="0"/><a:ext cx="${n}" cy="${r}"/></a:xfrm><a:prstGeom prst="rect"><a:avLst/></a:prstGeom><a:solidFill><a:srgbClr val="FFFFFF"/></a:solidFill><a:ln w="12700"><a:solidFill><a:srgbClr val="000000"/></a:solidFill></a:ln></wps:spPr><wps:txbx><w:txbxContent><w:p/></w:txbxContent></wps:txbx><wps:bodyPr lIns="91440" rIns="91440" tIns="45720" bIns="45720" anchor="t"><a:noAutofit/></wps:bodyPr></wps:wsp></a:graphicData></a:graphic>
|
|
21
|
+
</wp:anchor></w:drawing></w:r></w:p></w:body></w:document>`,i=chunkOSFOJTHU_cjs.Ia(o,{name:"/word/document.xml",contentType:"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml"});if(!i.ok)throw new Error("Cannot build textbox drawing");let a=l=>{if(l.kind==="drawing")return l;if(l.kind==="textValue")return null;for(let d of l.children){let c=a(d);if(c)return c}return null},s=a(i.part.root);if(!s)throw new Error("Textbox drawing is missing");return s}function wp(e){let t=e.activeScope();if(e.editingMode()!=="edit"||t.kind!=="body"&&t.kind!=="frame")return {ok:false,code:"unsupported",reason:"Textboxes can only be inserted in body editing mode"};let n=t.kind==="frame"?t.hostParagraphId:e.state().selection.head.paragraphId;return e.layout().pages.some(r=>r.fragments.some(o=>o.kind==="paragraph"&&o.paragraphId===n))?null:{ok:false,code:"unsupported",reason:"Select a body paragraph outside a table to insert a textbox"}}function gS(e){let t=wp(e);if(t)return t;let n=e.activeScope(),r=n.kind==="frame"?n.hostParagraphId:e.state().selection.head.paragraphId,o=e.session.part(),i=chunkOSFOJTHU_cjs.Ta(o,r);if(!i||i.kind!=="paragraph")return {ok:false,code:"notFound",reason:"Textbox anchor is missing"};let a=chunkOSFOJTHU_cjs.pe(e.session.currentPackage(),e.collaborationSession()?.identity.actorId);if(!a.ok)return {ok:false,code:"invalidArgs",reason:"Cannot allocate textbox identity"};let s=new Set(chunkOSFOJTHU_cjs.mi(o).map(m=>m.root.id)),l=e.layout().pages.flatMap(m=>m.fragments).find(m=>m.kind==="paragraph"&&m.paragraphId===r),d=Math.min(300,l?.box.width??300);n.kind==="frame"&&e.setActiveScope({kind:"body"});let c=chunkOSFOJTHU_cjs.lg(i);e.setSelection({anchor:{paragraphId:r,offset:c},head:{paragraphId:r,offset:c}});let u=e.applyDrawingOps([{op:"insertDrawing",paragraphId:r,offset:c,drawing:mS(a.id,d)}]);if(u.rejected)return {ok:false,code:"invalidArgs",reason:u.reason??"Textbox insertion was refused"};let p=chunkOSFOJTHU_cjs.mi(e.session.part()).find(m=>!s.has(m.root.id));return p&&e.setActiveScope({kind:"frame",id:p.root.id,drawingNodeId:p.drawingNodeId,hostParagraphId:p.hostParagraphId}),e.focus(),{ok:true,changed:u.committed}}var Sp=new WeakMap;function Lr(e){let t=Sp.get(e);if(t)return t;let n=chunkOSFOJTHU_cjs.Rf(e);if(n.length===0)return Sp.set(e,[]),[];let r=[];for(let o of n){let i=chunkOSFOJTHU_cjs.Qf(o);for(let a of new Set([o.beginParagraphId,...o.resultParagraphIds,o.endParagraphId])){let s=chunkOSFOJTHU_cjs.Ta(e,a);if(s?.kind!=="paragraph")continue;let l=chunkOSFOJTHU_cjs.jg(s),d=a===o.beginParagraphId,c=a===o.endParagraphId;r.push({toc:o,paragraphId:a,length:l.length,startsHere:d,endsHere:c,start:d?l.spanOf(o.beginNodeId)?.start??0:0,end:c&&i?l.spanOf(i.endNodeId)?.end??l.length:l.length});}}return Sp.set(e,r),r}function Sd(e){return new Set(Lr(e).filter(t=>t.start===0&&t.end===t.length&&!(t.endsHere&&!t.startsHere&&t.end===0)).map(t=>t.paragraphId))}function Ip(e,t){return e.endsHere&&!e.startsHere&&e.end===0||e.startsHere&&e.start>0&&t<=e.start||e.endsHere&&e.end<e.length&&t>=e.end?false:t>=e.start&&t<=e.end}function xn(e,t){return Lr(e).find(n=>n.paragraphId===t.paragraphId&&Ip(n,t.offset))?.toc}function hS(e,t){let{anchor:n,head:r}=t;if(n.paragraphId===r.paragraphId){let o=Math.min(n.offset,r.offset),i=Math.max(n.offset,r.offset);return Lr(e).some(a=>a.paragraphId===n.paragraphId&&(o===i?Ip(a,o):o<a.end&&i>a.start))}return xn(e,n)!==void 0||xn(e,r)!==void 0}function yS(e,t){let n=Lr(e);if(n.length===0)return false;let r=chunkOSFOJTHU_cjs.ok(t);if(r.kind==="nodes")return r.targets.some(a=>n.some(s=>{if(a.nodeId!==s.paragraphId)return false;if(a.range){let{start:l,end:d}=a.range;return l===d?Ip(s,l):l<s.end&&d>s.start}return t.op==="joinParagraphs"&&t.firstId===s.paragraphId&&s.endsHere&&s.end===0?false:a.removes||a.structural?true:s.end>s.start||s.length===0&&!s.endsHere}));let o=new Set(n.map(a=>a.paragraphId)),i=(a,s="")=>typeof a=="string"?/(?:Id|Ids)$/.test(s)&&o.has(a):Array.isArray(a)?a.some(l=>i(l,s)):!!a&&typeof a=="object"&&Object.entries(a).some(([l,d])=>i(d,l));return i(t)}function bS(e,t,n){let r=xn(e,t);if(!r)return null;let o=Lr(e).find(i=>i.toc.id===r.id&&(n?i.startsHere&&i.start>0:i.endsHere&&i.end<i.length));return o?{paragraphId:o.paragraphId,offset:n?o.start:o.end}:null}function vS(e,t){return !Lr(t).some(r=>r.toc.id===e.id&&(r.start>0||r.end<r.length))&&e.contentControlId?e.contentControlId:`toc:${e.id}`}function xS(e,t,n){if(!t)return;let r=n?.closest("[data-start]");return Lr(e).find(o=>o.paragraphId===t&&(r?Number(r.dataset.start)<o.end&&Number(r.dataset.end)>o.start:Sd(e).has(t)))?.toc}var ps=/^[0-9A-Fa-f]{6}$/,wS={dk1:"dk1",lt1:"lt1",dk2:"dk2",lt2:"lt2",accent1:"accent1",accent2:"accent2",accent3:"accent3",accent4:"accent4",accent5:"accent5",accent6:"accent6",hlink:"hlink",folhlink:"folHlink",dark1:"dk1",light1:"lt1",dark2:"dk2",light2:"lt2",hyperlink:"hlink",followedhyperlink:"folHlink",background1:"lt1",text1:"dk1",background2:"lt2",text2:"dk2",tx1:"dk1",tx2:"dk2",bg1:"lt1",bg2:"lt2"},lL={dk1:"000000",lt1:"FFFFFF",dk2:"44546A",lt2:"E7E6E6",accent1:"4472C4",accent2:"ED7D31",accent3:"A5A5A5",accent4:"FFC000",accent5:"5B9BD5",accent6:"70AD47",hlink:"0563C1",folHlink:"954F72"};function kp(e){return typeof e=="number"&&Number.isFinite(e)&&e>0&&e<=1}function Id(e){return Math.max(0,Math.min(1,e))}function SS(e){let t=e.replace(/^#/,"").padStart(6,"0").slice(0,6);return {r:parseInt(t.slice(0,2),16)||0,g:parseInt(t.slice(2,4),16)||0,b:parseInt(t.slice(4,6),16)||0}}function IS(e,t,n){let r=o=>Math.max(0,Math.min(255,Math.round(o))).toString(16).padStart(2,"0");return `${r(e)}${r(t)}${r(n)}`.toUpperCase()}function kS(e,t){if(t>=1)return e.toUpperCase();if(t<=0)return "FFFFFF";let r=Math.max(0,Math.min(255,Math.round((1-Id(t))*255)))/255,o=SS(e);return IS(r*255+(1-r)*o.r,r*255+(1-r)*o.g,r*255+(1-r)*o.b)}function RS(e,t){if(t>=1)return e.toUpperCase();if(t<=0)return "000000";let r=Math.max(0,Math.min(255,Math.round(Id(t)*255)))/255,o=SS(e);return IS(r*o.r,r*o.g,r*o.b)}function Rp(e){return wS[e]??wS[e.toLowerCase()]??null}function dL(e,t){let n=Rp(e);if(!n)return null;let r=t.find(i=>i.slot===n)?.hex;if(r&&ps.test(r))return r.toUpperCase();let o=lL[n];return o&&ps.test(o)?o.toUpperCase():null}function kd(e,t){let n=dL(e.slot,t);if(!n)return {ok:false,reason:"the theme colour could not be resolved for this document"};if(e.tint!==void 0&&!kp(e.tint))return {ok:false,reason:"theme tint is out of range"};if(e.shade!==void 0&&!kp(e.shade))return {ok:false,reason:"theme shade is out of range"};let r=n;return e.tint!==void 0?r=kS(r,Id(e.tint)):e.shade!==void 0&&(r=RS(r,Id(e.shade))),{ok:true,hex:r}}var cL="000000";function Pp(e,t){if(e.kind==="hex"){let o=e.value.toUpperCase();return ps.test(o)?{ok:true,color:{kind:"hex",value:o}}:{ok:false,reason:"border colour requires a six-digit hex value"}}if(e.kind==="auto")return {ok:true,color:{kind:"auto",resolvedHex:cL}};let n=kd(e,t);return n.ok?{ok:true,color:{kind:"theme",slot:Rp(e.slot)??e.slot,resolvedHex:n.hex,...e.tint!==void 0?{tint:e.tint}:{},...e.shade!==void 0?{shade:e.shade}:{}}}:n}function Tp(e,t){if(e.kind==="auto")return {ok:false,reason:"automatic fill cannot be written without a resolved colour"};if(e.kind==="hex"){let o=e.value.toUpperCase();return ps.test(o)?{ok:true,color:{kind:"hex",value:o}}:{ok:false,reason:"fill colour requires a six-digit hex value"}}let n=kd(e,t);return n.ok?{ok:true,color:{kind:"theme",slot:Rp(e.slot)??e.slot,resolvedHex:n.hex,...e.tint!==void 0?{tint:e.tint}:{},...e.shade!==void 0?{shade:e.shade}:{}}}:n}function uL(e,t,n="000000"){if(!e||e.kind==="auto")return `#${n}`;if(e.kind==="hex"){let o=e.value.replace(/^#/,"").toUpperCase();return ps.test(o)?`#${o}`:`#${n}`}let r=kd(e,t);return `#${r.ok?r.hex:n}`}function Cp(e,t){return chunkDOHF6FA7_cjs.Oe(e).occurrences.some(n=>n.table.tableId===t&&n.row.cells.some(r=>r.logicalGridColumn!==void 0))}function PS(e,t){return t?e==="left"?"right":e==="right"?"left":e:e}var gL=new Set(["insertRow","deleteRow","insertColumn","deleteColumn","deleteTable","setCellFill","setTableCellVerticalAlignment","setTableBorders","commitTableColumnDividerResize","commitTableRightEdgeResize","mergeCells","splitCell","toggleHeaderRow","selectTableRegion","setTableProperties"]);function no(e){return gL.has(e.type)}function he(e,t){return {ok:false,code:e,reason:t}}function Ep(e,t){switch(e){case "unknown-table":case "unknown-row":case "unknown-grid-column":return he("invalidArgs","the table target is no longer valid");case "table-has-merge":return he("unsupported","this table has merged cells");case "row-hides-cell":return he("unsupported","this table has a cell the editor cannot place in the grid");case "block-required":return he("unsupported","the table must keep at least one row or column");case "resource-limit":return he("unsupported","the table has reached the supported size limit");case "invalidArgs":case "invalid-property-value":case "unsupported-property":return he("invalidArgs","the table command arguments are invalid");default:return he("unsupported",`the table operation was refused (${e})`)}}function Kt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function cn(e,t){return !Kt(e)||Object.keys(e).length!==t.length?false:t.every(r=>Object.prototype.hasOwnProperty.call(e,r))}function OS(e){if(!Kt(e))return false;let t=e.kind;if(t==="hex")return cn(e,["kind","value"])&&typeof e.value=="string";if(t==="auto")return cn(e,["kind"]);if(t==="theme"){if(typeof e.slot!="string")return false;let n=["kind","slot"];if(e.tint!==void 0){if(typeof e.tint!="number"||!Number.isFinite(e.tint))return false;n.push("tint");}if(e.shade!==void 0){if(typeof e.shade!="number"||!Number.isFinite(e.shade))return false;n.push("shade");}return cn(e,n)}return false}function MS(e){return Kt(e)&&cn(e,["sourceRevision","tableId","rowId","isHeaderRepeat"])&&typeof e.sourceRevision=="number"&&Number.isInteger(e.sourceRevision)&&typeof e.tableId=="string"&&e.tableId.length>0&&typeof e.rowId=="string"&&e.rowId.length>0&&typeof e.isHeaderRepeat=="boolean"}function AS(e){return Kt(e)&&cn(e,["sourceRevision","tableId","gridColumnId","isHeaderRepeat"])&&typeof e.sourceRevision=="number"&&Number.isInteger(e.sourceRevision)&&typeof e.tableId=="string"&&e.tableId.length>0&&typeof e.gridColumnId=="string"&&e.gridColumnId.length>0&&typeof e.isHeaderRepeat=="boolean"}function hL(e){return Kt(e)&&cn(e,["sourceRevision","tableId","leftGridColumnId","rightGridColumnId","isHeaderRepeat"])&&typeof e.sourceRevision=="number"&&Number.isInteger(e.sourceRevision)&&typeof e.tableId=="string"&&typeof e.leftGridColumnId=="string"&&typeof e.rightGridColumnId=="string"&&typeof e.isHeaderRepeat=="boolean"}function yL(e){return Kt(e)&&cn(e,["sourceRevision","tableId","gridColumnId","isHeaderRepeat"])&&typeof e.sourceRevision=="number"&&Number.isInteger(e.sourceRevision)&&typeof e.tableId=="string"&&typeof e.gridColumnId=="string"&&typeof e.isHeaderRepeat=="boolean"}function bL(e){return !Kt(e)||!cn(e,["style","size","color"])?false:typeof e.style=="string"&&typeof e.size=="number"&&Number.isInteger(e.size)&&OS(e.color)}function TS(e){return !("target"in e)||e.target===void 0||MS(e.target)}function CS(e){return !("target"in e)||e.target===void 0||AS(e.target)}function vL(e){switch(e.type){case "insertRow":return !Kt(e)||e.type!=="insertRow"?he("invalidArgs","insertRow command shape is invalid"):e.where!=="above"&&e.where!=="below"?he("invalidArgs","insertRow where must be above or below"):TS(e)?null:he("invalidArgs","insertRow target shape is invalid");case "deleteRow":return !Kt(e)||e.type!=="deleteRow"?he("invalidArgs","deleteRow command shape is invalid"):TS(e)?null:he("invalidArgs","deleteRow target shape is invalid");case "insertColumn":return !Kt(e)||e.type!=="insertColumn"?he("invalidArgs","insertColumn command shape is invalid"):e.where!=="left"&&e.where!=="right"?he("invalidArgs","insertColumn where must be left or right"):CS(e)?null:he("invalidArgs","insertColumn target shape is invalid");case "deleteColumn":return !Kt(e)||e.type!=="deleteColumn"?he("invalidArgs","deleteColumn command shape is invalid"):CS(e)?null:he("invalidArgs","deleteColumn target shape is invalid");case "deleteTable":return !Kt(e)||!cn(e,["type"])?he("invalidArgs","deleteTable command shape is invalid"):null;case "setCellFill":return !Kt(e)||!cn(e,["type","color"])?he("invalidArgs","setCellFill command shape is invalid"):e.color!==null&&!OS(e.color)?he("invalidArgs","setCellFill color shape is invalid"):null;case "setTableCellVerticalAlignment":return !Kt(e)||!cn(e,["type","alignment"])||!["top","center","bottom"].includes(e.alignment)?he("invalidArgs","cell vertical alignment command shape is invalid"):null;case "setTableBorders":return !Kt(e)||e.type!=="setTableBorders"?he("invalidArgs","setTableBorders command shape is invalid"):e.scope==="none"?typeof e.target!="string"?he("invalidArgs","border none scope requires a target edge"):null:!("spec"in e)||!bL(e.spec)?he("invalidArgs","concrete border scopes require a complete spec"):null;case "commitTableColumnDividerResize":return !Kt(e)||!cn(e,["type","target","leftWidthTwips","rightWidthTwips"])||!hL(e.target)||typeof e.leftWidthTwips!="number"||typeof e.rightWidthTwips!="number"?he("invalidArgs","column divider resize command shape is invalid"):null;case "commitTableRightEdgeResize":return !Kt(e)||!cn(e,["type","target","columnWidthTwips","tableWidthTwips"])||!yL(e.target)||typeof e.columnWidthTwips!="number"||typeof e.tableWidthTwips!="number"?he("invalidArgs","right-edge resize command shape is invalid"):null;default:return null}}function xL(e){return !("target"in e)||e.target===void 0?null:MS(e.target)?e.target:null}function wL(e){return !("target"in e)||e.target===void 0?null:AS(e.target)?e.target:null}function SL(e,t){let n=chunkOSFOJTHU_cjs.aj(e.root,t.tableId);if(!n.ok)return {rowIds:[t.rowId],wholeTable:false};let r=new Set(t.cellIds),o=n.topology.rows.filter(i=>i.cells.some(a=>r.has(a.id))).map(i=>i.row.id);return o.length===0?{rowIds:[t.rowId],wholeTable:false}:{rowIds:o,wholeTable:o.length===n.topology.rows.length}}function IL(e,t){let n=chunkOSFOJTHU_cjs.aj(e.root,t.tableId);if(!n.ok||!n.topology.grid)return {gridColumnIds:[],wholeTable:false};let r=new Set(t.cellIds),o=new Set;for(let i of n.topology.rows){let a=0;for(let s of i.cells){let l=FS(s);if(r.has(s.id))for(let d=0;d<l;d+=1){let c=n.topology.gridColumns[a+d];c&&o.add(c.id);}a+=l;}}return {gridColumnIds:[...o],wholeTable:o.size>0&&o.size===n.topology.gridColumns.length}}function ES(e,t,n){let r=chunkOSFOJTHU_cjs.aj(e.root,t);return !r.ok||!r.topology.grid?null:r.topology.gridColumns[n]?.id??null}function kL(e){let t=chunkD7ZMDMPX_cjs.la(e.layout,e.selection.head.paragraphId,e.cellSelection);return t?{tableId:t.tableId,rowId:t.rowId,cellId:t.cellId,cellIds:[...t.cellIds],gridColumnIndex:t.gridColumnIndex,isHeaderRepeat:t.isHeaderRepeat}:null}function FS(e){let t=chunkOSFOJTHU_cjs.Zi(e,"tcPr"),n=t&&chunkOSFOJTHU_cjs.Zi(t,"gridSpan"),r=n&&chunkOSFOJTHU_cjs._i(n,"val");if(!r||!/^\d{1,7}$/.test(r))return 1;let o=Number(r);return Number.isInteger(o)&&o>1?Math.min(o,1024):1}function RL(e,t,n){let r=e.gridColumns.findIndex(o=>o.id===n);if(r===-1)return null;for(let{row:o,cells:i}of e.rows){let a=0;for(let s of i){let l=FS(s);if(r>=a&&r<a+l)return {tableId:t,rowId:o.id,cellId:s.id,cellIds:[s.id],gridColumnIndex:r,isHeaderRepeat:false};a+=l;}}return null}function PL(e,t){if(t.sourceRevision!==e.storeRevision||t.isHeaderRepeat)return null;let n=chunkOSFOJTHU_cjs.aj(e.part.root,t.tableId);if(!n.ok)return null;let r=n.topology.rows.findIndex(a=>a.row.id===t.rowId);if(r===-1)return null;let i=n.topology.rows[r].cells[0];return i?{tableId:t.tableId,rowId:t.rowId,cellId:i.id,cellIds:[i.id],gridColumnIndex:0,isHeaderRepeat:false}:null}function TL(e,t){if(t.sourceRevision!==e.storeRevision||t.isHeaderRepeat)return null;let n=chunkOSFOJTHU_cjs.aj(e.part.root,t.tableId);return n.ok?RL(n.topology,t.tableId,t.gridColumnId):null}function CL(e,t){for(let n of t){let r=chunkOSFOJTHU_cjs.Xk(e,n);if(r)return Ep(r)}return null}function dn(e,t,n){let r=CL(e,t);return r||{ok:true,ops:t,selection:n}}function EL(e,t){if(!chunkOSFOJTHU_cjs.Dk.includes(e.style))return {ok:false,reason:"border style is not allowlisted"};if(!Number.isInteger(e.size)||e.size<1)return {ok:false,reason:"border size is out of range"};if(e.size>96)return {ok:false,reason:"border size is out of range"};let n=Pp(e.color,t);return n.ok?{ok:true,spec:{style:e.style,size:e.size,color:n.color}}:{ok:false,reason:n.reason}}function ms(e,t,n){return n!==e.storeRevision?he("invalidArgs","the table target is stale"):chunkOSFOJTHU_cjs.aj(e.part.root,t).ok?null:he("invalidArgs","the table target is no longer valid")}function OL(e){return e?.isHeaderRepeat?he("unsupported","repeated header rows cannot be edited"):null}function ML(e,t,n,r){let o=ms(e,t.tableId,t.sourceRevision);if(o)return o;if(t.isHeaderRepeat)return he("unsupported","repeated header rows cannot be edited");if(!Number.isInteger(n)||!Number.isInteger(r))return he("invalidArgs","column widths must be whole twips");if(n<300||r<300)return he("invalidArgs","column widths are below the minimum");let i=chunkOSFOJTHU_cjs.aj(e.part.root,t.tableId);if(!i.ok){let u=i.reason==="duplicate-node-id"?"unknown-table":i.reason;return Ep(u)}let a=i.topology.gridColumns.find(u=>u.id===t.leftGridColumnId),s=i.topology.gridColumns.find(u=>u.id===t.rightGridColumnId);if(!a||!s)return he("invalidArgs","the table target is no longer valid");let l=i.topology.gridColumns.indexOf(a),d=i.topology.gridColumns.indexOf(s);if(Math.abs(d-l)!==1)return he("invalidArgs","the column divider target is not adjacent");let c={op:"setTableColumnWidths",tableId:t.tableId,leftGridColumnId:l<d?t.leftGridColumnId:t.rightGridColumnId,rightGridColumnId:l<d?t.rightGridColumnId:t.leftGridColumnId,leftWidthTwips:l<d?n:r,rightWidthTwips:l<d?r:n};return dn(e.part,[c],{kind:"preserveSelection"})}function AL(e,t,n,r){let o=ms(e,t.tableId,t.sourceRevision);if(o)return o;if(t.isHeaderRepeat)return he("unsupported","repeated header rows cannot be edited");if(!Number.isInteger(n)||!Number.isInteger(r))return he("invalidArgs","column widths must be whole twips");if(n<300)return he("invalidArgs","column widths are below the minimum");let i=chunkOSFOJTHU_cjs.aj(e.part.root,t.tableId);if(!i.ok){let l=i.reason==="duplicate-node-id"?"unknown-table":i.reason;return Ep(l)}let a=i.topology.gridColumns[i.topology.gridColumns.length-1];if(!a||a.id!==t.gridColumnId)return he("invalidArgs","the resize target is not the table right edge");let s={op:"setTableRightEdgeWidth",tableId:t.tableId,gridColumnId:t.gridColumnId,columnWidthTwips:n,tableWidthTwips:r};return dn(e.part,[s],{kind:"preserveSelection"})}function LS(e,t,n){if(e.viewing||!e.editable)return he("locked","the document is open for viewing");let r=ms(e,t.tableId,t.sourceRevision);if(r)return r;if(t.isHeaderRepeat)return he("unsupported","repeated header rows cannot be edited");if(!Number.isInteger(n)||n<20||n>31680)return he("invalidArgs","row height is outside the supported range");let o={op:"setTableRowHeight",tableId:t.tableId,rowId:t.rowId,heightTwips:n};return dn(e.part,[o],{kind:"preserveSelection"})}function Nr(e){let{command:t,part:n,viewing:r,editable:o}=e;if(r||!o)return he("locked","the document is open for viewing");switch(t.type){case "mergeCells":return he("unsupported","cell merge is not supported yet");case "splitCell":return he("unsupported","cell split is not supported yet");case "toggleHeaderRow":case "selectTableRegion":case "setTableProperties":return he("unsupported",`command '${t.type}' is not supported by the tree editor`);}let i=vL(t);if(i)return i;let a=xL(t),s=wL(t),l=OL(a??s);if(l)return l;if(a){let c=ms(e,a.tableId,a.sourceRevision);if(c)return c}if(s){let c=ms(e,s.tableId,s.sourceRevision);if(c)return c}let d=a!==null?PL(e,a):s!==null?TL(e,s):kL(e);if(t.type!=="commitTableColumnDividerResize"&&t.type!=="commitTableRightEdgeResize"&&!d)return a||s?he("invalidArgs","the table target is no longer valid"):he("unsupported","the selection is not inside a table");if(d?.isHeaderRepeat)return he("unsupported","repeated header rows cannot be edited");switch(t.type){case "insertRow":{if(!d)return he("unsupported","the selection is not inside a table");let c={op:"insertTableRow",tableId:d.tableId,rowId:d.rowId,where:t.where};return dn(n,[c],{kind:"adoptCommittedCaret"})}case "deleteRow":{if(!d)return he("unsupported","the selection is not inside a table");let c=SL(n,d),u=c.wholeTable?[{op:"deleteBlock",blockId:d.tableId}]:c.rowIds.map(p=>({op:"deleteTableRow",tableId:d.tableId,rowId:p,...p===d.rowId?{referenceCellId:d.cellId}:{}}));return dn(n,u,{kind:"adoptCommittedCaret"})}case "insertColumn":{if(!d)return he("unsupported","the selection is not inside a table");let c=s?.tableId??d.tableId,u=s?.gridColumnId??ES(n,c,d.gridColumnIndex),p=Cp(e.layout,c)?t.where==="left"?"right":"left":t.where,m=u?{op:"insertTableColumn",tableId:c,where:p,gridColumnId:u}:{op:"insertTableColumn",tableId:c,where:p,referenceCellId:d.cellId};return dn(n,[m],{kind:"adoptCommittedCaret"})}case "deleteColumn":{if(!d)return he("unsupported","the selection is not inside a table");let c=s?.tableId??d.tableId,u=s?.gridColumnId??ES(n,c,d.gridColumnIndex);if(!u)return he("invalidArgs","the table has no grid column to delete");let p=s?.gridColumnId===void 0?IL(n,d):{gridColumnIds:[u],wholeTable:false};if(p.wholeTable)return dn(n,[{op:"deleteBlock",blockId:c}],{kind:"adoptCommittedCaret"});let g=(p.gridColumnIds.length>0?p.gridColumnIds:[u]).map(b=>({op:"deleteTableColumn",tableId:c,gridColumnId:b}));return dn(n,g,{kind:"adoptCommittedCaret"})}case "deleteTable":{if(!d)return he("unsupported","the selection is not inside a table");let c={op:"deleteBlock",blockId:d.tableId};return dn(n,[c],{kind:"adoptCommittedCaret"})}case "setCellFill":{if(!d)return he("unsupported","the selection is not inside a table");let c;if(t.color===null)c=null;else {let p=Tp(t.color,e.themeColors);if(!p.ok)return he("invalidArgs",p.reason);c=p.color;}let u={op:"setTableCellFill",tableId:d.tableId,cellIds:d.cellIds,color:c};return dn(n,[u],{kind:"preserveSelection"})}case "setTableCellVerticalAlignment":{if(!d)return he("unsupported","the selection is not inside a table");let c={op:"setTableCellVerticalAlignment",tableId:d.tableId,cellIds:d.cellIds,alignment:t.alignment};return dn(n,[c],{kind:"preserveSelection"})}case "setTableBorders":{if(!d)return he("unsupported","the selection is not inside a table");if(t.scope==="none"){let p={op:"setTableCellBorders",tableId:d.tableId,cellIds:d.cellIds,scope:"none",target:PS(t.target,Cp(e.layout,d.tableId))};return dn(n,[p],{kind:"preserveSelection"})}let c=EL(t.spec,e.themeColors);if(!c.ok)return he("invalidArgs",c.reason);let u={op:"setTableCellBorders",tableId:d.tableId,cellIds:d.cellIds,scope:PS(t.scope,Cp(e.layout,d.tableId)),spec:c.spec};return dn(n,[u],{kind:"preserveSelection"})}case "commitTableColumnDividerResize":return ML(e,t.target,t.leftWidthTwips,t.rightWidthTwips);case "commitTableRightEdgeResize":return AL(e,t.target,t.columnWidthTwips,t.tableWidthTwips);default:return he("unsupported",`command '${t.type}' is not a table command`)}}function NS(e){if(!no(e))return {supported:false,reason:`command '${e.type}' is not a table command`};switch(e.type){case "mergeCells":return {supported:false,reason:"cell merge is not supported yet"};case "splitCell":return {supported:false,reason:"cell split is not supported yet"};case "toggleHeaderRow":case "selectTableRegion":case "setTableProperties":return {supported:false,reason:`command '${e.type}' is not supported by the tree editor`};default:return {supported:true}}}function Et(e){if(typeof e!="object"||e===null)return false;let t=e;return typeof t.paraId=="string"&&t.paraId.length>0&&(t.search===void 0||typeof t.search=="string"&&t.search.length>0)&&(t.occurrence===void 0||typeof t.occurrence=="number"&&Number.isInteger(t.occurrence)&&t.occurrence>=1)}function Ko(e){if(typeof e!="object"||e===null)return false;let t=e;return Et(t.from)&&Et(t.to)}function DS(e,t,n){let r=[],o=e.indexOf(t);for(;o>=0&&r.length<n;)r.push(o),o=e.indexOf(t,o+1);return r}function un(e,t,n){if(typeof n.paraId!="string"||n.paraId.length===0)return {ok:false,code:"invalidArgs",reason:"paraId must be a non-empty string"};let r=n.paraId.toUpperCase();if(t.ambiguousParaIds.has(r))return {ok:false,code:"ambiguous",reason:`paraId '${n.paraId}' is claimed by more than one story`};let o=t.nodeByParaId.get(r);if(o===void 0)return {ok:false,code:"notFound",reason:`no paragraph with paraId '${n.paraId}'`};let i=chunkOSFOJTHU_cjs.Vi(t.partByNode.get(o)??e,o)??"";if(n.search===void 0)return {ok:true,span:{nodeId:o,start:0,end:i.length}};if(n.search.length===0)return {ok:false,code:"invalidArgs",reason:"search must be a non-empty phrase"};if(n.occurrence!==void 0){if(!Number.isInteger(n.occurrence)||n.occurrence<1)return {ok:false,code:"invalidArgs",reason:"occurrence must be a positive integer (1-based)"};let s=DS(i,n.search,n.occurrence),l=s[n.occurrence-1];return l===void 0?{ok:false,code:"notFound",reason:`'${n.search}' matches ${s.length} time(s) in paragraph '${n.paraId}'; occurrence ${n.occurrence} does not exist`}:{ok:true,span:{nodeId:o,start:l,end:l+n.search.length}}}let a=DS(i,n.search,2);return a.length===0?{ok:false,code:"notFound",reason:`'${n.search}' does not occur in paragraph '${n.paraId}'`}:a.length>1?{ok:false,code:"ambiguous",reason:`'${n.search}' matches more than once in paragraph '${n.paraId}'; pass occurrence to disambiguate`}:{ok:true,span:{nodeId:o,start:a[0],end:a[0]+n.search.length}}}function HS(e,t,n){if("anchor"in n){let s=un(e,t,n.anchor);if(!s.ok)return {ok:false,code:s.code,reason:s.reason,target:n.anchor};let l={paragraphId:s.span.nodeId,offset:s.span.start};return {ok:true,selection:{anchor:l,head:l}}}let{from:r,to:o}=n.range;if(!Et(r)||!Et(o))return {ok:false,code:"unsupported",reason:"DocLocation endpoints are not supported; address paragraphs by paraId",target:n.range};let i=un(e,t,r);if(!i.ok)return {ok:false,code:i.code,reason:i.reason,target:r};let a=un(e,t,o);return a.ok?{ok:true,selection:{anchor:{paragraphId:i.span.nodeId,offset:i.span.start},head:{paragraphId:a.span.nodeId,offset:a.span.end}}}:{ok:false,code:a.code,reason:a.reason,target:o}}var FL=["alignment","direction","spaceBeforePt","spaceAfterPt","lineSpacing","tabStops"];function LL(e,t){return e===t?true:!e||!t?false:FL.every(n=>e[n]===t[n])}function Op(e,t){if(e===t)return true;if(!e||!t||e.bold!==t.bold||e.italic!==t.italic||e.underline!==t.underline||e.strike!==t.strike||e.superscript!==t.superscript||e.subscript!==t.subscript||e.highlight!==t.highlight||e.fontFamily!==t.fontFamily||e.fontSizePt!==t.fontSizePt||e.alignment!==t.alignment||e.direction!==t.direction||e.styleId!==t.styleId||e.spaceBeforePt!==t.spaceBeforePt||e.spaceAfterPt!==t.spaceAfterPt||e.lineSpacing?.rule!==t.lineSpacing?.rule||e.lineSpacing?.value!==t.lineSpacing?.value||e.indent?.left!==t.indent?.left||e.indent?.right!==t.indent?.right||e.indent?.firstLine!==t.indent?.firstLine||e.indent?.mixed.left!==t.indent?.mixed.left||e.indent?.mixed.right!==t.indent?.mixed.right||e.indent?.mixed.firstLine!==t.indent?.mixed.firstLine||e.indent?.rtl!==t.indent?.rtl||e.paragraphFlags?.contextualSpacing!==t.paragraphFlags?.contextualSpacing||e.paragraphFlags?.keepNext!==t.paragraphFlags?.keepNext||e.paragraphFlags?.keepLines!==t.paragraphFlags?.keepLines||e.paragraphFlags?.widowControl!==t.paragraphFlags?.widowControl||e.paragraphFlags?.pageBreakBefore!==t.paragraphFlags?.pageBreakBefore||!LL(e.disagrees,t.disagrees)||e.tabStops?.length!==t.tabStops?.length||(e.tabStops??[]).some((i,a)=>i.positionTwips!==t.tabStops?.[a]?.positionTwips||i.alignment!==t.tabStops?.[a]?.alignment||(i.leader??"none")!==(t.tabStops?.[a]?.leader??"none")))return false;if(e.color===t.color)return true;if(!e.color||!t.color)return false;let n=e.color,r=t.color,o=new Set([...Object.keys(n),...Object.keys(r)]);for(let i of o)if(n[i]!==r[i])return false;return true}function Mp(e,t){return e.current===t.current&&e.total===t.total}function Ap(e,t){return e===t?true:!e||!t?false:e.pageWidthTwips===t.pageWidthTwips&&e.pageHeightTwips===t.pageHeightTwips&&e.orientation===t.orientation&&e.marginsTwips.top===t.marginsTwips.top&&e.marginsTwips.right===t.marginsTwips.right&&e.marginsTwips.bottom===t.marginsTwips.bottom&&e.marginsTwips.left===t.marginsTwips.left&&e.gutterTwips===t.gutterTwips}function _S(e,t){if(e===t)return true;if(!e||!t)return false;let n=e,r=t;return n.paraId===r.paraId&&n.search===r.search&&n.occurrence===r.occurrence}function Fp(e,t){return e===t?true:!e||!t||!Ko(e)||!Ko(t)?false:_S(e.from,t.from)&&_S(e.to,t.to)}function Lp(){let e=null;return t=>(t===null?e=null:e?.id!==t&&(e=Object.freeze({id:t})),e)}var NL={scope:"compared",isLoading:"compared",isOpening:"compared",parseError:"compared",editable:"compared",zoom:"compared",zoomMode:"compared",selection:"compared",selectionCollapsed:"compared",formatting:"compared",table:"compared",tocContext:"compared",image:"compared",page:"compared",canUndo:"compared",canRedo:"compared",pageSetup:"compared",reviewPaneOpen:"compared",reviewPane:"compared",showParagraphMarks:"compared",documentProtection:"compared",reviewDisplayMode:"compared",revisionMarkup:"compared",hasReviewContent:"compared",hiddenReviewAuthors:"compared",collaborationStatus:"compared",editingMode:"compared",lastRejection:"compared",fontSubstitutions:"compared",formatPainter:"compared"},DL=Object.keys(NL);function Np(e,t){return DL.every(n=>e[n]===t[n])}function Rd(e){if(e===null||typeof e!="object"||Object.isFrozen(e))return e;if(Array.isArray(e)){for(let n of e)Rd(n);return Object.freeze(e)}let t=e;for(let n of Object.keys(t))Rd(t[n]);return Object.freeze(e)}var Dp=new Map([["bold",{localName:"b"}],["italic",{localName:"i"}],["underline",{localName:"u",attributes:{val:"single"}}],["strike",{localName:"strike"}],["superscript",{localName:"vertAlign",attributes:{val:"superscript"}}],["subscript",{localName:"vertAlign",attributes:{val:"subscript"}}]]),HL=new Set(["none","black","blue","cyan","darkBlue","darkCyan","darkGray","darkGreen","darkMagenta","darkRed","darkYellow","green","lightGray","magenta","red","yellow","white"]),_L=/^[0-9A-Fa-f]{6}$/;function Hp(e){let{mark:t,value:n}=e;switch(t){case "fontFamily":return typeof n!="string"||chunkBY2ACZZ6_cjs.a(n)===null?{ok:false,code:"invalidArgs",reason:"fontFamily requires a family name of 1-64 letters, digits, or [ -.+_,;]"}:{ok:true,localName:"rFonts",attributes:{ascii:n,hAnsi:n}};case "fontSize":return typeof n!="number"||!Number.isInteger(n)||n<2||n>3276?{ok:false,code:"invalidArgs",reason:"fontSize requires an integer half-point value between 2 and 3276"}:{ok:true,localName:"sz",attributes:{val:String(n)}};case "color":return typeof n!="string"||n!=="auto"&&!_L.test(n)?{ok:false,code:"invalidArgs",reason:"color requires a six-digit hex value like FF0000, or 'auto'"}:{ok:true,localName:"color",attributes:{val:n}};case "highlight":return typeof n!="string"||!HL.has(n)?{ok:false,code:"invalidArgs",reason:"highlight requires an ST_HighlightColor name (yellow, cyan, ...)"}:{ok:true,localName:"highlight",attributes:{val:n}};default:return {ok:false,code:"unsupported",reason:`mark '${t}' is not supported by setMarkAttr`}}}function KS(e){return typeof e=="object"&&e!==null&&typeof e.paragraphId=="string"&&typeof e.offset=="number"}function _p(e){return typeof e=="object"&&e!==null&&KS(e.anchor)&&KS(e.head)}function fn(e,t){let n=new Error(t);return n.code=e,n}function Pd(e,t){return e===t?true:!e||!t?false:e.anchor.paragraphId===t.anchor.paragraphId&&e.anchor.offset===t.anchor.offset&&e.head.paragraphId===t.head.paragraphId&&e.head.offset===t.head.offset}function Bp(e){return e==="blank"?Lf():e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):null}function $p(e){return typeof e=="string"?`'${e}' is not a document; pass DOCX bytes, or 'blank' for an empty one`:"a DocumentHandle cannot be re-loaded; pass DOCX bytes"}function Vo(e){switch(e.type){case "toggleMark":return Dp.has(e.mark)?{supported:true,mutating:true}:{supported:false,reason:`mark '${e.mark}' is not supported`};case "setMarkAttr":{let t=Hp(e);return t.ok?{supported:true,mutating:true}:{supported:false,reason:t.reason,code:t.code}}case "setAlignment":return {supported:true,mutating:true};case "setParagraphDirection":return e.direction==="ltr"||e.direction==="rtl"?{supported:true,mutating:true}:{supported:false,code:"invalidArgs",reason:"setParagraphDirection requires a direction of 'ltr' or 'rtl'"};case "clearFormatting":return {supported:true,mutating:true};case "copyFormatting":return {supported:true,mutating:false};case "pasteFormatting":return {supported:true,mutating:true};case "setLineSpacing":{if(!["multiple","exact","atLeast"].includes(e.rule))return {supported:false,code:"invalidArgs",reason:"setLineSpacing requires a rule of 'multiple', 'exact' or 'atLeast'"};let n=e.rule==="multiple"?e.value*240:e.value*20;return !Number.isFinite(e.value)||e.value<=0||Math.round(n)>31680?{supported:false,code:"invalidArgs",reason:"setLineSpacing requires a positive value no taller than 1584pt"}:{supported:true,mutating:true}}case "setParagraphSpacing":{for(let t of ["beforePt","afterPt"]){let n=e[t];if(n!=null&&(!Number.isFinite(n)||n<0||n>1584))return {supported:false,code:"invalidArgs",reason:`setParagraphSpacing requires ${t} between 0 and 1584 points`}}return {supported:true,mutating:true}}case "setParagraphStyle":return e.target!==void 0?{supported:false,reason:"DocTarget addressing is not supported; the style applies at the selection"}:typeof e.styleId!="string"||e.styleId.length===0||e.styleId.length>128||/[\u0000-\u001f\u007f-\u009f]/.test(e.styleId)?{supported:false,code:"invalidArgs",reason:"setParagraphStyle requires a styleId of 1-128 printable characters"}:{supported:true,mutating:true};case "insertHyperlink":return e.target!==void 0?{supported:false,reason:"DocTarget addressing is not supported; a link applies at the selection"}:typeof e.href!="string"||e.href.length===0?{supported:false,code:"invalidArgs",reason:"insertHyperlink requires an href"}:{supported:true,mutating:true};case "removeHyperlink":return e.target===void 0?{supported:true,mutating:true}:{supported:false,reason:"DocTarget addressing is not supported; unlink acts at the selection"};case "setParagraphFormat":{let t=[e.indentLeftTwips,e.indentRightTwips,e.indentFirstLineTwips];for(let r of t)if(r!=null&&(!Number.isInteger(r)||Math.abs(r)>chunkDOHF6FA7_cjs.fd))return {supported:false,code:"invalidArgs",reason:`indent values must be whole twips within \xB1${chunkDOHF6FA7_cjs.fd}`};for(let r of ["spaceBeforePt","spaceAfterPt"]){let o=e[r];if(o!=null&&(!Number.isFinite(o)||o<0||o>1584))return {supported:false,code:"invalidArgs",reason:`setParagraphFormat requires ${r} between 0 and 1584 points`}}let n=e.lineSpacing;if(n!=null){if(n.rule!=="multiple"&&n.rule!=="exact"&&n.rule!=="atLeast")return {supported:false,code:"invalidArgs",reason:"lineSpacing requires a rule of 'multiple', 'exact' or 'atLeast'"};let r=n.rule==="multiple"?n.value*240:n.value*20;if(!Number.isFinite(n.value)||n.value<=0||Math.round(r)>31680)return {supported:false,code:"invalidArgs",reason:"lineSpacing requires a positive value no taller than 1584pt"}}if(e.alignment!==void 0&&!["left","center","right","justify"].includes(e.alignment))return {supported:false,code:"invalidArgs",reason:"unknown alignment"};if(e.direction!==void 0&&!["ltr","rtl"].includes(e.direction))return {supported:false,code:"invalidArgs",reason:"unknown direction"};if(e.tabStops!==void 0){if(e.tabStops.length>64)return {supported:false,code:"invalidArgs",reason:"setParagraphFormat accepts at most 64 tab stops"};let r=new Set;for(let o of e.tabStops){if(typeof o!="object"||o===null)return {supported:false,code:"invalidArgs",reason:"a tab stop must be an object"};if(!Number.isInteger(o.positionTwips)||o.positionTwips<0||o.positionTwips>31680)return {supported:false,code:"invalidArgs",reason:"tab stop positions must be whole twips between 0 and 31680"};if(!["left","center","right","decimal"].includes(o.alignment))return {supported:false,code:"invalidArgs",reason:"unknown tab alignment"};if(o.leader!==void 0&&!["none","dot","hyphen","underscore","heavy","middleDot"].includes(o.leader))return {supported:false,code:"invalidArgs",reason:"unknown tab leader"};if(r.has(o.positionTwips))return {supported:false,code:"invalidArgs",reason:"two tab stops cannot share a position"};r.add(o.positionTwips);}}return {supported:true,mutating:true}}case "setIndent":{let t=[e.left,e.right,e.firstLine];if(t.every(n=>n===void 0))return {supported:false,reason:"setIndent requires at least one indent field"};for(let n of t)if(n!=null){if(!Number.isInteger(n))return {supported:false,reason:"indent values must be whole twips"};if(Math.abs(n)>chunkDOHF6FA7_cjs.fd)return {supported:false,reason:`indent values must be within \xB1${chunkDOHF6FA7_cjs.fd} twips`}}return {supported:true,mutating:true}}case "toggleList":return e.kind==="bullet"||e.kind==="ordered"?{supported:true,mutating:true}:{supported:false,reason:`list kind '${e.kind}' is not supported`};case "adjustIndent":return e.direction==="increase"||e.direction==="decrease"?{supported:true,mutating:true}:{supported:false,reason:`indent direction '${e.direction}' is not supported`};case "insertBreak":return e.kind==="line"||e.kind==="page"||e.kind==="section"||e.kind==="sectionContinuous"?{supported:true,mutating:true}:{supported:false,reason:`break kind '${e.kind}' is not supported`};case "insertText":return e.target===void 0?{supported:true,mutating:true}:{supported:false,reason:"DocTarget addressing is not supported; text inserts at the selection"};case "deleteText":return e.target===void 0?{supported:true,mutating:true}:{supported:false,reason:"DocTarget addressing is not supported; deletion removes the selection"};case "proposeInsertion":case "proposeReplacement":{let t=e.type==="proposeInsertion"?e.text:e.replaceWith;return typeof t!="string"||t.length===0?{supported:false,code:"invalidArgs",reason:`${e.type} requires non-empty text`}:/[\r\n\v\f\u2028\u2029]/.test(t)?{supported:false,code:"invalidArgs",reason:`${e.type} requires text without a paragraph mark`}:e.author!==void 0&&e.author.trim().length===0?{supported:false,code:"invalidArgs",reason:`${e.type} requires a non-empty author`}:{supported:true,mutating:true}}case "proposeDeletion":return e.author!==void 0&&e.author.trim().length===0?{supported:false,code:"invalidArgs",reason:"proposeDeletion requires a non-empty author"}:{supported:true,mutating:true};case "setPageSetup":{let t=[e.pageWidth,e.pageHeight],n=[e.marginTop,e.marginRight,e.marginBottom,e.marginLeft];if(t.every(r=>r===void 0)&&n.every(r=>r===void 0)&&e.orientation===void 0)return {supported:false,reason:"setPageSetup requires at least one field"};for(let r of t)if(r!==void 0&&(!Number.isInteger(r)||r<1||r>63360))return {supported:false,code:"invalidArgs",reason:"page dimensions must be integer twips between 1 and 63360"};for(let r of n)if(r!==void 0&&(!Number.isInteger(r)||r<0||r>31680))return {supported:false,code:"invalidArgs",reason:"margins must be integer twips between 0 and 31680"};return e.orientation!==void 0&&e.orientation!=="portrait"&&e.orientation!=="landscape"?{supported:false,code:"invalidArgs",reason:"orientation must be 'portrait' or 'landscape'"}:e.scope!==void 0&&e.scope!=="document"&&e.scope!=="section"?{supported:false,code:"invalidArgs",reason:"scope must be 'document' or 'section'"}:{supported:true,mutating:true}}case "undo":case "redo":return {supported:true,mutating:true};case "insertTable":return Number.isInteger(e.rows)&&Number.isInteger(e.cols)&&e.rows>=1&&e.cols>=1&&e.rows<=32767&&e.cols<=63&&e.rows*e.cols<=2e4?{supported:true,mutating:true}:{supported:false,code:"invalidArgs",reason:`insertTable needs whole rows and cols of at least 1, at most ${32767}\xD7${63}, and at most ${2e4} cells`};case "insertToc":return {supported:true,mutating:true};case "editTextFormField":return {supported:true,mutating:false};case "refreshToc":return e.mode!==void 0&&e.mode!=="entire"&&e.mode!=="pageNumbers"?{supported:false,code:"invalidArgs",reason:"refreshToc mode must be 'entire' or 'pageNumbers'"}:e.tocId!==void 0&&(typeof e.tocId!="string"||e.tocId.length===0)?{supported:false,code:"invalidArgs",reason:"refreshToc tocId must be a non-empty string"}:{supported:true,mutating:true};case "editHeaderFooter":return e.position!=="header"&&e.position!=="footer"?{supported:false,reason:"editHeaderFooter requires position 'header' or 'footer'"}:e.variant!==void 0&&e.variant!=="default"&&e.variant!=="first"&&e.variant!=="even"?{supported:false,reason:"editHeaderFooter variant must be 'default', 'first', or 'even'"}:{supported:true,mutating:true};case "exitHeaderFooter":return {supported:true,mutating:false};case "removeHeaderFooter":case "linkHeaderFooterToPrevious":case "unlinkHeaderFooterFromPrevious":return "variant"in e&&e.variant!==void 0&&e.variant!=="default"&&e.variant!=="first"&&e.variant!=="even"?{supported:false,reason:"furniture variant must be 'default', 'first', or 'even'"}:{supported:true,mutating:true};case "setHeaderFooterOptions":return e.titlePage===void 0&&e.evenAndOddHeaders===void 0&&e.headerDistanceTwips===void 0&&e.footerDistanceTwips===void 0?{supported:false,reason:"setHeaderFooterOptions requires at least one option"}:{supported:true,mutating:true};case "insertPageField":return e.field==="PAGE"||e.field==="NUMPAGES"||e.field==="SECTIONPAGES"||e.field==="PAGE_X_OF_Y"?{supported:true,mutating:true}:{supported:false,reason:"insertPageField field must be 'PAGE', 'NUMPAGES', 'SECTIONPAGES', or 'PAGE_X_OF_Y'"};case "insertNote":return e.noteKind==="footnote"||e.noteKind==="endnote"?{supported:true,mutating:true}:{supported:false,reason:"insertNote noteKind must be 'footnote' or 'endnote'"};case "deleteNote":return e.noteKind==="footnote"||e.noteKind==="endnote"?{supported:true,mutating:true}:{supported:false,reason:"deleteNote noteKind must be 'footnote' or 'endnote'"};case "convertNote":return e.fromKind==="footnote"||e.fromKind==="endnote"?{supported:true,mutating:true}:{supported:false,reason:"convertNote fromKind must be 'footnote' or 'endnote'"};case "convertAllNotes":return e.fromKind==="footnote"||e.fromKind==="endnote"?{supported:true,mutating:true}:{supported:false,reason:"convertAllNotes fromKind must be 'footnote' or 'endnote'"};case "setNoteProperties":return e.endnote?.position==="pageBottom"?{supported:false,reason:"endnote-pageBottom"}:e.footnote!==void 0||e.endnote!==void 0?{supported:true,mutating:true}:{supported:false,reason:"setNoteProperties requires footnote and/or endnote fields"};case "selectAll":case "copy":return {supported:true,mutating:false};case "cut":return {supported:true,mutating:true};case "paste":case "pasteWithoutFormatting":{if(typeof e.text!="string")return {supported:false,code:"invalidArgs",reason:"paste requires text"};let t=e.type==="paste"?e.html:void 0;return t!==void 0&&typeof t!="string"?{supported:false,code:"invalidArgs",reason:"paste html must be a string"}:e.text===""&&(t===void 0||t==="")?{supported:false,code:"invalidArgs",reason:"there is nothing to paste"}:{supported:true,mutating:true}}case "insertRow":case "deleteRow":case "insertColumn":case "deleteColumn":case "deleteTable":case "setCellFill":case "setTableCellVerticalAlignment":case "setTableBorders":case "commitTableColumnDividerResize":case "commitTableRightEdgeResize":case "mergeCells":case "splitCell":case "toggleHeaderRow":case "selectTableRegion":case "setTableProperties":{let t=NS(e);return t.supported?{supported:true,mutating:true}:{supported:false,reason:t.reason??"unsupported table command"}}case "setSelection":return "range"in e&&(_p(e.range)||Ko(e.range))||"anchor"in e&&Et(e.anchor)?{supported:true,mutating:false}:{supported:false,reason:"setSelection accepts { anchor: { paraId } }, a { range } whose from/to are paraId anchors, or a { range } carrying a semantic { anchor: { paragraphId, offset }, head } selection"};case "insertTextBox":return {supported:true,mutating:true};case "insertImage":return e.data instanceof Uint8Array&&(e.mime==="image/png"||e.mime==="image/jpeg"||e.mime==="image/gif")&&Number.isFinite(e.widthPoints)&&Number.isFinite(e.heightPoints)&&e.widthPoints>0&&e.heightPoints>0?{supported:true,mutating:true}:{supported:false,code:"invalidArgs",reason:"insertImage requires png/jpeg/gif bytes and finite dimensions"};case "replaceImage":return e.data instanceof Uint8Array?{supported:true,mutating:true}:{supported:false,code:"invalidArgs",reason:"replaceImage requires image bytes"};case "deleteImage":return {supported:true,mutating:true};case "setImageWrapType":return ["inline","square","squareLeft","squareRight","tight","through","topAndBottom","behind","inFront"].includes(e.target)?{supported:true,mutating:true}:{supported:false,code:"invalidArgs",reason:"unsupported wrap target"};case "transformImage":return e.action==="rotateCW"||e.action==="rotateCCW"||e.action==="flipH"||e.action==="flipV"?{supported:true,mutating:true}:{supported:false,code:"invalidArgs",reason:"unsupported transform action"};case "setImagePosition":return {supported:true,mutating:true};case "setImageProperties":return {supported:true,mutating:true};default:return {supported:false,reason:qp(e.type)}}}function qp(e){return `command '${e}' is not supported by the tree editor`}var Qt="comments and tracked changes require the pro review module (@docx-editor.dev/pro)",VS="realtime collaboration requires the pro collaboration module (@docx-editor.dev/pro)",ir="suggesting mode needs an author; configure author before enabling it",BL="this document asks for tracked changes, but no author is configured",Td="this document is protected for filling in forms, which does not track changes",Vp="this document permits editing only as tracked changes",gs="image changes are not supported in suggesting mode",_i="this revision kind has no structural accept/reject yet",jo="this document is protected against editing; open it in Word to change that",Wo="this document is protected for comments only",Kp={mode:null,rejection:null};function jp(e,t){if(e===void 0||e==="view")return Kp;if(e==="edit")return {mode:"editing",rejection:null};let n=Wp(t);return n!==null?{mode:null,rejection:n.reason}:{mode:"suggesting",rejection:null}}function Wp(e){return e.reviewEnabled?e.hasAuthor?null:{ok:false,code:"invalidArgs",reason:ir}:{ok:false,code:"unsupported",reason:Qt}}function jS(e){let t=false,n=null,r=e.log??(o=>console.error(o));return {report(o){o!==ir||t||n!==null||(n=setTimeout(()=>{if(n=null,!e.stillMissing())return;t=true;let i=`${ir}. Edits are not tracked until an author is set (the author option at construction, setAuthor(), or the adapter author prop).`;e.emit(fn("suggestingNeedsAuthor",i)),r(`[@docx-editor.dev/core] ${i}`);},0));},dispose(){n!==null&&clearTimeout(n),n=null;}}}function Zp(e){if(e.restrictedToReadOnly)return e.currentMode==="viewing"?Kp:{mode:"viewing",rejection:jo};let t=e.currentMode,n=null;e.engineAdoptedViewing&&t==="viewing"&&!e.viewOnly&&(n="editing",t="editing");let r=n===null?Kp:{mode:n,rejection:null};return e.restrictedToComments?t==="suggesting"&&!e.viewOnly?{mode:"editing",rejection:Wo}:r:e.restrictedToForms?t==="suggesting"&&!e.viewOnly?{mode:"editing",rejection:Td}:r:e.viewOnly||t!=="editing"||e.readerChoseMode||!(e.trackRevisions&&!e.hostChoseMode)&&!e.restrictedToTrackedChanges||!e.reviewEnabled?r:e.hasAuthor?{mode:"suggesting",rejection:null}:{mode:n,rejection:BL}}function WS(e){return e===null?{enter:true,rejection:null}:{enter:false,rejection:e.reason}}function zp(e,t){return t!=="viewing"&&e.restrictedToReadOnly?{ok:false,code:"locked",reason:jo}:t==="suggesting"&&e.restrictedToComments?{ok:false,code:"locked",reason:Wo}:t==="suggesting"&&e.restrictedToForms?{ok:false,code:"locked",reason:Td}:t!=="editing"||!e.restrictedToTrackedChanges?null:{ok:false,code:"locked",reason:Vp}}function ZS(e,t,n,r,o,i=false){let a=jp(e,t),s=e==="view"?"viewing":a.mode??o,l=Zp({...t,...n,viewOnly:e==="view",hostChoseMode:e!==void 0,readerChoseMode:false,currentMode:s,engineAdoptedViewing:i});l.mode!==null&&(s=l.mode);let d=zp(n,s),c=n.restrictedToReadOnly?"viewing":r;return {mode:d===null?s:c,rejection:l.rejection??d?.reason??null,configurationRejection:a.rejection}}var zS=new WeakMap;function US(e,t){zS.set(e,t);}var Up="this document is protected for tracked changes; their authors cannot change",Zo="this document is protected; only form fields can be filled";function Vn(e,t){if(e.type==="undo"||e.type==="redo"||e.type==="toggleDocumentProtection")return null;let n=chunkOSFOJTHU_cjs.Tg(t.session.currentPackage()),r=chunkOSFOJTHU_cjs.Lg(n?.root);if(!r.enforced)return null;if(r.edit==="readOnly"||r.edit==="comments")return {ok:false,code:"locked",reason:r.edit==="comments"?Wo:jo};if(r.edit==="trackedChanges"&&e.type==="setReviewChangesAuthor")return {ok:false,code:"locked",reason:Up};if(r.edit!=="forms"||no(e))return null;let o="structure",i,a=false;switch(e.type){case "insertText":o="text",i=e.text;break;case "paste":case "pasteWithoutFormatting":o="text",i=e.text,a=true;break;case "deleteText":case "cut":o="text";break;case "toggleMark":case "setMarkAttr":case "pasteFormatting":o="runFormat";break;case "clearFormatting":case "setAlignment":case "setParagraphDirection":case "setLineSpacing":case "setParagraphSpacing":case "setIndent":case "adjustIndent":case "toggleList":case "setParagraphStyle":case "setParagraphFormat":case "removeTabMark":o="paragraph";break;case "setPageSetup":case "setHeaderFooterOptions":case "convertAllNotes":case "insertToc":case "refreshToc":case "replaceAllMatches":case "resolveAllReviewChanges":case "setReviewChangesAuthor":case "acceptRevision":case "rejectRevision":case "acceptAllRevisions":case "rejectAllRevisions":o="document";break}let s=t.state().selection,l=t.session.storyParts().find(p=>s.head.paragraphId.startsWith(`${p.name}#`));if(!l)return {ok:false,code:"locked",reason:Zo};let d=t.state().cellSelection;return (d&&(o==="runFormat"||o==="paragraph")?[...chunkD7ZMDMPX_cjs.ga(t.layout(),d.cellIds)].map(p=>({anchor:{paragraphId:p,offset:0},head:{paragraphId:p,offset:(chunkOSFOJTHU_cjs.Vi(l,p)??"").length}})):[s]).some(p=>chunkOSFOJTHU_cjs.rj(l,n,{selection:p,intent:o,text:i,paste:a,fieldId:zS.get(t)?.()??void 0}))?{ok:false,code:"locked",reason:Zo}:null}function GS(e,t){if(e!=="locked")return e;let n=chunkOSFOJTHU_cjs.Lg(t);return n.enforced?n.edit==="comments"?Wo:n.edit==="forms"?Zo:jo:"this content is locked"}function XS(e){return e!==null&&Vn({type:"resolveAllReviewChanges"},e)!==null}function YS(e,t){return ()=>e()??(t()?null:"the document is read-only")}function QS(e){return e.borderWidthEmu!==void 0||e.borderColor!==void 0}function JS(e){return e.horizontalEmu!==void 0||e.verticalEmu!==void 0||e.relativeToH!==void 0||e.relativeToV!==void 0}function eI(e){return e.widthEmu!==void 0||e.heightEmu!==void 0||e.alt!==void 0||e.title!==void 0||e.description!==void 0||e.hyperlink!==void 0||e.crop!==void 0||e.wrap!==void 0||e.resetToNaturalSize===true||chunkOSFOJTHU_cjs.Ok(e)}var tI=new WeakMap;function nI(e,t){tI.set(e,t);}function rI(e,t,n){tI.get(e)?.(t,n);}function $L(e){return [e.left,e.top,e.right,e.bottom]}function Gp(e){return Object.freeze({left:e.left*100,top:e.top*100,right:e.right*100,bottom:e.bottom*100})}function qL(e){return Object.freeze({left:e.left/100,top:e.top/100,right:e.right/100,bottom:e.bottom/100})}function hs(e){return Math.round(e*1e3)}function ys(e){return e/1e3}function Xp(e){return Object.freeze({left:hs(e.left),top:hs(e.top),right:hs(e.right),bottom:hs(e.bottom)})}function KL(e){return Object.freeze({left:ys(e.left),top:ys(e.top),right:ys(e.right),bottom:ys(e.bottom)})}function Yp(e){return $L(e).some(n=>!Number.isFinite(n)||n<0||n>100)?false:e.left+e.right<100&&e.top+e.bottom<100}var Cd=12700;function Ot(e){return Math.round(e*12700)}function zo(e){return e/12700}function oI(e,t,n,r,o,i){let a=zo(e),s=zo(t),l=a/s,d=n.includes("e")?r:n.includes("w")?-r:0,c=n.includes("s")?o:n.includes("n")?-o:0;if(a=Math.max(1,a+d),s=Math.max(1,s+c),i)if(n.length===2){let p=Math.max(a/zo(e),s/zo(t));a=Math.max(1,zo(e)*p),s=Math.max(1,a/l);}else n==="e"||n==="w"?s=Math.max(1,a/l):a=Math.max(1,s*l);return Object.freeze({cx:Ot(a),cy:Ot(s)})}function Ed(e,t,n){return e.mode==="simple"?Object.freeze({mode:"simple",horizontalEmu:(e.horizontalEmu??0)+Ot(t),verticalEmu:(e.verticalEmu??0)+Ot(n)}):Object.freeze({mode:"frame",...e.horizontalEmu!==void 0?{horizontalEmu:e.horizontalEmu+Ot(t)}:{},...e.verticalEmu!==void 0?{verticalEmu:e.verticalEmu+Ot(n)}:{},...e.relativeToH!==void 0?{relativeToH:e.relativeToH}:{},...e.relativeToV!==void 0?{relativeToV:e.relativeToV}:{}})}var VL=new Set(["insertImage","replaceImage"]),jL=new Set(["insertImage","replaceImage","deleteImage","setImageWrapType","transformImage","setImagePosition","setImageProperties"]);function Qp(e,t,n){return e.accessibility.hidden||n!==null&&e.drawingNodeId!==n?false:e.start===t||e.start+1===t}function WL(e,t,n,r){if(!e)return null;for(let o of e.drawings??[])if(o.paragraphId===t&&Qp(o,n,r))return o;return null}function ZL(e,t,n,r){let o=e.layout();for(let i of o.pages){for(let a of i.anchoredDrawings??[])if(a.anchorParagraphId===t&&Qp(a,n,r))return a;for(let a of [i.header,i.footer])if(a){for(let s of a.anchoredDrawings??[])if(s.anchorParagraphId===t&&Qp(s,n,r))return s}}return null}function iI(e){return e.kind==="pointer"?`pointer:${e.drawingNodeId}`:e.kind}function Sn(e){if(!e)return null;let t=e.drawingSelectionIntent();if(t.kind==="none")return null;let{anchor:n,head:r}=e.state().selection;if(n.paragraphId!==r.paragraphId||n.offset!==r.offset)return null;let o=chunkDOHF6FA7_cjs.vd(e.layout(),n.paragraphId,n.offset),i=t.kind==="pointer"?t.drawingNodeId:null;return WL(o,n.paragraphId,n.offset,i)??ZL(e,n.paragraphId,n.offset,i)}function aI(e,t){let n=e.storyScope(),r=e.session.partFor(n)??e.session.part(),o=chunkOSFOJTHU_cjs.Ta(r,t.drawingNodeId);return o?o.kind!=="drawing"?chunkOSFOJTHU_cjs.Kk(r,t.drawingNodeId):chunkOSFOJTHU_cjs.Nd(o,{ownerPartName:t.ownerPartName,supportedMcRequires:chunkOSFOJTHU_cjs.Gd,limits:chunkOSFOJTHU_cjs.Fd,resolveRelationship:chunkOSFOJTHU_cjs.Id(e.session.currentPackage(),t.ownerPartName)}):null}function sI(e){if(e.kind!=="anchored"||!e.position)return null;let t=e.position;return e.anchor?.simplePos?Object.freeze({mode:"simple",horizontalEmu:t.simplePosition.xEmu,verticalEmu:t.simplePosition.yEmu}):Object.freeze({mode:"frame",...t.horizontal.offsetEmu!==null?{horizontalEmu:t.horizontal.offsetEmu}:{},...t.vertical.offsetEmu!==null?{verticalEmu:t.vertical.offsetEmu}:{},relativeToH:t.horizontal.relativeFrom,relativeToV:t.vertical.relativeFrom})}function zL(e){let t=e.resource;return t.kind!=="ready"?null:Object.freeze({pixelWidth:t.pixelWidth,pixelHeight:t.pixelHeight,dpiX:t.dpiX,dpiY:t.dpiY})}function lI(e){let t=e.locks,n=e.kind==="inline"&&e.textboxStory!==null;return Object.freeze({canResize:!n&&!t.resize&&!e.hidden,canMove:!n&&!t.move&&!e.hidden,canChangeWrap:e.picture!==null&&!t.move&&e.kind==="anchored"&&!e.hidden,canCrop:e.picture!==null&&!t.resize&&!t.changeAspect&&!e.hidden})}function UL(e){return e.kind==="inlineDrawing"?"inline":e.wrap}var dI=e=>e.placeholderGraphicKind===null||!!e.textboxStory;function ar(e){let t=Sn(e);if(!t||!dI(t))return null;let n=e?aI(e,t):null;if(!n||n.hidden||n.locks.select)return null;let r=t.transform;return Object.freeze({id:t.drawingNodeId,kind:n.kind,widthEmu:n.extentEmu.cx,heightEmu:n.extentEmu.cy,crop:Gp(t.crop),rotationDegrees:r.rotationDegrees,wrap:UL(t),position:sI(n),name:n.name,title:n.title,description:n.description,hyperlink:n.hyperlinkHref,locks:n.locks,hidden:n.hidden,resourceStatus:t.resource.kind,intrinsic:zL(t),...lI(n)})}function cI(e,t){return e===t?true:!e||!t?false:e.id===t.id&&e.kind===t.kind&&e.widthEmu===t.widthEmu&&e.heightEmu===t.heightEmu&&e.crop.left===t.crop.left&&e.crop.top===t.crop.top&&e.crop.right===t.crop.right&&e.crop.bottom===t.crop.bottom&&e.rotationDegrees===t.rotationDegrees&&e.wrap===t.wrap&&e.name===t.name&&e.title===t.title&&e.description===t.description&&e.hyperlink===t.hyperlink&&e.hidden===t.hidden&&e.resourceStatus===t.resourceStatus&&e.canResize===t.canResize&&e.canMove===t.canMove&&e.canChangeWrap===t.canChangeWrap&&e.canCrop===t.canCrop&&e.locks.select===t.locks.select&&e.locks.move===t.locks.move&&e.locks.resize===t.locks.resize&&e.locks.changeAspect===t.locks.changeAspect&&(e.position?.mode??"frame")===(t.position?.mode??"frame")&&(e.position?.horizontalEmu??null)===(t.position?.horizontalEmu??null)&&(e.position?.verticalEmu??null)===(t.position?.verticalEmu??null)&&(e.position?.relativeToH??null)===(t.position?.relativeToH??null)&&(e.position?.relativeToV??null)===(t.position?.relativeToV??null)&&(e.intrinsic?.pixelWidth??null)===(t.intrinsic?.pixelWidth??null)&&(e.intrinsic?.pixelHeight??null)===(t.intrinsic?.pixelHeight??null)&&(e.intrinsic?.dpiX??null)===(t.intrinsic?.dpiX??null)&&(e.intrinsic?.dpiY??null)===(t.intrinsic?.dpiY??null)}function Jp(e){if("drawingNodeId"in e&&typeof e.drawingNodeId=="string")return e.drawingNodeId}function uI(e){if("expectedPackageRevision"in e&&typeof e.expectedPackageRevision=="number")return e.expectedPackageRevision}function em(e){return Jp(e)!==void 0||uI(e)!==void 0||e.type==="setImageProperties"&&e.selectionParagraphId!==void 0}function tm(e,t,n){let r=e.surface;if(!r)return {ok:false,code:"notFound",reason:"no document is loaded"};let o=uI(t);if(o!==void 0&&r.session.packageRevision()!==o)return {ok:false,code:"notFound",reason:"stale package revision"};let i=Jp(t),a=ar(r);if(i!==void 0&&(!a||a.id!==i))return {ok:false,code:"notFound",reason:"stale drawing selection"};if(t.type==="setImageProperties"&&t.selectionParagraphId!==void 0&&t.selectionOffset!==void 0){let{anchor:s,head:l}=r.state().selection;if(s.paragraphId!==t.selectionParagraphId||s.offset!==t.selectionOffset||l.paragraphId!==t.selectionParagraphId||l.offset!==t.selectionOffset)return {ok:false,code:"notFound",reason:"stale drawing selection"}}return Bi(e,n,{requireDrawing:i!==void 0||n.drawingNodeId!==null,drawingNodeId:i??n.drawingNodeId??void 0})}function ro(e,t){let n=ar(e),r=Jp(t);return r?!n||n.id!==r?{ok:false,code:"notFound",reason:"stale drawing selection"}:{id:r}:n?{id:n.id}:{ok:false,code:"notFound",reason:"no drawing is selected"}}function GL(e){return e.rejected?{ok:false,code:"invalidArgs",reason:e.reason==="drawing-locked"?"the drawing is locked":e.reason==="unknown-drawing"?"stale drawing selection":typeof e.reason=="string"?e.reason:"the image change was refused"}:null}function Od(e,t){return GL(e.applyDrawingOps(t))}function XL(e){if(!e.intrinsic)return null;let t=Math.round(e.intrinsic.pixelWidth*914400/e.intrinsic.dpiX),n=Math.round(e.intrinsic.pixelHeight*914400/e.intrinsic.dpiY);return !Number.isFinite(t)||!Number.isFinite(n)||t<=0||n<=0?null:{cx:t,cy:n}}function fI(e,t){return t?.position?.mode==="simple"?Object.freeze({mode:"simple",...e.horizontalEmu!==void 0?{horizontalEmu:e.horizontalEmu}:{},...e.verticalEmu!==void 0?{verticalEmu:e.verticalEmu}:{}}):Object.freeze({mode:"frame",...e.horizontalEmu!==void 0?{horizontalEmu:e.horizontalEmu}:{},...e.verticalEmu!==void 0?{verticalEmu:e.verticalEmu}:{},...e.relativeToH!==void 0?{relativeToH:e.relativeToH}:{},...e.relativeToV!==void 0?{relativeToV:e.relativeToV}:{}})}function bs(e){return jL.has(e.type)}function YL(e){return VL.has(e.type)}function pI(e){return {ok:false,code:"unsupported",reason:`${e.type} is asynchronous; use executeImageCommand`}}function mI(e,t){if(!e)return {ok:false,code:"notFound",reason:"no document is loaded"};let n=e.editingMode();return n==="view"?{ok:false,code:"locked",reason:"the document is open for viewing"}:n==="suggest"&&t==="replaceImage"?{ok:false,code:"invalidArgs",reason:gs}:null}function vs(e){let t=e.surface;if(!t)return null;let{anchor:n}=t.state().selection,r=ar(t);return Object.freeze({mountGeneration:e.mountGeneration,packageRevision:t.session.packageRevision(),drawingNodeId:r?.id??null,selectionParagraphId:n.paragraphId,selectionOffset:n.offset})}function Bi(e,t,n){let r=e.surface;if(!r)return {ok:false,code:"notFound",reason:"no document is loaded"};if(e.mountGeneration!==t.mountGeneration)return {ok:false,code:"notFound",reason:"the editor is no longer attached"};let{anchor:o,head:i}=r.state().selection;if(o.paragraphId!==t.selectionParagraphId||o.offset!==t.selectionOffset)return {ok:false,code:"notFound",reason:"stale drawing selection"};if(o.paragraphId!==i.paragraphId||o.offset!==i.offset)return {ok:false,code:"notFound",reason:"stale drawing selection"};if(n?.requireDrawing){let a=ar(r),s=n.drawingNodeId??t.drawingNodeId;if(!a||!s||a.id!==s)return {ok:false,code:"notFound",reason:"stale drawing selection"}}return null}var nm="a picture is selected; place the caret in text to insert a picture";function $i(e,t){if(!bs(e))return null;if(!t)return {ok:false,code:"notFound",reason:"no document is loaded"};let n=Vn(e,t);if(n)return n;if(e.type==="insertImage")return Sn(t)?{ok:false,code:"invalidArgs",reason:nm}:!(e.data instanceof Uint8Array)||e.data.byteLength===0?{ok:false,code:"invalidArgs",reason:"insertImage requires image bytes"}:!Number.isFinite(e.widthPoints)||!Number.isFinite(e.heightPoints)?{ok:false,code:"invalidArgs",reason:"insertImage requires finite dimensions"}:e.widthPoints<=0||e.heightPoints<=0?{ok:false,code:"invalidArgs",reason:"insertImage dimensions must be positive"}:null;let r=Sn(t);if(r&&"textboxStory"in r&&r.textboxStory&&(e.type==="replaceImage"||e.type==="transformImage"||e.type==="setImageProperties"&&e.hyperlink!==void 0))return {ok:false,code:"unsupported",reason:"this operation is not supported for textboxes"};if(e.type==="replaceImage"){if(!(e.data instanceof Uint8Array)||e.data.byteLength===0)return {ok:false,code:"invalidArgs",reason:"replaceImage requires image bytes"};let s=ro(t,e);return "ok"in s?s:null}let i=ro(t,e);if("ok"in i)return i;let a=ar(t);if(!a)return {ok:false,code:"notFound",reason:"no drawing is selected"};if(t.editingMode()==="suggest"&&e.type!=="deleteImage")return {ok:false,code:"invalidArgs",reason:gs};switch(e.type){case "deleteImage":return a.locks.select?{ok:false,code:"locked",reason:"the drawing cannot be selected"}:null;case "setImageWrapType":return a.canChangeWrap?null:{ok:false,code:"locked",reason:"wrap cannot be changed on this drawing"};case "transformImage":return a.locks.changeAspect||a.locks.resize?{ok:false,code:"locked",reason:"the drawing is locked"}:null;case "setImagePosition":if(!a.canMove||a.kind!=="anchored")return {ok:false,code:"locked",reason:"position cannot be changed on this drawing"};if(!JS(e))return {ok:false,code:"invalidArgs",reason:"setImagePosition requires at least one field"};let s=a.position?.mode??"frame";return chunkOSFOJTHU_cjs.Qk(e,s)?chunkOSFOJTHU_cjs.Lk(fI(e,a))?null:{ok:false,code:"invalidArgs",reason:"setImagePosition carries invalid position values"}:{ok:false,code:"invalidArgs",reason:"setImagePosition carries invalid position values"};case "setImageProperties":{if(QS(e))return {ok:false,code:"unsupported",reason:"image border properties are not supported yet"};if(!eI(e))return {ok:false,code:"invalidArgs",reason:"setImageProperties requires at least one field"};if(e.resetToNaturalSize&&!a.intrinsic)return {ok:false,code:"invalidArgs",reason:"natural size is unavailable for this image"};if(e.widthEmu!==void 0&&(!Number.isFinite(e.widthEmu)||e.widthEmu<=0))return {ok:false,code:"invalidArgs",reason:"widthEmu must be a positive finite number"};if(e.heightEmu!==void 0&&(!Number.isFinite(e.heightEmu)||e.heightEmu<=0))return {ok:false,code:"invalidArgs",reason:"heightEmu must be a positive finite number"};if(e.widthEmu!==void 0&&!a.canResize)return {ok:false,code:"locked",reason:"the drawing is locked"};if(e.heightEmu!==void 0&&!a.canResize)return {ok:false,code:"locked",reason:"the drawing is locked"};if(e.crop!==void 0&&!Yp(e.crop))return {ok:false,code:"invalidArgs",reason:"crop values are out of range"};if(e.crop!==void 0&&!a.canCrop)return {ok:false,code:"locked",reason:"crop cannot be changed on this drawing"};if(e.hyperlink!==void 0&&e.hyperlink!==null&&!chunkOSFOJTHU_cjs.Q(e.hyperlink).ok)return {ok:false,code:"invalidArgs",reason:"unsafe hyperlink URL"};if(e.wrap!==void 0&&!a.canChangeWrap)return {ok:false,code:"locked",reason:"wrap cannot be changed on this drawing"};if(chunkOSFOJTHU_cjs.Ok(e)){if(!a.canMove||a.kind!=="anchored")return {ok:false,code:"locked",reason:"position cannot be changed on this drawing"};let l=a.position?.mode??"frame";if(!chunkOSFOJTHU_cjs.Qk(e,l))return {ok:false,code:"invalidArgs",reason:"setImageProperties carries invalid position values"};if(!chunkOSFOJTHU_cjs.Lk(chunkOSFOJTHU_cjs.Pk(e,a)))return {ok:false,code:"invalidArgs",reason:"setImageProperties carries invalid position values"}}return null}default:return null}}function rm(e,t){let n=mI(t,e.type);if(n)return n;let r=$i(e,t);return r||{ok:true}}function gI(e,t){let n=$i(e,t);return n||pI(e)}function om(e,t,n){if(YL(t))return pI(t);let r=n&&em(t)?vs(n):null;if(r&&n){let o=tm(n,t,r);if(o)return o}switch(t.type){case "deleteImage":{let o=ro(e,t);if("ok"in o)return o;let i=e.deleteImage(o.id);return i.ok?null:{ok:false,code:"invalidArgs",reason:i.detail??i.reason??"deleteImage was refused"}}case "setImageWrapType":{let o=ro(e,t);return "ok"in o?o:Od(e,[{op:"setDrawingWrap",drawingNodeId:o.id,wrap:t.target}])}case "transformImage":{let o=ro(e,t);return "ok"in o?o:Od(e,[{op:"transformDrawing",drawingNodeId:o.id,action:t.action}])}case "setImagePosition":{let o=ro(e,t);if("ok"in o)return o;let i=ar(e),a=fI(t,i);return Od(e,[{op:"positionDrawing",drawingNodeId:o.id,position:a}])}case "setImageProperties":{let o=ro(e,t);if("ok"in o)return o;let i=ar(e);if(!i)return {ok:false,code:"notFound",reason:"no drawing is selected"};let a=[];if(t.resetToNaturalSize){let d=XL(i);if(!d)return {ok:false,code:"invalidArgs",reason:"natural size is unavailable for this image"};a.push({op:"resizeDrawing",drawingNodeId:o.id,extentEmu:d});}else (t.widthEmu!==void 0||t.heightEmu!==void 0)&&a.push({op:"resizeDrawing",drawingNodeId:o.id,extentEmu:{cx:t.widthEmu??i.widthEmu,cy:t.heightEmu??i.heightEmu}});t.crop!==void 0&&a.push({op:"cropDrawing",drawingNodeId:o.id,crop:Xp(t.crop)});let s=t.title??t.alt,l=t.description??t.alt;if((s!==void 0||l!==void 0)&&a.push({op:"setDrawingMetadata",drawingNodeId:o.id,title:s??i.title,description:l??i.description}),t.wrap!==void 0&&a.push({op:"setDrawingWrap",drawingNodeId:o.id,wrap:t.wrap}),chunkOSFOJTHU_cjs.Ok(t)){let d=chunkOSFOJTHU_cjs.Pk(t,i);a.push({op:"positionDrawing",drawingNodeId:o.id,position:d});}if(t.hyperlink!==void 0){let d=e.applyImageProperties({drawingNodeId:o.id,ops:a,hyperlink:t.hyperlink});return d.ok?null:{ok:false,code:"invalidArgs",reason:d.detail??d.reason??"setImageProperties was refused"}}return a.length===0?{ok:false,code:"invalidArgs",reason:"setImageProperties requires at least one field"}:Od(e,a)}default:return null}}function QL(e,t,n,r,o){let i=chunkDOHF6FA7_cjs.Rc(e.sectionPropertiesAt(t)),a=i.width-i.margin.left-i.margin.right,s=chunkDOHF6FA7_cjs.Gc(i),l=i.height-s.top-s.bottom,d=chunkDOHF6FA7_cjs.vd(e.layout(),t,n),c=d&&d.box.width>0?Math.min(d.box.width,a):a,u=Math.min(1,c/r,l/o);return u>=1?{widthPoints:r,heightPoints:o}:{widthPoints:r*u,heightPoints:o*u}}async function im(e,t){let n=await JL(e,t);return rI(e,t,n),n}async function JL(e,t){let n=e.surface;if(!n)return {ok:false,code:"notFound",reason:"no document is loaded"};let r=mI(n,t.type);if(r)return r;let o=$i(t,n);if(o)return o;let i=vs(e);if(!i)return {ok:false,code:"notFound",reason:"no document is loaded"};if(t.type==="insertImage"){let{anchor:u}=n.state().selection,p=t.expectedPackageRevision??i.packageRevision;if(t.expectedPackageRevision!==void 0&&n.session.packageRevision()!==t.expectedPackageRevision)return {ok:false,code:"notFound",reason:"stale package revision"};let m=QL(n,u.paragraphId,u.offset,t.widthPoints,t.heightPoints),g=await n.insertImage({paragraphId:u.paragraphId,offset:u.offset,bytes:t.data,mime:t.mime,widthPoints:m.widthPoints,heightPoints:m.heightPoints,expectedPackageRevision:p,commitGuard:()=>Bi(e,i)===null,...t.title!==void 0?{title:t.title}:{},...t.description!==void 0?{description:t.description}:{},...t.hyperlink!==void 0?{hyperlink:t.hyperlink}:{}}),b=Bi(e,i);return b||(g.ok?{ok:true,changed:g.change!==null}:{ok:false,code:"invalidArgs",reason:g.detail==="stale-package-epoch"?"stale package revision":g.detail??g.reason??"insertImage was refused"})}let a=ro(n,t);if("ok"in a)return a;let s=t.expectedPackageRevision??i.packageRevision;if(t.expectedPackageRevision!==void 0&&n.session.packageRevision()!==t.expectedPackageRevision)return {ok:false,code:"notFound",reason:"stale package revision"};let l=t.mime??"image/png",d=await n.replaceImage(a.id,t.data,l,{expectedPackageRevision:s,commitGuard:()=>Bi(e,i,{requireDrawing:true,drawingNodeId:a.id})===null}),c=Bi(e,i,{requireDrawing:true,drawingNodeId:a.id});return c||(d.ok?{ok:true,changed:d.change!==null}:{ok:false,code:"invalidArgs",reason:d.detail==="stale-package-epoch"?"stale package revision":d.detail??d.reason??"replaceImage was refused"})}var eN=1,tN=10;function nN(e,t){if(!t||t.hidden||t.locks.select||!dI(e))return Object.freeze({canResize:false,canMove:false,aspectLocked:true});let n=lI(t);return Object.freeze({canResize:n.canResize,canMove:n.canMove,aspectLocked:t.locks.changeAspect})}function rN(e){if(!e)return null;let t=e.activeScope(),{anchor:n,head:r}=e.state().selection;if(t.kind!=="frame"&&(n.paragraphId!==r.paragraphId||n.offset!==r.offset))return null;let o=t.kind==="frame"?chunkDOHF6FA7_cjs.fe(e.layout(),t.drawingNodeId)?.record:Sn(e);if(!o||o.accessibility.hidden)return null;let i=e.layout(),a=chunkDOHF6FA7_cjs.fe(i,o.drawingNodeId);if(!a)return null;let s=aI(e,o);if(!s||s.locks.select)return null;let l=nN(o,s),c=e.editingMode()==="edit"&&e.session.editable?l:{...l,canResize:false,canMove:false},u=o.kind==="anchoredDrawing"?Object.freeze({x:o.horizontalFrameOrigin,y:o.verticalFrameOrigin}):null;return Object.freeze({id:o.drawingNodeId,textbox:"textboxStory"in o&&!!o.textboxStory,pageIndex:a.pageIndex,x:a.x,y:a.y,width:a.width,height:a.height,kind:o.kind==="inlineDrawing"?"inline":"anchored",widthEmu:s.extentEmu.cx,heightEmu:s.extentEmu.cy,position:sI(s),anchorFrameOrigin:u,transform:o.transform,...c})}function oN(e,t){let n=e.surface;return n?n.publishedLayout().revision!==t.layoutRevision?{ok:false,code:"notFound",reason:"stale layout revision"}:n.session.packageRevision()!==t.packageRevision?{ok:false,code:"notFound",reason:"stale package revision"}:Bi(e,t.preconditions,{requireDrawing:true,drawingNodeId:t.drawingNodeId}):{ok:false,code:"notFound",reason:"no document is loaded"}}function hI(e){if(!e)return null;let t=e.formatting();return {bold:t.bold,italic:t.italic,underline:t.underline,strike:t.strikethrough,superscript:t.superscript,subscript:t.subscript,...t.color?{color:{kind:"hex",value:t.color}}:{},...t.highlight?{highlight:t.highlight}:{},...t.fontFamily?{fontFamily:t.fontFamily}:{},...t.fontSizeHalfPoints!==null?{fontSizePt:t.fontSizeHalfPoints/2}:{},...t.alignment?{alignment:t.alignment}:{},...t.direction?{direction:t.direction}:{},...t.styleId?{styleId:t.styleId}:{},...t.lineSpacing?{lineSpacing:t.lineSpacing}:{},...t.spaceBeforePt!==null?{spaceBeforePt:t.spaceBeforePt}:{},...t.spaceAfterPt!==null?{spaceAfterPt:t.spaceAfterPt}:{},...t.indent!==null?{indent:t.indent}:{},paragraphFlags:t.paragraphFlags,disagrees:t.disagrees,...t.tabStops!==null?{tabStops:t.tabStops}:{}}}var am=new WeakMap;function yI(e,t){let n=e.isScheduled(),r=sm(t);return r?am.set(e,r):n||am.delete(e),r??(n?am.get(e)??null:null)}function sm(e){if(!e)return null;let t=e.sectionPropertiesAt(e.state().selection.head.paragraphId);return {pageWidthTwips:t.pageSize.widthTwips,pageHeightTwips:t.pageSize.heightTwips,orientation:t.landscape?"landscape":"portrait",marginsTwips:{top:t.margins.topTwips,right:t.margins.rightTwips,bottom:t.margins.bottomTwips,left:t.margins.leftTwips},gutterTwips:t.margins.gutterTwips}}function Md(e){if(!e)return null;let{anchor:t,head:n}=e.state().selection;if(t.paragraphId===n.paragraphId){let d=e.session.paraIdOf(t.paragraphId);return d===null?null:{from:{paraId:d},to:{paraId:d}}}let r=e.session.paragraphAnchors(),o=r.paraIdByNode.get(t.paragraphId),i=r.paraIdByNode.get(n.paragraphId);if(o===void 0||i===void 0)return null;let a=r.ordinalByNode.get(t.paragraphId)??0,s=r.ordinalByNode.get(n.paragraphId)??0;return s<a||s===a&&n.offset<t.offset?{from:{paraId:i},to:{paraId:o}}:{from:{paraId:o},to:{paraId:i}}}function bI(e){if(!e)return null;let t=e.hyperlinks.linkAtCaret();if(!t)return null;let n=e.session.paraIdOf(t.paragraphId);return n===null?null:{href:t.href??"",range:{from:{paraId:n},to:{paraId:n}},...t.tooltip!==void 0?{tooltip:t.tooltip}:{}}}function vI(e,t){if(!e)return [];if(t!==void 0&&t.part!=="body")return [];let n=e.session.part(),r=e.session.paragraphAnchors();return chunk6JPL6ZAS_cjs.d(n).map(o=>{let i=r.paraIdByNode.get(o.id),a=o.kind==="textValue"?void 0:chunk6JPL6ZAS_cjs.i(o);return {...i!==void 0?{paraId:i}:{},text:chunkOSFOJTHU_cjs.Vi(n,o.id)??"",...a!==void 0?{styleId:a}:{}}})}function qi(e){return e?e.state().pageCount:0}function lm(e,t="caret"){return e?e.currentPage(t):1}function iN(e,t){if(!no(e))return {ok:false,refusal:{ok:false,code:"unsupported",reason:"not a table command"}};let n=Ad(e,t);return n.can.ok?{ok:true,tablePlan:n.plan}:{ok:false,refusal:{ok:false,code:n.can.code,reason:n.can.reason}}}function aN(e,t){return {command:e,part:t.session.partFor(t.storyScope())??t.session.part(),layout:t.layout(),storeRevision:t.session.packageRevision(),selection:t.state().selection,cellSelection:t.state().cellSelection,themeColors:t.session.documentThemeColors(),editable:t.session.editable,viewing:t.editingMode()==="view"}}function Ad(e,t){let n=aN(e,t),r=Nr(n),o=chunkOSFOJTHU_cjs.Tg(t.session.currentPackage());return r.ok&&r.ops.some(i=>chunkOSFOJTHU_cjs.qk(n.part,o,i))&&(r={ok:false,code:"locked",reason:Zo}),r.ok?{can:{ok:true},plan:r}:{can:{ok:false,code:r.code,reason:r.reason},plan:r}}function xs(e,t,n,r){if(r?.scope){if(r.scope.kind==="all")return {ok:false,refusal:{ok:false,code:"unsupported",reason:"the all scope is read-only"}};if(r.scope.kind==="note"||r.scope.kind==="frame")return {ok:false,refusal:{ok:false,code:"unsupported",reason:`scope kind '${r.scope.kind}' is not supported`}};if(r.scope.kind==="headerFooter"){let s=t?.activeScope?.()??{kind:"body"};if(s.kind!=="headerFooter"||s.rId!==r.scope.rId)return {ok:false,refusal:{ok:false,code:"unsupported",reason:"open that header or footer before dispatching against its scope"}}}}let o=Vo(e);if(!o.supported)return {ok:false,refusal:{ok:false,code:o.code??"unsupported",reason:o.reason}};if(!t)return {ok:false,refusal:{ok:false,code:"notFound",reason:"no document is loaded"}};if(o.mutating&&(n==="view"||!t.session.editable))return {ok:false,refusal:{ok:false,code:"locked",reason:"the document is read-only"}};let i=o.mutating?Vn(e,t):null;if(i)return {ok:false,refusal:i};if(e.type==="insertTextBox"){let s=wp(t);return s?{ok:false,refusal:s}:{ok:true}}if(e.type==="adjustIndent"&&!t.canAdjustIndent(e.direction))return {ok:false,refusal:{ok:false,code:"unsupported",reason:e.direction==="decrease"?"the selection is already at the outermost level":"the selection cannot indent any further"}};if(e.type==="deleteText"&&Sn(t)){let s=$i({type:"deleteImage"},t);return s&&!s.ok?{ok:false,refusal:s}:{ok:true}}if(e.type==="copy"||e.type==="cut"||e.type==="deleteText"){let{anchor:s,head:l}=t.state().selection;if(s.paragraphId===l.paragraphId&&s.offset===l.offset)return {ok:false,refusal:{ok:false,code:"unsupported",reason:"nothing is selected"}}}if(e.type==="setParagraphStyle"&&!t.session.documentStyles().some(s=>s.type==="paragraph"))return {ok:false,refusal:{ok:false,code:"unsupported",reason:"this document defines no paragraph styles"}};if(e.type==="pasteFormatting"&&t.formatPainter.state().level==="none")return {ok:false,refusal:{ok:false,code:"notFound",reason:pS}};if(e.type==="undo"&&!t.state().canUndo)return {ok:false,refusal:{ok:false,code:"unsupported",reason:"nothing to undo"}};if(e.type==="redo"&&!t.state().canRedo)return {ok:false,refusal:{ok:false,code:"unsupported",reason:"nothing to redo"}};if(e.type==="insertTable"&&!t.canInsertTable(e.rows,e.cols))return {ok:false,refusal:{ok:false,code:"unsupported",reason:"a table can only be inserted at a caret in editable body, cell, or note text"}};if(e.type==="insertToc"&&!t.canInsertToc())return {ok:false,refusal:{ok:false,code:"unsupported",reason:"a table of contents can only be inserted in the editable document body"}};if(e.type==="editTextFormField"&&!t.canEditTextFormField())return {ok:false,refusal:{ok:false,code:"unsupported",reason:"field options are unavailable"}};if(e.type==="refreshToc"&&!t.canRefreshToc(e.tocId))return {ok:false,refusal:{ok:false,code:"notFound",reason:"there is no refreshable table of contents at the selection"}};if(e.type==="insertPageField"&&(t.activeScope?.()??{kind:"body"}).kind!=="headerFooter")return {ok:false,refusal:{ok:false,code:"unsupported",reason:"insertPageField requires an open header or footer scope"}};if(e.type==="insertNote"&&(t.activeScope?.()??{kind:"body"}).kind!=="body")return {ok:false,refusal:{ok:false,code:"unsupported",reason:"insertNote requires body scope"}};if(e.type==="insertBreak"&&(e.kind==="section"||e.kind==="sectionContinuous")){if((t.activeScope?.()??{kind:"body"}).kind!=="body")return {ok:false,refusal:{ok:false,code:"unsupported",reason:"a section break can only be inserted in the editable document body"}};let l=t.sectionBreakRefusal(e.kind==="section"?"nextPage":"continuous");if(l)return {ok:false,refusal:{ok:false,code:"unsupported",reason:l}}}if(e.type==="insertBreak"&&e.kind==="page"&&(t.activeScope?.()??{kind:"body"}).kind!=="body")return {ok:false,refusal:{ok:false,code:"unsupported",reason:"a page break can only be inserted in the editable document body"}};if(e.type==="linkHeaderFooterToPrevious"){let s=t.headerFooterState?.();if((e.sectionIndex??s?.sectionIndex??0)===0)return {ok:false,refusal:{ok:false,code:"invalidArgs",reason:"the first section cannot link to a previous header or footer"}}}if(no(e)){let s=iN(e,t);return s.ok?{ok:true,tablePlan:s.tablePlan}:s}let a=$i(e,t);return a&&!a.ok?{ok:false,refusal:a}:{ok:true}}function xI(e,t){let n=e.session.part();if(!t.startsWith(`${n.name}#`)||!chunkOSFOJTHU_cjs.Ta(n,t))return true;let r=chunkOSFOJTHU_cjs.Ua(n,t),o=0;for(;r;){if(r.kind==="tableCell"||r.kind==="generic"&&r.localName==="tc"||(o+=1)>64)return true;r=chunkOSFOJTHU_cjs.Ua(n,r.id);}return false}function wI(e){if(!e)return null;let t=e.state(),n=t.cellSelection;if(!n&&!xI(e,t.selection.head.paragraphId))return null;let r=chunkD7ZMDMPX_cjs.ka(e.layout(),t.selection.head.paragraphId);return r?{blockId:r.tableId,rowCount:r.rows,columnCount:r.columns,cell:{row:n?n.rows.from:r.rowIndex,column:n?n.columns.from:r.columnIndex}}:null}function Fd(e){if(!e)return null;let t=e.state(),n=t.cellSelection;if(!n&&!xI(e,t.selection.head.paragraphId))return null;let r=chunkD7ZMDMPX_cjs.ka(e.layout(),t.selection.head.paragraphId);return r?{rows:r.rows,columns:r.columns,rowIndex:n?n.rows.from:r.rowIndex,columnIndex:n?n.columns.from:r.columnIndex}:null}function SI(e){return e?{...e.bold!==void 0?{bold:e.bold}:{},...e.italic!==void 0?{italic:e.italic}:{},...e.underline!==void 0?{underline:e.underline}:{},...e.fontFamily?{fontFamily:e.fontFamily}:{},...e.fontSizePt!==void 0?{fontSizeHalfPoints:Math.round(e.fontSizePt*2)}:{},...e.styleId?{styleId:e.styleId}:{},...e.alignment?{alignment:e.alignment}:{}}:null}function II(e){return !!e&&xn(e.session.part(),e.state().selection.head)!==void 0}var de={undo:["M280-200v-80h284q63 0 109.5-40T720-420q0-60-46.5-100T564-560H312l104 104-56 56-200-200 200-200 56 56-104 104h252q97 0 166.5 63T800-420q0 94-69.5 157T564-200H280Z"],redo:["M396-200q-97 0-166.5-63T160-420q0-94 69.5-157T396-640h252L544-744l56-56 200 200-200 200-56-56 104-104H396q-63 0-109.5 40T240-420q0 60 46.5 100T396-280h284v80H396Z"],print:["M640-640v-120H320v120h-80v-200h480v200h-80Zm-480 80h640-640Zm560 100q17 0 28.5-11.5T760-500q0-17-11.5-28.5T720-540q-17 0-28.5 11.5T680-500q0 17 11.5 28.5T720-460Zm-80 260v-160H320v160h320Zm80 80H240v-160H80v-240q0-51 35-85.5t85-34.5h560q51 0 85.5 34.5T880-520v240H720v160Zm80-240v-160q0-17-11.5-28.5T760-560H200q-17 0-28.5 11.5T160-520v160h80v-80h480v80h80Z"],file_download:["M480-320 280-520l56-58 104 104v-326h80v326l104-104 56 58-200 200ZM240-160q-33 0-56.5-23.5T160-240v-120h80v120h480v-120h80v120q0 33-23.5 56.5T720-160H240Z"],file_upload:["M440-320v-326L336-542l-56-58 200-200 200 200-56 58-104-104v326h-80ZM240-160q-33 0-56.5-23.5T160-240v-120h80v120h480v-120h80v120q0 33-23.5 56.5T720-160H240Z"],format_bold:["M272-200v-560h221q65 0 120 40t55 111q0 51-23 78.5T602-491q25 11 55.5 41t30.5 90q0 89-65 124.5T501-200H272Zm121-112h104q48 0 58.5-24.5T566-372q0-11-10.5-35.5T494-432H393v120Zm0-228h93q33 0 48-17t15-38q0-24-17-39t-44-15h-95v109Z"],format_italic:["M200-200v-100h160l120-360H320v-100h400v100H580L460-300h140v100H200Z"],format_underlined:["M200-120v-80h560v80H200Zm123-223q-56-63-56-167v-330h103v336q0 56 28 91t82 35q54 0 82-35t28-91v-336h103v330q0 104-56 167t-157 63q-101 0-157-63Z"],strikethrough_s:["M486-160q-76 0-135-45t-85-123l88-38q14 48 48.5 79t85.5 31q42 0 76-20t34-64q0-18-7-33t-19-27h112q5 14 7.5 28.5T694-340q0 86-61.5 133T486-160ZM80-480v-80h800v80H80Zm402-326q66 0 115.5 32.5T674-674l-88 39q-9-29-33.5-52T484-710q-41 0-68 18.5T386-640h-96q2-69 54.5-117.5T482-806Z"],superscript:["M760-600v-80q0-17 11.5-28.5T800-720h80v-40H760v-40h120q17 0 28.5 11.5T920-760v40q0 17-11.5 28.5T880-680h-80v40h120v40H760ZM235-160l185-291-172-269h106l124 200h4l123-200h107L539-451l186 291H618L482-377h-4L342-160H235Z"],subscript:["M760-160v-80q0-17 11.5-28.5T800-280h80v-40H760v-40h120q17 0 28.5 11.5T920-320v40q0 17-11.5 28.5T880-240h-80v40h120v40H760Zm-525-80 185-291-172-269h106l124 200h4l123-200h107L539-531l186 291H618L482-457h-4L342-240H235Z"],link:["M440-280H280q-83 0-141.5-58.5T80-480q0-83 58.5-141.5T280-680h160v80H280q-50 0-85 35t-35 85q0 50 35 85t85 35h160v80ZM320-440v-80h320v80H320Zm200 160v-80h160q50 0 85-35t35-85q0-50-35-85t-85-35H520v-80h160q83 0 141.5 58.5T880-480q0 83-58.5 141.5T680-280H520Z"],format_clear:["m528-546-93-93-121-121h486v120H568l-40 94ZM792-56 460-388l-80 188H249l119-280L56-792l56-56 736 736-56 56Z"],format_paragraph:["M360-160v-240q-83 0-141.5-58.5T160-600q0-83 58.5-141.5T360-800h360v80h-80v560h-80v-560H440v560h-80Z"],format_shapes:["M40-40v-240h80v-400H40v-240h240v80h400v-80h240v240h-80v400h80v240H680v-80H280v80H40Zm240-160h400v-80h80v-400h-80v-80H280v80h-80v400h80v80Zm32-120 136-360h64l136 360h-62l-32-92H408l-32 92h-64Zm114-144h108l-52-150h-4l-52 150ZM120-760h80v-80h-80v80Zm640 0h80v-80h-80v80Zm0 640h80v-80h-80v80Zm-640 0h80v-80h-80v80Zm80-640Zm560 0Zm0 560Zm-560 0Z"],lock:["M240-80q-33 0-56.5-23.5T160-160v-400q0-33 23.5-56.5T240-640h40v-80q0-83 58.5-141.5T480-920q83 0 141.5 58.5T680-720v80h40q33 0 56.5 23.5T800-560v400q0 33-23.5 56.5T720-80H240Zm0-80h480v-400H240v400Zm240-120q33 0 56.5-23.5T560-360q0-33-23.5-56.5T480-440q-33 0-56.5 23.5T400-360q0 33 23.5 56.5T480-280ZM360-640h240v-80q0-50-35-85t-85-35q-50 0-85 35t-35 85v80Zm-120 480v-400 400Z"],format_align_left:["M120-120v-80h720v80H120Zm0-160v-80h480v80H120Zm0-160v-80h720v80H120Zm0-160v-80h480v80H120Zm0-160v-80h720v80H120Z"],format_align_center:["M120-120v-80h720v80H120Zm160-160v-80h400v80H280ZM120-440v-80h720v80H120Zm160-160v-80h400v80H280ZM120-760v-80h720v80H120Z"],format_align_right:["M120-760v-80h720v80H120Zm240 160v-80h480v80H360ZM120-440v-80h720v80H120Zm240 160v-80h480v80H360ZM120-120v-80h720v80H120Z"],format_align_justify:["M120-120v-80h720v80H120Zm0-160v-80h720v80H120Zm0-160v-80h720v80H120Zm0-160v-80h720v80H120Zm0-160v-80h720v80H120Z"],format_line_spacing:["M240-160 80-320l56-56 64 62v-332l-64 62-56-56 160-160 160 160-56 56-64-62v332l64-62 56 56-160 160Zm240-40v-80h400v80H480Zm0-240v-80h400v80H480Zm0-240v-80h400v80H480Z"],format_list_bulleted:["M360-200v-80h480v80H360Zm0-240v-80h480v80H360Zm0-240v-80h480v80H360ZM200-160q-33 0-56.5-23.5T120-240q0-33 23.5-56.5T200-320q33 0 56.5 23.5T280-240q0 33-23.5 56.5T200-160Zm0-240q-33 0-56.5-23.5T120-480q0-33 23.5-56.5T200-560q33 0 56.5 23.5T280-480q0 33-23.5 56.5T200-400Zm-56.5-263.5Q120-687 120-720t23.5-56.5Q167-800 200-800t56.5 23.5Q280-753 280-720t-23.5 56.5Q233-640 200-640t-56.5-23.5Z"],format_list_numbered:["M120-80v-60h100v-30h-60v-60h60v-30H120v-60h120q17 0 28.5 11.5T280-280v40q0 17-11.5 28.5T240-200q17 0 28.5 11.5T280-160v40q0 17-11.5 28.5T240-80H120Zm0-280v-110q0-17 11.5-28.5T160-510h60v-30H120v-60h120q17 0 28.5 11.5T280-560v70q0 17-11.5 28.5T240-450h-60v30h100v60H120Zm60-280v-180h-60v-60h120v240h-60Zm180 440v-80h480v80H360Zm0-240v-80h480v80H360Zm0-240v-80h480v80H360Z"],format_indent_increase:["M120-120v-80h720v80H120Zm320-160v-80h400v80H440Zm0-160v-80h400v80H440Zm0-160v-80h400v80H440ZM120-760v-80h720v80H120Zm0 440v-320l160 160-160 160Z"],format_indent_decrease:["M120-120v-80h720v80H120Zm320-160v-80h400v80H440Zm0-160v-80h400v80H440Zm0-160v-80h400v80H440ZM120-760v-80h720v80H120Zm160 440L120-480l160-160v320Z"],format_color_text:["M80 0v-160h800V0H80Zm140-280 210-560h100l210 560h-96l-50-144H368l-52 144h-96Zm176-224h168l-82-232h-4l-82 232Z"],ink_highlighter:["M544-400 440-504 240-304l104 104 200-200Zm-47-161 104 104 199-199-104-104-199 199Zm-84-28 216 216-229 229q-24 24-56 24t-56-24l-2-2-26 26H60l126-126-2-2q-24-24-24-56t24-56l229-229Zm0 0 227-227q24-24 56-24t56 24l104 104q24 24 24 56t-24 56L629-373 413-589Z"],format_color_reset:["M800-436q0 36-8 69t-22 63l-62-60q6-17 9-34.5t3-37.5q0-47-17.5-89T650-600L480-768l-88 86-56-56 144-142 226 222q44 42 69 99.5T800-436Zm-8 380L668-180q-41 29-88 44.5T480-120q-133 0-226.5-92.5T160-436q0-51 16-98t48-90L56-792l56-56 736 736-56 56ZM480-200q36 0 68.5-10t61.5-28L280-566q-21 32-30.5 64t-9.5 66q0 98 70 167t170 69Zm-37-204Zm110-116Z"],arrow_drop_down:["M480-360 280-560h400L480-360Z"],table:["M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm240-240H200v160h240v-160Zm80 0v160h240v-160H520Zm-80-80v-160H200v160h240Zm80 0h240v-160H520v160ZM200-680h560v-80H200v80Z"],table_chart:["M760-120H200q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120ZM200-640h560v-120H200v120Zm100 80H200v360h100v-360Zm360 0v360h100v-360H660Zm-80 0H380v360h200v-360Z"],grid_on:["M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm0-80h133v-133H200v133Zm213 0h134v-133H413v133Zm214 0h133v-133H627v133ZM200-413h133v-134H200v134Zm213 0h134v-134H413v134Zm214 0h133v-134H627v134ZM200-627h133v-133H200v133Zm213 0h134v-133H413v133Zm214 0h133v-133H627v133Z"],table_rows:["M760-200v-120H200v120h560Zm0-200v-160H200v160h560Zm0-240v-120H200v120h560ZM200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Z"],view_column:["M121-280v-400q0-33 23.5-56.5T201-760h559q33 0 56.5 23.5T840-680v400q0 33-23.5 56.5T760-200H201q-33 0-56.5-23.5T121-280Zm79 0h133v-400H200v400Zm213 0h133v-400H413v400Zm213 0h133v-400H626v400Z"],border_all:["M120-120v-720h720v720H120Zm640-80v-240H520v240h240Zm0-560H520v240h240v-240Zm-560 0v240h240v-240H200Zm0 560h240v-240H200v240Z"],select_all:["M120-120v-720h720v720H120Zm640-80v-240H520v240h240Zm0-560H520v240h240v-240Zm-560 0v240h240v-240H200Zm0 560h240v-240H200v240Z"],border_outer:["M200-200h560v-560H200v560Zm-80 80v-720h720v720H120Zm160-320v-80h80v80h-80Zm160 160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 160v-80h80v80h-80Z"],border_inner:["M120-120v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-320v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-640v-80h80v80h-80Zm320 640v-80h80v80h-80Zm160 0v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-320v-80h80v80h-80Zm0-160v-80h80v80h-80Zm-160 0v-80h80v80h-80ZM440-120v-320H120v-80h320v-320h80v320h320v80H520v320h-80Z"],border_clear:["M120-120v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-320v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-320v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Z"],add:["M440-440H200v-80h240v-240h80v240h240v80H520v240h-80v-240Z"],remove:["M200-440v-80h560v80H200Z"],delete:["M280-120q-33 0-56.5-23.5T200-200v-520h-40v-80h200v-40h240v40h200v80h-40v520q0 33-23.5 56.5T680-120H280Zm400-600H280v520h400v-520ZM360-280h80v-360h-80v360Zm160 0h80v-360h-80v360ZM280-720v520-520Z"],delete_sweep:["M600-240v-80h160v80H600Zm0-320v-80h280v80H600Zm0 160v-80h240v80H600ZM120-640H80v-80h160v-60h160v60h160v80h-40v360q0 33-23.5 56.5T440-200H200q-33 0-56.5-23.5T120-280v-360Zm80 0v360h240v-360H200Zm0 0v360-360Z"],call_merge:["m296-160-56-56 200-200v-269L337-582l-57-57 200-200 201 201-57 57-104-104v301L296-160Zm368 1L536-286l57-57 127 128-56 56Z"],call_split:["M440-160v-304L240-664v104h-80v-240h240v80H296l224 224v336h-80Zm154-376-58-58 128-126H560v-80h240v240h-80v-104L594-536Z"],drag_indicator:["M360-160q-33 0-56.5-23.5T280-240q0-33 23.5-56.5T360-320q33 0 56.5 23.5T440-240q0 33-23.5 56.5T360-160Zm240 0q-33 0-56.5-23.5T520-240q0-33 23.5-56.5T600-320q33 0 56.5 23.5T680-240q0 33-23.5 56.5T600-160ZM360-400q-33 0-56.5-23.5T280-480q0-33 23.5-56.5T360-560q33 0 56.5 23.5T440-480q0 33-23.5 56.5T360-400Zm240 0q-33 0-56.5-23.5T520-480q0-33 23.5-56.5T600-560q33 0 56.5 23.5T680-480q0 33-23.5 56.5T600-400ZM360-640q-33 0-56.5-23.5T280-720q0-33 23.5-56.5T360-800q33 0 56.5 23.5T440-720q0 33-23.5 56.5T360-640Zm240 0q-33 0-56.5-23.5T520-720q0-33 23.5-56.5T600-800q33 0 56.5 23.5T680-720q0 33-23.5 56.5T600-640Z"],image:["M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm0-80h560v-560H200v560Zm40-80h480L570-480 450-320l-90-120-120 160Zm-40 80v-560 560Z"],format_image_left:["M120-280v-400h400v400H120Zm80-80h240v-240H200v240Zm-80-400v-80h720v80H120Zm480 160v-80h240v80H600Zm0 160v-80h240v80H600Zm0 160v-80h240v80H600ZM120-120v-80h720v80H120Z"],format_image_right:["M440-280v-400h400v400H440Zm80-80h240v-240H520v240ZM120-120v-80h720v80H120Zm0-160v-80h240v80H120Zm0-160v-80h240v80H120Zm0-160v-80h240v80H120Zm0-160v-80h720v80H120Z"],horizontal_rule:["M160-440v-80h640v80H160Z"],flip_to_back:["M200-120q-33 0-56.5-23.5T120-200v-480h80v480h480v80H200Zm160-240v80q-33 0-56.5-23.5T280-360h80Zm-80-80v-80h80v80h-80Zm0-160v-80h80v80h-80Zm80-160h-80q0-33 23.5-56.5T360-840v80Zm80 480v-80h80v80h-80Zm0-480v-80h80v80h-80Zm160 0v-80h80v80h-80Zm0 480v-80h80v80h-80Zm160-480v-80q33 0 56.5 23.5T840-760h-80Zm0 400h80q0 33-23.5 56.5T760-280v-80Zm0-80v-80h80v80h-80Zm0-160v-80h80v80h-80Z"],flip_to_front:["M360-280q-33 0-56.5-23.5T280-360v-400q0-33 23.5-56.5T360-840h400q33 0 56.5 23.5T840-760v400q0 33-23.5 56.5T760-280H360Zm0-80h400v-400H360v400ZM200-200v80q-33 0-56.5-23.5T120-200h80Zm-80-80v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 480v-80h80v80h-80Zm160 0v-80h80v80h-80Zm160 0v-80h80v80h-80Z"],open_with:["M480-80 310-250l57-57 73 73v-166h80v165l72-73 58 58L480-80ZM250-310 80-480l169-169 57 57-72 72h166v80H235l73 72-58 58Zm460 0-57-57 73-73H560v-80h165l-73-72 58-58 170 170-170 170ZM440-560v-166l-73 73-57-57 170-170 170 170-57 57-73-73v166h-80Z"],tune:["M440-120v-240h80v80h320v80H520v80h-80Zm-320-80v-80h240v80H120Zm160-160v-80H120v-80h160v-80h80v240h-80Zm160-80v-80h400v80H440Zm160-160v-240h80v80h160v80H680v80h-80Zm-480-80v-80h400v80H120Z"],rotate_right:["M522-80v-82q34-5 66.5-18t61.5-34l56 58q-42 32-88 51.5T522-80Zm-80 0Q304-98 213-199.5T122-438q0-75 28.5-140.5t77-114q48.5-48.5 114-77T482-798h6l-62-62 56-58 160 160-160 160-56-56 64-64h-8q-117 0-198.5 81.5T202-438q0 104 68 182.5T442-162v82Zm322-134-58-56q21-29 34-61.5t18-66.5h82q-5 50-24.5 96T764-214Zm76-264h-82q-5-34-18-66.5T706-606l58-56q32 39 51 86t25 98Z"],rotate_left:["M440-80q-50-5-96-24.5T256-156l56-58q29 21 61.5 34t66.5 18v82Zm80 0v-82q104-15 172-93.5T760-438q0-117-81.5-198.5T480-718h-8l64 64-56 56-160-160 160-160 56 58-62 62h6q75 0 140.5 28.5t114 77q48.5 48.5 77 114T840-438q0 137-91 238.5T520-80ZM198-214q-32-42-51.5-88T122-398h82q5 34 18 66.5t34 61.5l-58 56Zm-76-264q6-51 25-98t51-86l58 56q-21 29-34 61.5T204-478h-82Z"],swap_horiz:["M280-160 80-360l200-200 56 57-103 103h287v80H233l103 103-56 57Zm400-240-56-57 103-103H440v-80h287L624-743l56-57 200 200-200 200Z"],swap_vert:["M320-440v-287L217-624l-57-56 200-200 200 200-57 56-103-103v287h-80ZM600-80 400-280l57-56 103 103v-287h80v287l103-103 57 56L600-80Z"],shapes:["M600-360ZM320-242q10 1 19.5 1.5t20.5.5q11 0 20.5-.5T400-242v82h400v-400h-82q1-10 1.5-19.5t.5-20.5q0-11-.5-20.5T718-640h82q33 0 56.5 23.5T880-560v400q0 33-23.5 56.5T800-80H400q-33 0-56.5-23.5T320-160v-82Zm40-78q-117 0-198.5-81.5T80-600q0-117 81.5-198.5T360-880q117 0 198.5 81.5T640-600q0 117-81.5 198.5T360-320Zm0-80q83 0 141.5-58.5T560-600q0-83-58.5-141.5T360-800q-83 0-141.5 58.5T160-600q0 83 58.5 141.5T360-400Zm0-200Z"],format_paint:["M440-80q-33 0-56.5-23.5T360-160v-160H240q-33 0-56.5-23.5T160-400v-280q0-66 47-113t113-47h480v440q0 33-23.5 56.5T720-320H600v160q0 33-23.5 56.5T520-80h-80ZM240-560h480v-200h-40v160h-80v-160h-40v80h-80v-80H320q-33 0-56.5 23.5T240-680v120Zm0 160h480v-80H240v80Zm0 0v-80 80Z"],expand_more:["M480-345 240-585l56-56 184 184 184-184 56 56-240 240Z"],expand_less:["m296-345-56-56 240-240 240 240-56 56-184-184-184 184Z"],border_top:["M120-120v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h720v80H120Zm160 640v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 320v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 480v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 320v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Z"],border_bottom:["M120-120v-80h720v80H120Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 320v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 480v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 320v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 480v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Z"],border_left:["M120-120v-720h80v720h-80Zm160 0v-80h80v80h-80Zm0-320v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-320v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Z"],border_right:["M120-120v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-320v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-320v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 640v-720h80v720h-80Z"],border_horizontal:["M120-120v-60h60v60h-60Zm0-165v-60h60v60h-60Zm0-165v-60h720v60H120Zm0-165v-60h60v60h-60Zm0-165v-60h60v60h-60Zm165 660v-60h60v60h-60Zm0-660v-60h60v60h-60Zm165 660v-60h60v60h-60Zm0-165v-60h60v60h-60Zm0-330v-60h60v60h-60Zm0-165v-60h60v60h-60Zm165 660v-60h60v60h-60Zm0-660v-60h60v60h-60Zm165 660v-60h60v60h-60Zm0-165v-60h60v60h-60Zm0-330v-60h60v60h-60Zm0-165v-60h60v60h-60Z"],border_vertical:["M120-120v-60h60v60h-60Zm0-165v-60h60v60h-60Zm0-165v-60h60v60h-60Zm0-165v-60h60v60h-60Zm0-165v-60h60v60h-60Zm165 660v-60h60v60h-60Zm0-330v-60h60v60h-60Zm0-330v-60h60v60h-60Zm165 660v-720h60v720h-60Zm165 0v-60h60v60h-60Zm0-330v-60h60v60h-60Zm0-330v-60h60v60h-60Zm165 660v-60h60v60h-60Zm0-165v-60h60v60h-60Zm0-165v-60h60v60h-60Zm0-165v-60h60v60h-60Zm0-165v-60h60v60h-60Z"],padding:["M320-600q17 0 28.5-11.5T360-640q0-17-11.5-28.5T320-680q-17 0-28.5 11.5T280-640q0 17 11.5 28.5T320-600Zm160 0q17 0 28.5-11.5T520-640q0-17-11.5-28.5T480-680q-17 0-28.5 11.5T440-640q0 17 11.5 28.5T480-600Zm160 0q17 0 28.5-11.5T680-640q0-17-11.5-28.5T640-680q-17 0-28.5 11.5T600-640q0 17 11.5 28.5T640-600ZM200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm0-80h560v-560H200v560Zm0-560v560-560Z"],text_rotation_none:["M160-200v-80h528l-42-42 56-56 138 138-138 138-56-56 42-42H160Zm116-200 164-440h80l164 440h-76l-38-112H392l-40 112h-76Zm138-176h132l-64-182h-4l-64 182Z"],wrap_text:["M588-132 440-280l148-148 56 58-50 50h96q29 0 49.5-20.5T760-390q0-29-20.5-49.5T690-460H160v-80h530q63 0 106.5 43.5T840-390q0 63-43.5 106.5T690-240h-96l50 50-56 58ZM160-240v-80h200v80H160Zm0-440v-80h640v80H160Z"],height:["M480-120 320-280l56-56 64 63v-414l-64 63-56-56 160-160 160 160-56 57-64-64v414l64-63 56 56-160 160Z"],fit_width:["M120-120v-720h80v720h-80Zm640 0v-720h80v720h-80ZM280-440v-80h80v80h-80Zm160 0v-80h80v80h-80Zm160 0v-80h80v80h-80Z"],settings:["m370-80-16-128q-13-5-24.5-12T307-235l-119 50L78-375l103-78q-1-7-1-13.5v-27q0-6.5 1-13.5L78-585l110-190 119 50q11-8 23-15t24-12l16-128h220l16 128q13 5 24.5 12t22.5 15l119-50 110 190-103 78q1 7 1 13.5v27q0 6.5-2 13.5l103 78-110 190-118-50q-11 8-23 15t-24 12L590-80H370Zm70-80h79l14-106q31-8 57.5-23.5T639-327l99 41 39-68-86-65q5-14 7-29.5t2-31.5q0-16-2-31.5t-7-29.5l86-65-39-68-99 42q-22-23-48.5-38.5T533-694l-13-106h-79l-14 106q-31 8-57.5 23.5T321-633l-99-41-39 68 86 64q-5 15-7 30t-2 32q0 16 2 31t7 30l-86 65 39 68 99-42q22 23 48.5 38.5T427-266l13 106Zm42-180q58 0 99-41t41-99q0-58-41-99t-99-41q-59 0-99.5 41T342-480q0 58 40.5 99t99.5 41Zm-2-140Z"],border_color:["M80 0v-160h800V0H80Zm160-320h56l312-311-29-29-28-28-311 312v56Zm-80 80v-170l448-447q11-11 25.5-17t30.5-6q16 0 31 6t27 18l55 56q12 11 17.5 26t5.5 31q0 15-5.5 29.5T777-687L330-240H160Zm560-504-56-56 56 56ZM608-631l-29-29-28-28 57 57Z"],format_color_fill:["m247-904 57-56 343 343q23 23 23 57t-23 57L457-313q-23 23-57 23t-57-23L153-503q-23-23-23-57t23-57l190-191-96-96Zm153 153L209-560h382L400-751Zm360 471q-33 0-56.5-23.5T680-360q0-21 12.5-45t27.5-45q9-12 19-25t21-25q11 12 21 25t19 25q15 21 27.5 45t12.5 45q0 33-23.5 56.5T760-280ZM80 0v-160h800V0H80Z"],vertical_align_top:["M160-760v-80h640v80H160Zm280 640v-408L336-424l-56-56 200-200 200 200-56 56-104-104v408h-80Z"],vertical_align_center:["M440-80v-168l-64 64-56-56 160-160 160 160-56 56-64-64v168h-80ZM160-440v-80h640v80H160Zm320-120L320-720l56-56 64 64v-168h80v168l64-64 56 56-160 160Z"],vertical_align_bottom:["M160-120v-80h640v80H160Zm320-160L280-480l56-56 104 104v-408h80v408l104-104 56 56-200 200Z"],line_weight:["M120-160v-40h720v40H120Zm0-120v-80h720v80H120Zm0-160v-120h720v120H120Zm0-200v-160h720v160H120Z"],keyboard_arrow_up:["M480-528 296-344l-56-56 240-240 240 240-56 56-184-184Z"],keyboard_arrow_down:["M480-344 240-584l56-56 184 184 184-184 56 56-240 240Z"],keyboard_arrow_left:["M560-240 320-480l240-240 56 56-184 184 184 184-56 56Z"],keyboard_arrow_right:["M504-480 320-664l56-56 240 240-240 240-56-56 184-184Z"],more_vert:["M480-160q-33 0-56.5-23.5T400-240q0-33 23.5-56.5T480-320q33 0 56.5 23.5T560-240q0 33-23.5 56.5T480-160Zm0-240q-33 0-56.5-23.5T400-480q0-33 23.5-56.5T480-560q33 0 56.5 23.5T560-480q0 33-23.5 56.5T480-400Zm0-240q-33 0-56.5-23.5T400-720q0-33 23.5-56.5T480-800q33 0 56.5 23.5T560-720q0 33-23.5 56.5T480-640Z"],page_break:["M120-440v-80h160v80H120Zm200 0v-80h160v80H320Zm200 0v-80h160v80H520Zm200 0v-80h120v80H720ZM240-120q-33 0-56.5-23.5T160-200v-120h80v120h480v-120h80v120q0 33-23.5 56.5T720-120H240Zm-80-520v-120q0-33 23.5-56.5T240-840h480q33 0 56.5 23.5T800-760v120h-80v-120H240v120h-80Z"],branding_watermark:["M160-160q-33 0-56.5-23.5T80-240v-480q0-33 23.5-56.5T160-800h640q33 0 56.5 23.5T880-720v480q0 33-23.5 56.5T800-160H160Zm0-80h640v-480H160v480Zm320-60q66 0 113-37t47-93q0-29-13-58t-34-55q-21-26-50-49t-50-31q-21 8-50 31t-50 49q-21 26-34 55t-13 58q0 56 47 93t140 37Z"],arrow_back:["M313-440l224 224-57 56-320-320 320-320 57 56-224 224h487v80H313Z"],search:["M784-120 532-372q-30 24-69 38t-83 14q-109 0-184.5-75.5T120-580q0-109 75.5-184.5T380-840q109 0 184.5 75.5T640-580q0 44-14 83t-38 69l252 252-56 56ZM380-400q75 0 127.5-52.5T560-580q0-75-52.5-127.5T380-760q-75 0-127.5 52.5T200-580q0 75 52.5 127.5T380-400Z"],toc:["M120-240v-80h240v80H120Zm0-200v-80h480v80H120Zm0-200v-80h720v80H120Z"],done_all:["M268-240 42-466l57-56 170 170 56 56-57 56Zm226 0L268-466l56-57 170 170 368-368 57 57-425 424Zm0-226-57-56 198-198 57 56-198 198Z"],check_circle:["m424-296 282-282-56-56-226 226-114-114-56 56 170 170Zm56 216q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Z"],chat_bubble_outline:["M80-80v-720q0-33 23.5-56.5T160-880h640q33 0 56.5 23.5T880-800v480q0 33-23.5 56.5T800-240H240L80-80Zm126-240h594v-480H160v525l46-45Zm-46 0v-480 480Z"],chat_bubble_check:["M80-80v-720q0-33 23.5-56.5T160-880h640q33 0 56.5 23.5T880-800v480q0 33-23.5 56.5T800-240H240L80-80Zm126-240h594v-480H160v525l46-45Zm-46 0v-480 480Z"],check:["M382-240 154-468l57-57 171 171 367-367 57 57-424 424Z"],close:["m256-200-56-56 224-224-224-224 56-56 224 224 224-224 56 56-224 224 224 224-56 56-224-224-224 224Z"],add_comment:["M440-400h80v-120h120v-80H520v-120h-80v120H320v80h120v120ZM80-80v-720q0-33 23.5-56.5T160-880h640q33 0 56.5 23.5T880-800v480q0 33-23.5 56.5T800-240H240L80-80Zm126-240h594v-480H160v525l46-45Zm-46 0v-480 480Z"],comment:["M240-400h480v-80H240v80Zm0-120h480v-80H240v80Zm0-120h480v-80H240v80ZM80-80v-720q0-33 23.5-56.5T160-880h640q33 0 56.5 23.5T880-800v480q0 33-23.5 56.5T800-240H240L80-80Zm126-240h594v-480H160v525l46-45Zm-46 0v-480 480Z"],edit_note:["M160-400h280v-80H160v80Zm0-160h440v-80H160v80Zm0-160h440v-80H160v80Zm360 360v-123l221-220q9-9 20-13t22-4q12 0 23 4.5t20 13.5l37 37q8 9 12.5 20t4.5 22q0 11-4 22.5T863-380L643-160H520Zm300-263-37-37 37 37ZM580-220h38l121-122-18-19-19-18-122 121v38Zm141-141-19-18 37 37-18-19Z"],rate_review:["M240-400h122l200-200q9-9 13.5-20.5T580-643q0-11-5-21.5T562-684l-36-38q-9-9-20-13.5t-23-4.5q-11 0-22.5 4.5T440-722L240-522v122Zm280-243-37-37 37 37ZM300-460v-38l101-101 20 18 18 20-101 101h-38Zm121-121 18 20-38-38 20 18Zm26 181h273v-80H527l-80 80ZM80-80v-720q0-33 23.5-56.5T160-880h640q33 0 56.5 23.5T880-800v480q0 33-23.5 56.5T800-240H240L80-80Zm126-240h594v-480H160v525l46-45Zm-46 0v-480 480Z"],visibility:["M480-320q75 0 127.5-52.5T660-500q0-75-52.5-127.5T480-680q-75 0-127.5 52.5T300-500q0 75 52.5 127.5T480-320Zm0-72q-45 0-76.5-31.5T372-500q0-45 31.5-76.5T480-608q45 0 76.5 31.5T588-500q0 45-31.5 76.5T480-392Zm0 192q-146 0-266-81.5T40-500q54-137 174-218.5T480-800q146 0 266 81.5T920-500q-54 137-174 218.5T480-200Zm0-300Zm0 220q113 0 207.5-59.5T832-500q-50-101-144.5-160.5T480-720q-113 0-207.5 59.5T128-500q50 101 144.5 160.5T480-280Z"],format_textdirection_l_to_r:["M360-360v-200q-66 0-113-47t-47-113q0-66 47-113t113-47h320v80h-80v440h-80v-440h-80v440h-80Zm0-280v-160q-33 0-56.5 23.5T280-720q0 33 23.5 56.5T360-640Zm0-80ZM680-80l-56-56 64-64H120v-80h568l-64-64 56-56 160 160L680-80Z"],format_textdirection_r_to_l:["M360-360v-200q-66 0-113-47t-47-113q0-66 47-113t113-47h320v80h-80v440h-80v-440h-80v440h-80Zm-88 160 64 64-56 56-160-160 160-160 56 56-64 64h568v80H272Zm88-440v-160q-33 0-56.5 23.5T280-720q0 33 23.5 56.5T360-640Zm0-80Z"],"agent-sparkle":["m760-600-50-110-110-50 110-50 50-110 50 110 110 50-110 50-50 110Zm0 560-50-110-110-50 110-50 50-110 50 110 110 50-110 50-50 110ZM360-160 260-380 40-480l220-100 100-220 100 220 220 100-220 100-100 220Zm0-194 40-86 86-40-86-40-40-86-40 86-86 40 86 40 40 86Zm0-126Z"]};var Ki={activeTarget:"all",spec:{style:"single",size:8,color:{kind:"hex",value:"000000"}}},RI=["table.borderTarget","table.borderColor","table.borderStyle","table.borderWidth","table.cellFill"];function dm(e){return i18n.createT(i18n.en)(e)}function ws(e){return RI.includes(e)}function dN(e){return e!=null}var PI=[{value:"all",icon:"border_all",labelKey:"table.borders.all"},{value:"outside",icon:"border_outer",labelKey:"table.borders.outside"},{value:"inside",icon:"border_inner",labelKey:"table.borders.inside"},{value:"top",icon:"border_top",labelKey:"table.borders.top"},{value:"bottom",icon:"border_bottom",labelKey:"table.borders.bottom"},{value:"left",icon:"border_left",labelKey:"table.borders.left"},{value:"right",icon:"border_right",labelKey:"table.borders.right"},{value:"none",icon:"border_clear",labelKey:"table.borders.none"}],TI=[{value:"single",labelKey:"table.borderStyles.single",previewClass:"docx-table-line--single"},{value:"dashed",labelKey:"table.borderStyles.dashed",previewClass:"docx-table-line--dashed"},{value:"dotted",labelKey:"table.borderStyles.dotted",previewClass:"docx-table-line--dotted"},{value:"double",labelKey:"table.borderStyles.double",previewClass:"docx-table-line--double"},{value:"triple",labelKey:"table.borderStyles.triple",previewClass:"docx-table-line--triple"},{value:"thick",labelKey:"table.borderStyles.thick",previewClass:"docx-table-line--thick"}],cN=[{size:4,labelKey:"table.borderWidths.halfPt",previewThickness:.5},{size:8,labelKey:"table.borderWidths.onePt",previewThickness:1},{size:12,labelKey:"table.borderWidths.oneHalfPt",previewThickness:1.5},{size:16,labelKey:"table.borderWidths.twoPt",previewThickness:2},{size:24,labelKey:"table.borderWidths.threePt",previewThickness:3}];function uN(e){return e==="all"||e==="outside"||e==="inside"||e==="top"||e==="bottom"||e==="left"||e==="right"}function fN(e){return e==="none"||uN(e)}function kI(e){if(!e||typeof e!="object")return false;let t=e.kind;return t==="hex"||t==="theme"||t==="auto"}function pN(e){return TI.some(t=>t.value===e)}function Uo(e,t,n){switch(t){case "table.borderTarget":return fN(n)?n==="none"?{command:{type:"setTableBorders",scope:"none",target:e.activeTarget},nextDraft:e}:{command:{type:"setTableBorders",scope:n,spec:e.spec},nextDraft:{activeTarget:n,spec:e.spec}}:null;case "table.borderColor":{if(!kI(n))return null;let r={...e.spec,color:n};return {command:{type:"setTableBorders",scope:e.activeTarget,spec:r},nextDraft:{activeTarget:e.activeTarget,spec:r}}}case "table.borderStyle":{if(!pN(n))return null;let r={...e.spec,style:n};return {command:{type:"setTableBorders",scope:e.activeTarget,spec:r},nextDraft:{activeTarget:e.activeTarget,spec:r}}}case "table.borderWidth":{if(typeof n!="number"||!Number.isInteger(n))return null;let r={...e.spec,size:n};return {command:{type:"setTableBorders",scope:e.activeTarget,spec:r},nextDraft:{activeTarget:e.activeTarget,spec:r}}}case "table.cellFill":return n!==null&&!kI(n)?null:{command:{type:"setCellFill",color:n},nextDraft:e};default:return null}}function cm(e,t=Ki){switch(e){case "table.borderTarget":return {type:"setTableBorders",scope:t.activeTarget,spec:t.spec};case "table.borderColor":return Uo(t,e,{kind:"hex",value:"000000"})?.command??null;case "table.borderStyle":return Uo(t,e,"single")?.command??null;case "table.borderWidth":return Uo(t,e,8)?.command??null;case "table.cellFill":return {type:"setCellFill",color:{kind:"hex",value:"FFFF00"}};default:return null}}function mN(e){return PI.find(n=>n.value===e)?.labelKey??"table.borders.all"}function gN(e){return de[e]}function oo(e){return e.surface??null}var hN={"review.revisionMarkup":{type:"openRevisionMarkupDialog"},"review.comments":{type:"toggleReviewPane"},"review.paragraphMarks":{type:"toggleParagraphMarks"},"review.protectDocument":{type:"toggleDocumentProtection"},"review.simpleMarkup":{type:"setReviewDisplayMode",mode:"simple-markup"},"review.allMarkup":{type:"setReviewDisplayMode",mode:"all-markup"},"review.noMarkup":{type:"setReviewDisplayMode",mode:"proposed"},"review.original":{type:"setReviewDisplayMode",mode:"original"},"review.previousChange":{type:"navigateReviewChange",direction:"previous"},"review.nextChange":{type:"navigateReviewChange",direction:"next"},"review.acceptAllChanges":{type:"resolveAllReviewChanges",action:"accept"},"review.rejectAllChanges":{type:"resolveAllReviewChanges",action:"reject"},"history.undo":{type:"undo"},"history.redo":{type:"redo"},"text.bold":{type:"toggleMark",mark:"bold"},"text.italic":{type:"toggleMark",mark:"italic"},"text.underline":{type:"toggleMark",mark:"underline"},"text.strike":{type:"toggleMark",mark:"strike"},"script.super":{type:"toggleMark",mark:"superscript"},"script.sub":{type:"toggleMark",mark:"subscript"},"format.clear":{type:"clearFormatting"},"alignment.left":{type:"setAlignment",align:"left"},"alignment.center":{type:"setAlignment",align:"center"},"alignment.right":{type:"setAlignment",align:"right"},"alignment.justify":{type:"setAlignment",align:"justify"},"direction.ltr":{type:"setParagraphDirection",direction:"ltr"},"direction.rtl":{type:"setParagraphDirection",direction:"rtl"},"list.bullet":{type:"toggleList",kind:"bullet"},"list.numbered":{type:"toggleList",kind:"ordered"},"list.indent":{type:"adjustIndent",direction:"increase"},"list.outdent":{type:"adjustIndent",direction:"decrease"},"insert.textBox":{type:"insertTextBox"},"insert.footnote":{type:"insertNote",noteKind:"footnote"},"insert.endnote":{type:"insertNote",noteKind:"endnote"},"insert.pageNumber":{type:"insertPageField",field:"PAGE"},"insert.totalPages":{type:"insertPageField",field:"NUMPAGES"},"insert.sectionPages":{type:"insertPageField",field:"SECTIONPAGES"},"insert.pageXofY":{type:"insertPageField",field:"PAGE_X_OF_Y"},"insert.pageBreak":{type:"insertBreak",kind:"page"},"insert.sectionBreakNextPage":{type:"insertBreak",kind:"section"},"insert.sectionBreakContinuous":{type:"insertBreak",kind:"sectionContinuous"},"insert.toc":{type:"insertToc"},"contentControl.remove":{type:"removeContentControl"}};function yN(e){return EI[e]??null}var CI=Uint8Array.from(atob("iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="),e=>e.charCodeAt(0)),EI={"text.link":{type:"insertHyperlink",href:"https://example.com"},"image.insert":{type:"insertImage",data:CI,mime:"image/png",widthPoints:72,heightPoints:72},"image.properties":{type:"setImageProperties",description:"probe"},"table.insert":{type:"insertTable",rows:1,cols:1},"file.pageSetup":{type:"setPageSetup",orientation:"portrait"},"paragraph.dialog":{type:"setParagraphFormat",alignment:"left"}};function Nd(e){return hN[e]??null}var bN={"font.family":{mark:"fontFamily",attr:"family"},"font.size":{mark:"fontSize",attr:"val"},"text.color":{mark:"color",attr:"val"},"text.highlight":{mark:"highlight",attr:"val"}},OI={"font.family":"Arial","font.size":22,"text.color":"000000","text.highlight":"yellow","styles.style":"Normal","list.lineSpacing":1,"image.wrap":"square","image.altText":"probe alt text"};function MI(e,t,n){return Uo(n,e,t)?.command??null}function Ld(e,t){if(e==="review.editingMode")return {type:"setEditingMode",mode:t};if(e==="styles.style")return {type:"setParagraphStyle",styleId:t};if(e==="list.lineSpacing")return {type:"setLineSpacing",rule:"multiple",value:t};if(ws(e))return MI(e,t,Ki);if(e==="image.wrap")return typeof t!="string"||!chunkOSFOJTHU_cjs.Ed.includes(t)?null:{type:"setImageWrapType",target:t};if(e==="image.altText")return typeof t!="string"?null:{type:"setImageProperties",description:t};let n=bN[e];return n?{type:"setMarkAttr",mark:n.mark,attr:n.attr,value:t}:null}function AI(e,t,n=Ki){if(!e)return {id:t,enabled:false,disabledReason:"editor is not ready",active:false};let r=cm(t,n);if(!r)return {id:t,enabled:false,disabledReason:"not wired to an editor command",active:false};let o=e.can(r);return o.ok?{id:t,enabled:true,disabledReason:null,active:false}:{id:t,enabled:false,disabledReason:o.reason,active:false}}var vN=["editing","suggesting","viewing"];function xN(e){let t="review.addComment",n=o=>({id:t,enabled:false,disabledReason:o,active:false}),r=e.can({type:"toggleReviewPane"});return r.ok?(e.getEditingMode?.()??"editing")==="viewing"?n("the document is open for viewing"):e.getSelectionPlacement()===null?n("a comment needs a selected range"):{id:t,enabled:true,disabledReason:null,active:false}:n(r.reason)}function FI(e,t){if(!e)return {id:t,enabled:false,disabledReason:"editor is not ready",active:false};if(ws(t))return AI(e,t);if(t==="review.editingMode"){let i=e.getEditingMode?.()??"editing",a=vN.filter(d=>d!==i).map(d=>e.can(Ld(t,d))),s=a.some(d=>d.ok),l=a.find(d=>!d.ok);return {id:t,enabled:s,disabledReason:!s&&l&&!l.ok?l.reason:null,active:false,value:i}}if(t==="format.painter"){let i=oo(e);if(!i)return {id:t,enabled:false,disabledReason:"editor is not ready",active:false};let a=i.formatPainter.state();if(a.mode!=="off")return {id:t,enabled:true,disabledReason:null,active:true,value:a.mode};let s=e.can({type:"clearFormatting"});return s.ok?{id:t,enabled:true,disabledReason:null,active:false,value:a.mode}:{id:t,enabled:false,disabledReason:s.reason,active:false,value:a.mode}}if(t==="contentControl.showAll"||t==="contentControl.formFill"){let i=oo(e),a=i?.state().contentControls,s=t==="contentControl.showAll"?a?.showAll??false:a?.formFill??false;return {id:t,enabled:i!==null,disabledReason:i?null:"editor is not ready",active:s}}if(t==="contentControl.inspector"){let i=oo(e);return i?i.state().contentControls.activeControlId?{id:t,enabled:true,disabledReason:null,active:false}:{id:t,enabled:false,disabledReason:"no content control at the selection",active:false}:{id:t,enabled:false,disabledReason:"editor is not ready",active:false}}if(t==="review.addComment")return xN(e);if(t==="review.authors"){let i=e.can({type:"toggleReviewPane"});return i.ok?(e.getReviewAuthors?.().length??0)>0?{id:t,enabled:true,disabledReason:null,active:false}:{id:t,enabled:false,disabledReason:"the document has no review authors",active:false}:{id:t,enabled:false,disabledReason:i.reason,active:false}}let n=Nd(t);if(!n){let i=OI[t];if(i!==void 0){let s=Ld(t,i);if(!s)return {id:t,enabled:false,disabledReason:"not wired to an editor command",active:false};let l=e.can(s),d=e.getSelectedImage?.()??null,c=t==="image.wrap"?d?.wrap:t==="image.altText"?d?.description:fS(e,t);return l.ok?{id:t,enabled:true,disabledReason:null,active:false,...c!==void 0?{value:c}:{}}:{id:t,enabled:false,disabledReason:l.reason,active:false,...c!==void 0?{value:c}:{}}}let a=EI[t];if(a){if(t==="image.insert"&&a.type==="insertImage"){let l=e.canExecuteImageCommand?.({type:"insertImage",data:CI,mime:"image/png",widthPoints:72,heightPoints:72})??e.can(a);return l.ok?{id:t,enabled:true,disabledReason:null,active:false}:{id:t,enabled:false,disabledReason:l.reason,active:false}}if(t==="image.properties"&&a.type==="setImageProperties"){let l=e.can(a);return l.ok?{id:t,enabled:true,disabledReason:null,active:false}:{id:t,enabled:false,disabledReason:l.reason,active:false}}if(t==="table.insert"&&a.type==="insertTable"){let l=e.can(a);return l.ok?{id:t,enabled:true,disabledReason:null,active:false}:{id:t,enabled:false,disabledReason:l.reason,active:false}}if(t==="paragraph.dialog"&&a.type==="setParagraphFormat"){let l=e.can(a);return l.ok?{id:t,enabled:true,disabledReason:null,active:false}:{id:t,enabled:false,disabledReason:l.reason,active:false}}let s=e.can(a);if(!s.ok)return {id:t,enabled:false,disabledReason:s.reason,active:false}}return t==="file.exportMarkdown"||t==="file.exportPdf"?{id:t,enabled:false,active:false,disabledReason:"export is not a command; run it with runChromeExport(editor, format, handlers)"}:t==="file.print"?{id:t,enabled:false,active:false,disabledReason:"print is not a command; run it with runChromePrint(editor, handlers)"}:t==="file.save"?{id:t,enabled:false,disabledReason:"save is not a command; run it with runSave(editor)",active:false}:t==="file.open"?{id:t,enabled:false,disabledReason:"open is not a command; run it with editor.load(bytes)",active:false}:{id:t,enabled:false,disabledReason:"not wired to an editor command",active:false}}let r=e.can(n),o=e.isActive?.(n)??false;return r.ok?{id:t,enabled:true,disabledReason:null,active:o}:{id:t,enabled:false,disabledReason:r.reason,active:o}}function wN(e){if(e==="format.painter")return true;let t=Nd(e);return t?.type==="toggleMark"||t?.type==="toggleParagraphMarks"||t?.type==="toggleDocumentProtection"||t?.type==="setReviewDisplayMode"||t?.type==="setAlignment"||t?.type==="setParagraphDirection"}function SN(e,t){return t.map(n=>FI(e,n))}function IN(e,t,n,r){if(!e)return {result:{ok:false,code:"unsupported",reason:"editor is not ready"},nextDraft:null};let o=Uo(r,t,n);if(!o)return {result:{ok:false,code:"unsupported",reason:"invalid table chrome value"},nextDraft:null};let i=e.can(o.command);if(!i.ok)return {result:{ok:false,code:i.code,reason:i.reason},nextDraft:null};let a=e.exec(o.command);return a.ok?{result:a,nextDraft:o.nextDraft}:{result:a,nextDraft:null}}var kN=new Set(["format.painter","contentControl.showAll","contentControl.formFill","contentControl.inspector","contentControl.remove"]);function RN(e,t,n,r){if(!e)return {ok:false,code:"unsupported",reason:"editor is not ready"};if(n&&typeof n=="object"&&("historyGroup"in n||"scope"in n||Object.keys(n).length===0)){if(r||OI[t]!==void 0||ws(t))return {ok:false,code:"invalidArgs",reason:"pass a toolbar value before command options"};r=n,n=void 0;}if(r?.historyGroup!==void 0&&kN.has(t))return {ok:false,code:"unsupported",reason:`${t} does not take a history group`};if(t==="format.painter"){let a=oo(e);if(!a)return {ok:false,code:"unsupported",reason:"editor is not ready"};if(a.formatPainter.state().mode==="off"){let s=e.can({type:"clearFormatting"});if(!s.ok)return {ok:false,code:s.code,reason:s.reason}}return a.formatPainter.press()?{ok:true,changed:false}:{ok:false,code:"notFound",reason:xd}}if(t==="contentControl.showAll"){let a=oo(e);return a?(a.contentControls.setShowAll(!a.contentControls.showAll()),{ok:true,changed:false}):{ok:false,code:"unsupported",reason:"editor is not ready"}}if(t==="contentControl.formFill"){let a=oo(e);return a?(a.contentControls.setFormFill(!a.contentControls.formFill()),{ok:true,changed:false}):{ok:false,code:"unsupported",reason:"editor is not ready"}}if(t==="contentControl.inspector"){let a=oo(e);return a?a.state().contentControls.activeControlId?{ok:true,changed:false}:{ok:false,code:"notFound",reason:"no content control at the selection"}:{ok:false,code:"unsupported",reason:"editor is not ready"}}if(t==="contentControl.remove"){let a=oo(e);if(!a)return {ok:false,code:"unsupported",reason:"editor is not ready"};let s=a.state().contentControls.activeControlId;if(!s)return {ok:false,code:"notFound",reason:"no content control at the selection"};let l=a.contentControls.disabledReason(s,"remove");return l?{ok:false,code:l==="bound"?"bound":"locked",reason:l}:a.contentControls.remove(s)?{ok:true,changed:true}:{ok:false,code:a.state().lastRejection??"unsupported",reason:a.state().lastRejection??"removeContentControl was refused"}}let o=n===void 0?Nd(t):Ld(t,n);if(!o)return n!==void 0?{ok:false,code:"unsupported",reason:"invalid value for toolbar command"}:t==="file.exportMarkdown"||t==="file.exportPdf"?{ok:false,code:"unsupported",reason:"export is not a command; run it with runChromeExport(editor, format, handlers)"}:t==="file.print"?{ok:false,code:"unsupported",reason:"print is not a command; run it with runChromePrint(editor, handlers)"}:t==="file.save"?{ok:false,code:"unsupported",reason:"save is not a command; run it with runSave(editor)"}:t==="file.open"?{ok:false,code:"unsupported",reason:"open is not a command; run it with editor.load(bytes)"}:{ok:false,code:"unsupported",reason:"not wired to an editor command"};let i=e.can(o,r);return i.ok?e.exec(o,r):{ok:false,code:i.code,reason:i.reason}}function PN(e){return e?e.save():Promise.reject(new Error("editor is not ready"))}function TN(e,t){if(!e)return {enabled:false,disabledReason:"editor is not ready"};let n=Ad(t,e);return n.can.ok?{enabled:true,disabledReason:null}:{enabled:false,disabledReason:n.can.reason}}function CN(e,t,n){if(!e)return {ok:false,code:"unsupported",reason:"editor is not ready"};let r=e.can(t,n);return r.ok?e.exec(t,n):{ok:false,code:r.code,reason:r.reason}}function um(e){return e instanceof Uint8Array?Array.from(e):Array.isArray(e)?e.map(um):e===null||typeof e!="object"?e:Object.fromEntries(Object.keys(e).sort().map(t=>[t,um(e[t])]))}function EN(e){return JSON.stringify(um(e))}var fm=["zoom","script","format","list","alignment","styles","font","text","history"],ON=new Set(["review"]),NI=24,DI=new Set;function HI(e,t=fm){let n=t.indexOf(e);return n===-1?void 0:(n+1)*10}function MN(e,t=fm,n){let r=[],o=[];return e.forEach((i,a)=>{let s=n?.get(i)??HI(i,t);s===void 0||Number.isNaN(s)?o.push(i):r.push({id:i,priority:s,position:a});}),r.sort((i,a)=>i.priority-a.priority||a.position-i.position),[...o.reverse(),...r.map(i=>i.id)]}function AN(e,t){let n=[...e],r=new Map,o=t.filter(i=>!e.includes(i.id));for(;o.length>0;){let i=[];for(let a of o){let s=a.after;if(s===void 0||s===a.id){n.push(a.id);continue}if(!n.includes(s)){i.push(a);continue}let l=r.get(s)??s;n.splice(n.indexOf(l)+1,0,a.id),r.set(s,a.id);}if(i.length===o.length){n.push(...i.map(a=>a.id));break}o=i;}return n}var pm=8;function FN(e){let t=e.margin??pm,n=Math.max(0,e.viewportWidth-t*2),r=Math.min(e.panelWidth,n),o=t,i=e.viewportWidth-t-r,a=e.triggerRight-r;if(a>=o&&a<=i)return {left:a,maxWidth:n,anchor:"end"};let s=e.triggerLeft;return s>=o&&s<=i?{left:s,maxWidth:n,anchor:"start"}:{left:Math.max(o,Math.min(a,i)),maxWidth:n,anchor:"clamped"}}function LI(e,t){let{widths:n,groups:r,order:o,fixed:i,more:a}=e,s=i;for(let d of r)s+=n.get(d)??0;if(s<=t)return DI;s+=a;let l=new Set;for(let d of o){if(s<=t)break;let c=n.get(d);c===void 0||l.has(d)||(l.add(d),s-=c);}return l}function _I(e,t){if(e===t)return true;if(e.size!==t.size)return false;for(let n of e)if(!t.has(n))return false;return true}var LN=_I;function NN(e){if(!(e.available>0))return DI;let t=LI(e,e.available),n=e.previous;if(!n||n.size===0||t.size>=n.size)return t;let r=LI(e,e.available-(e.hysteresis??NI));return _I(r,n)?n:r}function DN(e){let t=e.margin??pm,n=e.viewportWidth-t-e.popupWidth;return Math.max(t,Math.min(e.anchorLeft,n))}function HN(e,t,n,r){return e+t+n+r*2}function _N(e,t){return e+t}function BN(e,t){return e+t}function $N(e){let t=Number.parseFloat(e.marginInlineStart||e.marginLeft),n=Number.parseFloat(e.marginInlineEnd||e.marginRight);return {start:Number.isFinite(t)?t:0,end:Number.isFinite(n)?n:0}}function jn(e){let t=Number.parseFloat(e);return Number.isFinite(t)?t:0}function qN(e){return jn(e.columnGap)}function BI(e){if(!(e.parentContent>0))return e.own;let t=e.parentContent-e.siblings-e.margins;return e.maxWidth!==null&&(t=Math.min(t,e.maxWidth)),Math.max(e.own,t-e.chrome)}function $I(e){return e.position==="absolute"||e.position==="fixed"||e.display==="none"}function qI(e){let t=e.computedStyleMap;if(typeof t!="function")return null;try{return t.call(e)}catch{return null}}function mm(e,t){let n=e?.get(t);return n&&typeof n.value=="string"?n.value:null}var KN=new Set(["auto","max-content","fit-content","min-content"]);function KI(e){return e.display.includes("flex")&&!e.flexDirection.startsWith("column")&&!e.flexWrap.startsWith("wrap")}function Hd(e,t,n){return mm(e,`margin-${n}`)==="auto"?0:jn(n==="left"?t.marginLeft:t.marginRight)}function VN(e){return /^(input|textarea|select|button|img|video|canvas|iframe|svg)$/i.test(e.tagName)?true:e.children.length>0||(e.textContent??"").trim().length>0}function jN(e,t,n){let r=t.flexBasis.trim(),o=r.endsWith("px")?jn(r):0,i=mm(n,"min-width")??t.minWidth.trim();return i==="auto"||i===""?VN(e)?null:o:/^[\d.]+px$/.test(i)?Math.max(o,jn(i)):null}function VI(e,t,n){for(let r of e.childNodes){if(r.nodeType===3&&(r.textContent??"").trim().length>0)return false;if(!(r instanceof Element))continue;let o=getComputedStyle(r);if(o.display==="contents"){if(!VI(r,t,n))return false;continue}if($I(o)||(n.items+=1,r===t))continue;let i=qI(r),s=Number.parseFloat(o.flexGrow)>0?jN(r,o,i):r.getBoundingClientRect().width;if(s===null)return false;n.width+=s+Hd(i,o,"left")+Hd(i,o,"right");}return true}function WN(e,t){if(!KI(t)||!e.parentElement)return 0;let n={width:0,items:0};return VI(e.parentElement,e,n)?n.width+Math.max(0,n.items-1)*jn(t.columnGap):null}function ZN(e,t,n){let r=e.maxWidth.trim();if(r==="none"||r==="")return null;let o;if(/^-?[\d.]+%$/.test(r))o=Number.parseFloat(r)/100*t;else if(/^-?[\d.]+px$/.test(r))o=Number.parseFloat(r);else return;if(Number.isFinite(o))return e.boxSizing==="border-box"?o:o+n}var zN="[data-toolbar-group], [data-toolbar-fixed], [data-toolbar-more]";function jI(e,t){let n=e.getBoundingClientRect();if(!(n.width>0))return null;let r=n.left+e.clientLeft+jn(t.paddingLeft),o=n.left+e.clientLeft+e.clientWidth-jn(t.paddingRight);for(let i of e.querySelectorAll(zN)){let a=i.getBoundingClientRect();if(a.width!==0&&(a.right>o+1||a.left<r-1))return true}return false}var Ss=new WeakMap,Dd=new WeakMap;function UN(e,t,n,r){let o=e.parentElement;if(!o||$I(t)||(t.cssFloat||t.getPropertyValue("float")||"none")!=="none")return null;let i=qI(e),a=mm(i,"width");if(a===null||!KN.has(a))return null;let s=getComputedStyle(o),l=KI(s),d=s.display.includes("flex")&&s.flexDirection.startsWith("column"),c=(s.display==="block"||s.display==="flow-root"||d)&&!t.display.startsWith("inline");if(!l&&!c||l&&Number.parseFloat(t.flexGrow)>0)return null;let u=o.clientWidth-jn(s.paddingLeft)-jn(s.paddingRight),p=Math.max(0,e.offsetWidth-e.clientWidth)+r,m=WN(e,s),g=ZN(t,u,p);return m===null||g===void 0?null:{room:BI({own:n,parentContent:u,siblings:m,margins:Hd(i,t,"left")+Hd(i,t,"right"),chrome:p,maxWidth:g}),parentContent:u}}function GN(e,t){let n=jn(t.paddingLeft)+jn(t.paddingRight),r=e.clientWidth-n,o=UN(e,t,r,n);if(!o)return Ss.delete(e),Dd.delete(e),r;let i=Ss.get(e);if(i&&i.parentContent!==o.parentContent&&Ss.delete(e),jI(e,t)===true)return Dd.get(e)&&Ss.set(e,{parentContent:o.parentContent,cap:r}),Dd.set(e,false),r;let a=Ss.get(e)?.cap??Number.POSITIVE_INFINITY,s=Math.max(r,Math.min(o.room,a));return Dd.set(e,s>r),s}var XN=/^[a-z]$/;function gm(e){let t=e.key.toLowerCase();if(XN.test(t))return t;let n=e.code??"";return n.length===4&&n.startsWith("Key")?n[3].toLowerCase():""}function WI(e){let t=[],n=r=>{for(let o of r)o.kind==="item"?t.push(o.slot):o.kind==="submenu"&&n(o.items);};for(let r of e)n(r.entries);return t}var ZI={id:"file",labelKey:"toolbar.file",contextual:true,controls:[{id:"open",labelKey:"toolbar.open",paths:de.file_upload,state:{kind:"load"}},{id:"save",labelKey:"toolbar.saveShortcut",paths:de.file_download,state:{kind:"save"}},{id:"exportMarkdown",labelKey:"toolbar.exportMarkdown",paths:de.file_download,state:{kind:"export"}},{id:"exportPdf",labelKey:"toolbar.exportPdf",paths:de.file_download,state:{kind:"export"}},{id:"print",labelKey:"toolbar.print",paths:de.print,state:{kind:"export"}},{id:"pageSetup",labelKey:"toolbar.pageSetup",paths:de.settings,state:{kind:"command"}}]};var zI={id:"review",labelKey:"formattingBar.commentsAndChanges",controls:[{id:"revisionMarkup",shape:"icon",labelKey:"revisionMarkup.title",defaultToolbar:false,paths:de.edit_note,state:{kind:"command"}},{id:"simpleMarkup",shape:"icon",labelKey:"review.simpleMarkup",defaultToolbar:false,paths:de.visibility,state:{kind:"command"}},{id:"allMarkup",shape:"icon",labelKey:"review.allMarkup",defaultToolbar:false,paths:de.visibility,state:{kind:"command"}},{id:"noMarkup",shape:"icon",labelKey:"review.noMarkup",defaultToolbar:false,paths:de.visibility,state:{kind:"command"}},{id:"original",shape:"icon",labelKey:"review.original",defaultToolbar:false,paths:de.visibility,state:{kind:"command"}},{id:"previousChange",shape:"icon",labelKey:"review.previousChange",defaultToolbar:false,paths:de.keyboard_arrow_up,state:{kind:"command"}},{id:"nextChange",shape:"icon",labelKey:"review.nextChange",defaultToolbar:false,paths:de.keyboard_arrow_down,state:{kind:"command"}},{id:"acceptAllChanges",shape:"icon",labelKey:"review.acceptAllChanges",defaultToolbar:false,paths:de.check,state:{kind:"command"}},{id:"rejectAllChanges",shape:"icon",labelKey:"review.rejectAllChanges",defaultToolbar:false,paths:de.close,state:{kind:"command"}},{id:"paragraphMarks",shape:"icon",labelKey:"formattingBar.paragraphMarks",defaultToolbar:false,paths:de.format_paragraph,state:{kind:"command"}},{id:"protectDocument",shape:"icon",labelKey:"review.protectDocument",defaultToolbar:false,paths:de.lock,state:{kind:"command"}},{id:"comments",shape:"icon",labelKey:"formattingBar.commentsAndChanges",paths:de.comment,state:{kind:"command"}},{id:"addComment",shape:"icon",labelKey:"formattingBar.addComment",defaultToolbar:false,paths:de.add_comment,state:{kind:"command"}},{id:"authors",shape:"dropdown",labelKey:"reviewers.label",paths:de.visibility,defaultToolbar:false,state:{kind:"command"}},{id:"editingMode",shape:"dropdown",labelKey:"editingMode.label",valueKey:"editingMode.editing",paths:de.edit_note,state:{kind:"command"}}]};var hm=[{id:"history",labelKey:"formattingBar.groups.history",controls:[{id:"undo",labelKey:"formattingBar.undoShortcut",paths:de.undo,state:{kind:"command"}},{id:"redo",labelKey:"formattingBar.redoShortcut",paths:de.redo,state:{kind:"command"}}]},{id:"zoom",labelKey:"formattingBar.groups.zoom",controls:[{id:"level",shape:"stepper",valueText:"100%",labelKey:"formattingBar.groups.zoom",paths:null,valueKey:"zoom.zoomLevel",state:{kind:"command"}}]},{id:"styles",labelKey:"formattingBar.groups.styles",controls:[{id:"style",shape:"dropdown",labelKey:"styles.selectAriaLabel",paths:null,valueKey:"styles.normalText",state:{kind:"value"}}]},{id:"font",labelKey:"formattingBar.groups.font",controls:[{id:"family",shape:"dropdown",labelKey:"font.selectAriaLabel",paths:null,valueKey:"font.sansSerif",state:{kind:"value"}},{id:"size",shape:"stepper",valueText:"11",labelKey:"fontSize.listLabel",paths:null,valueKey:"fontSize.label",state:{kind:"value"}}]},{id:"text",labelKey:"formattingBar.groups.textFormatting",controls:[{id:"bold",labelKey:"formattingBar.boldShortcut",paths:de.format_bold,state:{kind:"command"}},{id:"italic",labelKey:"formattingBar.italicShortcut",paths:de.format_italic,state:{kind:"command"}},{id:"underline",labelKey:"formattingBar.underlineShortcut",paths:de.format_underlined,state:{kind:"command"}},{id:"strike",labelKey:"formattingBar.strikethrough",paths:de.strikethrough_s,state:{kind:"command"}},{id:"color",shape:"colorSplit",swatch:"#ff0000",labelKey:"formattingBar.fontColor",paths:de.format_color_text,state:{kind:"value"}},{id:"highlight",shape:"colorSplit",swatch:"#ffff00",labelKey:"formattingBar.highlightColor",paths:de.ink_highlighter,state:{kind:"value"}},{id:"link",labelKey:"formattingBar.insertLinkShortcut",paths:de.link,state:{kind:"command"}}]},{id:"script",labelKey:"formattingBar.groups.script",controls:[{id:"super",labelKey:"formattingBar.superscript",paths:de.superscript,state:{kind:"command"}},{id:"sub",labelKey:"formattingBar.subscript",paths:de.subscript,state:{kind:"command"}}]},{id:"alignment",labelKey:"formattingBar.groups.alignment",controls:[{id:"left",labelKey:"alignment.alignLeft",paths:de.format_align_left,state:{kind:"command"}},{id:"center",labelKey:"alignment.center",paths:de.format_align_center,state:{kind:"command"}},{id:"right",labelKey:"alignment.alignRight",paths:de.format_align_right,state:{kind:"command"}},{id:"justify",labelKey:"alignment.justify",paths:de.format_align_justify,state:{kind:"command"}}]},{id:"direction",labelKey:"formattingBar.groups.direction",contextual:true,controls:[{id:"ltr",labelKey:"toolbar.leftToRight",paths:de.format_textdirection_l_to_r,state:{kind:"command"}},{id:"rtl",labelKey:"toolbar.rightToLeft",paths:de.format_textdirection_r_to_l,state:{kind:"command"}}]},{id:"list",labelKey:"formattingBar.groups.listFormatting",controls:[{id:"bullet",labelKey:"lists.bulletList",paths:de.format_list_bulleted,state:{kind:"command"}},{id:"numbered",labelKey:"lists.numberedList",paths:de.format_list_numbered,state:{kind:"command"}},{id:"outdent",labelKey:"lists.decreaseIndent",paths:de.format_indent_decrease,state:{kind:"command"}},{id:"indent",labelKey:"lists.increaseIndent",paths:de.format_indent_increase,state:{kind:"command"}},{id:"lineSpacing",shape:"dropdown",labelKey:"lineSpacing.label",paths:de.format_line_spacing,state:{kind:"command"}}]},{id:"format",labelKey:"formattingBar.groups.format",controls:[{id:"painter",labelKey:"formattingBar.formatPainterShortcut",paths:de.format_paint,state:{kind:"command"}},{id:"clear",labelKey:"formattingBar.clearFormatting",paths:de.format_clear,state:{kind:"command"}}]},zI,{id:"contentControl",labelKey:"contentControl.group",contextual:true,controls:[{id:"showAll",labelKey:"contentControl.showAll",paths:de.visibility,state:{kind:"command"}},{id:"formFill",labelKey:"contentControl.formFill",paths:de.edit_note,state:{kind:"command"}},{id:"inspector",labelKey:"contentControl.inspector",paths:de.tune,state:{kind:"command"}},{id:"remove",labelKey:"contentControl.remove",paths:de.delete,state:{kind:"command"}}]},{id:"image",labelKey:"formattingBar.groups.image",contextual:true,controls:[{id:"insert",labelKey:"toolbar.image",paths:de.image,state:{kind:"command"}},{id:"properties",labelKey:"formattingBar.imagePropertiesShortcut",paths:de.tune,state:{kind:"command"}},{id:"wrap",shape:"dropdown",labelKey:"formattingBar.imageWrap",paths:de.wrap_text,valueKey:"imageWrap.inline",state:{kind:"value"}},{id:"altText",shape:"dropdown",labelKey:"formattingBar.altText",paths:null,valueKey:"imageProperties.altText",state:{kind:"value"}}]},{id:"table",labelKey:"formattingBar.groups.table",contextual:true,controls:[{id:"insert",labelKey:"toolbar.table",paths:de.table,state:{kind:"command"}},{id:"borderTarget",shape:"dropdown",labelKey:"table.borders.tooltip",paths:de.border_all,state:{kind:"value"}},{id:"borderColor",shape:"colorSplit",swatch:"#000000",labelKey:"table.borderColor",paths:de.border_color,state:{kind:"value"}},{id:"borderStyle",shape:"dropdown",labelKey:"table.borders.styleAriaLabel",paths:de.border_horizontal,state:{kind:"value"}},{id:"borderWidth",shape:"dropdown",labelKey:"table.borderWidth",paths:de.line_weight,state:{kind:"value"}},{id:"cellFill",shape:"colorSplit",swatch:"#ffffff",labelKey:"table.cellFillColor",paths:de.format_color_fill,state:{kind:"value"}}]},{id:"paragraph",labelKey:"dialogs.paragraph.title",contextual:true,controls:[{id:"dialog",labelKey:"lineSpacing.options",paths:de.format_line_spacing,state:{kind:"command"}}]},ZI,{id:"insert",labelKey:"toolbar.insert",contextual:true,controls:[{id:"textBox",labelKey:"toolbar.insertTextBox",paths:de.format_shapes,state:{kind:"command"}},{id:"footnote",labelKey:"toolbar.insertFootnote",paths:de.superscript,state:{kind:"command"}},{id:"endnote",labelKey:"toolbar.insertEndnote",paths:de.edit_note,state:{kind:"command"}},{id:"pageNumber",labelKey:"headerFooter.insertPageNumber",paths:de.format_list_numbered,state:{kind:"command"}},{id:"totalPages",labelKey:"headerFooter.insertTotalPages",paths:de.format_list_numbered,state:{kind:"command"}},{id:"sectionPages",labelKey:"headerFooter.insertSectionPages",paths:de.format_list_numbered,state:{kind:"command"}},{id:"pageXofY",labelKey:"headerFooter.insertPageXofY",paths:de.format_list_numbered,state:{kind:"command"}},{id:"pageBreak",labelKey:"toolbar.pageBreak",paths:de.page_break,state:{kind:"command"}},{id:"sectionBreakNextPage",labelKey:"toolbar.sectionBreakNextPage",paths:de.horizontal_rule,state:{kind:"command"}},{id:"sectionBreakContinuous",labelKey:"toolbar.sectionBreakContinuous",paths:de.border_horizontal,state:{kind:"command"}},{id:"toc",labelKey:"toolbar.tableOfContents",paths:de.toc,state:{kind:"command"}}]}],UI=hm;function YN(e,t){return `${e.id}.${t.id}`}function GI(){return UI.filter(e=>!e.contextual).map(e=>({...e,controls:e.controls.filter(t=>t.defaultToolbar!==false)}))}function QN(e){let t=GI();if(!e)return t;let n=UI.find(r=>r.id==="image");return n?[...t,n]:t}var XI=[{id:"file",labelKey:"toolbar.file",entries:[{kind:"item",slot:"file.open",shortcutKey:"toolbar.openShortcut"},{kind:"item",slot:"file.save",labelKey:"toolbar.save",shortcutKey:"toolbar.saveShortcut"},{kind:"separator"},{kind:"submenu",labelKey:"toolbar.export",paths:de.file_download,items:[{kind:"item",slot:"file.exportMarkdown"},{kind:"item",slot:"file.exportPdf"}]},{kind:"item",slot:"file.print",shortcutKey:"toolbar.printShortcut"},{kind:"item",slot:"file.pageSetup"}]},{id:"format",labelKey:"toolbar.format",entries:[{kind:"item",slot:"text.bold",labelKey:"formattingBar.bold"},{kind:"item",slot:"text.italic",labelKey:"formattingBar.italic"},{kind:"item",slot:"text.underline",labelKey:"formattingBar.underline"},{kind:"item",slot:"text.strike"},{kind:"separator"},{kind:"item",slot:"alignment.left"},{kind:"item",slot:"alignment.center"},{kind:"item",slot:"alignment.right"},{kind:"item",slot:"alignment.justify"},{kind:"separator"},{kind:"item",slot:"direction.ltr"},{kind:"item",slot:"direction.rtl"},{kind:"separator"},{kind:"item",slot:"paragraph.dialog"},{kind:"separator"},{kind:"item",slot:"format.painter",labelKey:"formattingBar.formatPainter"},{kind:"item",slot:"format.clear"}]},{id:"insert",labelKey:"toolbar.insert",entries:[{kind:"item",slot:"image.insert"},{kind:"item",slot:"insert.textBox"},{kind:"item",slot:"table.insert",picker:"tableGrid"},{kind:"separator"},{kind:"item",slot:"insert.footnote"},{kind:"item",slot:"insert.endnote"},{kind:"separator"},{kind:"submenu",labelKey:"toolbar.break",paths:de.page_break,items:[{kind:"item",slot:"insert.pageBreak"},{kind:"item",slot:"insert.sectionBreakNextPage"},{kind:"item",slot:"insert.sectionBreakContinuous"}]},{kind:"item",slot:"insert.toc"}]},{id:"review",labelKey:"toolbar.review",entries:[{kind:"submenu",labelKey:"review.displayForReview",paths:de.visibility,items:[{kind:"item",slot:"review.simpleMarkup"},{kind:"item",slot:"review.allMarkup"},{kind:"item",slot:"review.noMarkup"},{kind:"item",slot:"review.original"}]},{kind:"separator"},{kind:"item",slot:"review.revisionMarkup"},{kind:"item",slot:"review.previousChange"},{kind:"item",slot:"review.nextChange"},{kind:"separator"},{kind:"item",slot:"review.acceptAllChanges"},{kind:"item",slot:"review.rejectAllChanges"},{kind:"separator"},{kind:"item",slot:"review.paragraphMarks"},{kind:"separator"},{kind:"item",slot:"review.protectDocument"}]},{id:"help",labelKey:"toolbar.help",entries:[]}];function JN(){return WI(XI)}function eD(){return hm.reduce((e,t)=>e+t.controls.length,0)}var tD="formattingBar.unavailableInPreview";var _d=class{constructor(t,n,r,o){this.selection=n;this.part=r;this.revision=o;this.position=t?chunkOSFOJTHU_cjs.kl(t):void 0;}selection;part;revision;entries=new WeakMap;position;save(){let t=this.part(),n=o=>{let i=chunkOSFOJTHU_cjs.Ta(t,o.paragraphId);return {nodeId:o.paragraphId,stableId:i&&i.kind!=="textValue"?chunkOSFOJTHU_cjs.wb(i):null,offset:o.offset}},r=this.selection();return {partName:t.name,anchor:n(r.anchor),head:n(r.head)}}begin(){if(!this.position)return ()=>{};let t=this.revision(),n=this.save();return ()=>{let r=this.position.current();!r||t===this.revision()||this.entries.set(r,{before:this.entries.get(r)?.before??n,after:this.save()});}}step(t,n){let r=this.position?.current(),o=n(),i=t==="undo"?r:this.position?.current(),a=i?this.entries.get(i):void 0,s=t==="undo"?a?.before:a?.after;return {changed:o,selection:s?this.resolve(s):null}}resolve(t){let n=this.part();if(n.name!==t.partName)return null;let r=new Map,o=[n.root];for(;o.length;){let l=o.pop();for(let c of l.children)c.kind!=="textValue"&&o.push(c);if(l.kind!=="paragraph")continue;let d=chunkOSFOJTHU_cjs.wb(l);d&&r.set(d,l.id);}let i=l=>{let d=l.stableId?r.get(l.stableId):l.nodeId;return d?{paragraphId:d,offset:l.offset}:null},a=i(t.anchor),s=i(t.head);return a&&s?{anchor:a,head:s}:null}};var nD=new Set(["Shift","Control","Alt","AltGraph","Meta","OS","Hyper","Super","Symbol","Fn","FnLock","CapsLock","NumLock","ScrollLock","SymbolLock"]),rD=["opening","fonts","drawing-resources"];function YI(e){return !nD.has(e.key)}function QI(e){return e.paragraphIds.size>0||!rD.some(t=>e.dependencyKeys.has(t))}var oD=new Set;function Is(e,t){let n=chunkDOHF6FA7_cjs.pd(e,t.displayMode,t.authorFilter),r=chunkDOHF6FA7_cjs.sc(n);if(r===n)return oD;let o=new Set(n.map(i=>i.id));return new Set(r.flatMap(i=>o.has(i.id)?[]:[i.id]))}function iD(e,t,n){let r=chunkDOHF6FA7_cjs.pd(e,n.displayMode,n.authorFilter),o=chunkDOHF6FA7_cjs.sc(r);if(o===r)return null;let i=new Set(r.map(l=>l.id));if(i.has(t))return null;let a=o.findIndex(l=>l.id===t);if(a===-1)return null;let s=o.slice(a+1).find(l=>i.has(l.id));return s?.kind==="paragraph"?s.id:null}function aD(e,t,n,r){let o=d=>e.findIndex(c=>c.kind!=="textValue"&&c.id===d),i=o(t),a=o(n);if(i===-1||a<=i)return null;let s=[];for(let d=i+1;d<a;d+=1){let c=e[d];if(c.kind==="textValue")return null;s.push(c.id);}if(s.length===0)return s;let l=r();return s.every(d=>l.has(d))?s:null}function JI(e,t,n,r){let o=chunkOSFOJTHU_cjs.Ua(e,t);if(o===null||chunkOSFOJTHU_cjs.Ua(e,n)?.id!==o.id)return null;let i=aD(o.children,t,n,()=>Is(o.children,r));return i===null?null:[...i,n].map(a=>({op:"joinParagraphs",firstId:t,secondId:a}))}function ek(e,t,n,r){if(chunkDOHF6FA7_cjs.ud(e,n.paragraphId).length>0)return n;let o=chunkOSFOJTHU_cjs.Ua(t,n.paragraphId);if(o===null)return n;let i=iD(o.children,n.paragraphId,r);return i===null?n:{paragraphId:i,offset:0}}function sD(e,t,n,r,o){if(chunkDOHF6FA7_cjs.ud(e,n.paragraphId).length>0)return null;let i=chunkOSFOJTHU_cjs.Ua(t,n.paragraphId);if(i===null||!Is(i.children,r).has(n.paragraphId))return null;let a=i.children,s=a.findIndex(c=>c.kind!=="textValue"&&c.id===n.paragraphId),l;for(let c=s-1;c>=0&&l===void 0;c-=1)a[c].kind!=="textValue"&&(l=a[c]);if(l===void 0||l.kind!=="paragraph")return null;let d=o==="backward"?{paragraphId:l.id,offset:(chunkOSFOJTHU_cjs.Vi(t,l.id)??"").length}:ek(e,t,n,r);return {ops:[{op:"joinParagraphs",firstId:l.id,secondId:n.paragraphId}],caret:d}}function lD(e,t,n){let r=chunkOSFOJTHU_cjs.Ua(e,t);if(r===null)return null;let o=r.children,i=o.findIndex(l=>l.kind!=="textValue"&&l.id===t);if(i===-1)return null;let a=null,s=[];for(let l=i+1;l<o.length;l+=1){let d=o[l];if(d.kind!=="textValue"){if(a??=Is(o,n),!a.has(d.id))break;s.push({op:"joinParagraphs",firstId:t,secondId:d.id});}}return s.length>0?s:null}function tk(e){let t=n=>ek(e.layout(),e.part(),n,e.view());return {joinOps:(n,r)=>JI(e.part(),n,r,e.view()),forwardJoinOps:(n,r)=>JI(e.part(),n,r,e.view())??lD(e.part(),n,e.view()),shown:t,removedCaretEdit:(n,r)=>sD(e.layout(),e.part(),n,e.view(),r),shownRange:n=>{let{from:r,to:o}=n;if(r.paragraphId!==o.paragraphId||r.offset!==o.offset)return n;let i=t(r);return i===r?n:{from:i,to:i}},shownSelection:n=>{let{anchor:r,head:o}=n;if(r.paragraphId!==o.paragraphId||r.offset!==o.offset)return n;let i=t(o);return i===o?n:{...n,anchor:i,head:i}}}}var nk="\uFFFC";function dD(e,t){let n=new Map,r=new Set,o=chunkDOHF6FA7_cjs.ud(e,t),i=o[0],a=i&&e.pages.find(l=>l.index===i.pageIndex),s=i&&[a?.header,a?.footer].some(l=>l?chunkDOHF6FA7_cjs.ya(l.fragments).some(d=>d.lines.includes(i.line)):false);for(let{line:l,pageIndex:d}of o)if(!(s&&d!==i.pageIndex)&&!r.has(l)){r.add(l);for(let c of chunkDOHF6FA7_cjs.Na(l,t)?.spans??[])!c.fieldAtom&&!c.projected||c.range.end-c.range.start===1&&n.set(c.range.start,(n.get(c.range.start)??"")+c.text);}for(let[l,d]of n)d.length<=1&&n.delete(l);return n}function ks(e,t){let n=new Map,r=i=>{let a=n.get(i);return a||n.set(i,a=dD(e,i)),a},o=i=>{let a=t(e,i).split("");for(let s of r(i).keys())s<a.length&&(a[s]=nk);return a};return {markedText:(i,a)=>o(a).join(""),resultAt:(i,a)=>r(i).get(a)??null,spelledText:(i,a)=>{let s=r(a);return o(a).map((l,d)=>l===nk?s.get(d)??l:l).join("")}}}var cD=/[\p{L}\p{N}_'’]/u,rk=e=>e!==void 0&&cD.test(e);function Bd(e,t,n){let r=chunkDOHF6FA7_cjs.pe(e,t.paragraphId),o=t.paragraphId,i=Math.max(0,Math.min(t.offset,r.length)),a=-1;if(rk(r[i])?a=i:i>0&&rk(r[i-1])&&(a=i-1),a===-1){let s=i,l=i;for(;s>0&&/\s/.test(r[s-1]??"");)s-=1;for(;l<r.length&&/\s/.test(r[l]??"");)l+=1;return s===l&&l<r.length&&(l+=1),{from:{paragraphId:o,offset:s},to:{paragraphId:o,offset:l}}}return {from:{paragraphId:o,offset:chunkDOHF6FA7_cjs.he(r,a+1,-1,n)},to:{paragraphId:o,offset:chunkDOHF6FA7_cjs.he(r,a,1,n)}}}function Ke(e){return {anchor:e,head:e}}function Go(e){if(e.anchor.paragraphId!==e.head.paragraphId)return null;let t=Math.min(e.anchor.offset,e.head.offset),n=Math.max(e.anchor.offset,e.head.offset);return {paragraphId:e.head.paragraphId,start:t,end:n}}function $d(e,t,n){let{anchor:r,head:o}=t;if(r.paragraphId===o.paragraphId)return r.offset<=o.offset?{from:r,to:o}:{from:o,to:r};let i=n??chunkDOHF6FA7_cjs.Ra(e);return i.indexOf(r.paragraphId)<=i.indexOf(o.paragraphId)?{from:r,to:o}:{from:o,to:r}}function io(e,t,n){let r=t[0],o=i=>{let a=t.includes(i.paragraphId),s=a?i.paragraphId:r??i.paragraphId,l=a?i.offset:0,d=chunkDOHF6FA7_cjs.pe(e,s).length;return {paragraphId:s,offset:Math.max(0,Math.min(l,d))}};return {anchor:o(n.anchor),head:o(n.head)}}function ym(e,t,n,r,o,i=chunkDOHF6FA7_cjs.pe){let a=(p,m,g)=>o===void 0||!m.includes("\uFFFC")?m:m.replace(/\uFFFC/g,(b,h)=>o(p,g+h)??b);if(t.paragraphId===n.paragraphId)return a(t.paragraphId,i(e,t.paragraphId).slice(t.offset,n.offset),t.offset);let s=r??chunkDOHF6FA7_cjs.Ra(e),l=s.indexOf(t.paragraphId),d=s.indexOf(n.paragraphId);if(l===-1||d===-1)return "";let c=s.slice(l,d+1),u=a(t.paragraphId,i(e,t.paragraphId).slice(t.offset),t.offset);for(let p=1;p<c.length;p+=1){let m=c[p],g=i(e,m),b=chunkDOHF6FA7_cjs.Oa(e,m).includes(c[p-1])?"":`
|
|
22
|
+
`;u+=b+a(m,p===c.length-1?g.slice(0,n.offset):g,0);}return u}function ik(e,t,n,r){let o=ks(e,chunkDOHF6FA7_cjs.pe);return ym(e,t,n,r,o.resultAt,o.markedText)}function ak(e,t){return chunkD7ZMDMPX_cjs.ja(e,t,ks(e,chunkDOHF6FA7_cjs.pe).spelledText)}function bm(e){let t=[],n=r=>{if(r.kind!=="textValue"){r.kind==="paragraph"&&t.push(r.id);for(let o of r.children)n(o);}};return n(e),t}function sk(e){return e.kind}function lk(e){return e.kind!=="textValue"&&sk(e)==="contentControl"}function ok(e){return e.kind!=="textValue"&&sk(e)==="contentControlContent"}function uD(e,t){let n=new Map,r=o=>{if(o.kind!=="textValue"){if(o.kind==="table"){let i=bm(o);if(i.length>0&&i.every(a=>t.has(a))){n.set(o.id,i);return}}for(let i of o.children)r(i);}};return r(e.root),n}function fD(e,t,n){let r=new Set,o=(i,a)=>{if(i.kind!=="textValue"){if(i.kind==="table"&&n.has(i.id)){for(let s of i.children)o(s,true);return}if(lk(i)){let s=bm(i);!a&&s.length>0&&s.every(l=>t.has(l))&&r.add(i.id);for(let l of i.children)o(l,a);return}for(let s of i.children)o(s,a);}};return o(e.root,false),r}function dk(e,t,n,r,o,i){let a=new Set;for(let s=n;s<=r;s+=1){let l=t[s];(s===n?o.offset===0&&(s!==r||i.offset===e(l).length):s!==r||i.offset===e(l).length)&&a.add(l);}return a}function pD(e,t,n){let r=[],o=i=>{if(i.kind!=="textValue"){if(i.kind==="table"||lk(i)){let s=bm(i).filter(l=>n.has(l));if(s.length>0&&s.every(l=>t.has(l))){r.push(i.id);return}}for(let a of i.children)o(a);}};return o(e.root),r}function ck(e,t,n,r,o){let i=p=>chunkDOHF6FA7_cjs.pe(e,p);if(n.paragraphId===r.paragraphId&&n.offset===r.offset)return null;let a=o??chunkDOHF6FA7_cjs.Ra(e),s=a.indexOf(n.paragraphId),l=a.indexOf(r.paragraphId);if(s===-1||l===-1||s>l)return null;let d=a.slice(s,l+1),c=dk(i,a,s,l,n,r),u=a[l];return {partName:t.name,paragraphIds:d,startOffset:n.offset,endOffset:r.offset,coveredParagraphIds:[...c],fullyCoveredBlockIds:pD(t,c,new Set(a)),lastMarkCovered:r.offset===i(u).length}}function uk(e,t,n,r,o,i={displayMode:e.displayMode??"all-markup",authorFilter:void 0}){let a=v=>chunkDOHF6FA7_cjs.pe(e,v);if(n.paragraphId===r.paragraphId)return n.offset===r.offset?{ops:[],collapseTo:n}:{ops:[{op:"deleteText",paragraphId:n.paragraphId,start:n.offset,end:r.offset}],collapseTo:n};let s=o??chunkDOHF6FA7_cjs.Ra(e),l=s.indexOf(n.paragraphId),d=s.indexOf(r.paragraphId);if(l===-1||d===-1)return {ops:[],collapseTo:n};let c=dk(a,s,l,d,n,r),u=uD(t,c),p=new Map;for(let[v,C]of u)for(let L of C)p.set(L,v);let m=fD(t,c,u),g=l;if(p.has(n.paragraphId)){g=-1;for(let v=l+1;v<=d;v+=1)if(!p.has(s[v])){g=v;break}if(g===-1){let v=p.get(n.paragraphId);for(let C of u.get(v)??[])p.delete(C);u.delete(v),g=l;}}let b=s[g],h=g===l?n:{paragraphId:b,offset:0},y=[];for(let v=l;v<=d;v+=1){let C=s[v];if(p.has(C))continue;let L=a(C).length,A=v===l?n.offset:0,q=v===d?r.offset:L;A<q&&y.push({op:"deleteText",paragraphId:C,start:A,end:q});}for(let v of u.keys())y.push({op:"deleteBlock",blockId:v});for(let v of m)y.push({op:"removeContentControl",controlId:v});let S=v=>{let C=chunkOSFOJTHU_cjs.Ua(t,v);for(;C&&ok(C);){let L=chunkOSFOJTHU_cjs.Ua(t,C.id);if(!L||!m.has(L.id))break;C=chunkOSFOJTHU_cjs.Ua(t,L.id);}return C},x=new Map,I=v=>{let C=x.get(v.id);return C||x.set(v.id,C=Is(v.children,i)),C},R=v=>{let C=[],L=A=>{for(let q of A)if(q.kind!=="textValue"&&!u.has(q.id)){if(m.has(q.id)){let K=q.children.find(ok);K&&K.kind!=="textValue"&&L(K.children);continue}if(q.kind==="paragraph"){C.push(q.id);continue}C.push(`\0barrier:${q.id}`);}};return L(v.children),C},T=(v,C)=>{let L=S(v);if(!L||S(C)!==L)return null;let A=R(L),q=A.indexOf(v),K=A.indexOf(C);if(q===-1||K<=q)return null;let E=A.slice(q+1,K);if(E.length===0)return E;let _=I(L);return E.every(X=>_.has(X))?E:null},P=b,O=b;for(let v=g+1;v<=d;v+=1){let C=s[v];if(p.has(C))continue;let L=T(O,C);if(L)for(let A of [...L,C])y.push({op:"joinParagraphs",firstId:P,secondId:A});else P=C;O=C;}return {ops:y,collapseTo:h}}function fk(e,t,n,r){return t.anchor.paragraphId===t.head.paragraphId&&t.anchor.offset===t.head.offset?[]:chunkDOHF6FA7_cjs.ve(e,t,n(),r)}function vm(e,t){if(!e)return null;let n=e.position,r=o=>o.paragraphId===n.paragraphId&&o.offset===n.offset;return r(t.anchor)&&r(t.head)?e:null}function pk(e,t,n,r){if(n===null||n.length===0)return t?null:void 0;let{anchor:o,head:i}=e;if(!(o.paragraphId!==i.paragraphId||o.offset!==i.offset))return {position:i,properties:n,base:vm(t,e)?.base??r()}}function mk(e,t,n){let r=io(t,n,e.selection),o=n.includes(e.selection.head.paragraphId);return {selection:r,format:o&&e.format?{...e.format,position:r.head}:null}}var qd=class{undo=[];redo=[];moving=false;group;position;constructor(t){this.position=chunkOSFOJTHU_cjs.kl(t);}get canUndo(){return this.matches(this.undo.at(-1))}get canRedo(){return this.matches(this.redo.at(-1))}matches(t){return !!t&&!!this.position&&t.anchor===this.position.current()}record(t,n,r){if(!this.position)return;let o=this.undo.at(-1);if(r!==void 0&&r===this.group&&this.matches(o)){this.undo[this.undo.length-1]={...o,after:n},chunkOSFOJTHU_cjs.il(r,"extended");return}this.group=r,this.position.split(),this.redo.length=0,this.undo.push({anchor:this.position.current(),before:t,after:n}),this.undo.length>200&&this.undo.shift(),chunkOSFOJTHU_cjs.il(r,"started");}endGroup(){this.group=void 0;}noteEdit(){this.endGroup(),this.moving||(this.redo.length=0);}step(t,n,r){let o=t==="undo"?this.undo:this.redo,i=t==="undo"?this.redo:this.undo;this.endGroup(),this.moving=true;try{if(this.matches(o.at(-1))){let a=o.pop();i.push(a),n(t==="undo"?a.before:a.after);}else r();}finally{this.moving=false;}}};function gk(e,t,n,r){let o=e??chunkDOHF6FA7_cjs.Ua,i,a,s;return {current:()=>o,filter(){let l=t();return (!s||l!==i||o!==a)&&(i=l,a=o,s={...l,hiddenAuthors:l?.hiddenAuthors??new Set,revisionMarkup:o,cacheKey:`${l?.cacheKey??""}|markup:${JSON.stringify(o)}`}),s},set(l){JSON.stringify(l)!==JSON.stringify(o)&&(n(),o=l,r());}}}function hk(e){return e?.root.children.some(t=>t.kind!=="textValue"&&(t.localName==="mirrorMargins"||t.localName==="evenAndOddHeaders")&&!t.attributes.some(n=>n.localName==="val"&&["0","false","off"].includes(n.value)))??false}function yk(e,t,n,r){let o=chunkOSFOJTHU_cjs.Ta(e,t);if(o?.kind!=="paragraph")return false;if(!chunkDOHF6FA7_cjs.qc(o,n,r))return true;let i=chunkOSFOJTHU_cjs.Ua(e,t);return i?chunkDOHF6FA7_cjs.pd(i.children,n,r).some(a=>a.kind==="paragraph"&&a.id===t):false}var mD=new Set(["Shift","Control","Alt","Meta","CapsLock","NumLock","ScrollLock","ContextMenu"]);function bk(e){return {onDrawingPointerGesture(t){if(t instanceof PointerEvent&&t.button!==0||e.surface.editingMode()==="view")return;let n=t.target instanceof Element?t.target:null,o=!e.textbox()?.preparePointer(n)&&n?.closest("[data-drawing-node-id]")?.getAttribute("data-drawing-node-id");if(o&&n?.closest(".docx-drawing-textbox")){let i;for(let a of e.surface.layout().pages)if(i=chunkDOHF6FA7_cjs.yd(a,o),i)break;if(i&&e.surface.selectDrawing(o,i.paragraphId)){t.preventDefault(),t.stopImmediatePropagation();return}}e.setIntent(o?{kind:"pointer",drawingNodeId:o}:{kind:"none"});},onDrawingKeyGesture(t){if(t instanceof KeyboardEvent&&mD.has(t.key))return;if(t instanceof KeyboardEvent&&t.key==="Escape"&&e.textbox()?.active()){e.textbox().exit(),t.preventDefault(),t.stopImmediatePropagation();return}if((t instanceof KeyboardEvent&&(t.key==="Delete"||t.key==="Backspace")&&!t.altKey&&!t.ctrlKey&&!t.metaKey||t instanceof InputEvent&&(t.inputType==="deleteContentBackward"||t.inputType==="deleteContentForward"))&&e.intent().kind==="pointer"){let r=Sn(e.surface);if(r!==null){t.preventDefault(),t.stopImmediatePropagation(),e.setIntent({kind:"none"}),e.surface.deleteImage(r.drawingNodeId);return}}e.setIntent({kind:"none"});}}}var wk=32,vk=new WeakMap,xk=new WeakMap,gD=new WeakMap,hD=new WeakMap;function Kd(e){let t=vk.get(e);if(t)return t;let n=[e.fragments];e.header&&n.push(e.header.fragments),e.footer&&n.push(e.footer.fragments);for(let o of [e.footnotes,e.endnotes])if(o)for(let i of o.notes)n.push(i.fragments);let r={stories:n,sparse:new Map,complete:null};return vk.set(e,r),r}function Sk(e,t){let n=t?hD:gD,r=n.get(e);return r||(r={fragment:e,indent:{indent:e.indent,inTable:t},emptyStyle:e.emptyParagraphStyle},n.set(e,r)),r}function Ik(e,t){return e?!e.emptyStyle&&t.emptyStyle?{...e,emptyStyle:t.emptyStyle}:e:t}function Rs(e,t,n){let r=e.get(t),o=Ik(r,n);o!==r&&e.set(t,o);}function yD(e,t){let n=(r,o)=>{for(let i of r){if(i.kind==="paragraph"){t(i,o);continue}for(let a of i.rows)if(!a.isHeaderRepeat)for(let s of a.cells)n(s.blocks,true);}};for(let r of e)n(r,false);}function xm(e){if(e.complete)return e.complete;let t=new Map;yD(e.stories,(n,r)=>{let o=Sk(n,r);for(let i of chunkDOHF6FA7_cjs.Pa(n))Rs(t,i,o);});for(let[n,r]of e.sparse)r&&t.set(n,r);return e.sparse.clear(),e.complete=t,t}function bD(e,t){if(e.paragraphId===t)return true;for(let n of e.lines??[])if(n.range.paragraphId===t||n.spans.some(r=>r.range.paragraphId===t)||(n.drawings??[]).some(r=>r.paragraphId===t))return chunkDOHF6FA7_cjs.Pa(e).includes(t);return false}function kk(e,t){if(e.complete)return e.complete.get(t);let n=e.sparse.get(t);if(n!==void 0)return n??void 0;if(e.sparse.size>=wk)return xm(e).get(t);let r,o=(i,a)=>{for(let s of i){if(s.kind==="paragraph"){if(!bD(s,t))continue;if(r=Ik(r,Sk(s,a)),r.emptyStyle)return true;continue}if(chunkDOHF6FA7_cjs.bf(s).has(t)){for(let l of s.rows)if(!l.isHeaderRepeat){for(let d of l.cells)if(o(d.blocks,true))return true}}}return false};for(let i of e.stories)if(o(i,false))break;return e.sparse.set(t,r??null),r}function vD(e,t,n){for(let[r,o]of n)Rk(e,t,r,o);for(let r=0;r<t.frontier;r+=1)for(let[o,i]of xm(Kd(e.pages[r])))n.has(o)||Rs(t.entries,o,i);t.progress=null;}function Rk(e,t,n,r){for(let o=r;o<t.frontier;o+=1){let i=kk(Kd(e.pages[o]),n);i&&Rs(t.entries,n,i);}}function Ps(e,t,n=false){let r=xk.get(e);r||(r={frontier:0,entries:new Map,progress:new Map},xk.set(e,r));let o=()=>{let s=r.entries.get(t);return s&&(!n||s.emptyStyle)?s:void 0},i=r.progress;if(i&&!i.has(t)&&i.size>=wk&&vD(e,r,i),r.progress){Rk(e,r,t,r.progress.get(t)??0);let s=o();for(;!s&&r.frontier<e.pages.length;){let l=kk(Kd(e.pages[r.frontier++]),t);l&&Rs(r.entries,t,l),s=o();}return r.progress.set(t,r.frontier),s??r.entries.get(t)}let a=o();for(;!a&&r.frontier<e.pages.length;){for(let[s,l]of xm(Kd(e.pages[r.frontier++])))Rs(r.entries,s,l);a=o();}return a??r.entries.get(t)}var wm=e=>chunkDOHF6FA7_cjs.sd(e)?"rtl":"ltr";function xD(e,t){return Ps(e,t,true)?.emptyStyle}function sr(e,t){return Ps(e,t)?.fragment.props??[]}function Ts(e,t){return Ps(e,t)?.fragment.tabStops??null}function Vd(e){return Math.round((e.hanging>0?-e.hanging:e.firstLine)*20)}function Sm(e,t){return Ps(e,t)?.indent??null}function Tk(e,t,n,r,o=chunkOSFOJTHU_cjs.th,i){let a=chunkOSFOJTHU_cjs.Ta(e,t);if(!a||a.kind!=="paragraph")return false;for(let s of chunkOSFOJTHU_cjs.uh(a,chunkOSFOJTHU_cjs.Hh(a),n,r,o,i))if(chunkOSFOJTHU_cjs.Ch(chunkOSFOJTHU_cjs.Bh(s.run,"runProperties","rPr"),chunkOSFOJTHU_cjs.zh).length>0)return true;return false}function Wi(e,t,n,r=chunkOSFOJTHU_cjs.th,o){let i=chunkOSFOJTHU_cjs.Ta(e,t);if(!i||i.kind!=="paragraph")return [];let a=chunkOSFOJTHU_cjs.Oh(i,n,r,o);return a?chunkOSFOJTHU_cjs.Ch(chunkOSFOJTHU_cjs.Bh(a,"runProperties","rPr"),chunkOSFOJTHU_cjs.zh):chunkOSFOJTHU_cjs.Eh(e,t)}function ji(e,t,n){let r=e?.find(i=>i.localName===t);if(!r)return null;let o=r.attributes?.val;return t==="vertAlign"?o===n:(t==="u"||o!=="0"&&o!=="false"&&o!=="off")&&o!=="none"}function Ck(e,t){if(!t||t.length===0)return e;let n=e;for(let r of t){let o=r.attributes?.val;switch(r.localName){case "b":n={...n,bold:ji(t,"b")===true};break;case "i":n={...n,italic:ji(t,"i")===true};break;case "u":n={...n,underline:ji(t,"u")===true};break;case "strike":n={...n,strikethrough:ji(t,"strike")===true};break;case "vertAlign":n={...n,superscript:o==="superscript",subscript:o==="subscript"};break;case "rFonts":n={...n,fontFamily:r.attributes?.ascii??n.fontFamily};break;case "sz":{let i=Number(o);Number.isFinite(i)&&(n={...n,fontSizeHalfPoints:i});break}case "color":n={...n,color:o==="auto"?null:o??n.color};break;case "highlight":n={...n,highlight:o==="none"?null:o??n.highlight};break;}}return n}function Im(e,t,n,r){return (n&&n.length>0?chunkD7ZMDMPX_cjs.ha(e,n):chunkDOHF6FA7_cjs.te(e,t,r??(t.anchor.paragraphId===t.head.paragraphId?[]:chunkDOHF6FA7_cjs.Sa(e)))).map(i=>{let a=chunkDOHF6FA7_cjs.v(chunkDOHF6FA7_cjs.u(i.style));return a===i.style?i:{...i,style:a}})}function jd(e,t){let n=e.indexOf(t.from.paragraphId),r=e.indexOf(t.to.paragraphId);if(n===-1||r===-1)return [];let o=r>n&&t.to.offset===0?r-1:r;return e.slice(n,o+1)}function Wd(e,t,n,r){return Im(e,t,n,r)[0]?.style??null}function km(e,t,n,r,o,i){let a=Im(e,t,r,i);if(a.length===0)return false;let s=l=>{switch(n){case "b":return l.style.bold;case "i":return l.style.italic;case "u":return l.style.underline!==null;case "strike":return l.style.strike;case "vertAlign":return l.style.verticalAlign===o;default:return false}};return a.every(s)}function Ek(e,t,n,r,o,i,a){let s=Im(e,t,r,i),l=s.length===0?Pk(e,t,r,i).map(_=>xD(e,_)).filter(_=>_!==void 0):[],d=l.length>0?l:s.map(_=>_.style),c=_=>{if(d.length===0)return null;let X=_(d[0]);return d.every(z=>_(z)===X)?X:null},u=(_,X=(z,oe)=>z===oe)=>_.length>0&&_.every(z=>X(z,_[0]))?_[0]:null,p=(_,X)=>_.props.some(z=>z.localName===X),m=_=>_.style.fontFamily??n?.(_.range.paragraphId,_.props).fontFamily??null,g=_=>p(_,"sz")?Math.round(_.style.fontSizePt*2):n?.(_.range.paragraphId,_.props).fontSizeHalfPoints??Math.round(_.style.fontSizePt*2),b=l.length>0?{fontFamily:c(_=>_.fontFamily??a??null),fontSizeHalfPoints:c(_=>Math.round(_.fontSizePt*2))}:s.length===0?n?.(t.head.paragraphId,[]):void 0,h=Pk(e,t,r,i),y=_=>u(h.map(X=>_(sr(e,X)))),S=(_,X=(z,oe)=>z===oe)=>{if(h.length<2)return false;let z=_(sr(e,h[0]));return h.some((oe,j)=>j>0&&!X(_(sr(e,oe)),z))},x=y(_=>chunkDOHF6FA7_cjs.bd(_)),I=y(wm),R=y(_=>chunkDOHF6FA7_cjs.O(_,"pStyle")?.val??o??void 0)??null,T=_=>chunkDOHF6FA7_cjs.O(_,"spacing")??void 0,P=_=>{let X=T(_),z=chunkOSFOJTHU_cjs.nd(X?.line);if(z===null)return "";let oe=X?.lineRule??"auto";return oe==="auto"?`multiple:${Math.round(z/240*100)/100}`:`${oe==="exact"?"exact":"atLeast"}:${Math.round(z/20*100)/100}`},O=y(P),v=(()=>{if(!O)return null;let[_,X]=O.split(":");return {rule:_,value:Number(X)}})(),C=(_,X)=>{let z=chunkOSFOJTHU_cjs.nd(T(_)?.[X]);return z===null?null:Math.round(z/20*100)/100},L=_=>y(X=>C(X,_)),A=(()=>{let _=B=>wm(sr(e,B))==="rtl",X=h.map(B=>{let $=Sm(e,B);return !$||!_(B)?$:{...$,indent:{...$.indent,left:$.indent.right,right:$.indent.left}}}),z=X[0];if(!z||X.some(B=>B===null||B.inTable))return null;let oe=_(h[0]),j=B=>Math.round(B*20),me=X,U=j(z.indent.left),F=j(z.indent.right),N=Vd(z.indent);return {left:U,right:F,firstLine:N,mixed:{left:me.some(B=>j(B.indent.left)!==U),right:me.some(B=>j(B.indent.right)!==F),firstLine:me.some(B=>Vd(B.indent)!==N)},...oe?{rtl:oe}:{}}})(),q=_=>y(X=>_(chunkDOHF6FA7_cjs.nd(X))),K=y(chunkDOHF6FA7_cjs.H),E=y(chunkDOHF6FA7_cjs.S);return {bold:d.length>0&&d.every(_=>_.bold),italic:d.length>0&&d.every(_=>_.italic),underline:d.length>0&&d.every(_=>_.underline!==null),strikethrough:d.length>0&&d.every(_=>_.strike),superscript:d.length>0&&d.every(_=>_.verticalAlign==="superscript"),subscript:d.length>0&&d.every(_=>_.verticalAlign==="subscript"),fontFamily:s.length>0?u(s.map(m)):b?.fontFamily??null,fontSizeHalfPoints:s.length>0?u(s.map(g)):b?.fontSizeHalfPoints??null,color:c(_=>_.color),highlight:c(_=>_.highlight),alignment:x,direction:I,styleId:R,lineSpacing:v,spaceBeforePt:L("before"),spaceAfterPt:L("after"),disagrees:{alignment:S(_=>chunkDOHF6FA7_cjs.bd(_)),direction:S(wm),spaceBeforePt:S(_=>C(_,"before")),spaceAfterPt:S(_=>C(_,"after")),lineSpacing:S(P),tabStops:(()=>{if(h.length<2)return false;let _=JSON.stringify(Ts(e,h[0])?.stops??null);return h.some((X,z)=>z>0&&JSON.stringify(Ts(e,X)?.stops??null)!==_)})()},indent:A,tabStops:u(h.map(_=>Ts(e,_)?.stops??null),(_,X)=>_===null||X===null?_===X:_.length===X.length&&_.every((z,oe)=>Math.round(z.positionPt*20)===Math.round(X[oe].positionPt*20)&&z.alignment===X[oe].alignment&&(z.leader??"none")===(X[oe].leader??"none")))?.map(_=>({positionTwips:Math.round(_.positionPt*20),alignment:_.alignment,..._.leader?{leader:_.leader}:{}}))??null,paragraphFlags:{contextualSpacing:E,keepNext:q(_=>_.keepNext),keepLines:q(_=>_.keepLines),widowControl:q(_=>_.widowControl),pageBreakBefore:K}}}function Pk(e,t,n,r){if(n&&n.length>0)return [...chunkD7ZMDMPX_cjs.ga(e,n)];if(t.anchor.paragraphId===t.head.paragraphId)return [t.head.paragraphId];let o=r??chunkDOHF6FA7_cjs.Sa(e),i=o.indexOf(t.anchor.paragraphId),a=o.indexOf(t.head.paragraphId);return i===-1||a===-1?[t.head.paragraphId]:o.slice(Math.min(i,a),Math.max(i,a)+1)}function Ok(e,t,n,r){return t.paragraphId!==n.paragraphId?[]:t.offset!==0||n.offset!==e.length?[]:e.length===0?[]:[{op:"setParagraphMarkProperties",paragraphId:t.paragraphId,properties:r}]}function Mk(e){let t=null,n=null,r=null,o=()=>t&&chunkOSFOJTHU_cjs.mi(e.session.part()).find(l=>l.root.id===t.id&&l.drawingNodeId===t.drawingNodeId),i=()=>{if(t&&!o()){a();return}for(let l of e.pagesLayer.querySelectorAll(".docx-drawing-textbox")){let d=l.dataset.drawingNodeId===t?.drawingNodeId;l.dataset.docxTextboxActive=String(d),l.contentEditable=d?"true":"false",l.setAttribute("role",d?"textbox":"img"),d?(l.removeAttribute("aria-hidden"),l.setAttribute("aria-multiline","true")):(l.removeAttribute("aria-multiline"),l.hasAttribute("aria-label")||l.setAttribute("aria-hidden","true"));for(let c of l.querySelectorAll("[data-textbox-paragraph-id]"))d?c.dataset.paragraphId=c.dataset.textboxParagraphId:delete c.dataset.paragraphId;}},a=(l=true)=>{t&&(e.flush(),t=null,r=null,i(),l&&n&&e.setSelection(n),n=null);},s=l=>{if(l.owner||!e.writable())return false;e.flush();let d=chunkOSFOJTHU_cjs.mi(e.session.part()).find(R=>R.root.id===l.id&&R.drawingNodeId===l.drawingNodeId&&R.hostParagraphId===l.hostParagraphId),c=d&&chunkOSFOJTHU_cjs.Ua(e.session.part(),d.root.id),u=c&&chunkOSFOJTHU_cjs.Ua(e.session.part(),c.id),p=u&&chunkOSFOJTHU_cjs.ud(u.children,{namespaceUri:chunkOSFOJTHU_cjs.ia,localName:"spPr"}),m=p&&chunkOSFOJTHU_cjs.ud(p.children,{namespaceUri:chunkOSFOJTHU_cjs.ra,localName:"xfrm"}),g=u&&chunkOSFOJTHU_cjs.ud(u.children,{namespaceUri:chunkOSFOJTHU_cjs.ia,localName:"bodyPr"}),b=m&&chunkOSFOJTHU_cjs.ka(m.attributes,"rot"),h=g&&chunkOSFOJTHU_cjs.ka(g.attributes,"rot"),y=g&&chunkOSFOJTHU_cjs.ka(g.attributes,"vert");if(b&&Number(b)!==0||h&&Number(h)!==0||y&&y!=="horz")return false;let S;for(let R of e.layout().pages)if(S=chunkDOHF6FA7_cjs.yd(R,l.drawingNodeId),S)break;if(!d||!S?.textboxStory||S.transform.rotationDegrees!==0||S.textboxStory.fragments.some(R=>R.kind!=="paragraph"))return false;let x=S.textboxStory.fragments[0];if(!x||x.kind!=="paragraph")return false;if(t?.id===l.id)return true;a(),e.leaveOtherStories(),n=e.selection(),t=l,r=null,i();let I={paragraphId:x.paragraphId,offset:x.range.start};return e.setSelection({anchor:I,head:I}),true};return {active:()=>t,replacementFormatOps(l,d,c){let{anchor:u,head:p}=e.selection();if(!t||c===0||u.paragraphId===p.paragraphId&&u.offset===p.offset)return [];let m=Wi(e.session.part(),l,d);return m.length?[{op:"setRunProperties",paragraphId:l,start:d,end:d+c,properties:m}]:[]},enter:s,exit:a,syncDom:i,contains:l=>{let d=o();return !!d&&chunkOSFOJTHU_cjs.Rc(d.root).some(c=>c.id===l)},paragraphIds:()=>{let l=o();return l?chunkOSFOJTHU_cjs.Rc(l.root).map(d=>d.id):[]},caretInput(l){if(!t)return {};let d=t.drawingNodeId,c;for(let g of l.pages)if(c=chunkDOHF6FA7_cjs.yd(g,d),c)break;let u=c?.textboxStory,m=[...e.pagesLayer.querySelectorAll(".docx-drawing-textbox")].find(g=>g.dataset.drawingNodeId===d)?.querySelector(".docx-drawing-textbox-content");return !c||!u||!m?{}:{scopedHost:m,scopedHostKind:"textbox",scopedOrigin:{x:c.x+u.contentOffset.x,y:c.y+u.contentOffset.y}}},layout(l){if(!t)return l;if(r?.base===l&&r.id===t.id)return r.layout;let d=t.drawingNodeId,c={...l,pages:l.pages.map(u=>{let p=chunkDOHF6FA7_cjs.yd(u,d),m=p?.textboxStory;return {...u,header:void 0,footer:void 0,footnotes:void 0,endnotes:void 0,anchoredDrawings:[],fragments:p&&m?m.fragments.flatMap(g=>g.kind==="paragraph"?[chunkDOHF6FA7_cjs.Le(g,p.x+m.contentOffset.x,p.y+m.contentOffset.y)]:[]):[]}})};return r={base:l,id:t.id,layout:c},c},preparePointer(l){let c=l?.closest(".docx-drawing-textbox-content")?.closest("[data-drawing-node-id]")?.dataset.drawingNodeId,u=c&&chunkOSFOJTHU_cjs.mi(e.session.part()).find(p=>p.drawingNodeId===c);return u&&s({kind:"frame",id:u.root.id,drawingNodeId:u.drawingNodeId,hostParagraphId:u.hostParagraphId})?true:(a(false),false)}}}function Ak(e,t,n){return (r,o)=>{let i=t(),a=n();return chunkOSFOJTHU_cjs.Nh(Me(e,r)??e.part(),r,o,chunkEKLM7NWB_cjs.a(e.stylesRoot(),e.settingsRoot(),i,a),i,a)}}function Rm(e,t){e.setAttribute("aria-label",t?.("editor.documentContent")??i18n.en.editor.documentContent);}var Pm=new WeakSet,Fk=new WeakMap,Wn=e=>Pm.has(e);function ao(e,t){t?Pm.add(e):Pm.delete(e);}function Lk(e,t){Fk.set(e,t);}var Nk=e=>Fk.get(e)?.()??false;function Dk(e){let t="select[data-docx-form-dropdown]",n=d=>d instanceof Element?d.closest(t):null,r=d=>{let c=d.closest("[data-start][data-paragraph-id]"),u=c?.dataset.paragraphId;if(!c||!u)return null;let p=e.part(u),m=chunkOSFOJTHU_cjs.Ta(p,u);if(m?.kind!=="paragraph")return null;let g=Number(c.dataset.start),b=chunkOSFOJTHU_cjs.Mi(m).find(y=>y.start<=g&&g<y.end);if(!b)return null;let h={op:"setLegacyDropdown",paragraphId:u,fieldNodeId:b.fieldNodeId,selectedIndex:d.selectedIndex};return {field:b,paragraphId:u,op:h,enabled:e.editable()&&e.canApply(h)&&chunkOSFOJTHU_cjs.nj(e.settings(),h)===null&&chunkOSFOJTHU_cjs.Xk(p,h)===null}},o=()=>{for(let d of e.pagesLayer.querySelectorAll(t))d.disabled=!r(d)?.enabled;},i=d=>{let c=n(d.target);c&&(d.stopPropagation(),r(c)?.enabled||d.preventDefault());},a=d=>{let c=n(d.target);c&&(c.disabled=!r(c)?.enabled);},s=d=>{let c=n(d.target);if(!c)return;d.stopPropagation();let u=r(c);if(!u)return;if(!u.enabled||!e.apply(u.op)){c.selectedIndex=u.field.selectedIndex;return}e.select({anchor:{paragraphId:u.paragraphId,offset:u.field.start},head:{paragraphId:u.paragraphId,offset:u.field.end}}),[...e.pagesLayer.querySelectorAll(t)].find(m=>{let g=m.closest("[data-start][data-paragraph-id]");return g?.dataset.paragraphId===u.paragraphId&&Number(g.dataset.start)===u.field.start})?.focus({preventScroll:true});},l=new MutationObserver(d=>{for(let c of d)for(let u of c.addedNodes){if(!(u instanceof Element))continue;let p=u.matches(t)?[u]:u.querySelectorAll(t);for(let m of p)m.disabled=!r(m)?.enabled;}});return l.observe(e.pagesLayer,{childList:true,subtree:true}),e.pagesLayer.addEventListener("pointerdown",i,true),e.pagesLayer.addEventListener("focusin",a),e.pagesLayer.addEventListener("change",s),o(),{sync:o,keydown(d){let c=n(d.target);if(!c)return false;d.stopPropagation();let u=d.key.toLowerCase();return (d.ctrlKey||d.metaKey)&&!d.altKey&&(u==="z"||u==="y")?(d.preventDefault(),e.pagesLayer.focus({preventScroll:true}),e.history(u==="y"||d.shiftKey?"redo":"undo"),true):(!r(c)?.enabled&&d.key!=="Tab"&&d.preventDefault(),true)},destroy(){l.disconnect(),e.pagesLayer.removeEventListener("pointerdown",i,true),e.pagesLayer.removeEventListener("focusin",a),e.pagesLayer.removeEventListener("change",s);}}}function Hk(e,t){let n=chunkOSFOJTHU_cjs.Ua(e,t.id);for(let i=0;n&&i<64&&(n.namespaceUri===chunkOSFOJTHU_cjs.la&&n.localName==="customXml"||chunkOSFOJTHU_cjs.Uc(n)||chunkOSFOJTHU_cjs.Vc(n));i+=1)n=chunkOSFOJTHU_cjs.Ua(e,n.id);if(!n)return [];let r=chunkOSFOJTHU_cjs.Yc(n.children),o=r.findIndex(i=>i.id===t.id);return o>=2?r.slice(o-2,o):[]}function _k(e){let t=n=>n.kind==="textValue"?/^[ \t\u00a0]*$/.test(n.value):n.namespaceUri!==chunkOSFOJTHU_cjs.la?false:n.localName==="pPr"?!n.children.some(r=>r.kind!=="textValue"&&r.localName==="sectPr"):n.localName==="rPr"||n.localName==="tab"||["bookmarkStart","bookmarkEnd","commentRangeStart","commentRangeEnd","proofErr"].includes(n.localName)?true:["p","r","t","hyperlink"].includes(n.localName)?n.children.every(t):false;return t(e)}function Bk(e,t,n,r,o,i,a,s){let l=chunkOSFOJTHU_cjs.Ta(e,n.paragraphId);if(l?.kind!=="paragraph")return null;let[d,c]=Hk(e,l);if(c?.kind!=="paragraph"||d?.kind!=="paragraph"||!_k(c))return null;let u=chunkDOHF6FA7_cjs.Qa(t,l.id),p=chunkDOHF6FA7_cjs.Qa(t,d.id);if(!u||u.numId!==p?.numId||u.level!==p.level||chunkDOHF6FA7_cjs.Qa(t,c.id))return null;let m=(T,P,O,v)=>({id:T,kind:P,localName:O,namespaceUri:chunkOSFOJTHU_cjs.la,prefix:"w",namespaceBindings:[],attributes:[],children:v}),g=l.children.find(T=>T.kind==="paragraphProperties"),b=g&&{...g,children:g.children.filter(T=>T.localName!=="sectPr")},h=chunkOSFOJTHU_cjs.Li({localName:"pStyle",attributes:{val:o}},"separator-style"),y=r.map((T,P)=>chunkOSFOJTHU_cjs.Li(T,`separator-format-${P}`));a&&y.push(chunkOSFOJTHU_cjs.Li({localName:"ins",attributes:{id:chunkOSFOJTHU_cjs.oh(e,s)(),author:a.author,...a.date?{date:a.date}:{}}},"separator-insertion"));let S=m("separator-mark","runProperties","rPr",y),x=m("separator-properties","paragraphProperties","pPr",[...h?[h]:[],...y.length?[S]:[]]),I=[...x.children],R=i?.styles.has(o)?x:m("separator-defaults","paragraphProperties","pPr",[]);return i&&chunkDOHF6FA7_cjs.vc(chunkDOHF6FA7_cjs.id(i,R).paragraphPropertyNodes)&&I.splice(h?1:0,0,m("separator-numbering","generic","numPr",[chunkOSFOJTHU_cjs.Li({localName:"numId",attributes:{val:"0"}},"separator-number-id")])),{op:"insertFragment",paragraphId:l.id,offset:n.offset,blocks:[m("separator-head","paragraph","p",b?[b]:[]),m("separator-blank","paragraph","p",[m("separator-properties-final","paragraphProperties","pPr",I)])],lastMarkCovered:true}}function $k(e,t=true){return e.ownerDocument.defaultView?.navigator?.scheduling?.isInputPending?.({includeContinuous:t})??false}function Tm(e,t){let n=e.setScale;return typeof n!="function"?false:n.call(e,t)}var qk=new Set(["comment-add","comment-delete","comment-reply","comment-resolve","package-scoped","revision-resolve","revision-attribution"]);var SD="list paragraph",ID="ListParagraph";function Kk(e){return e.find(t=>t.localName==="pStyle")?.attributes?.val}function Zd(e){let t=null;for(let n of e)if(n.type==="paragraph"){if(n.name.trim().toLowerCase()===SD)return n.styleId;t===null&&n.styleId===ID&&(t=n.styleId);}return t}function Vk(e){let{session:t}=e,n;function r(){let o=t.stylesRoot();return (n===void 0||n.root!==o)&&(n={root:o,styleId:chunkDOHF6FA7_cjs.hd(o,t.documentThemeFonts()).defaultParagraphStyleId}),n.styleId}return {applyOps(o){let i=Zd(t.documentStyles());if(i===null)return [];let a=r(),s=e.storyPart(),l=[];for(let d of o){let c=chunkOSFOJTHU_cjs.Dh(s,d),u=Kk(c);u!==void 0&&u!==a||l.push({op:"setParagraphProperties",paragraphId:d,properties:chunkOSFOJTHU_cjs.Fh(c,{localName:"pStyle",attributes:{val:i}})});}return l},clearOp(o){let i=Zd(t.documentStyles());if(i===null)return null;let a=chunkOSFOJTHU_cjs.Dh(e.storyPart(),o);return Kk(a)!==i?null:{op:"setParagraphProperties",paragraphId:o,properties:a.filter(s=>s.localName!=="pStyle")}}}}function jk(e,t){return n=>{let r=chunkOSFOJTHU_cjs.bd(n),o=r?.name??"/word/styles.xml",i="application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml",a=r?null:chunkOSFOJTHU_cjs.Ia('<w:styles xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"/>',{name:o,contentType:i}),s=r??(a?.ok?a.part:null);if(!s)throw new Error("Cannot create list paragraph style");if(s.root.children.some(g=>g.kind!=="textValue"&&g.attributes.some(b=>b.localName==="styleId"&&b.value===t)))return n;let l=chunkOSFOJTHU_cjs.Ra(s),d=(g,b={},h=[])=>({...chunkOSFOJTHU_cjs.Li({localName:g,attributes:b},l()),children:h,...g==="pPr"?{kind:"paragraphProperties"}:{}}),u={...d("style",{type:"paragraph",styleId:t},[d("name",{val:"List Paragraph"}),...e?[d("basedOn",{val:e})]:[],d("uiPriority",{val:"34"}),d("qFormat"),d("pPr",{},[d("ind",{left:"720"}),d("contextualSpacing")])]),namespaceBindings:[{prefix:"w",namespaceUri:chunkOSFOJTHU_cjs.la}]};if(r){let g=chunkOSFOJTHU_cjs.Ya(s,s.root.id,s.root.children.length,[u]);if(!g.ok)throw new Error("Cannot insert list paragraph style");return chunkOSFOJTHU_cjs.Fe(n,g.part)}let p=chunkOSFOJTHU_cjs.Pe(n,o,{...s.root,children:[u]},i);p=chunkOSFOJTHU_cjs.Ne(p,n.mainDocumentPart);let m=chunkOSFOJTHU_cjs.Oe(p,n.mainDocumentPart,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",o);if(!m.ok)throw new Error("Cannot link list paragraph style");return m.pkg}}function zd(e,t){let n=e.ownerDocument,r=e.dataset.docxCcId,o=()=>{n.removeEventListener("pointerdown",i,true),n.removeEventListener("keydown",a,true);},i=s=>{if(e.parentNode===null){o();return}let l=s.target,d=l instanceof Element?l.closest("[data-docx-cc-widget]"):null;l&&(e.contains(l)||d?.getAttribute("data-docx-cc-id")===r)||(o(),t());},a=s=>{s.key!=="Escape"||s.isComposing||(s.preventDefault(),o(),e.parentNode!==null&&(s.stopPropagation(),t()));};return n.addEventListener("pointerdown",i,true),n.addEventListener("keydown",a,true),o}function Wk(e,t,n,r,o){let a=chunkDOHF6FA7_cjs.oe(e).find(u=>u.id===n)?.fragments[0],s=a?e.pages[a.pageIndex]:void 0;if(!a||!s)return null;let l=o?.get(a.pageIndex)??0,d=s.contentBox.x-s.box.x,c=s.contentBox.y-s.box.y;return {left:(s.box.x+l+d+a.box.x)*t,top:(s.box.y+c+a.box.y+a.box.height)*t,element:[...r.querySelectorAll("[data-docx-content-control]")].find(u=>u.dataset.docxContentControl===n)?.querySelector(".docx-content-control-boundary")??void 0,sheetLeft:(s.box.x+l)*t,sheetRight:(s.box.x+l+s.box.width)*t}}function Zk(e){return e.kind==="textValue"?e.value:e.localName==="sdtPr"?"":e.children.map(Zk).join("")}function Cm(e,t){let n=e?Zk(e):"";return t.find(r=>r.displayText===n)?.value??n}function zk(e){let t=e?.children.find(n=>n.kind!=="textValue"&&n.localName==="sdtPr");if(!(!t||t.kind==="textValue")){for(let n of t.children)if(n.kind!=="textValue"){if(n.localName==="dropDownList")return "dropdown";if(n.localName==="comboBox"||n.localName==="date")return n.localName;if(n.localName==="checkbox")return "checkbox";if(n.localName==="picture")return "picture";if(n.localName==="docPartList")return "buildingBlockGallery"}}}var kD=["dropdown","comboBox","date","checkbox","picture","buildingBlockGallery"];function Uk(e){let t=null,n=false,r=()=>{let o=t;t=null,o&&(e.setOpen(o.id,false),o.controller.abort());};return {cancel:r,destroy(){n=true,r();},open(o,i){if(r(),n||!e.request||!kD.includes(i))return false;let a=new AbortController;t={controller:a,id:o};let s=()=>!n&&t?.controller===a&&!a.signal.aborted,l=()=>s()&&zk(e.find(o))===i&&e.allowed(o),d=e.find(o),c=e.items(o).map(b=>({...b})),u=Cm(d,c),p=i==="picture"?e.picture(o):void 0;if(i==="picture"&&!p)return r(),false;let m=false,g={controlId:o,kind:i,items:c,value:i==="date"?e.date(o)??"":i==="checkbox"?String(e.checked(o)):i==="picture"?p:i==="buildingBlockGallery"?"":u,locale:e.locale(),anchor:[...e.layer.querySelectorAll("[data-docx-content-control]")].find(b=>b.getAttribute("data-docx-content-control")===o)?.querySelector(".docx-content-control-boundary")??null,signal:a.signal,canApply:l,apply(b){return i==="picture"||!l()||!e.apply(o,b)?false:(s()&&r(),true)},cancel(){s()&&r();},...i==="picture"?{async replaceImage(b){if(m||!l())return false;m=true;try{return await e.replaceImage(o,b,()=>l()&&e.picture(o)===p)?(s()&&r(),!0):!1}finally{m=false;}}}:{}};return e.setOpen(o,true),e.request(g)?true:(g.cancel(),false)}}}function Gk(e,t){if(!e)return [];if(t&&Yk(e))return chunkOSFOJTHU_cjs.Fg(t(),e).map(n=>({displayText:n.name,value:n.name}));for(let n of e.children)if(n.kind!=="textValue"&&!(n.kind!=="contentControlProperties"&&n.localName!=="sdtPr"))for(let r of n.children){if(r.kind==="textValue"||r.localName!=="dropDownList"&&r.localName!=="comboBox")continue;let o=[];for(let i of r.children){if(i.kind==="textValue"||i.localName!=="listItem")continue;let a=i.attributes.find(l=>l.localName==="value")?.value??"",s=i.attributes.find(l=>l.localName==="displayText")?.value??a;o.push({displayText:s,value:a});}return o}return []}function Xk(e){if(e){for(let t of e.children)if(t.kind==="contentControlProperties"){for(let n of t.children)if(n.kind==="contentControlDate")return n.attributes.find(r=>r.localName==="fullDate")?.value}}}function Yk(e){return zk(e&&e.kind!=="textValue"?e:null)==="buildingBlockGallery"}function Qk(e,t,n,r){if(!e||!Yk(e))return [{op:"setContentControlValue",controlId:n,value:r}];let o=chunkOSFOJTHU_cjs.Fg(t(),e).filter(a=>a.name===r),i=o.length===1?o[0]:void 0;return i?[{op:"insertBuildingBlock",controlId:n,name:i.name,blocks:i.blocks}]:null}function Jk(e){let t=-1,n=true;return ()=>{let r=e.packageRevision();return t!==r&&(t=r,n=!chunkOSFOJTHU_cjs.ji(e.settingsRoot()).doNotShadeFormData),n}}var Zi="switch to field results before editing a form value";function eR(e,t){let{anchor:n,head:r}=t,o=n.paragraphId===r.paragraphId;for(let i of [n,r]){let a=e(i.paragraphId),s=a&&chunkOSFOJTHU_cjs.Ta(a,i.paragraphId);if(s?.kind!=="paragraph")continue;let l=o?Math.min(n.offset,r.offset):i.offset,d=o?Math.max(n.offset,r.offset):i.offset,c=chunkOSFOJTHU_cjs.jg(s);if(chunkOSFOJTHU_cjs.Hf(s).filter(p=>p.addressing==="editable-result").map(p=>{let m=c.spanOf(p.node)?.start??0,g=m;for(let b of p.removeNodeIds)g=Math.max(g,c.spanOf(b)?.end??g);return {start:m,end:g}}).some(p=>l===d?l>=p.start&&(l<p.end||p.start===p.end):l<p.end&&d>p.start))return true}return false}function tR(e,t,n,r){let o=e.contentControlId?chunkDOHF6FA7_cjs.oe(t).find(c=>c.id===e.contentControlId):void 0,i=Lr(n).filter(c=>c.toc.id===e.id),a=i.some(c=>c.start>0||c.end<c.length);if(o&&!a)return {tocId:e.id,boundary:o,additional:false};let s=new Map(i.map(c=>[c.paragraphId,c])),l=i.filter(c=>c.start>0||c.end<c.length).flatMap(c=>chunkDOHF6FA7_cjs.ue(t,{anchor:{paragraphId:c.paragraphId,offset:c.start},head:{paragraphId:c.paragraphId,offset:c.end}},[c.paragraphId],r)),d=t.pages.flatMap(c=>{let u=chunkDOHF6FA7_cjs.xa(c).filter(h=>{let y=s.get(h.paragraphId);return y&&y.start===0&&y.end===y.length}).map(chunkDOHF6FA7_cjs.Ed);if(u.push(...l.filter(h=>h.pageIndex===c.index)),u.length===0)return [];let p=Math.min(...u.map(h=>h.x)),m=Math.min(...u.map(h=>h.y)),g=Math.max(...u.map(h=>h.x+h.width)),b=Math.max(...u.map(h=>h.y+h.height));return [{pageIndex:c.index,box:{x:p,y:m,width:g-p,height:b-m}}]});return d.length===0?null:{tocId:e.id,additional:true,boundary:{id:`toc:${e.id}`,controlType:"richText",lock:"unlocked",effectiveLock:"unlocked",placeholder:false,bound:false,nestingDepth:0,level:"block",fragments:d}}}var nR=new WeakMap;function rR(e,t,n,r){nR.set(e,o=>{let i=t();e.flushPendingInput();try{n(o),r();}catch(a){throw n(i),r(),a}});}function oR(e,t){let n=nR.get(e);if(!n)throw new Error("Surface does not support measurement updates");n(t);}var Ud=new WeakMap;function iR(e){if(e.host){e.status.replaceChildren();return}let t=e.status.ownerDocument.createElement("span");t.className="docx-editor__loading-spinner",t.setAttribute("aria-hidden","true"),e.status.replaceChildren(t);}function aR(e,t){let n=t.ownerDocument,r=n.createElement("div");r.className="docx-opening-indicator",r.contentEditable="false";let o=n.createElement("div");o.className="docx-editor__loading-page-status",o.setAttribute("role","status"),r.append(o);let i={frame:r,status:o,host:null};Ud.set(e,i),iR(i);let a=()=>{let s=t.querySelector(':scope > .docx-pages > .docx-page[data-page-index="0"]');r.hidden=!s,s&&(r.style.left=s.style.left,r.style.top=s.style.top,r.style.width=s.style.width,r.style.height=s.style.height);};return t.append(r),a(),{place:a,remove:()=>{Ud.get(e)===i&&(Ud.delete(e),r.remove(),i.host?.publish(null));}}}function Em(e,t){let n=Ud.get(e);if(!n||n.host===t)return;let r=n.host;n.host=t,r?.publish(null),iR(n),t?.publish(n.status);}var Gd=new WeakMap;function PD(e,t){Gd.set(e,t);}function Om(e,t){let n=Gd.get(e);if(!n)return true;let r=n(t);return r&&Gd.delete(e),r}function Cs(e){return Gd.has(e)}var TD=40;function sR(e,t,n,r){let o=r,i=null,a=0,s=()=>{let d=i;i=null,d&&chunkDOHF6FA7_cjs.ff(d);},l=d=>{let c=n.now()+d;for(;n.limit()!==null&&!n.destroyed();){if(!i){let g=n.limit(),b=n.bodyBlockCount();if(b!==void 0&&g>=b)return n.finish(),true;n.setLimit(g+o),i=n.prefixPass(g+o),a=0;}let u=n.now(),p=false;do p=i.next().done===true;while(!p&&n.now()<c);if(a+=n.now()-u,!p)return false;i=null;let m=Math.max(a,1)/o;if(o=Math.min(4096,Math.max(16,Math.round(TD/m))),n.now()>=c)return false}return true};if(t.removeAttribute("data-docx-opening-preview"),n.limit()!==null){t.setAttribute("data-docx-opening-preview","");let d=aR(e,t);PD(e,c=>{let u=l(c);return u?(t.removeAttribute("data-docx-opening-preview"),d.remove()):d.place(),u});}return s}var CD=40,ED=12,OD=8;function Mm(e){if(typeof MessageChannel=="function"){let t=new MessageChannel;t.port1.onmessage=()=>{t.port1.close(),e();},t.port2.postMessage(null);return}setTimeout(e,0);}function AD(e){if(typeof requestAnimationFrame=="function"){requestAnimationFrame(()=>Mm(e));return}Mm(e);}function lR(e){let t=null,n=0,r=(s,l)=>{s&&e.passTimed?.(l);},o=s=>{let l=t===null!=(s===null);t=s,l&&e.pendingChanged?.(s!==null);},i=(s,l)=>{e.revision()===l&&e.publish(s);},a=()=>{let s=t;if(!s)return;let l=e.now(),d=l+ED;for(;;){let c=s.steps.next();if(c.done){o(null),i(c.value,s.revision),r(s.timed,s.spent+e.now()-l);return}if(e.now()>=d)break}s.spent+=e.now()-l,Mm(a);};return {run(s,l,d=true){let c=e.snapshot(),u=e.now(),p=d?n:0;d&&(n=0);let m=u+CD,g=e.pageAfterView(),b=e.current(),h=null;for(;;){let y=s.next();if(y.done)return r(d,p+e.now()-u),y.value;if(y.value&&(h=y.value),g===void 0||!h?.finalize||h.pages.length<=g||e.now()<m||!b||b.pages.length-h.pages.length<OD)continue;let S=[...h.pages,...b.pages.slice(h.pages.length)];return o({steps:s,revision:l,restore:c,spent:p+e.now()-u,timed:d}),AD(a),h.finalize(S)}},finish(){let s=t;if(!s)return;let l=e.now();o(null),i(chunkDOHF6FA7_cjs.ff(s.steps),s.revision),r(s.timed,s.spent+e.now()-l);},abandon(){let s=t;s&&(o(null),s.restore(),s.timed&&(n+=s.spent));},pending:()=>t!==null,cancel(){o(null);}}}var FD=1e4;function dR(e){let t=null,n=()=>{let a=[],s=new Set([e.part()]);for(let l of e.headerFooterPartsBySection())for(let d of [l.headers,l.footers])for(let c of d.values())s.has(c)||(s.add(c),a.push(c));for(let l of ["footnote","endnote"]){let d=e.partFor({kind:"notesPart",noteKind:l});!d||s.has(d)||(s.add(d),a.push(d));}return a},r=(a,s)=>a.length===s.length&&a.every((l,d)=>l===s[d]),o=a=>{let s=chunkOSFOJTHU_cjs.Ta(e.part(),a);if(!s||s.kind!=="paragraph")return false;let l=0,d=[...s.children];for(;d.length>0;){let c=d.pop();if(++l>FD)return false;if(c.kind!=="textValue"){if(c.namespaceUri===chunkOSFOJTHU_cjs.la&&c.localName==="p")return false;for(let u of c.children)d.push(u);}}return true},i=(a,s)=>{if(a.splitJoin.length!==1||a.story!==void 0&&a.story.kind!=="body")return false;let l=a.splitJoin[0];if("split"in l){let{from:u,tail:p}=l.split,m=s.get(u);if(m===void 0||s.has(p)||a.deleted.length>0||a.created.length!==1||a.created[0]!==p||!o(u)||!o(p))return false;for(let[g,b]of s)b>m&&s.set(g,b+1);return s.set(p,m+1),true}let{kept:d,removed:c}=l.join;return !s.has(d)||a.created.length>0||a.deleted.length!==1||a.deleted[0]!==c||!o(d)?false:(s.delete(c),true)};return {retain(a){if(!t)return;let s=a.created.length>0||a.deleted.length>0||a.splitJoin.length>0,l=a.impact==="text-local"&&!s?t.otherParts:n();a.impact!=="global"&&(a.impact==="text-local"||r(t.otherParts,l))&&(!s||r(t.otherParts,l)&&i(a,t.index))?t={packageRevision:e.packageRevision(),bodyRoot:e.part().root,index:t.index,otherParts:l}:t=null;},index(){let a=e.packageRevision(),s=e.part().root;if(t&&t.packageRevision===a&&t.bodyRoot===s)return t.index;let l=new Map,d=u=>{let p=l.size;for(let[m,g]of u)l.has(m)||l.set(m,p+g);};d(chunkOSFOJTHU_cjs.lj(e.part()));let c=n();for(let u of c)d(chunkOSFOJTHU_cjs.lj(u));return t={packageRevision:a,bodyRoot:s,index:l,otherParts:c},l}}}var DD=i18n.createT(i18n.en);function In(e){return t=>{try{let n=e?.(t);if(typeof n=="string"&&n&&n!==t)return n}catch{}return DD(t)}}var cR=new WeakMap;function Xd(e,t){let n=new Map;return cR.set(e,n),(r,o,i="textContent")=>{let a=n.get(r);a||n.set(r,a=new Map),a.set(i,o),i==="textContent"?r.textContent=t(o):r.setAttribute(i,t(o));}}function uR(e,t){let n=cR.get(e);if(n)for(let[r,o]of n){if(r!==e&&!e.contains(r)){n.delete(r);continue}for(let[i,a]of o)i==="textContent"?r.textContent=t(a):r.setAttribute(i,t(a));}}function fR(e,t){let n=e.ownerDocument.defaultView;if(!n)return;if(n.getComputedStyle(e).position==="fixed"){let O=t.getBoundingClientRect();e.style.maxHeight="";let v=Number.parseFloat(n.getComputedStyle(e).maxHeight),C=Number.isFinite(v)?v:n.innerHeight;e.style.maxWidth=`${Math.max(0,n.innerWidth-16)}px`,e.style.maxHeight=`${Math.max(0,Math.min(C,n.innerHeight-16))}px`;let L=e.getBoundingClientRect(),A=Math.max(0,n.innerHeight-8-O.bottom-4),q=Math.max(0,O.top-8-4),K=L.height>A&&q>A,E=Math.min(L.height,K?q:A);e.style.maxHeight=`${E}px`,e.style.left=`${Math.max(8,Math.min(O.left,n.innerWidth-8-L.width))}px`;let _=K?O.top-4-E:O.bottom+4;e.style.top=`${Math.max(8,Math.min(_,n.innerHeight-8-E))}px`,e.dataset.placement=K?"top":"bottom";return}let r=e.offsetParent;if(!r)return;let o=t.getBoundingClientRect(),i=t.closest(".docx-page")?.getBoundingClientRect(),a=t.closest(".docx-editor__scroll-container")?.getBoundingClientRect(),s=Math.max(0,i?.left??0,a?.left??0),l=Math.min(n.innerWidth,i?.right??n.innerWidth,a?.right??n.innerWidth),d=Math.max(0,a?.top??0),c=Math.min(n.innerHeight,a?.bottom??n.innerHeight);e.style.maxWidth=`${Math.max(0,l-s)}px`,e.style.maxHeight=`${Math.max(0,c-d)}px`;let u=e.getBoundingClientRect(),p=c-o.bottom,m=o.top-d,g=u.height>p&&m>p,b=Math.max(0,g?m:p);e.style.maxHeight=`${Math.max(0,Math.min(c-d,b))}px`;let h=Math.min(u.height,b),y=Math.max(s,Math.min(o.left,l-u.width)),S=Math.max(d,g?o.top-h:o.bottom),x=r.getBoundingClientRect(),I=r.offsetWidth?x.width/r.offsetWidth:1,R=r.offsetHeight?x.height/r.offsetHeight:1;e.style.left=`${(y-x.left)/I-r.clientLeft+r.scrollLeft}px`,e.style.top=`${(S-x.top)/R-r.clientTop+r.scrollTop}px`,e.dataset.placement=g?"top":"bottom";}function Es(e,t){let n=e.ownerDocument.defaultView,r=t.closest(".docx-pages")??e.closest(".docx-editor")?.querySelector(".docx-pages"),o=t.closest("[data-docx-content-control]")?.dataset.docxContentControl,i=t,a=()=>{if(!i.isConnected&&r&&o){let d=[...r.querySelectorAll("[data-docx-content-control]")].find(c=>c.dataset.docxContentControl===o)?.querySelector(".docx-content-control-boundary");d&&(s?.unobserve(i),i=d,s?.observe(i));}i.isConnected&&fR(e,i);},s=typeof ResizeObserver>"u"?null:new ResizeObserver(a);s?.observe(e),s?.observe(i);let l=typeof MutationObserver>"u"?null:new MutationObserver(a);return r&&l?.observe(r,{childList:true,subtree:true}),a(),n?.addEventListener("resize",a),e.ownerDocument.addEventListener("scroll",a,true),()=>{s?.disconnect(),l?.disconnect(),n?.removeEventListener("resize",a),e.ownerDocument.removeEventListener("scroll",a,true);}}function Os(e,t,n){if(t.stopPropagation(),t.isComposing||(t.key==="Escape"&&(t.preventDefault(),n()),t.key!=="Tab"))return;let r=[...e.querySelectorAll("button,input,select,textarea,[href],[tabindex]")].filter(a=>a.tabIndex>=0&&!a.hasAttribute("disabled")&&!a.closest("[hidden]")&&e.ownerDocument.defaultView?.getComputedStyle(a).display!=="none");if(!r.length){t.preventDefault(),e.focus();return}let o=e.ownerDocument.activeElement,i=t.shiftKey&&(o===r[0]||o===e)?r.at(-1):!t.shiftKey&&(o===r.at(-1)||o===e)?r[0]:null;i&&(t.preventDefault(),i.focus());}function HD(e){let t=e?.ownerDocument??(typeof document>"u"?null:document),n=t?.activeElement;return n&&n!==t?.body?n:e?.closest(".docx-pages")??null}var Am="image/png,image/jpeg,image/gif,image/bmp,image/webp",_D=new Set(Am.split(",")),BD=8;function $D(e){if(!e||e.kind==="textValue")return;let t=(n,r)=>{if(!(n.kind==="textValue"||r>BD)){if(n.kind==="drawing")return n.id;if(n.localName!=="sdtPr")for(let o of n.children){let i=t(o,r+1);if(i)return i}}};return t(e,0)}function pR(e){let t=null,n=null,r=null,o,i,a=0,s=false,l=()=>{a++,o?.(),i?.(),r?.remove(),r=null;let u=n;t?.remove(),t=null,n=null,u&&(e.setOpen(u,false),s||e.layer.focus({preventScroll:true}));},d=u=>$D(e.find(u)),c=async(u,p,m=()=>true)=>{if(s||!m()||!e.allowed(u))return false;if(p.byteLength>chunkOSFOJTHU_cjs.r.maxEncodedBytes)return e.reject("image-resource-limit"),false;let g=d(u);if(!g)return e.reject("no-picture"),false;let b=chunkOSFOJTHU_cjs.de(p);if(!_D.has(b))return e.reject("unsupported-image"),false;let h=await e.replaceImage(g,p,b,()=>!s&&m()&&e.allowed(u)&&d(u)===g);return h.ok?true:(e.reject(h.detail??h.reason),false)};return {drawingOf:d,replace:c,cancel:l,select(u){let p=d(u),m=p?chunkDOHF6FA7_cjs.fe(e.layout(),p):null;return m?e.selectDrawing(p,m.record.paragraphId):false},pick(u){if(l(),s||!e.allowed(u))return;let p=a,m=()=>!s&&a===p;if(!d(u)){e.reject("no-picture");return}let g=e.document.createElement("input");g.type="file",g.accept=Am,g.className="docx-content-control-picture-picker",g.dataset.docxMarker="",g.dataset.docxCcId=u,g.setAttribute("contenteditable","false"),g.setAttribute("aria-hidden","true"),g.tabIndex=-1;let b=In(e.translate),h=e.document.createElement("div");h.className="docx-content-control-menu",h.style.position="absolute",h.style.zIndex="20",h.style.pointerEvents="auto",h.dataset.docxCcId=u,h.dataset.docxMarker="",h.setAttribute("role","dialog"),h.setAttribute("aria-label",b("contentControl.types.picture")),h.setAttribute("contenteditable","false"),h.hidden=true;let y=e.document.createElement("div");y.className="docx-content-control-widget-error",y.setAttribute("role","alert"),y.textContent=b("disabledReason.invalidValue");let S=e.document.createElement("button");S.type="button",S.textContent=b("common.cancel"),S.addEventListener("click",l),h.addEventListener("pointerdown",x=>x.stopPropagation()),h.addEventListener("keydown",x=>{Os(h,x,l),x.stopPropagation();}),h.append(y,S),g.addEventListener("change",()=>{let x=g.files?.[0];!x||!m()||(g.value="",g.disabled=true,(async()=>{let I=false;try{x.size>chunkOSFOJTHU_cjs.r.maxEncodedBytes?e.reject("image-resource-limit"):I=await c(u,new Uint8Array(await x.arrayBuffer()),m);}catch{m()&&e.reject("image-read-failed");}if(!m())return;if(I){l();return}g.disabled=false,g.className="docx-content-control-picture-input",g.removeAttribute("aria-hidden"),g.tabIndex=0,g.setAttribute("aria-label",b("contentControl.types.picture")),g.setAttribute("aria-invalid","true"),h.prepend(g),h.hidden=false;let R=[...e.layer.querySelectorAll("[data-docx-content-control]")].find(T=>T.getAttribute("data-docx-content-control")===u)?.querySelector(".docx-content-control-boundary");i?.(),o?.(),R&&(i=Es(h,R)),o=zd(h,l),g.focus();})());}),g.addEventListener("cancel",l),e.layer.append(g),(e.layer.closest(".docx-editor__scroll-container")??e.layer).append(h),r=h,t=g,n=u,e.setOpen(u,true),g.click();},destroy(){s=true,l();}}}function mR(e,t,n,r){return (chunkOSFOJTHU_cjs.uk(e,t,n)?.offset??n)+r}function gR(e){if(e&&!(e.effectiveLock==="contentLocked"||e.effectiveLock==="sdtContentLocked")&&!e.bound&&!(e.controlType==="checkbox"||e.controlType==="picture"))return e.id}function hR(e,t,n){return {op:"insertText",paragraphId:e.paragraphId,offset:e.offset,text:t,...n===void 0?{}:{inside:n}}}function qD(e,t,n){let r=e.ownerDocument;if(typeof r.elementFromPoint!="function")return null;let o=r.elementFromPoint(t,n)?.closest(".docx-page");if(!o)return null;for(let i of o.querySelectorAll("[data-docx-content-control]:not([data-docx-toc])"))for(let a of i.querySelectorAll(".docx-content-control-boundary")){let s=a.getBoundingClientRect();if(t>=s.left-3&&t<=s.right+22&&n>=s.top-3&&n<=s.bottom+3)return i}return null}function yR(e){let t=null,n=0,r=null,o=l=>{l!==t&&(t?.isConnected&&delete t.dataset.hover,t=l,l&&(l.dataset.hover=""));},i=()=>{n=0,r&&o(qD(e,r.x,r.y));},a=l=>{r={x:l.clientX,y:l.clientY},n===0&&(n=e.ownerDocument.defaultView?.requestAnimationFrame(i)??0),n===0&&i();},s=()=>{r=null,o(null);};return e.addEventListener("pointermove",a),e.addEventListener("pointerleave",s),{destroy(){e.removeEventListener("pointermove",a),e.removeEventListener("pointerleave",s),n&&e.ownerDocument.defaultView?.cancelAnimationFrame(n),o(null);}}}var Ms=.25;function bR(e,t,n){let r=(s,l)=>{let d=chunkDOHF6FA7_cjs.ne(e,s,n);return d?chunkDOHF6FA7_cjs.ke(e,{x:d.x+l,y:d.y+d.height/2,pageIndex:d.pageIndex}):null},o=r(t.head,0);if(o)return o;if(t.anchor.paragraphId===t.head.paragraphId&&t.anchor.offset===t.head.offset)return r(t.head,-Ms);let a=t.head.paragraphId===t.anchor.paragraphId&&t.head.offset<t.anchor.offset;return r(t.head,a?Ms:-Ms)??r(t.anchor,a?-Ms:Ms)}function vR(e,t,n,r,o){let i=r==="left"?-1:1,a=chunkDOHF6FA7_cjs.ne(e,t.from,o),s=chunkDOHF6FA7_cjs.ne(e,t.to,o),l=a?chunkDOHF6FA7_cjs.ie(e,a)??1:1,d=i*l===-1?t.from:t.to;if(!a||!s||a.lineId!==s.lineId||a.pageIndex!==s.pageIndex)return d;let c=chunkDOHF6FA7_cjs.ud(e,t.from.paragraphId)?.find(({line:g})=>g.id===a.lineId)?.line;if(!c?.spans.some(g=>g.style.shaping))return d;let u=n.indexOf(t.from.paragraphId),p=n.indexOf(t.to.paragraphId),m;for(let g of c.spans){let b=g.range.paragraphId,h=n.indexOf(b);if(h<u||h>p)continue;let y=Math.max(g.range.start,b===t.from.paragraphId?t.from.offset:0),S=Math.min(g.range.end,b===t.to.paragraphId?t.to.offset:1/0);if(!(y>=S))for(let x of [y,S]){let I={paragraphId:b,offset:x},R=chunkDOHF6FA7_cjs.ne(e,I,o);if(!R||R.lineId!==a.lineId||R.pageIndex!==a.pageIndex)continue;let T=R.x;(!m||(T-m.x)*i>0)&&(m={position:I,x:T});}}return m?.position??d}function xR(e,t,n){let r=e;return {get:()=>r,set(o){o!==r&&(t(),r=o,n());}}}function wR(e,t,n,r){let o=In(r),i=e.ownerDocument,a=i.createElement("dialog"),s=Xd(a,o);a.className="docx-text-form-dialog",a.setAttribute("role","alertdialog"),a.setAttribute("data-docx-modal",""),s(a,"textFormField.invalidTitle","aria-label"),s(a,`textFormField.invalid${t==="number"?"Number":"Date"}`,"aria-description");let l=i.createElement("h2");l.className="docx-text-form-dialog__header",s(l,"textFormField.invalidTitle");let d=i.createElement("div");d.className="docx-text-form-dialog__body",s(d,`textFormField.invalid${t==="number"?"Number":"Date"}`);let c=i.createElement("div");c.className="docx-text-form-dialog__footer";let u=i.createElement("button");u.type="button",u.className="docx-text-form-dialog__button docx-text-form-dialog__button--primary",s(u,"textFormField.apply");let p=false,m=()=>{p||(p=true,n());};return u.addEventListener("click",m),a.addEventListener("keydown",g=>{g.key!=="Enter"||g.isComposing||(g.preventDefault(),g.stopPropagation(),m());}),a.addEventListener("cancel",g=>{g.preventDefault(),m();}),c.append(u),a.append(l,d,c),e.append(a),a.showModal(),u.focus(),a}function SR(e,t,n,r,o){let i=In(o),a=e.ownerDocument,s=a.createElement("dialog"),l=Xd(s,i);s.className="docx-text-form-dialog",s.setAttribute("data-docx-modal",""),l(s,"textFormField.title","aria-label");let d=a.createElement("h2");d.className="docx-text-form-dialog__header",l(d,"textFormField.title");let c=a.createElement("div");c.className="docx-text-form-dialog__body";let u=a.createElement("div");u.className="docx-text-form-dialog__footer",s.append(d,c,u);let p=(C,L)=>{let A=a.createElement("label");A.className="docx-text-form-dialog__row";let q=a.createElement("span");q.className="docx-text-form-dialog__label",l(q,C),L.className="docx-text-form-dialog__input",A.append(q,L),c.append(A);},m=a.createElement("input");m.type="text",m.value=t.defaultText,p("textFormField.defaultText",m);let g=a.createElement("select"),b=["regular","number","date"];for(let C of b){let L=a.createElement("option");L.value=C,l(L,`textFormField.${C}`),g.append(L);}if(!b.includes(t.type)){let C=a.createElement("option");C.value=t.type,l(C,"textFormField.preservedType"),C.disabled=true,g.append(C);}g.value=t.type,p("textFormField.type",g);let h=a.createElement("input");h.type="number",h.min="0",h.max="32767",h.step="1",h.value=String(t.maxLength),p("textFormField.maxLength",h);let y=a.createElement("select"),S=C=>{y.replaceChildren();let L=chunkOSFOJTHU_cjs.Qi[g.value]??[];for(let A of L){let q=a.createElement("option");q.value=A;let E={Uppercase:"textFormField.uppercase",Lowercase:"textFormField.lowercase","First capital":"textFormField.firstCapital","Title case":"textFormField.titleCase"}[A];E||!A?l(q,E??"textFormField.noFormat"):q.textContent=A,y.append(q);}if(!L.includes(C)){let A=a.createElement("option");A.value=C,C?A.textContent=C:l(A,"textFormField.noFormat"),A.disabled=true,y.append(A);}y.value=C;};S(t.format),g.addEventListener("change",()=>S("")),p("textFormField.format",y);let x=a.createElement("input");x.type="checkbox",x.checked=t.enabled;let I=a.createElement("label");I.className="docx-text-form-dialog__checkbox-row";let R=a.createElement("span");l(R,"textFormField.enabled"),I.append(x,R),c.append(I);let T=a.createElement("p");T.className="docx-text-form-dialog__error",T.setAttribute("role","alert"),c.append(T);let P=a.createElement("button");P.type="button",P.className="docx-text-form-dialog__button",l(P,"textFormField.cancel"),P.addEventListener("click",r);let O=a.createElement("button");O.type="button",O.className="docx-text-form-dialog__button docx-text-form-dialog__button--primary",l(O,"textFormField.apply");let v=()=>{if(!h.value||!h.checkValidity()||!n(m.value,{type:g.value,maxLength:Number(h.value),format:y.value,enabled:x.checked})){l(T,"textFormField.invalidOptions");return}r();};return O.addEventListener("click",v),s.addEventListener("keydown",C=>{C.key==="Enter"&&!C.isComposing&&C.target instanceof HTMLInputElement&&(C.preventDefault(),v());}),s.addEventListener("cancel",C=>{C.preventDefault(),r();}),u.append(P,O),e.append(s),s.showModal(),m.focus(),m.select(),s}function IR(e,t,n){let r=[],o=[];for(let a of e)for(let s of chunkOSFOJTHU_cjs.lj(a).keys()){let l=chunkOSFOJTHU_cjs.Ta(a,s);if(l?.kind==="paragraph")for(let d of chunkOSFOJTHU_cjs.hj(l)){let c=t.get(d.fieldNodeId);if(!c)continue;let u=(chunkOSFOJTHU_cjs.Vi(a,s)??"").slice(d.start,d.end),p=chunkOSFOJTHU_cjs.Ri(u,d,"fill",c.locale);if(p===null)return {reason:"invalidArgs"};if(p===u)continue;let m={op:"commitTextFormField",paragraphId:s,fieldNodeId:d.fieldNodeId,locale:c.locale},g=chunkOSFOJTHU_cjs.Xk(a,m);if(g)return {reason:g};r.push(m),o.push({paragraphId:s,start:d.start,end:d.end,length:p.length});}}let i=a=>{let s=a.offset;for(let l of o)l.paragraphId!==a.paragraphId||a.offset<=l.start||(s+=a.offset>=l.end?l.length-(l.end-l.start):Math.min(a.offset-l.start,l.length)-(a.offset-l.start));return s===a.offset?a:{...a,offset:s}};return {ops:r,selection:{anchor:i(n.anchor),head:i(n.head)}}}var Yd=new WeakMap,Qd=new WeakMap;function RR(e){return Qd.get(e)?.()??null}function kR(e){return [...chunkOSFOJTHU_cjs.lj(e).keys()].flatMap(t=>{let n=chunkOSFOJTHU_cjs.Ta(e,t);return n?.kind==="paragraph"?chunkOSFOJTHU_cjs.hj(n):[]})}function Fm(e){return Yd.get(e)?.()}function PR(e,t){let n=In(e.translate),r=e.container.ownerDocument,o,i=false,a=new Map,s=()=>e.parts?.()??[e.part()];if(t?.length)for(let F of s()){let N=t.filter($=>$.partName===F.name);if(!N.length)continue;let B=kR(F);for(let $ of N){let G=B[$.fieldIndex];G&&a.set(G.fieldNodeId,{text:$.text,locale:$.locale});}}let l=new WeakMap,d=new WeakMap,c=(F=e.part())=>{l.set(F,new Map([...a].filter(([N])=>N.startsWith(`${F.name}#`))));},u=()=>(a=new Map(s().flatMap(F=>[...l.get(F)??[]])),d.get(e.part())??null),p=F=>{a.delete(F),c();};s().forEach(c);let m=()=>{if(!a.size)return null;if(i)return "invalidState";let F=IR(s(),a,e.selection());if("reason"in F)return F.reason;if(F.ops.length&&!e.editable())return "locked";let N=s();s().forEach(c);let B=a;F.ops.length&&d.set(e.part(),e.selection()),a=new Map,i=true;try{let $=F.ops.length?e.save?e.save(F.ops,F.selection):"unsupported":null;return $?a=B:(delete U.dataset.fieldError,F.ops.length&&d.set(e.part(),F.selection)),s().forEach(c),$}catch($){throw s().every(G=>N.includes(G))&&(a=B),s().forEach(c),$}finally{i=false;}};Qd.set(e.container,m);let g=()=>a.size?s().flatMap(F=>kR(F).flatMap((N,B)=>{let $=a.get(N.fieldNodeId);return $?[{partName:F.name,fieldIndex:B,...$}]:[]})):[];Yd.set(e.container,g);let b,h=(F,N)=>(chunkOSFOJTHU_cjs.Vi(e.part(),F)??"").slice(N.start,N.end),y=null,S=null,x=null,I=false,R=false,T=()=>{let F=x;x=null,R=false,y?.remove(),y=null,F?.abort();},P=()=>{if(!y&&!x)return;let F=e.selection();T(),!I&&(e.pagesLayer.focus({preventScroll:true}),e.select(F));};function O(F,N,B="plain"){b={paragraphId:F,fieldNodeId:N.fieldNodeId},e.select({anchor:{paragraphId:F,offset:N.start},head:{paragraphId:F,offset:N.end}},B==="press"?"pressed":void 0);let $=e.selection().head.paragraphId===F&&e.selection().head.offset>=N.start&&e.selection().head.offset<=N.end;$&&(S=b??S),b=void 0,$&&B==="travel"&&e.reveal?.({paragraphId:F,offset:N.start});}function v(F,N){if(I)return;P();let B=e.locale?.()??"en-US",$=new AbortController;x=$;let G=()=>{if(I||$.signal.aborted||x!==$)return false;let W=chunkOSFOJTHU_cjs.Ta(e.part(F),F);return W?.kind==="paragraph"&&chunkOSFOJTHU_cjs.hj(W).some(Z=>Z.fieldNodeId===N.fieldNodeId)&&e.editable()&&!e.protected(F)},H={field:{...N},signal:$.signal,canApply:G,apply(W,Z){if(!G()||!e.apply({op:"setTextFormFieldDefault",locale:B,paragraphId:F,fieldNodeId:N.fieldNodeId,text:W,options:Z}))return false;if(I||x!==$||$.signal.aborted)return true;let re=chunkOSFOJTHU_cjs.Ta(e.part(F),F),ne=re?.kind==="paragraph"?chunkOSFOJTHU_cjs.hj(re).find(ee=>ee.fieldNodeId===N.fieldNodeId):null;return ne&&O(F,ne),P(),true},cancel(){x===$&&!$.signal.aborted&&P();}};e.onRequest?.(H)||$.signal.aborted||(y=SR(e.container,N,H.apply,H.cancel,n));}let C=F=>{let B=F.target?.closest('[data-field-atom="form"][data-start]'),$=B?.closest("[data-paragraph-id]")?.dataset.paragraphId;if(!B||!$||!e.editable())return null;let G=chunkOSFOJTHU_cjs.Ta(e.part(),$);if(G?.kind!=="paragraph")return null;let H=Number(B.dataset.start),W=chunkOSFOJTHU_cjs.hj(G).find(Z=>Z.start<=H&&H<Z.end);return W?{paragraphId:$,field:W}:null},L=null,A=F=>F.shiftKey||F.altKey||F.ctrlKey||F.metaKey,q=F=>{if(o=void 0,L=null,F.button!==0)return;let N=C(F);N&&!A(F)&&!e.protected(N.paragraphId)&&(L={x:F.clientX,y:F.clientY,paragraphId:N.paragraphId,fieldNodeId:N.field.fieldNodeId,moved:false}),b=N?{paragraphId:N.paragraphId,fieldNodeId:N.field.fieldNodeId}:null;};e.pagesLayer.addEventListener("pointerdown",q,{capture:true});let K=F=>{L&&Math.hypot(F.clientX-L.x,F.clientY-L.y)>4&&(L.moved=true);},E=()=>{L=null;},_=(F,N=false)=>{let B=L;if(L=null,!B||B.moved||y||F.button!==0||F.detail>1||Math.hypot(F.clientX-B.x,F.clientY-B.y)>4||!e.editable()||A(F)||e.protected(B.paragraphId))return;let $=chunkOSFOJTHU_cjs.Ta(e.part(),B.paragraphId),G=$?.kind==="paragraph"?chunkOSFOJTHU_cjs.hj($).find(W=>W.fieldNodeId===B.fieldNodeId):null;if(!G)return;let H=e.selection();N&&(H.anchor.paragraphId!==H.head.paragraphId||H.anchor.offset!==H.head.offset)&&!(H.anchor.paragraphId===B.paragraphId&&H.head.paragraphId===B.paragraphId&&Math.min(H.anchor.offset,H.head.offset)===G.start&&Math.max(H.anchor.offset,H.head.offset)===G.end)||O(B.paragraphId,G,"press");};r.addEventListener("pointermove",K),r.addEventListener("pointercancel",E),e.pagesLayer.addEventListener("click",_);let X=F=>{if(F.shiftKey||F.altKey||F.ctrlKey||F.metaKey||e.pagesLayer.contentEditable==="false")return false;let N=C(F);if(!N)return false;let{paragraphId:B,field:$}=N;return F.preventDefault(),O(B,$,"press"),e.protected(B)||v(B,$),true};e.pagesLayer.addEventListener("dblclick",X);function z(){let F=e.selection();if(F.anchor.paragraphId!==F.head.paragraphId)return null;let N=F.head.paragraphId,B=chunkOSFOJTHU_cjs.Ta(e.part(),N);if(B?.kind!=="paragraph")return null;let $=Math.min(F.anchor.offset,F.head.offset),G=Math.max(F.anchor.offset,F.head.offset),H=chunkOSFOJTHU_cjs.hj(B).filter(Z=>Z.start<=$&&Z.end>=G&&(Z.start===Z.end||$!==G||$<Z.end||e.protected(N))),W=H.find(Z=>S?.paragraphId===N&&Z.fieldNodeId===S.fieldNodeId)??H.find(Z=>Z.start===$&&Z.end===G)??H[0];return W?{paragraphId:N,field:W}:null}function oe(){if(o===void 0)return z();if(!o)return null;let F=chunkOSFOJTHU_cjs.Ta(e.part(),o.paragraphId),N=F?.kind==="paragraph"?chunkOSFOJTHU_cjs.hj(F).find(B=>B.fieldNodeId===o.fieldNodeId):null;return N?{paragraphId:o.paragraphId,field:N}:null}let j=F=>{let N=F.button===-1||F.clientX===0&&F.clientY===0?z():C(F);o=N?{paragraphId:N.paragraphId,fieldNodeId:N.field.fieldNodeId}:null;};e.pagesLayer.addEventListener("contextmenu",j);let me=()=>{let F=oe();return !!F&&e.editable()&&!e.protected(F.paragraphId)&&!chunkOSFOJTHU_cjs.Xk(e.part(),{op:"setTextFormFieldDefault",paragraphId:F.paragraphId,fieldNodeId:F.field.fieldNodeId,text:"",options:{type:"regular",maxLength:0,format:"",enabled:true}})},U=r.createElement("span");return U.className="docx-text-form-status",e.container.append(U),{doubleClick:X,pointerUp:F=>_(F,true),canEdit:me,edit(){if(!me())return false;let F=oe();return O(F.paragraphId,F.field,"travel"),v(F.paragraphId,F.field),true},selectForDeletion(F){let N=e.selection(),{paragraphId:B,offset:$}=N.head;if(!e.editable()||e.protected(B)||N.anchor.paragraphId!==B||N.anchor.offset!==$)return false;let G=chunkOSFOJTHU_cjs.Ta(e.part(),B);if(G?.kind!=="paragraph")return false;let H=chunkOSFOJTHU_cjs.hj(G).find(W=>W.start<W.end&&(F==="backward"?W.end===$:W.start===$));return H?(O(B,H),true):false},wordDeletionBoundary(F,N,B,$){let G=chunkDOHF6FA7_cjs.he(F,N,B,$),H=e.selection().head.paragraphId;if(e.protected(H))return G;let W=chunkOSFOJTHU_cjs.Ta(e.part(H),H);if(W?.kind!=="paragraph")return G;let Z=chunkOSFOJTHU_cjs.hj(W),re=Z.find(ee=>ee.start<ee.end&&(B===-1?ee.end===N:ee.start===N));if(re)return B===-1?re.start:re.end;let ne=G;for(let ee of Z)for(let se of [ee.start,ee.end])B===-1&&se<N&&se>ne&&(ne=se),B===1&&se>N&&se<ne&&(ne=se);return ne},beforeSelect(F){let N=Ne=>{if(b!==void 0)S=b;else if(F.anchor.paragraphId!==F.head.paragraphId||S?.paragraphId!==F.head.paragraphId)S=null;else {let Te=chunkOSFOJTHU_cjs.Ta(e.part(),F.head.paragraphId),Pt=Te?.kind==="paragraph"?chunkOSFOJTHU_cjs.hj(Te).find(st=>st.fieldNodeId===S?.fieldNodeId):null;(!Pt||Math.min(F.anchor.offset,F.head.offset)<Pt.start||Math.max(F.anchor.offset,F.head.offset)>Pt.end)&&(S=null);}return b=void 0,delete U.dataset.fieldError,Ne};if(i||R)return null;if(!e.editable())return F;let B=z();if(!B||!e.protected(B.paragraphId)||!B.field.enabled||!chunkOSFOJTHU_cjs.Si(B.field))return N(F);let{field:$,paragraphId:G}=B;if((!b||b.fieldNodeId===$.fieldNodeId)&&F.anchor.paragraphId===G&&F.head.paragraphId===G&&Math.min(F.anchor.offset,F.head.offset)>=$.start&&Math.max(F.anchor.offset,F.head.offset)<=$.end)return N(F);let H=a.get($.fieldNodeId),W=H?.text,Z=H?.locale??e.locale?.()??"en-US",re=h(G,$);if($.type==="date"&&W===void 0)return p($.fieldNodeId),N(F);let ne=chunkOSFOJTHU_cjs.Ri(re,$,"fill",Z);if(ne===re||ne===null&&(W===void 0||W===re))return p($.fieldNodeId),N(F);i=true;let ee=e.part();c(ee);let se=a;a=new Map(se),a.delete($.fieldNodeId);let fe;try{fe=e.apply({op:"commitTextFormField",locale:Z,paragraphId:G,fieldNodeId:$.fieldNodeId}),fe||(a=se);}catch(Ne){throw e.part()===ee&&(a=se),Ne}finally{c(),i=false;}if(!fe){if(b=void 0,U.setAttribute("role","alert"),U.dataset.fieldError="true",U.textContent=n("textFormField.invalidValue"),ne===null&&($.type==="number"||$.type==="date")){T();let Ne=new AbortController;x=Ne,R=true;let Te=()=>{if(I||Ne.signal.aborted||x!==Ne||(T(),I))return;let st=e.selection(),Ye=()=>{e.pagesLayer.focus({preventScroll:true}),e.select(st);},He=chunkOSFOJTHU_cjs.Ta(e.part(),G),Ae=He?.kind==="paragraph"?chunkOSFOJTHU_cjs.hj(He).find(ye=>ye.fieldNodeId===$.fieldNodeId):null;if(!Ae||!e.editable()||!e.protected(G)||h(G,Ae)!==re||!Ae.enabled||!chunkOSFOJTHU_cjs.Si(Ae)||Ae.type!==$.type||Ae.format!==$.format||chunkOSFOJTHU_cjs.Ri(re,Ae,"fill",Z)!==null){Ye();return}i=true;try{if(e.apply({op:"deleteText",paragraphId:G,start:Ae.start,end:Ae.end,textFormFieldId:Ae.fieldNodeId})){p(Ae.fieldNodeId),delete U.dataset.fieldError,e.pagesLayer.focus({preventScroll:!0});let ye={paragraphId:G,offset:Ae.start};i=!1,e.select({anchor:ye,head:ye}),S={paragraphId:G,fieldNodeId:Ae.fieldNodeId};}else i=!1,Ye();}finally{i=false;}},Pt={type:$.type,signal:Ne.signal,acknowledge:Te,cancel(){x===Ne&&!Ne.signal.aborted&&P();}};!e.onInvalidRequest?.(Pt)&&!Ne.signal.aborted&&(y=wR(e.container,$.type,Te,n));}return null}p($.fieldNodeId);let Ce=chunkOSFOJTHU_cjs.Ta(e.part(),G),Ee=Ce?.kind==="paragraph"?chunkOSFOJTHU_cjs.hj(Ce).find(Ne=>Ne.fieldNodeId===$.fieldNodeId):null,at=Ee?Ee.end-$.end:0,ot=Ne=>Ne.paragraphId===G&&Ne.offset>=$.end?{...Ne,offset:Ne.offset+at}:Ne;return N({anchor:ot(F.anchor),head:ot(F.head)})},update(){y&&uR(y,n);let F=z(),N=e.selection(),B=!!F&&N.anchor.offset!==N.head.offset&&Math.min(N.anchor.offset,N.head.offset)===F.field.start&&Math.max(N.anchor.offset,N.head.offset)===F.field.end;for(let $ of e.pagesLayer.querySelectorAll('[data-field-atom="form"][data-start]')){let G=$.closest("[data-paragraph-id]")?.dataset.paragraphId,H=Number($.dataset.start);!!F&&G===F.paragraphId&&H>=F.field.start&&H<F.field.end?$.dataset.textFormSelection=B?"whole":"caret":delete $.dataset.textFormSelection;}if(U.dataset.fieldError){U.textContent=n("textFormField.invalidValue");return}F?U.setAttribute("role","status"):U.removeAttribute("role"),U.textContent=F?n(B?"textFormField.selected":"textFormField.editing"):"";},fieldId:()=>z()?.field.fieldNodeId??null,afterApply(F){F?c():u();},restoreAfterHistory:u,annotate(F){(!i||F.some(B=>B.op!=="commitTextFormField"))&&c(),F.some(B=>B.op==="insertText"||B.op==="deleteText")&&delete U.dataset.fieldError;let N=z();return S=N?{paragraphId:N.paragraphId,fieldNodeId:N.field.fieldNodeId}:null,F.map(B=>{if(!S||B.op!=="insertText"&&B.op!=="deleteText"||B.revision||B.paragraphId!==S.paragraphId||!e.protected(B.paragraphId))return B;let $=chunkOSFOJTHU_cjs.Ta(e.part(),B.paragraphId),G=$?.kind==="paragraph"?chunkOSFOJTHU_cjs.hj($).find(Z=>Z.fieldNodeId===S.fieldNodeId):null,H=B.op==="insertText"?B.offset:B.start,W=B.op==="insertText"?B.offset:B.end;return !G||H<G.start||W>G.end?B:(a.has(G.fieldNodeId)||a.set(G.fieldNodeId,{text:h(B.paragraphId,G),locale:e.locale?.()??"en-US"}),{...B,textFormFieldId:G.fieldNodeId})})},keydown(F){if(F.key==="F10"&&F.shiftKey&&!F.altKey&&!F.ctrlKey&&!F.metaKey)return o=void 0,F.preventDefault(),e.pagesLayer.dispatchEvent(new MouseEvent("contextmenu",{bubbles:true,cancelable:true,button:-1})),true;if(F.key!=="Tab"||F.altKey||F.ctrlKey||F.metaKey||!e.editable()||!e.protected(e.selection().head.paragraphId))return false;let N=[],B=[e.part().root];for(;B.length;){let ne=B.pop();if(ne.kind==="paragraph")for(let ee of chunkOSFOJTHU_cjs.hj(ne))e.protected(ne.id)&&ee.enabled&&chunkOSFOJTHU_cjs.Si(ee)&&!chunkOSFOJTHU_cjs.Xk(e.part(),{op:"insertText",paragraphId:ne.id,offset:ee.start,text:"x"})&&N.push({paragraphId:ne.id,field:ee});else for(let ee=ne.children.length-1;ee>=0;ee--){let se=ne.children[ee];se.kind!=="textValue"&&B.push(se);}}if(!N.length)return false;let $=e.selection(),G=$.head,H=S?N.findIndex(ne=>ne.paragraphId===S.paragraphId&&ne.field.fieldNodeId===S.fieldNodeId&&ne.field.start<=Math.min($.anchor.offset,G.offset)&&ne.field.end>=Math.max($.anchor.offset,G.offset)):-1,W=H>=0?H:N.findIndex(ne=>ne.paragraphId===G.paragraphId&&ne.field.start<=Math.min($.anchor.offset,G.offset)&&ne.field.end>=Math.max($.anchor.offset,G.offset)),Z=W<0?F.shiftKey?N.length-1:0:(W+(F.shiftKey?-1:1)+N.length)%N.length,re=N[Z];return F.preventDefault(),O(re.paragraphId,re.field,"travel"),true},destroy(){I=true,T(),Qd.get(e.container)===m&&Qd.delete(e.container),Yd.get(e.container)===g&&Yd.delete(e.container),r.removeEventListener("pointermove",K),r.removeEventListener("pointercancel",E),e.pagesLayer.removeEventListener("click",_),e.pagesLayer.removeEventListener("contextmenu",j),U.remove(),e.pagesLayer.removeEventListener("dblclick",X),e.pagesLayer.removeEventListener("pointerdown",q,{capture:true}),y?.remove(),y=null;}}}function TR(e,t,n,r=o=>o){let o,i=e.subscribe(a=>{for(let s of a.splitJoin)"split"in s&&s.split.from===t&&(o=s.split.tail);});try{n(()=>{let a=o&&r(o,t);if(!a)return null;let s={paragraphId:a,offset:0};return {anchor:s,head:s}});}finally{i();}}var Jd=new WeakMap;function As(e){let t=Jd.get(e);if(t)return t.settled??=new Promise(n=>{t.resolve=n;}),t.settled}function CR(e){let t=Jd.get(e)??{depth:0};return t.depth++,Jd.set(e,t),()=>{--t.depth===0&&(Jd.delete(e),t.resolve?.());}}async function ER(e,t,n){if(!e)throw fn("notFound","no document is loaded");let r=t?As(t):void 0;if(r&&(await r,n()!==e))throw fn("invalidState","The document changed before the pending save could finish.");return e.save().slice().buffer}function OR(e,t,n){let r=()=>{if(n())throw fn("destroyed","Cannot save a destroyed surface.")};if(r(),As(t))throw fn("invalidState","Cannot save during an active edit. Retry after the edit finishes.");e.flushPendingInput(),r();let o=RR(t);if(o)throw fn(o,"Cannot save pending text form input. Enter a valid value in each field.");r(),e.refreshRefFieldResults(),r();let i=Wn(t);ao(t,true);try{return e.session.save()}finally{ao(t,i);}}function ec(e,t,n){let r=false;return t(()=>{let o=n([e]);return r=!o.rejected,o}),r}function MR(e,t,n){let r=n.refusal();if(r)return r;let o=new Map;for(let a of e){if(a.op!=="commitTextFormField")return "invalidArgs";let s=Rt(n.session,a.paragraphId,{kind:"body"}),l=JSON.stringify(s),d=o.get(l)??{scope:s,ops:[]};d.ops.push(a),o.set(l,d);}for(let a of o.values()){let s=n.gate(a.ops,a.scope);if(s)return s}if(n.collaborationActive)return "unsupported";let i;return n.commit(()=>i=n.session.applyTreeOpsAtomic([...o.values()]),()=>t),i?.rejected?i.reason??"invalidArgs":null}function AR(e,t){let n=chunkOSFOJTHU_cjs.Ni(e);return {get:()=>n,set(r){let o=chunkOSFOJTHU_cjs.Ni(r);n!==o&&(t(),n=o);}}}var KD=42,VD=/^(\d{4})-(\d{2})-(\d{2})/,jD=new Set(["AG","AS","BD","BR","BS","BT","BW","BZ","CA","CO","DM","DO","ET","GT","GU","HK","HN","ID","IL","IN","JM","JP","KE","KH","KR","LA","MH","MM","MO","MT","MX","MZ","NI","NP","PA","PE","PH","PK","PR","PT","PY","SA","SG","SV","TH","TT","TW","UM","US","VE","VI","WS","YE","ZA","ZW"]),WD=new Set(["AE","AF","BH","DJ","DZ","EG","IQ","IR","JO","KW","LY","OM","QA","SD","SY"]);function Xo(e){return `${String(e.getFullYear()).padStart(4,"0")}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function Dr(e){let t=VD.exec(e);if(!t)return null;let n=Number(t[1]),r=Number(t[2]),o=Number(t[3]);if(r<1||r>12||o<1||o>31)return null;let i=new Date(n,r-1,o);return i.getFullYear()!==n||i.getMonth()!==r-1||i.getDate()!==o?null:i}function tc(e){let t=chunkOSFOJTHU_cjs.Ni(e);try{let n=new Intl.Locale(t),r=n,o=r.getWeekInfo?.().firstDay??r.weekInfo?.firstDay;if(typeof o=="number"&&o>=1&&o<=7)return o%7;let i=n.maximize().region;if(i&&jD.has(i))return 0;if(i&&WD.has(i))return 6}catch{}return 1}function FR(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function LR(e,t,n){return new Intl.DateTimeFormat(chunkOSFOJTHU_cjs.Ni(n),{calendar:"gregory",month:"long",year:"numeric"}).format(new Date(e,t,1))}function NR(e){let t=chunkOSFOJTHU_cjs.Ni(e),n=new Intl.DateTimeFormat(t,{calendar:"gregory",weekday:"narrow"}),r=tc(t);return Array.from({length:7},(o,i)=>n.format(new Date(2024,0,7+(r+i)%7)))}function Lm(e,t,n={}){let r=chunkOSFOJTHU_cjs.Ni(n.locale),o=n.selected?Dr(n.selected):null,i=n.today??new Date,a=new Intl.DateTimeFormat(r,{calendar:"gregory",weekday:"long",year:"numeric",month:"long",day:"numeric"}),s=tc(r),l=(new Date(e,t,1).getDay()-s+7)%7,d=[];for(let c=0;c<KD;c+=1){let u=new Date(e,t,c-l+1);d.push({iso:Xo(u),day:u.getDate(),label:a.format(u),otherMonth:u.getMonth()!==t,selected:o!==null&&FR(u,o),today:FR(u,i)});}return {year:e,month:t,title:LR(e,t,r),weekdays:NR(r),days:d}}function nc(e,t,n){let r=new Date(e,t+n,1);return {year:r.getFullYear(),month:r.getMonth()}}function Nm(e,t,n,r=false){let o=Dr(e);if(!o)return null;let i={ArrowLeft:-1,ArrowRight:1,ArrowUp:-7,ArrowDown:7},a=(o.getDay()-tc(n)+7)%7;if(t==="PageUp"||t==="PageDown"){let s=o.getDate();o.setDate(1),o.setMonth(o.getMonth()+(t==="PageUp"?-1:1)*(r?12:1));let l=new Date(o.getFullYear(),o.getMonth()+1,0).getDate();o.setDate(Math.min(s,l));}else {let s=t==="Home"?-a:t==="End"?6-a:i[t];if(s===void 0)return null;o.setDate(o.getDate()+s);}return o.getFullYear()>=100&&o.getFullYear()<=9999?Xo(o):null}function rc(e,t){let n=Dr(e);if(!n)return "";let r=chunkOSFOJTHU_cjs.Ni(t),o=new Intl.NumberFormat(r,{useGrouping:false}).format(0);return new Intl.DateTimeFormat(r,{calendar:"gregory",year:"numeric",month:"numeric",day:"numeric"}).formatToParts(n).map(i=>i.type==="year"?i.value.padStart(4,o):i.value).join("")}function Dm(e,t){if(e.length>100)return null;let n=e.trim();if(/^\d{4}-\d{2}-\d{2}$/.test(n)){let s=Dr(n);return s?Xo(s):null}let r=chunkOSFOJTHU_cjs.Oi(chunkOSFOJTHU_cjs.Ni(t)),o=r.pattern.exec(chunkOSFOJTHU_cjs.Pi(n,r));if(!o)return null;let i={year:"",month:"",day:""};if(r.order.forEach((s,l)=>{i[s]=o[l+1];}),i.year.length!==4)return null;let a=`${i.year}-${i.month.padStart(2,"0")}-${i.day.padStart(2,"0")}`;return Dr(a)?a:null}function Hm(e){let t=new Intl.DateTimeFormat(chunkOSFOJTHU_cjs.Ni(e),{calendar:"gregory",month:"long"});return Array.from({length:12},(n,r)=>t.format(new Date(2e3,r,1)))}function _m(e){let t="",n=0,r=new Intl.Collator(chunkOSFOJTHU_cjs.Ni(e),{usage:"search",sensitivity:"base"});return {reset(){t="",n=0;},keyDown(o,i){if(o.defaultPrevented||o.isComposing||o.altKey||o.ctrlKey||o.metaKey)return;let a=o.target.tagName==="INPUT",s=[...i.querySelectorAll('[role="option"]')].filter(c=>!c.hasAttribute("disabled"));if(!s.length)return;let l=s.indexOf(i.ownerDocument.activeElement),d;if(o.key==="ArrowDown")d=Math.min(s.length-1,l+1);else if(o.key==="ArrowUp")d=l<0?s.length-1:Math.max(0,l-1);else if(!a&&o.key==="Home")d=0;else if(!a&&o.key==="End")d=s.length-1;else if(!a&&o.key.length===1&&o.key!==" "){let c=Date.now();t=c-n>700?o.key:(t+o.key).slice(-100),n=c;let u=[...t].every(p=>r.compare(p,o.key)===0)?o.key:t;for(let p=1;p<=s.length;p++){let m=(Math.max(-1,l)+p)%s.length;if(r.compare((s[m].textContent??"").slice(0,u.length),u)===0){d=m;break}}}d!==void 0&&(o.preventDefault(),s.forEach((c,u)=>{c.tabIndex=u===d?0:-1;}),s[d]?.focus({preventScroll:true}),s[d]?.scrollIntoView?.({block:"nearest"}));}}}var ZD=0;function DR(e,t){let n=e.document.createElement("div");n.className="docx-content-control-menu",n.dataset.docxMarker="",n.dataset.docxPart="popup",n.addEventListener("keydown",r=>Os(n,r,()=>e.close(n))),n.dataset.docxCcId=t,n.setAttribute("contenteditable","false"),n.style.position="absolute",n.style.zIndex="20",n.style.pointerEvents="auto",n.addEventListener("pointerdown",r=>r.stopPropagation());for(let r of ["keydown","beforeinput","input","compositionstart","compositionupdate","compositionend","copy","cut","paste"])n.addEventListener(r,o=>o.stopPropagation());return n}function HR(e,t,n){if(!n){t.append(e);return}e.style.left=`${n.left}px`,e.style.top=`${n.top}px`;let r=n.element?t.closest(".docx-editor__scroll-container")??t.parentElement??t:t;if(r.append(e),n.element){let a=Es(e,n.element),s=new MutationObserver(()=>{e.isConnected||(a(),s.disconnect());});s.observe(r,{childList:true});return}let o=e.offsetWidth;if(o<=0)return;let i=n.left+o-n.sheetRight;i>0&&(e.style.left=`${Math.max(n.sheetLeft,n.left-i)}px`);}function oc(e,t,n,r){if(e.setValue(n,r))return e.close(t),true;let o=t.querySelector("[data-docx-part=error]");return o||(o=e.document.createElement("div"),o.dataset.docxPart="error",o.className="docx-content-control-widget-error",o.setAttribute("role","alert"),t.append(o)),o.hidden=false,o.textContent=In(e.translate)("disabledReason.invalidValue"),false}function _R(e,t,n,r,o,i){let a=DR(e,t),s=In(e.translate);a.setAttribute("role","dialog"),a.setAttribute("aria-label",o||s(`contentControl.types.${n}`));let l=e.document.createElement("div");l.className="docx-content-control-menu-list",l.dataset.docxPart="list",l.id=`docx-engine-cc-list-${++ZD}`,l.setAttribute("role","listbox"),l.setAttribute("aria-label",o||s(`contentControl.types.${n}`));let d=_m(e.locale());a.addEventListener("keydown",u=>d.keyDown(u,a));let c=r.findIndex(u=>u.value===i);for(let[u,p]of r.entries()){let m=e.document.createElement("button");m.type="button",m.className="docx-content-control-menu-item",m.dataset.docxPart="item",m.dataset.value=p.value,m.setAttribute("role","option"),m.setAttribute("aria-selected",String(p.value===i)),m.tabIndex=u===Math.max(0,c)?0:-1,m.textContent=p.displayText,m.addEventListener("click",()=>{oc(e,a,t,p.value);}),l.append(m);}if(n==="buildingBlockGallery"&&r.length===0){let u=e.document.createElement("div");u.className="docx-content-control-menu-empty",u.dataset.docxPart="empty",u.setAttribute("role","note"),u.tabIndex=0,u.textContent=s("contentControl.gallery.empty"),l.append(u);}if(n==="comboBox"){let u=e.document.createElement("input");u.type="text",u.className="docx-content-control-menu-input",u.dataset.docxPart="input",u.value=i??"",u.setAttribute("aria-label",o||s("contentControl.types.comboBox")),u.setAttribute("aria-autocomplete","list"),u.setAttribute("role","combobox"),u.setAttribute("aria-expanded","true"),u.setAttribute("aria-controls",l.id),u.addEventListener("keydown",m=>{m.key!=="Enter"||m.isComposing||(m.preventDefault(),oc(e,a,t,u.value));}),a.append(u);let p=e.document.createElement("div");p.className="docx-dialog__footer",p.dataset.docxPart="footer";for(let m of ["cancel","apply"]){let g=e.document.createElement("button");g.type="button",g.className=`docx-dialog__button${m==="apply"?" docx-dialog__button--primary":""}`,g.dataset.docxPart=m,g.textContent=s(`common.${m}`),g.addEventListener("click",()=>{m==="apply"?oc(e,a,t,u.value):e.close(a);}),p.append(g);}a.append(l,p);}else a.append(l);return a}function ic(e,t){let n=(t?e.querySelector(`[data-iso="${t}"]`):null)??e.querySelector("[data-selected]")??e.querySelector("[data-today]:not([data-other-month])")??e.querySelector(".docx-content-control-calendar-day:not([data-other-month])");for(let r of e.querySelectorAll("[data-iso]"))r.tabIndex=r===n?0:-1;n?.focus({preventScroll:true});}function BR(e,t,n,r){let o=In(e.translate),i=DR(e,t);i.classList.add("docx-content-control-calendar"),i.setAttribute("role","dialog"),i.setAttribute("aria-label",r||o("contentControl.types.date"));let a=n?Dr(n):null,s=a?Xo(a):null,l=new Date,d={year:(a??l).getFullYear(),month:(a??l).getMonth()},c=null,u=rc(s??"",e.locale()),p=y=>{oc(e,i,t,y);},m=y=>{y.addEventListener("mousedown",S=>S.stopPropagation());},g=e.document.createElement("div");g.className="docx-content-control-calendar-title docx-content-control-calendar-announcement",g.dataset.docxPart="title",g.setAttribute("aria-live","polite");let b=()=>{let y=e.document.activeElement?.dataset.docxCalendarNav,S=Lm(d.year,d.month,{locale:e.locale(),selected:s,today:l}),x=e.document.createElement("div");x.className="docx-content-control-calendar-header",x.dataset.docxPart="header";let I=e.document.createElement("button");I.type="button",I.className="docx-content-control-calendar-nav",I.dataset.docxPart="previousMonth",I.dataset.docxCalendarNav="previous",I.textContent="\u2039",I.setAttribute("aria-label",o("contentControl.calendar.previousMonth")),g.textContent=S.title;let R=e.document.createElement("button");R.type="button",R.className="docx-content-control-calendar-nav",R.dataset.docxPart="nextMonth",R.dataset.docxCalendarNav="next",R.textContent="\u203A",R.setAttribute("aria-label",o("contentControl.calendar.nextMonth")),m(I),m(R),I.addEventListener("click",()=>{d=nc(d.year,d.month,-1),c=null,b();}),R.addEventListener("click",()=>{d=nc(d.year,d.month,1),c=null,b();});let T=e.document.createElement("div");T.className="docx-content-control-calendar-navigation",T.dataset.docxPart="navigation";let P=e.document.createElement("select");P.className="docx-content-control-calendar-month",P.dataset.docxPart="month",P.dataset.docxCalendarNav="month",P.setAttribute("aria-label",o("contentControl.calendar.month"));for(let[X,z]of Hm(e.locale()).entries()){let oe=e.document.createElement("option");oe.value=String(X),oe.textContent=z,P.append(oe);}P.value=String(d.month);let O=e.document.createElement("input");O.type="number",O.min="100",O.max="9999",O.value=String(d.year),O.className="docx-content-control-calendar-year",O.dataset.docxPart="year",O.dataset.docxCalendarNav="year",O.addEventListener("keydown",X=>{X.key==="Enter"&&!X.isComposing&&(X.preventDefault(),O.blur());}),O.setAttribute("aria-label",o("contentControl.calendar.year")),P.addEventListener("change",()=>{d.month=Number(P.value),c=null,b();}),O.addEventListener("change",()=>{let X=Number(O.value);if(!Number.isInteger(X)||X<100||X>9999){O.value=String(d.year);return}d.year=X,c=null,b();}),T.append(P,O);let v=e.document.createElement("div");v.className="docx-content-control-calendar-weekdays",v.dataset.docxPart="weekdays";for(let X of S.weekdays){let z=e.document.createElement("span");z.textContent=X,v.append(z);}let C=e.document.createElement("div");C.className="docx-content-control-calendar-grid",C.dataset.docxPart="grid",C.setAttribute("role","grid"),C.setAttribute("aria-label",S.title);for(let X=0;X<S.days.length;X+=7){let z=e.document.createElement("div");z.className="docx-content-control-calendar-week",z.setAttribute("role","row");for(let oe of S.days.slice(X,X+7))z.append(h(oe));C.append(z);}let L=e.document.createElement("div");L.className="docx-content-control-calendar-entry",L.dataset.docxPart="dateEntry";let A=e.document.createElement("button");A.type="button",A.className="docx-content-control-calendar-today",A.dataset.docxPart="today",A.textContent=o("contentControl.calendar.today"),m(A),A.addEventListener("click",()=>p(Xo(l)));let q=e.document.createElement("input");q.type="text",q.className="docx-content-control-menu-input",q.dataset.docxPart="input",q.setAttribute("aria-label",o("contentControl.types.date")),q.placeholder=rc("2006-11-22",e.locale()),q.value=u,q.addEventListener("input",()=>{u=q.value,q.removeAttribute("aria-invalid"),K.hidden=true;});let K=e.document.createElement("div");K.className="docx-content-control-widget-error",K.dataset.docxPart="error",K.setAttribute("role","alert"),K.hidden=true,K.textContent=o("disabledReason.invalidValue");let E=()=>{let X=Dm(u,e.locale());X?p(X):(K.hidden=false,q.setAttribute("aria-invalid","true"),q.focus());};q.addEventListener("keydown",X=>{X.key==="Enter"&&!X.isComposing&&(X.preventDefault(),E());});let _=e.document.createElement("div");_.className="docx-dialog__footer",_.dataset.docxPart="footer";for(let X of ["cancel","apply"]){let z=e.document.createElement("button");z.type="button",z.dataset.docxPart=X,z.className=`docx-dialog__button${X==="apply"?" docx-dialog__button--primary":""}`,z.textContent=o(`common.${X}`),z.addEventListener("click",X==="apply"?E:()=>e.close(i)),_.append(z);}x.append(I,T,R,g),L.append(A,q),i.replaceChildren(x,v,C,L,K,_),ic(i,c),y==="previous"&&I.focus({preventScroll:true}),y==="next"&&R.focus({preventScroll:true}),y==="month"&&P.focus({preventScroll:true}),y==="year"&&O.focus({preventScroll:true});},h=y=>{let S=e.document.createElement("button");return S.type="button",S.className="docx-content-control-calendar-day",S.dataset.docxPart="day",S.textContent=String(y.day),S.dataset.iso=y.iso,S.setAttribute("role","gridcell"),S.setAttribute("aria-label",y.label),y.otherMonth&&(S.dataset.otherMonth=""),y.selected&&(S.dataset.selected="",S.setAttribute("aria-selected","true")),S.setAttribute("aria-selected",String(y.selected)),y.today&&(S.dataset.today="",S.setAttribute("aria-current","date")),m(S),S.addEventListener("click",()=>p(y.iso)),S.addEventListener("keydown",x=>{if(x.isComposing||x.altKey||x.ctrlKey||x.metaKey)return;let I=Nm(y.iso,x.key,e.locale(),x.shiftKey);if(!I)return;x.preventDefault();let R=Dr(I);if(c=I,R.getFullYear()!==d.year||R.getMonth()!==d.month){d={year:R.getFullYear(),month:R.getMonth()},b();return}ic(i,c);}),S};return b(),i}function Bm(e,t){let r=(t instanceof Element?t:null)?.closest("[data-docx-form-checkbox][data-start]"),o=r?.closest("[data-paragraph-id]")?.dataset.paragraphId;if(!r||!o)return null;let i=chunkOSFOJTHU_cjs.Ta(e.part(o),o);if(i?.kind!=="paragraph")return null;let a=Number(r.dataset.start),s=chunkOSFOJTHU_cjs.jj(i).find(l=>l.start<=a&&a<l.end);return s?{paragraphId:o,field:s}:null}function $R(e){return e.shiftKey||e.altKey||e.ctrlKey||e.metaKey}function qR(e){let t=(i,a)=>{if(!e.editable()||!a.enabled)return false;let s=e.apply({op:"setLegacyCheckbox",paragraphId:i,fieldNodeId:a.fieldNodeId,checked:!a.checked});return s&&(e.pagesLayer.focus({preventScroll:true}),e.select({anchor:{paragraphId:i,offset:a.start},head:{paragraphId:i,offset:a.end}})),s},n=i=>{if(i.button!==0||$R(i))return;let a=Bm(e,i.target);!a||!e.editable()||!a.field.enabled||(i.preventDefault(),i.stopPropagation(),t(a.paragraphId,a.field));};e.pagesLayer.addEventListener("pointerdown",n,{capture:true});let r=i=>{let a=Bm(e,i.target);a&&i.target instanceof HTMLElement&&i.target.setAttribute("aria-disabled",String(!e.editable()||!a.field.enabled));};e.pagesLayer.addEventListener("focusin",r);let o=()=>{let i=e.selection();if(i.anchor.paragraphId!==i.head.paragraphId)return null;let a=i.head.paragraphId,s=chunkOSFOJTHU_cjs.Ta(e.part(a),a);if(s?.kind!=="paragraph")return null;let l=Math.min(i.anchor.offset,i.head.offset),d=Math.max(i.anchor.offset,i.head.offset),c=chunkOSFOJTHU_cjs.jj(s).find(u=>u.start===l&&u.end===d||l===d&&l===u.start&&e.protected(a));return c?{paragraphId:a,field:c}:null};return {keydown(i){let a=Bm(e,i.target);if(a&&i.key==="Tab")return true;if(a&&i.key.length===1&&i.key!==" "&&!i.ctrlKey&&!i.metaKey&&!i.altKey)return i.preventDefault(),true;if(i.key!==" "||$R(i)||i.isComposing)return false;let s=a??o();if(!s)return false;if(!e.editable()||!s.field.enabled)return a?(i.preventDefault(),true):false;i.preventDefault();let l=t(s.paragraphId,s.field);return a&&l&&[...e.pagesLayer.querySelectorAll("[data-docx-form-checkbox][data-start]")].find(d=>d.dataset.paragraphId===s.paragraphId&&Number(d.dataset.start)===s.field.start)?.focus({preventScroll:true}),true},destroy(){e.pagesLayer.removeEventListener("pointerdown",n,{capture:true}),e.pagesLayer.removeEventListener("focusin",r);}}}var zD=new Set(["insertText","deleteText","insertTab","insertHardBreak","insertPageBreak","insertPageField","insertNote","insertTable","insertTableRow","deleteTableRow","setRunProperties","setParagraphProperties","setParagraphMarkProperties"]);function $m(e){return zD.has(e.op)}function qm(e){if($m(e))return e.revision!==void 0;switch(e.op){case "setParagraphMarkRevision":case "proposeParagraphMerge":return true;case "insertContentControl":case "authorTable":case "setListNumbering":case "setListLevel":case "splitParagraphMany":return e.revision!==void 0;default:return false}}function Km(e){return e?.trim()||void 0}function KR(e){let t=e.trim().split(/\s+/).filter(Boolean);return t.length===0?"?":t.slice(0,2).map(n=>n[0].toUpperCase()).join("")}function VR(e){return e==="suggesting needs an author before it can propose a change"||e==="tracked changes need a non-empty author"}function zi(e,t,n){if(!e)return null;let r=chunkDOHF6FA7_cjs.fe(e,t);return !r||r.record.paragraphId!==n?null:{paragraphId:n,offset:r.record.start}}var jR="docx-field-atom--active",UD="docx-field-atom",WR=new WeakMap;function Vm(e,t,n){let r=WR.get(e);r||(r={caretKey:null,marked:[]},WR.set(e,r));let o=t?`${t.paragraphId}\0${t.offset}`:null;if(!n?.domReplaced&&o===r.caretKey)return;for(let a of r.marked)a.classList.remove(jR);if(r.marked=[],r.caretKey=o,!t)return;let i=e.querySelectorAll(`.${UD}`);for(let a of i){if(a.dataset.paragraphId!==t.paragraphId)continue;let s=Number(a.dataset.fieldResultStart??a.dataset.start),l=Number(a.dataset.fieldResultEnd??a.dataset.end);!Number.isFinite(s)||!Number.isFinite(l)||t.offset<s||t.offset>l||(a.classList.add(jR),r.marked.push(a));}}var GD={kind:"body"};function ZR(e){let{session:t}=e;if(e.editingMode==="view"||!t.editable)return true;if(e.collaborationActive)return false;let n,r=e.reviewerFilterActive?l=>(n??=chunkD7ZMDMPX_cjs.T(e.canonicalUnfilteredLayout()),n(l)):chunkD7ZMDMPX_cjs.T(e.layout),o={package:t.currentPackage(),styleCascade:e.styleCascade,numberingIndex:e.numberingIndex,displayMode:e.displayMode,pageRefPageNumberOf:r},i=chunkD7ZMDMPX_cjs.U(t.part(),o),a=chunkD7ZMDMPX_cjs.V(t.part(),o);if(!i&&a.length===0)return true;let s=[];i&&s.push({scope:GD,ops:[i]});for(let l of a)s.push({scope:{kind:"notesPart",noteKind:l.noteKind},ops:[l.op]});return t.applyTreeOpsAtomic(s).committed}function UR(e){let t=0,n=null,r="",o=null,i=true,a=null,s="";return ()=>{let l=e.surface(),d=`${l?.session.packageRevision()??-1}:${l?.session.revision()??-1}`,c=e.activeKey(),u=e.paneOpen(),p=e.selectionAnchor(),m=e.authorFilterKey();return (l!==n||d!==r||c!==o||u!==i||p!==a||m!==s)&&(n=l,r=d,o=c,i=u,a=p,s=m,t+=1),t}}function ac(e=[]){let t=new Set(e),n=Object.freeze([...t]),r=chunkDOHF6FA7_cjs.ab(t),o=null,i="accept",a=null,s="accept",l=new WeakMap,d=null,c=false,u=0,p=null,m=[],g=null,b=[],h=r,y=t,S=new Set,x="accept",I=new WeakSet,R=new WeakMap,T=new Map,P=()=>{u+=1,p=null,m=[],g=null;},O=L=>JSON.stringify([L.id,chunkOSFOJTHU_cjs.wj(L)]),v=(L,A,q)=>{let K=XD(q),E=t,_=r?.hiddenAuthors??chunkDOHF6FA7_cjs.$a,X=i,z;E===y&&YD(K,S)&&(K.size===0||X===x)?z=h:K.size===0&&E.size===0?z=void 0:z=Object.freeze({hiddenAuthors:_,includes:j=>!E.has(j.author)&&!K.has(j.nodeId),includesNode:(j,me)=>!E.has(me)&&!K.has(j),excludedNodeMode:(j,me)=>E.has(me)?"proposed":K.has(j)&&X==="reject"?"original":"proposed",cacheKey:QD(E,K,X)});let oe=[];for(let j of L){let me=zR(j);me!==null&&E.has(me)||j.kind==="revision"&&A.has(j)||oe.push(j);}b=oe.length===L.length?L:chunkOSFOJTHU_cjs.jk(oe),g=L,I=A,h=z,y=E,S=K,x=X,c=false,a=null,s="accept",l=new WeakMap,d=null;},C=L=>{if(L===g)return;let A=new WeakSet,q=[],K=[];try{for(let _ of L){if(_.kind!=="revision")continue;let X=!t.has(_.author),z=R.get(_);z===void 0&&(z=o?.(_)??!0,K.push([_,z])),!(X&&z)&&(A.add(_),z||q.push(_));}}catch(_){if(c)o=a,i=s,R=l,g=d,a=null,s="accept",l=new WeakMap,d=null,u+=1;else {let X=new WeakSet,z=[];for(let oe of L){if(oe.kind!=="revision")continue;let j=T.get(O(oe))??true;(t.has(oe.author)||!j)&&X.add(oe),j||z.push(oe);}v(L,X,z);}throw c=false,_}for(let[_,X]of K)R.set(_,X);let E=new Map;for(let _ of L)_.kind==="revision"&&E.set(O(_),R.get(_)??true);T=E,v(L,A,q);};return {get hiddenAuthors(){return r?.hiddenAuthors??chunkDOHF6FA7_cjs.$a},get hiddenAuthorList(){return n},get stateKey(){return String(u)},get hasFilter(){return t.size>0||o!==null},filterFor(L){return o?(C(L),h):r},filterForSession(L){return o?(C(L.reviewItems()),h):r},filterItems(L){if(!o){if(t.size===0)return L;if(L===p)return m;let A=L.filter(q=>{let K=zR(q);return K===null||!t.has(K)});return p=L,m=A.length===L.length?L:chunkOSFOJTHU_cjs.jk(A),m}return C(L),b},includesRevisionItem(L){return !I.has(L)},setPredicate(L,A="accept"){return o===null&&L===null?false:L===null?(o=null,i="accept",a=null,s="accept",c=false,R=new WeakMap,l=new WeakMap,T=new Map,d=null,b=[],I=new WeakSet,h=r,y=t,S=new Set,x="accept",P(),true):(a=o,s=i,l=R,d=g,c=true,o=L,i=A,R=new WeakMap,P(),true)},isVisible:L=>!t.has(L),setVisible(L,A){if(A===!t.has(L))return false;let q=new Set(t);return A?q.delete(L):q.add(L),t=q,n=Object.freeze([...q]),r=chunkDOHF6FA7_cjs.ab(q),P(),true},setAllVisible(L,A){let q=A?new Set:new Set(L);return q.size===t.size&&[...q].every(K=>t.has(K))?false:(t=q,n=Object.freeze([...q]),r=chunkDOHF6FA7_cjs.ab(q),P(),true)},showAll(){return t.size===0?false:(t=new Set,n=Object.freeze([]),r=void 0,P(),true)}}}function jm(e,t){return t.filterItems(e)}function XD(e){let t=new Set;for(let n of e)for(let r of chunkOSFOJTHU_cjs.wj(n))t.add(r);return t}function YD(e,t){if(e.size!==t.size)return false;for(let n of e)if(!t.has(n))return false;return true}function QD(e,t,n){return JSON.stringify({hiddenAuthors:[...e].sort(),excludedNodeIds:[...t].sort(),mode:t.size===0?"accept":n})}function zR(e){return e.kind==="comment"?e.comment?.author??"":e.author??null}function GR(e,t){let n=r=>{if(!t.enabled)return;let o=t.surface();if(o)return o.setAllRevisionAuthorsVisible(r);!r||!e.showAll()||t.notify();};return {isReviewAuthorVisible:e.isVisible,setReviewAuthorVisible(r,o){if(!t.enabled)return;let i=t.surface();if(i)return i.setRevisionAuthorVisible(r,o);e.setVisible(r,o)&&t.notify();},setAllReviewAuthorsVisible:n,showAllReviewAuthors:()=>n(true)}}var JD=Object.freeze({mode:"atomic",run:e=>e(),wrap:e=>e,methods:e=>e,listeners:()=>{},selectsWholeFieldWhen:()=>{},edits:e=>e});function e2(e){if(e===void 0||e==="atomic")return "atomic";if(e==="editable")return "editable";throw new TypeError('Invalid fieldResults: use "atomic" or "editable"')}var Wm='fieldResults "editable" is not supported in a collaboration session: shared paragraph text keeps each field one unit';function t2(e){if(e==="atomic")return JD;let t=o=>chunkOSFOJTHU_cjs.kf(e,o),n=o=>function(...i){return t(()=>o.apply(this,i))},r=()=>false;return {mode:e,run:t,wrap:n,selectsWholeFieldWhen(o){r=o;},edits:o=>function(...i){return r()?chunkOSFOJTHU_cjs.lf(()=>o.apply(this,i)):o.apply(this,i)},methods(o){for(let i of Reflect.ownKeys(o)){let a=Object.getOwnPropertyDescriptor(o,i);if(a?.configurable){if(typeof a.value=="function")a.value=n(a.value);else if(a.get||a.set)a.get&&(a.get=n(a.get)),a.set&&(a.set=n(a.set));else continue;Object.defineProperty(o,i,a);}}return o},listeners(o){let i=o.addEventListener,a=o.removeEventListener,s=new WeakMap,l=d=>{let c=s.get(d);return c||(c=typeof d=="function"?function(u){return t(()=>d.call(this,u))}:u=>t(()=>d.handleEvent(u)),s.set(d,c)),c};Object.defineProperty(o,"addEventListener",{configurable:true,writable:true,value(d,c,u){c&&i.call(o,d,l(c),u);}}),Object.defineProperty(o,"removeEventListener",{configurable:true,writable:true,value(d,c,u){c&&a.call(o,d,s.get(c)??c,u);}});}}}function XR(e,t){if(t.mode==="atomic")return e;let n=e,r=n.subscribe.bind(n),o=n.applyTreeOps.bind(n),i=n.applyTreeOpsAtomic.bind(n);return n.subscribe=a=>r(t.wrap(a)),n.applyTreeOps=t.edits(o),n.applyTreeOpsAtomic=t.edits(i),t.methods(e)}function sc(e){let t=e2(e.fieldResults);if(t==="editable"&&e.collaborationModel)throw new TypeError(Wm);return t2(t)}function lc(e,t){let n=e.part(t),r=n?chunkOSFOJTHU_cjs.Ta(n,t):null;return r?.kind!=="paragraph"?[]:chunkOSFOJTHU_cjs.Ki(r).filter(o=>o.start<o.end)}function n2(e,t){return lc(e,t.paragraphId).find(n=>t.offset>n.start&&t.offset<n.end)}function r2(e,t){let n=(i,a)=>{let s=n2(e,i);if(!s||a.paragraphId===i.paragraphId&&a.offset>=s.start&&a.offset<=s.end)return i;let l=e.compare(a,i)<0?s.end:s.start;return {paragraphId:i.paragraphId,offset:l}},r=n(t.anchor,t.head),o=n(t.head,t.anchor);return r===t.anchor&&o===t.head?t:{anchor:r,head:o}}function o2(e,t){if(t.length!==2)return t;let[n,r]=t;if(n?.op!=="deleteText"||r?.op!=="insertText"||r.paragraphId!==n.paragraphId||n.start>=n.end||r.offset!==n.start&&r.offset!==n.end)return t;let{start:o,end:i}=n,a=lc(e,n.paragraphId).find(l=>l.start<=o&&i<=l.end);if(!a||o!==a.start&&i!==a.end)return t;let s=r.text.length;return [{...r,offset:o,...o===a.start?{bias:"right"}:{}},{...n,start:o+s,end:i+s}]}function YR(e,t,n){if(n.mode==="atomic")return e;let{selectForDeletion:r,wordDeletionBoundary:o,beforeSelect:i,annotate:a}=e,s=null,l=c=>s!==null&&c.anchor.paragraphId===s.anchor.paragraphId&&c.head.paragraphId===s.head.paragraphId&&c.anchor.offset===s.anchor.offset&&c.head.offset===s.head.offset;n.selectsWholeFieldWhen(()=>l(t.selection()));let d=c=>{let{anchor:u,head:p}=t.selection();if(!(u.paragraphId!==p.paragraphId||u.offset!==p.offset))return lc(t,p.paragraphId).find(m=>c===-1?m.end===p.offset:m.start===p.offset)};return Object.assign(e,{annotate:n.wrap(c=>a.call(e,l(t.selection())?c:o2(t,c))),selectForDeletion:n.wrap(c=>{let u=t.writable()?d(c==="backward"?-1:1):void 0;if(!u)return r.call(e,c);let{paragraphId:p}=t.selection().head;return s={anchor:{paragraphId:p,offset:u.start},head:{paragraphId:p,offset:u.end}},t.select(s),true}),wordDeletionBoundary:n.wrap((c,u,p,m)=>{let g=o.call(e,c,u,p,m),b=lc(t,t.selection().head.paragraphId),h=b.find(S=>p===-1?S.end===u:S.start===u);if(h)return p===-1?h.start:h.end;let y=g;for(let S of b)for(let x of [S.start,S.end])p===-1&&x<u&&x>y&&(y=x),p===1&&x>u&&x<y&&(y=x);return y}),beforeSelect:n.wrap(c=>(l(c)||(s=null),i.call(e,r2(t,c))))})}function QR(e,t){let n=false,r=()=>{n=false,t();};return ()=>{if(n)return;n=true;let o=e.defaultView?.requestAnimationFrame;o?o(r):queueMicrotask(r);}}function Zm(e){return e.kind==="comment"?e.comment.author:e.kind==="revision"?e.author:null}function JR(e){let t=null;return {get(){let n=e.layout(),r=e.items(),o=e.styles(),i=t;if(i?.layout===n&&i.items===r&&i.styles===o)return i;let a=e.slots.resolve(chunkCAJEXXVG_cjs.d(n),(function*(){for(let p of r){let m=Zm(p);m!==null&&(yield m);}})()),s=i?.value,l=s!==void 0&&s.size===a.size&&[...a].every(([u,p])=>s.get(u)===p),d=l?s:a,c=i!==null&&l&&i.styles===o?i.resolved:new Map(chunkCAJEXXVG_cjs.c(d,o).map(u=>[u.author,u]));return t={layout:n,items:r,styles:o,value:d,resolved:c},t},releaseLayout(){t!==null&&(t={...t,layout:null,items:null});}}}function eP(e){let t=null;return {forAuthor(n){let r=e.roster(),o=r.resolved.get(n);if(o)return chunkBTQKU64Q_cjs.a(o.color)??chunkCAJEXXVG_cjs.a(o.slot);let i=e.slots.resolve(r.value,[n]).get(n);return i===void 0?void 0:chunkCAJEXXVG_cjs.a(i)},declaredFor(n){let r=e.styles();return (t===null||t.styles!==r)&&(t={styles:r,resolved:chunkCAJEXXVG_cjs.b(r)}),chunkBTQKU64Q_cjs.a(t.resolved.get(n)?.color)}}}function Ui(e){try{return e.createElement("canvas").getContext("2d")}catch{return null}}var tP=new WeakMap;function i2(e){let t=[],n={x:e.box.x,y:e.box.y};for(let r of [e.header,e.footer]){if(!r)continue;let o={x:r.box.x,y:r.box.y};chunkDOHF6FA7_cjs.Fa(r,(i,a)=>{a.textboxDepth===0||a.textboxOwner?.accessibility.hidden||t.push(chunkDOHF6FA7_cjs.Le(i,a.storyOrigin.x-e.contentBox.x,a.storyOrigin.y-e.contentBox.y));},o,i=>chunkDOHF6FA7_cjs.wa(i,o,n));}return t}function Yo(e){let t=tP.get(e);if(t)return t;let n=e.pages.map(o=>{let i=chunkDOHF6FA7_cjs.xd(o).flatMap(a=>{let s=a.textboxStory;return s.fragments.flatMap(l=>l.kind==="paragraph"?[chunkDOHF6FA7_cjs.Le(l,a.x+s.contentOffset.x,a.y+s.contentOffset.y)]:[])});return i.push(...i2(o)),i.length?{...o,fragments:[...o.fragments,...i]}:o}),r=n.every((o,i)=>o===e.pages[i])?e:{...e,pages:n};return tP.set(e,r),r}function rP(e,t,n){let r=t(e.anchor.paragraphId),o=t(e.head.paragraphId);return !r||!o?null:{anchor:{paragraphId:r.paragraphId,offset:Math.max(0,e.anchor.offset)},head:{paragraphId:o.paragraphId,offset:Math.max(0,e.head.offset)},...n?{kind:n}:{}}}function oP(e,t){let n=chunkOSFOJTHU_cjs.Ta(e,t);if(!n||n.kind==="textValue")return null;let r=chunkOSFOJTHU_cjs.wb(n);return !r||!chunkOSFOJTHU_cjs.vb(r)?null:{paragraphId:r.toUpperCase(),nodeId:t,text:""}}var zm=new WeakMap;function a2(e,t,n){return e.map(r=>chunkBTQKU64Q_cjs.a(n?.(r.name))??chunkBTQKU64Q_cjs.a(r.color)??chunkBTQKU64Q_cjs.a(t?.(r.name)))}function s2(e,t){let n="";for(let[r,o]of e.entries())n+=`${o.actorId} ${o.name} ${t[r]??""} ${o.kind??""} `,n+=`${o.anchor.nodeId}:${o.anchor.offset} `,n+=`${o.head.nodeId}:${o.head.offset}
|
|
23
|
+
`;return n}function l2(e){if(!e)return "*";let t=[];for(let n of e)t.push(n);return t.sort((n,r)=>n-r),t.join(",")}function d2(e){if(!e||e.size===0)return "";let t=[];for(let[n,r]of e)t.push(`${n}:${r}`);return t.sort(),t.join(",")}function c2(e,t,n){return e.layout===n.layout&&e.fingerprint===n.fingerprint&&e.pagesKey===n.pagesKey&&e.scale===n.scale&&e.offsetKey===n.offsetKey&&e.labelHost===n.labelHost&&e.childCount===t.childElementCount}function nP(e){return e.anchor.nodeId===e.head.nodeId&&e.anchor.offset===e.head.offset}function u2(e,t){let n=chunkD7ZMDMPX_cjs.ma(e,t.anchor.nodeId),r=chunkD7ZMDMPX_cjs.ma(e,t.head.nodeId);if(!n||!r)return [];let o=chunkD7ZMDMPX_cjs.ea(e,n,r);return o?chunkD7ZMDMPX_cjs.ia(e,o.cellIds).map(i=>({...i,className:"docx-remote-selection-rect"})):[]}function iP(e,t,n,r){t=Yo(t);let{scale:o,pageOffsetX:i,pages:a,colorForAuthor:s,declaredColorFor:l}=r,d=r.labelHost??null,c=a2(n,s,l),u={layout:t,fingerprint:s2(n,c),pagesKey:l2(a),scale:o,offsetKey:d2(i),labelHost:d},p=zm.get(e);if(p&&c2(p,e,u))return;zm.delete(e);let m=[],g=[],b=[],h=[];for(let[I,R]of n.entries())R.kind==="cells"||nP(R)||h.push({key:String(I),from:{paragraphId:R.anchor.nodeId,offset:R.anchor.offset},to:{paragraphId:R.head.nodeId,offset:R.head.offset}});let y=h.length>0?chunkDOHF6FA7_cjs.Ae(t,h,chunkDOHF6FA7_cjs.Sa(t),a,r.measurer):null;for(let[I,R]of n.entries()){let T=c[I],P=chunkDOHF6FA7_cjs.ne(t,{paragraphId:R.head.nodeId,offset:R.head.offset},r.measurer);if(P){let v=chunkDOHF6FA7_cjs.ze(t,R.head.nodeId,P.pageIndex);b.push({selection:R,...T?{color:T}:{},pageIndex:P.pageIndex,x:P.x+v.x,y:P.y+v.y});}if(R.kind==="cells"){let v=u2(t,R);if(v.length>0){for(let C of v)m.push(C),g.push(T);continue}}if(nP(R)){let v=chunkDOHF6FA7_cjs.ne(t,{paragraphId:R.anchor.nodeId,offset:R.anchor.offset},r.measurer);if(!v)continue;let C=chunkDOHF6FA7_cjs.ze(t,R.anchor.nodeId,v.pageIndex);m.push({pageIndex:v.pageIndex,x:v.x+C.x,y:v.y+C.y,width:Math.max(1/o,1),height:v.height,className:"docx-remote-caret"}),g.push(T);continue}let O=y?.get(String(I));if(O)for(let v of O)m.push({...v,className:"docx-remote-selection-rect"}),g.push(T);}chunkCAJEXXVG_cjs.r(e,t,m,{scale:o,pageOffsetX:i}),[...e.children].forEach((I,R)=>{let T=chunkBTQKU64Q_cjs.a(g[R]);!T||!(I instanceof HTMLElement)||I.style.setProperty("--doc-remote-color",T);});let S=e.ownerDocument,x=[];for(let I of b){let R=t.pages[I.pageIndex];if(!R)continue;let T=S.createElement("div");T.className="docx-remote-caret-label",d?(T.setAttribute("data-docx-remote-actor",I.selection.actorId),x.push({element:T,selection:I.selection})):T.textContent=I.selection.name,T.style.left=`${(R.contentBox.x+I.x+(i?.get(I.pageIndex)??0))*o}px`,T.style.top=`${(R.contentBox.y+I.y)*o}px`;let P=chunkBTQKU64Q_cjs.a(I.color);P&&T.style.setProperty("--doc-remote-color",P),e.append(T);}zm.set(e,{...u,childCount:e.childElementCount}),d&&d.publish(x);}function f2(e,t){let n=Math.max(0,e.end-e.start);return e.start+Math.max(0,Math.min(t,n))}var uP=/^[^\s]{1,512}$/,Um=/["\\\u0000-\u001f\u007f]/;function fP(e,t){return !e||t===void 0||!/^\d{1,9}$/.test(t)||!uP.test(e)||e==="__proto__"?null:{paragraphId:e,offset:Number(t)}}function so(e){let t=fP(e.dataset?.paragraphId,e.dataset?.start);if(!t)return null;let{paragraphId:n,offset:r}=t,o=e.dataset?.end,i=o!==void 0&&/^\d{1,9}$/.test(o)&&Number(o)>=r?Number(o):r+(e.textContent?.length??0);return {paragraphId:n,start:r,end:i}}function Gi(e){if(!e||e.nodeType!==Node.ELEMENT_NODE)return null;let t=e;return !t.classList.contains("docx-inline-drawing-advance")||t.parentElement?.dataset.paragraphId===void 0?null:fP(t.dataset.drawingParagraphId,t.dataset.drawingStart)}function p2(e,t){let n=Um.test(t)?"[data-paragraph-id][data-start], .docx-inline-drawing-advance":`[data-paragraph-id="${t}"][data-start], .docx-inline-drawing-advance[data-drawing-paragraph-id="${t}"]`,r=[],o=[];for(let i of e.querySelectorAll(n))i.classList.contains("docx-inline-drawing-advance")?Gi(i)?.paragraphId===t&&o.push(i):r.push(i);return {spans:r,spacers:o}}function cc(e,t,n){return Um.test(t)?e.querySelectorAll(`[data-paragraph-id]${n}`):e.querySelectorAll(`[data-paragraph-id="${t}"]${n}`)}function pP(e){let t=e.nodeType===Node.TEXT_NODE?e.parentNode:e;for(;t&&t.nodeType===Node.ELEMENT_NODE;){let n=so(t);if(n)return {element:t,identity:n};t=t.parentNode;}return null}function mP(e){return e.querySelector("[data-docx-hf-active]")}function Qo(e,t){if(!e||t&&!t.contains(e))return;let o=(e.nodeType===Node.ELEMENT_NODE?e:e.parentElement)?.closest("[data-page-index]")?.dataset?.pageIndex;if(!(o===void 0||!/^\d{1,9}$/.test(o)))return Number(o)}function m2(e,t){return t===void 0||!Number.isInteger(t)||t<0?null:e.querySelector(`[data-page-index="${t}"]`)}function dc(e,t){let n=mP(e);if(n)return [n,e];let r=m2(e,t);return r&&r!==e?[r,e]:[e]}function aP(e,t){let n=l=>({paragraphId:l.paragraphId,offset:t?l.end:l.start}),r=l=>t?{...l,offset:l.offset+1}:l,o=pP(e);if(o)return n(o.identity);let i=Gi(e);if(i)return r(i);if(e.nodeType!==Node.ELEMENT_NODE)return null;let a=e.querySelectorAll("[data-paragraph-id][data-start], .docx-inline-drawing-advance"),s=t?[...a].reverse():[...a];for(let l of s){let d=Gi(l);if(d)return r(d);let c=so(l);if(c)return n(c)}return null}function sP(e,t,n=false){let r=[...e.childNodes];if(r.length===0)return null;let o=Gi(r[t-1]);if(o)return {paragraphId:o.paragraphId,offset:o.offset+1};for(let i=Math.max(0,t);!n&&i<r.length;i+=1){let a=aP(r[i],false);if(a)return a}for(let i=Math.min(t,r.length)-1;i>=0;i-=1){let a=aP(r[i],true);if(a)return a}return null}function lP(e,t,n){if(!n.contains(e))return null;let r=e.nodeType===Node.ELEMENT_NODE?e:e.parentElement;if(r?.closest("[data-docx-field]"))return null;let o=r?.closest("[data-docx-hf]");if(o&&!o.hasAttribute("data-docx-hf-active")||mP(n)&&r?.closest(".docx-page-content"))return null;let i=r?.closest("[data-docx-marker]"),a=Gi(i??void 0);if(a)return t>0?{...a,offset:a.offset+1}:a;let s=r?.closest(".docx-terminator-seat");if(s?.querySelector(".docx-line-break-mark")&&s.parentElement){let c=s.parentElement,u=[...c.querySelectorAll(".layout-run[data-start]")].filter(g=>g.closest(".docx-line")===c).flatMap(g=>{let b=so(g);return b?[{run:g,identity:b}]:[]}),p=u.at(-1)?.identity.paragraphId,m;for(let g of u)g.identity.paragraphId===p&&(!m||g.identity.start>m.identity.start)&&(m=g);if(m){let g=m.run.textContent===`
|
|
24
|
+
`,{start:b,end:h}=m.identity;return {paragraphId:m.identity.paragraphId,offset:g?b:h}}}let l=s??(i?.classList.contains("docx-wrap-advance")?i:null);if(l?.parentElement){let c=[...l.parentElement.childNodes],u=c.indexOf(l);if(s){let g="[data-start], a, br, .docx-inline-drawing-advance, .docx-wrap-advance";for(;u>0&&!c[u-1].matches?.(g);)u-=1;}let p=!s&&t>0?1:0,m=sP(l.parentElement,u+p,!!s);if(m)return m}if(i)return i.parentElement?gP(i.parentElement):null;if(r?.closest("[data-docx-tab-leader]"))return null;if(e.nodeType===Node.ELEMENT_NODE){let c=e,u=so(c);if(u)return {paragraphId:u.paragraphId,offset:t>0?u.end:u.start};let p=sP(c,t);return p||b2(c)}let d=pP(e);return d?{paragraphId:d.identity.paragraphId,offset:f2(d.identity,t)}:null}function Xi(e,t){if(!t||t.rangeCount===0)return null;let{anchorNode:n,anchorOffset:r,focusNode:o,focusOffset:i}=t;if(!n||!o)return null;let a=lP(n,r,e),s=lP(o,i,e);if(!a||!s){let l=a??s;return l?{anchor:l,head:l}:null}return {anchor:a,head:s}}function Gm(e,t){if(!t||t.rangeCount===0)return false;let{anchorNode:n,focusNode:r}=t;return !!n&&e.contains(n)||!!r&&e.contains(r)}function dP(e,t,n,r){if(r!==void 0)for(let o of dc(e,n)){let i=Um.test(r)?"[data-line-id]":`[data-line-id="${r}"]`;for(let a of o.querySelectorAll(i)){if(a.dataset.lineId!==r)continue;let s=cP(a,t);if(s)return s}}for(let o of dc(e,n)){let i=cP(o,t);if(i)return i}return null}function g2(e,t){let n=null;for(let r of e){if(!r.hasAttribute("data-docx-field")||!r.parentNode)continue;let o=so(r);if(o?.paragraphId===t.paragraphId){if(o.start===t.offset)return {node:r.parentNode,offset:[...r.parentNode.childNodes].indexOf(r)};o.end===t.offset&&(n=r);}}if(n){let r=so(n);for(let o of e){let i=so(o);i?.paragraphId===t.paragraphId&&i.start===r.start&&i.end===r.end&&(n=o);}}return n?.parentNode?{node:n.parentNode,offset:[...n.parentNode.childNodes].indexOf(n)+1}:null}function cP(e,t){let{spans:n,spacers:r}=p2(e,t.paragraphId),o=g2(n,t);if(o)return o;let i=null,a=false;for(let m of n){let g=so(m);if(!g||g.paragraphId!==t.paragraphId)continue;let b=h2(m),h=m.textContent?.length??0,y=g.end;if(b){if(m.closest?.("[data-docx-field]")){a=true;continue}if(a=true,t.offset>=g.start&&t.offset<=y){let S={node:b,offset:Math.min(t.offset-g.start,h)};if(t.offset<y)return S;i=S;}}}let s=m=>r.find(g=>Gi(g)?.offset===m)??null,l=s(t.offset);if(i&&l?.parentNode&&!l.parentNode.contains(i.node))return {node:l.parentNode,offset:[...l.parentNode.childNodes].indexOf(l)};if(i)return i;let d=l,c=d?null:s(t.offset-1),u=d??c;if(u?.parentNode)return {node:u.parentNode,offset:[...u.parentNode.childNodes].indexOf(u)+(c?1:0)};if(a||=r.length>0,a)return null;let p=y2(e,t.paragraphId);return p?{node:p,offset:0}:null}function h2(e){let t=e.firstChild;for(;t&&t.nodeType===Node.ELEMENT_NODE;)t=t.firstChild;return t&&t.nodeType===Node.TEXT_NODE?t:null}function y2(e,t){let n=null;for(let r of cc(e,t,""))if(r.dataset?.paragraphId===t&&r.dataset?.start===void 0){if(r.dataset?.lineId!==void 0)return r;n??=r;}return n}function gP(e){let t=e.closest("[data-paragraph-id]");if(!t||t.dataset.start!==void 0)return null;let n=t.dataset.paragraphId;return !n||!uP.test(n)||n==="__proto__"?null:{paragraphId:n,offset:0}}function b2(e){let t=gP(e);return !t||e.closest("[data-paragraph-id]").querySelector("[data-paragraph-id][data-start]")?null:t}function hP(e,t,n,r){if(!n)return false;let o=r?.preferredPageIndex??Qo(n.anchorNode,e),a=Mt(t,{anchor:t.head,head:t.head})?r?.preferredLineId:void 0,s=dP(e,t.anchor,o,a),l=dP(e,t.head,o,a);if(!s||!l)return false;let d=Xi(e,n);if(d&&Mt(d,t)){let c=Qo(n.anchorNode,e),p=(n.focusNode?.nodeType===Node.ELEMENT_NODE?n.focusNode:n.focusNode?.parentElement)?.closest("[data-line-id]")?.dataset.lineId;if((o===void 0||c===o)&&(a===void 0||p===a))return true}try{return n.setBaseAndExtent(s.node,s.offset,l.node,l.offset),!0}catch{return false}}function Mt(e,t){return e.anchor.paragraphId===t.anchor.paragraphId&&e.anchor.offset===t.anchor.offset&&e.head.paragraphId===t.head.paragraphId&&e.head.offset===t.head.offset}var v2='[data-docx-marker],[data-docx-tab-leader],[aria-hidden="true"],[contenteditable="false"],[data-drawing-node-id]';function yP(e,t,n){let r=e.dataset.end;if(r===void 0||!/^\d{1,9}$/.test(r))return n;let o=Number(r);return o>=t?o:n}function bP(e,t){if(e.dataset.paragraphId!==t)return null;let n=e.dataset.start;return n===void 0||!/^\d{1,9}$/.test(n)?null:Number(n)}function x2(e){return e?(e.nodeType===Node.ELEMENT_NODE?e:e.parentElement)?.closest(".docx-page")??null:null}function w2(e,t,n){return t&&e.contains(t)?2:n?.contains(e)?1:0}function vP(e,t,n,r){if(e.dataset.docxField!==void 0){let i=yP(e,t,t);return {start:t,end:i,text:n.slice(t,i),seq:r}}let o=e.textContent??"";return {start:t,end:yP(e,t,t+o.length),text:o,seq:r}}function xP(e,t){for(let n of e.childNodes){if(n.nodeType===Node.TEXT_NODE){let s=n.textContent??"";s.length>0&&(t.pieces.push({start:t.end,end:t.end,text:s,seq:t.seq}),t.seq+=1);continue}if(n.nodeType!==Node.ELEMENT_NODE)continue;let r=n,o=bP(r,t.paragraphId);if(o===null){if(r.dataset?.start!==void 0)continue;let s=r.dataset?.drawingStart;if(r.dataset?.drawingParagraphId===t.paragraphId&&s!==void 0&&/^\d{1,9}$/.test(s)){t.end=Math.max(t.end,Number(s)+1);continue}if(r.matches?.(v2))continue;xP(r,t);continue}let i=vP(r,o,t.modelText,t.seq);t.seq+=1,t.end=Math.max(t.end,i.end);let a=`${i.start}:${i.end}`;t.ranges.has(a)||(t.ranges.add(a),t.pieces.push(i));}}function S2(e,t,n,r){let o=[];for(let a of cc(e,t,"")){let s=a;s.dataset.paragraphId===t&&s.dataset.start===void 0&&(o.some(l=>l.contains(s))||o.push(s));}let i=new Map;for(let a of o){let s=a.dataset.fragmentIndex??"",l=w2(a,n,r),d=i.get(s);(!d||l>d.affinity)&&i.set(s,{element:a,affinity:l});}return [...i.values()].map(a=>a.element)}function I2(e,t,n){for(let r of cc(e,n.paragraphId,"[data-start]")){let o=r,i=bP(o,n.paragraphId);if(i===null||t.some(l=>l.contains(o)))continue;let a=vP(o,i,n.modelText,n.seq);n.seq+=1;let s=`${a.start}:${a.end}`;n.ranges.has(s)||(n.ranges.add(s),n.pieces.push(a));}}function k2(e,t){let n=[...e].sort((i,a)=>i.start-a.start||i.seq-a.seq),r="",o=0;for(let i of n)i.start>o&&(r+=t.slice(o,i.start)),r+=i.text,o=Math.max(o,i.end);return o<t.length&&(r+=t.slice(o)),r}function wP(e,t,n,r){let o=S2(e,t,r,x2(r)),i={paragraphId:t,modelText:n,pieces:[],ranges:new Set,end:0,seq:0};for(let a of o)xP(a,i);return I2(e,o,i),i.pieces.length===0?null:k2(i.pieces,n)}var PP={ArrowLeft:"left",ArrowRight:"right",ArrowUp:"up",ArrowDown:"down",Home:"lineStart",End:"lineEnd"};function R2(e){return PP[e.key]||e.key==="PageUp"||e.key==="PageDown"?true:(e.metaKey||e.ctrlKey)&&e.key.toLowerCase()==="a"}var SP={l:"left",e:"center",r:"right",j:"both"},IP={1:"240",5:"360",2:"480"},kP={b:{localName:"b"},i:{localName:"i"},u:{localName:"u",attributes:{val:"single"}}};function P2(e,t){return e.altKey?e.metaKey?true:e.ctrlKey?e.getModifierState?.("AltGraph")??false?e.key.toLowerCase()===t:true:false:false}function TP(e,t={}){return n=>{if(n.defaultPrevented||e.editingMode()==="view"&&R2(n))return;if(n.key==="F9"&&n.altKey&&!n.ctrlKey&&!n.metaKey&&!n.shiftKey&&!n.isComposing&&t.onToggleFieldCodes){n.preventDefault(),t.onToggleFieldCodes();return}if(!n.altKey&&!n.isComposing&&(n.metaKey&&!n.ctrlKey&&!n.shiftKey&&n.key==="8"||n.ctrlKey&&!n.metaKey&&n.shiftKey&&(n.code==="Digit8"||n.key==="*"))&&t.onToggleParagraphMarks){n.preventDefault(),t.onToggleParagraphMarks();return}if(n.key==="Escape"&&e.formatPainter.state().mode!=="off"){e.formatPainter.disarm(),n.preventDefault();return}if(n.key==="Escape"&&e.activeScope().kind==="headerFooter"){e.exitHeaderFooter(),n.preventDefault();return}if(n.key==="Escape"&&e.activeScope().kind==="note"){e.exitNote(),n.preventDefault();return}let r=gm(n);if(P2(n,r)&&!n.shiftKey){let a=r;if(a==="f"){n.preventDefault(),e.insertNote("footnote");return}if(a==="d"){n.preventDefault(),e.insertNote("endnote");return}if(a==="c"){n.preventDefault(),e.formatPainter.capture();return}if(a==="v"){n.preventDefault(),e.formatPainter.apply();return}}let o=n.metaKey||n.ctrlKey,i=PP[n.key];if(i){let a=i;n.key==="Home"||n.key==="End"?o&&(a=n.key==="Home"?"documentStart":"documentEnd"):(n.key==="ArrowLeft"||n.key==="ArrowRight")&&(n.altKey||n.ctrlKey)?a=n.key==="ArrowLeft"?"wordLeft":"wordRight":n.metaKey&&(n.key==="ArrowLeft"||n.key==="ArrowRight")?a=n.key==="ArrowLeft"?"lineStart":"lineEnd":o&&(n.key==="ArrowUp"||n.key==="ArrowDown")&&(a=n.key==="ArrowUp"?"documentStart":"documentEnd"),e.navigate(a,n.shiftKey),n.preventDefault();return}if(n.key==="PageUp"||n.key==="PageDown"){e.navigate(o?n.key==="PageUp"?"documentStart":"documentEnd":n.key==="PageUp"?"pageUp":"pageDown",n.shiftKey),n.preventDefault();return}if(n.key==="Backspace"){o||n.altKey?e.deleteWordBackward():e.deleteBackward(),n.preventDefault();return}if(n.key==="Delete"){o||n.altKey?e.deleteWordForward():e.deleteForward(),n.preventDefault();return}if(n.key==="Tab"){if(e.contentControls.formFill()&&e.contentControls.navigate(n.shiftKey?"previous":"next")){n.preventDefault();return}let a=n.shiftKey?"decrease":"increase";e.isListParagraph()?e.adjustIndent(a):e.indentWithTab(a)||(n.shiftKey?e.adjustIndent("decrease"):e.insertTab()),n.preventDefault();return}if(n.key==="Enter"){o?e.insertPageBreak():n.shiftKey?e.insertLineBreak():e.exitListOnEmptyItem()||e.splitParagraph(),n.preventDefault();return}if(o&&n.key.toLowerCase()==="a"){e.selectAll(),n.preventDefault();return}if(o&&n.shiftKey&&n.key.toLowerCase()==="v"){e.armForcePlainPaste();return}if(o&&!n.shiftKey&&n.key.toLowerCase()==="k"&&t.onRequestHyperlink){t.onRequestHyperlink(),n.preventDefault();return}if(o&&!n.shiftKey&&kP[n.key.toLowerCase()]){let a=kP[n.key.toLowerCase()];e.toggleRunProperty(a.localName,a.attributes),n.preventDefault();return}if(o&&(n.key==="="||n.key==="+"||n.code==="Equal")){e.toggleRunProperty("vertAlign",{val:n.shiftKey?"superscript":"subscript"}),n.preventDefault();return}if(o&&n.shiftKey&&n.key.toLowerCase()==="m"){e.adjustIndent("decrease"),n.preventDefault();return}if(o&&!n.shiftKey&&n.key.toLowerCase()==="m"){e.adjustIndent("increase"),n.preventDefault();return}if(o&&!n.shiftKey&&SP[n.key.toLowerCase()]){if(n.metaKey&&n.key.toLowerCase()==="r")return;e.setParagraphProperties([{localName:"jc",attributes:{val:SP[n.key.toLowerCase()]},physicalAlignment:true}]),n.preventDefault();return}if(o&&!n.shiftKey&&IP[n.key]){e.setParagraphProperty("spacing",{line:IP[n.key],lineRule:"auto"},{mergeAttributes:true}),n.preventDefault();return}if(o&&n.key.toLowerCase()==="y"){e.redo(),n.preventDefault();return}(n.metaKey||n.ctrlKey)&&n.key.toLowerCase()==="z"&&(n.shiftKey?e.redo():e.undo(),n.preventDefault());}}function CP(e){let t=i=>{let a=e.copyFlavours();return a.reason?(i.preventDefault(),false):!a.text||!i.clipboardData?false:(i.clipboardData?.setData("text/plain",a.text),a.html&&i.clipboardData?.setData("text/html",a.html),true)};return {onCopy:i=>{t(i)&&i.preventDefault();},onCut:i=>{t(i)&&(e.deleteSelection(),i.preventDefault());},onPaste:i=>{let a=up(i.clipboardData),s=i.clipboardData?.getData("text/html")??"";i.preventDefault(),!(!a&&!s)&&e.pasteRich(a,s.length>0?s:null);}}}function RP(e){let t=up(e.dataTransfer);return t.length>0?t:null}function EP(e,t){return n=>{if(n.preventDefault(),!t.isComposing()){if(n.inputType==="insertText"&&n.data!=null){e.enqueueType(n.data);return}if(n.inputType!=="insertFromPaste"){if(n.inputType==="insertReplacementText"){let r=n.data??RP(n);if(!r)return;O2(e,C2(n),r),t.onBrowserSelectionFixup?.();return}if(n.inputType==="deleteContentBackward"){e.deleteBackward();return}if(n.inputType==="deleteWordBackward"){e.deleteWordBackward();return}if(n.inputType==="deleteContentForward"){e.deleteForward();return}if(n.inputType==="deleteWordForward"){e.deleteWordForward();return}if(n.inputType==="insertLineBreak"){e.insertLineBreak();return}if(n.inputType==="insertFromDrop"||n.inputType==="insertFromPasteAsQuotation"){let r=RP(n);r&&t.insertPlainText(r);return}n.inputType==="insertParagraph"&&e.splitParagraph();}}}}function T2(e){let{startContainer:t,endContainer:n}=e;if(t===n&&t.nodeType===Node.TEXT_NODE)return (t.textContent??"").slice(e.startOffset,e.endOffset);let r=t.ownerDocument;if(!r)return null;try{let o=r.createRange();return o.setStart(t,e.startOffset),o.setEnd(n,e.endOffset),o.toString()}catch{return null}}function C2(e){if(typeof e.getTargetRanges!="function")return null;let t=e.getTargetRanges();if(t.length!==1)return null;let n=t[0],r=T2(n);return r?{text:r,paragraphId:E2(n)}:null}function E2(e){let t=e.startContainer;return t.isConnected?(t.nodeType===Node.ELEMENT_NODE?t:t.parentElement??null)?.closest("[data-paragraph-id]")?.getAttribute("data-paragraph-id")??null:null}function O2(e,t,n){if(t!==null){e.flushPendingInput();let r=e.state(),o=r.selection.head,i=t.text;if(Mt(r.selection,Ke(o))&&o.offset>=i.length&&(t.paragraphId===null||t.paragraphId===o.paragraphId)&&r.pendingFormat===null){let a=Me(e.session,o.paragraphId)??e.session.part(),s=chunkOSFOJTHU_cjs.Vi(a,o.paragraphId);s!==null&&s.slice(o.offset-i.length,o.offset)===i&&e.setSelection({anchor:{paragraphId:o.paragraphId,offset:o.offset-i.length},head:o});}}e.type(n);}function OP(e,t,n,r=null){for(let o of dc(e)){let i=wP(o,t,n,r);if(i!==null)return i}return null}function MP(e,t,n){if(n===t)return null;let r=0;for(;r<n.length&&r<t.length&&n[r]===t[r];)r+=1;let o=0;for(;o<n.length-r&&o<t.length-r&&n[n.length-1-o]===t[t.length-1-o];)o+=1;let i=n.slice(r,n.length-o),a=[];return t.length-o>r&&a.push({op:"deleteText",paragraphId:e,start:r,end:t.length-o}),i.length>0&&a.push({op:"insertText",paragraphId:e,offset:r,text:i}),a.length===0?null:{ops:a,caret:r+i.length}}var M2="equation replacement and removal are not supported in suggesting mode",AP=new WeakMap;function Xm(e,t){let n=chunkOSFOJTHU_cjs.Ta(e,t);if(!n||n.kind!=="paragraph")return [];let r=AP.get(n);if(r)return r;let o=[];for(let a of chunkOSFOJTHU_cjs.hg(n))for(let s of chunkOSFOJTHU_cjs.Ze(a.node)){let l=chunkOSFOJTHU_cjs.Te(s);l&&o.push(Object.freeze({id:s.id,paragraphId:t,start:a.start,end:a.end,linear:chunkOSFOJTHU_cjs.Ve(l.expression),fallbackText:l.fallbackText,supported:kn(l.expression)}));}let i=Object.freeze(o);return AP.set(n,i),i}function FP(e,t,n){let r=Xm(e,t).filter(o=>o.start===n);return r.length===0?null:r.map(o=>o.linear||o.fallbackText).join(" ")}function kn(e){switch(e.kind){case "fallback":return false;case "text":return true;case "row":return e.items.every(kn);case "fraction":return kn(e.numerator)&&kn(e.denominator);case "radical":return kn(e.radicand)&&(e.degree===void 0||kn(e.degree));case "script":return kn(e.base)&&(e.subscript===void 0||kn(e.subscript))&&(e.superscript===void 0||kn(e.superscript));case "nary":return kn(e.body)&&(e.lowerLimit===void 0||kn(e.lowerLimit))&&(e.upperLimit===void 0||kn(e.upperLimit))}}function LP(e,t){return e.find(n=>n.paragraphId===t.paragraphId&&t.offset>=n.start&&t.offset<=n.end)??null}function NP(e){let t=null,n=a=>{let s=e.pagesLayer.ownerDocument.defaultView;if(!s||!(a instanceof s.Element))return null;let l=a.closest("[data-docx-equation]");return l&&e.pagesLayer.contains(l)?l:null},r=(a,s)=>{let l=e.equationById(a);l&&(e.pagesLayer.contentEditable!=="false"&&e.setSelection({anchor:{paragraphId:l.paragraphId,offset:l.start},head:{paragraphId:l.paragraphId,offset:l.end}}),e.onPopover?.({equation:l,rect:s}));},o=a=>{t=null;let s=n(a.target),l=s?.dataset.docxEquation;if(!s||!l)return;let d=s.getBoundingClientRect();t={equationId:l,rect:{left:d.left,top:d.top,right:d.right,bottom:d.bottom}};},i=a=>{let s=n(a.target),l=s?.dataset.docxEquation,d=t;if(t=null,!s||!l){if(!d)return;a.preventDefault(),r(d.equationId,d.rect);return}let c=s.getBoundingClientRect();a.preventDefault(),r(l,{left:c.left,top:c.top,right:c.right,bottom:c.bottom});};return e.pagesLayer.addEventListener("pointerdown",o,true),e.pagesLayer.addEventListener("click",i),{destroy:()=>{e.pagesLayer.removeEventListener("pointerdown",o,true),e.pagesLayer.removeEventListener("click",i);}}}function DP(e){let t=()=>e.session.partFor(e.storyScope()),n=l=>{let d=t();return d?Xm(d,l):[]},r=()=>{let l=e.selection().head;return LP(n(l.paragraphId),l)},o=l=>{let d=n(e.selection().head.paragraphId).find(c=>c.id===l);if(d)return d;for(let c of e.session.storyParts()){let u=chunkOSFOJTHU_cjs.Ta(c,l);if(!u||u.kind!=="generic"||u.namespaceUri!==chunkOSFOJTHU_cjs.Re||u.localName!=="oMath")continue;let p=u;for(;p&&p.kind!=="paragraph";)p=chunkOSFOJTHU_cjs.Ua(c,p.id);return !p||p.kind!=="paragraph"?null:Xm(c,p.id).find(m=>m.id===l)??null}return null},i=(l,d)=>{let c=false,u={paragraphId:l.paragraphId,offset:l.start};return e.commit(()=>{let p=e.session.applyTreeOps([d],e.selectionMark(),{paragraphId:u.paragraphId,start:u.offset,end:u.offset},e.storyScope());return c=p.committed,p},()=>({anchor:u,head:u})),c},a=(l,d)=>{let c=o(l);if(!c)return {ok:false,code:"notFound",reason:"no equation with that id"};if(e.editingMode()==="suggest")return {ok:false,code:"unsupported",reason:M2};let u=d==="replace"?{op:"setMathEquation",equationId:l,linear:c.linear}:{op:"removeMathEquation",equationId:l},p=e.writeRefusal(u);return p===null?{ok:true}:{ok:false,code:"locked",reason:p}},s=l=>(e.commit(()=>({committed:false,rejected:true,opCount:0,reason:l.reason})),false);return {equationsInCaretParagraph:()=>[...n(e.selection().head.paragraphId)],equationAtCaret:r,equationById:o,can:a,applyEquation(l,d){let c=o(l);if(!c)return false;let u=a(l,"replace");return u.ok?c.supported&&c.linear===d?true:i(c,{op:"setMathEquation",equationId:l,linear:d}):s(u)},removeEquation(l){let d=o(l);if(!d)return false;let c=a(l,"remove");return c.ok?i(d,{op:"removeMathEquation",equationId:l}):s(c)}}}function HP(e,t){for(let[n,r]of t){let o=chunkOSFOJTHU_cjs.Ta(e,n);if(o&&o.kind!=="textValue"&&o.kind==="paragraph"&&r&&r.end>r.start){let i=chunkOSFOJTHU_cjs.jg(o),a=[...o.children];for(;a.length;){let s=a.pop();if(s.kind!=="textValue"){if(chunkT6K2QYNZ_cjs.G(s)){let l=i.spanOf(s);if(l?l.end>r.start&&l.start<r.end:r.start===0&&r.end===1/0)return true}for(let l of s.children)a.push(l);}}}}return false}function uc(e){let t=chunkOSFOJTHU_cjs.Ce(e);if(!t.ok)return false;for(let n of t.package.parts.values())if(chunkT6K2QYNZ_cjs.H([n.root]))return true;return false}function Ve(e){return e.kind!=="textValue"}function pe(e,t){if(!e||e.kind==="textValue")return null;for(let n of e.children)if(Ve(n)&&n.localName===t&&n.namespaceUri===chunkOSFOJTHU_cjs.la)return n;return null}function tt(e,t="val"){return e?chunkOSFOJTHU_cjs.Yf(e,t,chunkOSFOJTHU_cjs.la):void 0}function Rn(e,t,n){return e?chunkOSFOJTHU_cjs.Yf(e,t,n):void 0}function Ym(e){if(e.kind==="textValue")return e.value;let t="";for(let n of e.children)t+=Ym(n);return t}function Yi(e,t,n){if(e.kind==="textValue")return null;if(e.localName===t&&e.namespaceUri===n)return e;for(let r of e.children){let o=Yi(r,t,n);if(o)return o}return null}function lo(e){if(e===void 0||!/^-?\d+$/.test(e))return null;let t=Number(e);return Number.isSafeInteger(t)?t:null}function nn(e){return chunkOSFOJTHU_cjs.nd(e)}function Qm(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}var lr=Qm;function fc(e){return e===void 0||e.toLowerCase()==="auto"?null:/^[0-9A-Fa-f]{6}$/.test(e)?`#${e.toLowerCase()}`:null}function Zn(e){return `${Math.round(e/20*100)/100}pt`}var A2="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",F2=chunkDOHF6FA7_cjs.Ib;function Fs(e,t,n){for(let o of chunkOSFOJTHU_cjs.He(e,e.mainDocumentPart)){if(o.type!==t||o.targetMode==="External")continue;let i=chunkOSFOJTHU_cjs.B(o.ownerPart,o.rawTarget);if(i.ok){let a=e.parts.get(i.partName);if(a&&Ve(a.root))return a.root}}let r=e.parts.get(n);return r&&Ve(r.root)?r.root:null}function _P(e){let t=Fs(e,A2,"/word/styles.xml"),n=new Map,r=null,o=null,i=null,a=null,s=null;if(!t)return {byId:n,docDefaultsRPr:r,docDefaultsPPr:o,defaultParagraphStyleId:i,defaultCharacterStyleId:a,defaultTableStyleId:s};let l=0,d=null;for(let c of t.children){if(!Ve(c)||c.namespaceUri!==chunkOSFOJTHU_cjs.la)continue;if(c.localName==="docDefaults"){d=c,r=pe(pe(c,"rPrDefault"),"rPr"),o=pe(pe(c,"pPrDefault"),"pPr");continue}if(c.localName!=="style")continue;if(l>=chunkDOHF6FA7_cjs.gd)break;l+=1;let u=chunkOSFOJTHU_cjs.Yf(c,"styleId",chunkOSFOJTHU_cjs.la);if(!u)continue;n.set(u,c);let p=chunkOSFOJTHU_cjs.Yf(c,"default",chunkOSFOJTHU_cjs.la),m=chunkOSFOJTHU_cjs.Yf(c,"type",chunkOSFOJTHU_cjs.la);p==="1"||p==="true"||p==="on"?m==="paragraph"?i=u:m==="character"?a=u:m==="table"&&(s=u):(i===u&&(i=null),a===u&&(a=null),s===u&&(s=null));}if(t.namespaceUri===chunkOSFOJTHU_cjs.la){let c=chunkT6K2QYNZ_cjs.K(d);c.run&&(r=chunkT6K2QYNZ_cjs.M("rPr","application")),c.paragraph&&(o=chunkT6K2QYNZ_cjs.M("pPr","application"));}return {byId:n,docDefaultsRPr:r,docDefaultsPPr:o,defaultParagraphStyleId:i,defaultCharacterStyleId:a,defaultTableStyleId:s}}function Hr(e,t,n){let r=[],o=new Set,i=t;for(;i&&!o.has(i)&&r.length<F2;){o.add(i);let a=e.byId.get(i);if(!a)break;if(r.length===0&&n!==void 0){let s=chunkOSFOJTHU_cjs.Yf(a,"type",chunkOSFOJTHU_cjs.la);if(s!==void 0&&s!==n)return []}r.unshift(a),i=tt(pe(a,"basedOn"));}return r}function Jm(e,t,n){let r=[];if(e.docDefaultsPPr&&r.push(e.docDefaultsPPr),n)for(let i of n)r.push(i);let o=tt(pe(t,"pStyle"));for(let i of Hr(e,o??e.defaultParagraphStyleId??void 0,"paragraph")){let a=pe(i,"pPr");a&&r.push(a);}return t&&r.push(t),r}function pc(e,t,n,r){let o=[];e.docDefaultsRPr&&o.push(e.docDefaultsRPr);let i=[];if(r)for(let u of r)i.push(u);let a=[],s=tt(pe(t,"pStyle"));for(let u of Hr(e,s??e.defaultParagraphStyleId??void 0,"paragraph")){let p=pe(u,"rPr");p&&a.push(p);}let l=[],d=tt(pe(n,"rStyle"))??e.defaultCharacterStyleId??void 0;for(let u of Hr(e,d,"character")){let p=pe(u,"rPr");p&&l.push(p);}let c=[...o,...i,...a,...l];return n&&c.push(n),{all:c,defaults:o,tableLevel:i,paragraphLevel:a,characterLevel:l,direct:n}}function Pn(e,t){let n=null;for(let r of e){let o=pe(r,t);o&&(n=o);}return n}function St(e,t,n){let r;for(let o of e){let i=pe(o,t);if(!i)continue;let a=chunkOSFOJTHU_cjs.Yf(i,n,chunkOSFOJTHU_cjs.la);a!==void 0&&(r=a);}return r}function mc(e){return !(e==="0"||e==="false"||e==="off")}function dr(e,t){let n=false;for(let r of e){let o=pe(r,t);o&&(n=mc(tt(o)));}return n}function co(e,t){let n;for(let r of e){let o=pe(r,t);o&&(n=mc(tt(o)));}return n}function zn(e,t){let n=e.direct?pe(e.direct,t):null;if(n)return mc(tt(n));let r=co(e.tableLevel,t),o=co(e.paragraphLevel,t),i=co(e.characterLevel,t);return i===false||i===void 0&&o===false||i===void 0&&o===void 0&&r===false?false:co(e.defaults,t)===true?true:r===true!=(o===true)!=(i===true)}function eg(e,t){let n=e.direct?pe(e.direct,t):null;if(n)return mc(tt(n));let r=co(e.characterLevel,t);if(r!==void 0)return r;let o=co(e.paragraphLevel,t);if(o!==void 0)return o;let i=co(e.tableLevel,t);return i!==void 0?i:co(e.defaults,t)===true}function BP(e){return e.isLgl?"decimal":e.numFmt}function $P(e){let t=chunkDOHF6FA7_cjs.lc(e),n=new Map,r=new Map,o=new Map,i=new Map,a=new Map,s=new Map;for(let[l,d]of t.abstractNums){d.numStyleLink!==void 0&&s.set(l,d.numStyleLink);let c=new Map,u=new Map;for(let[p,m]of d.levels)c.set(String(p),BP(m)),u.set(String(p),m.start);r.set(l,c),o.set(l,u);}for(let[l,d]of t.nums){n.set(l,d.abstractNumId);for(let[c,u]of d.overrides){let p=`${l}:${c}`,m=u.startOverride??u.level?.start;m!==void 0&&i.set(p,m),u.level!==void 0&&a.set(p,BP(u.level));}}return {numToAbstract:n,levelFormats:r,levelStarts:o,startOverrides:i,formatOverrides:a,styleLinks:s}}function qP(e,t){return e===null?null:chunkOSFOJTHU_cjs.nd(chunkOSFOJTHU_cjs.Yf(e,t,chunkOSFOJTHU_cjs.la))}function VP(e,t){if(e===null)return null;let n=chunkOSFOJTHU_cjs.Yf(e,t,chunkOSFOJTHU_cjs.la);return n!==void 0&&/^[0-9A-Fa-f]{6}$/.test(n)?`#${n.toLowerCase()}`:null}function KP(e){return `${Math.round(e/20*100)/100}pt`}var L2=["wholeTable","firstRow","lastRow","firstCol","lastCol","band1Horz","band2Horz","band1Vert","band2Vert","nwCell","neCell","swCell","seCell"];function Qi(e,t,n){if(e===null)return null;let r=chunkOSFOJTHU_cjs.Yf(e,t,chunkOSFOJTHU_cjs.la);if(r!==void 0)return !(r==="0"||r==="false"||r==="off");let o=chunkOSFOJTHU_cjs.Yf(e,"val",chunkOSFOJTHU_cjs.la);return o===void 0||!/^[0-9A-Fa-f]{1,4}$/.test(o)?null:(Number.parseInt(o,16)&n)!==0}function tg(e,t){let n=new Map,r=new Set(L2);for(let o of e)for(let i of o.children){if(i.kind==="textValue"||i.localName!=="tblStylePr"||i.namespaceUri!==chunkOSFOJTHU_cjs.la)continue;let a=chunkOSFOJTHU_cjs.Yf(i,"type",chunkOSFOJTHU_cjs.la);a===void 0||!r.has(a)||n.set(a,{fill:VP(pe(pe(i,"tcPr"),"shd"),"fill"),rPr:pe(i,"rPr"),pPr:pe(i,"pPr")});}return {byType:n,firstRowEnabled:Qi(t,"firstRow",32)??false,lastRowEnabled:Qi(t,"lastRow",64)??false,firstColumnEnabled:Qi(t,"firstColumn",128)??false,lastColumnEnabled:Qi(t,"lastColumn",256)??false,hBandingEnabled:!(Qi(t,"noHBand",512)??false),vBandingEnabled:!(Qi(t,"noVBand",1024)??false)}}function ng(e,t,n,r,o,i){let a=e.firstRowEnabled&&t===0,s=e.lastRowEnabled&&t===n-1,l=e.firstColumnEnabled&&r,d=e.lastColumnEnabled&&o,c=u=>e.byType.get(u)??null;if(s&&l&&c("swCell"))return c("swCell");if(s&&d&&c("seCell"))return c("seCell");if(a&&l&&c("nwCell"))return c("nwCell");if(a&&d&&c("neCell"))return c("neCell");if(s&&c("lastRow"))return c("lastRow");if(a&&c("firstRow"))return c("firstRow");if(d&&c("lastCol"))return c("lastCol");if(l&&c("firstCol"))return c("firstCol");if(e.hBandingEnabled){let u=t-(e.firstRowEnabled?1:0);if(u>=0){let p=c(u%2===0?"band1Horz":"band2Horz");if(p)return p}}if(e.vBandingEnabled){let u=i-(e.firstColumnEnabled?1:0);if(u>=0){let p=c(u%2===0?"band1Vert":"band2Vert");if(p)return p}}return null}function jP(e,t,n,r,o,i,a,s,l=false,d=[]){let c=[],u=pe(e,"tcBorders"),p={top:n===0?"top":"insideH",bottom:n+o>=r?"bottom":"insideH",left:i?"left":"insideV",right:a?"right":"insideV"};for(let I of ["top","left","bottom","right"]){let R=I==="left"?"start":I==="right"?"end":I,T=pe(u,I)??pe(u,R),P=p[I],O=P==="left"?"start":P==="right"?"end":P,v=T!==null?Do(T):Do(pe(t,P)??pe(t,O));v&&c.push(`border-${Kn(I,l)}:${v}`);}let m=VP(pe(e,"shd"),"fill")??s;m&&c.push(`background-color:${m}`);let g=pe(e,"vAlign"),b=g===null?void 0:chunkOSFOJTHU_cjs.Yf(g,"val",chunkOSFOJTHU_cjs.la);b==="center"?c.push("vertical-align:middle"):(b==="bottom"||b==="top")&&c.push(`vertical-align:${b}`);let h=pe(e,"tcW"),y=qP(h,"w"),S=h===null?void 0:chunkOSFOJTHU_cjs.Yf(h,"type",chunkOSFOJTHU_cjs.la);y!==null&&y>0&&(S===void 0||S==="dxa")&&c.push(`width:${KP(y)}`);let x=pe(e,"tcMar");for(let I of ["top","right","bottom","left"]){let R=I==="left"?"start":I==="right"?"end":I,T=pe(x,I)??pe(x,R)??d.map(v=>pe(v,I)??pe(v,R)).find(v=>v!==null)??null,P=qP(T,"w"),O=T===null?void 0:chunkOSFOJTHU_cjs.Yf(T,"type",chunkOSFOJTHU_cjs.la);P!==null&&P>=0&&(O===void 0||O==="dxa")&&c.push(`padding-${Kn(I,l)}:${KP(P)}`);}return c.join(";")}function N2(e){return e.kind==="tableCell"?true:e.localName==="tc"&&e.namespaceUri===chunkOSFOJTHU_cjs.la}function WP(e){return e.localName==="customXml"&&e.namespaceUri===chunkOSFOJTHU_cjs.la}function ZP(e){let t=[],n=[],r=o=>{for(let i of o)if(Ve(i)){if(i.kind==="tableRow"||i.localName==="tr"&&i.namespaceUri===chunkOSFOJTHU_cjs.la){n.push({row:t.length}),t.push(i);continue}if(i.kind==="contentControl"){let a=i.children.find(s=>s.kind==="contentControlContent");a&&Ve(a)&&r(a.children);continue}if(WP(i)){r(i.children);continue}n.push({skip:i});}};return r(e.children),{rows:t,tableItems:n}}function zP(e){let t=[],n=[],r=new Set;for(let o of e){let i=new Set,a=[],s=[],l=0,d=c=>{for(let u of c)if(Ve(u)){if(N2(u)){let p=pe(u,"tcPr"),m=Math.min(Math.max(lo(tt(pe(p,"gridSpan")))??1,1),63),g=pe(p,"vMerge"),b=g===null?null:tt(g)==="restart"?"restart":"continue",h=b==="continue"&&!r.has(l)?"restart":b;b!==null&&i.add(l);let y={cell:u,startColumn:l,span:m,vMerge:h};a.push(y),s.push({placement:y}),l+=m;continue}if(u.kind==="contentControl"){let p=u.children.find(m=>m.kind==="contentControlContent");p&&Ve(p)&&d(p.children);continue}if(WP(u)){d(u.children);continue}s.push({skip:u});}};d(o.children),r=i,t.push(a),n.push(s);}return {placements:t,items:n}}function UP(e){let t=1;for(let n of e)for(let r of n)t=Math.max(t,r.startColumn+r.span);return t}function GP(e,t,n,r){let o=new Map,i=t.byType.get("wholeTable")??null;for(let a=0;a<n.length;a+=1)for(let s of n[a]??[]){if(s.vMerge==="continue")continue;let l=ng(t,a,n.length,s.startColumn===0,s.startColumn+s.span>=r,s.startColumn),d=[],c=[];i?.rPr&&d.push(i.rPr),i?.pPr&&c.push(i.pPr),l?.rPr&&d.push(l.rPr),l?.pPr&&c.push(l.pPr),o.set(s.cell,d.length>0||c.length>0?{...e,tableRPr:d,tablePPr:c}:e);}return o}function XP(e,t){let n=Hr(e.styles,tt(pe(t,"tblStyle")),"table");return n.length>0?n:Hr(e.styles,e.styles.defaultTableStyleId??void 0,"table")}function YP(e,t){let n=t.children.find(l=>l.kind==="tableProperties"),r=n&&Ve(n)?n:null,o=XP(e,r),i=tg(o,pe(r,"tblLook")),{rows:a}=ZP(t),{placements:s}=zP(a);return GP(e,i,s,UP(s))}function QP(e,t,n,r){let o=t.children.find(v=>v.kind==="tableProperties"),i=o&&Ve(o)?o:null,a=null,s=XP(e,i);for(let v of s){let C=pe(pe(v,"tblPr"),"tblBorders");C&&(a=C);}let l=s.map(v=>pe(v,"tblPr")).filter(v=>v!==null);i&&l.push(i);let d=dr(l,"bidiVisual"),c=[],u;for(let v of l){let C=pe(v,"tblCellMar");C&&c.unshift(C),u=tt(pe(v,"jc"))??u;}let p=pe(i,"tblBorders");p&&(a=p);let m=tg(s,pe(i,"tblLook")),{rows:g,tableItems:b}=ZP(t),{placements:h,items:y}=zP(g),S=UP(h),x=GP(e,m,h,S),I=["border-collapse:collapse"],R=pe(i,"tblW"),T=nn(Rn(R,"w",chunkOSFOJTHU_cjs.la));T!==null&&T>0&&Rn(R,"type",chunkOSFOJTHU_cjs.la)==="dxa"&&I.push(`width:${Zn(T)}`);let P=Kn(u==="right"||u==="end"?"right":u==="center"?"center":"left",d);P==="center"?I.push("margin-left:auto","margin-right:auto"):P==="right"?I.push("margin-left:auto","margin-right:0"):I.push("margin-left:0","margin-right:auto");for(let[v,C]of [["insideH","insideh"],["insideV","insidev"]]){let L=Do(pe(a,v));L&&I.push(`mso-border-${C}-alt:${L}`);}let O=`<table dir="${d?"rtl":"ltr"}" align="${P}" style="${I.join(";")}">`;for(let v of b){if("skip"in v){r.advanceFieldState(v.skip,n);continue}let C=v.row,L=pe(pe(g[C]??null,"trPr"),"trHeight"),A=nn(Rn(L,"val",chunkOSFOJTHU_cjs.la)),q=yx(A,Rn(L,"hRule",chunkOSFOJTHU_cjs.la)),K=q===""?"":` style="${q}"`;O+=`<tr${K}>`;for(let E of y[C]??[]){if("skip"in E){r.advanceFieldState(E.skip,n);continue}let _=E.placement;if(_.vMerge==="continue"){r.advanceFieldState(_.cell,n);continue}let X=1;if(_.vMerge==="restart")for(let B=C+1;B<h.length&&h[B].find(G=>G.startColumn===_.startColumn&&G.vMerge==="continue");B+=1)X+=1;let z=pe(_.cell,"tcPr"),oe=_.startColumn+_.span>=S,j=ng(m,C,h.length,_.startColumn===0,oe,_.startColumn),me=m.byType.get("wholeTable")??null,U=jP(z,a,C,h.length,X,_.startColumn===0,oe,j?.fill??me?.fill??null,d,c),F=(_.span>1?` colspan="${_.span}"`:"")+(X>1?` rowspan="${X}"`:"")+(U===""?"":` style="${lr(U)}"`),N=x.get(_.cell)??e;O+=`<td dir="ltr"${F}>${r.renderBlocks(N,_.cell.children,n)}</td>`;}O+="</tr>";}return `${O}</table>`}function gc(e){if(e===void 0||!/^\d{1,10}$/.test(e))return null;let t=Number.parseInt(e,10);return t>=1&&t<=2147483647?t:null}function rg(e){let t=chunkOSFOJTHU_cjs.Yf(e,"type",chunkOSFOJTHU_cjs.la);return t==="separator"||t==="continuationSeparator"}function og(e,t){let n=new Set;if(e===null)return n;for(let r of e.children){if(!Ve(r)||r.namespaceUri!==chunkOSFOJTHU_cjs.la||r.localName!==t||rg(r))continue;let o=gc(chunkOSFOJTHU_cjs.Yf(r,"id",chunkOSFOJTHU_cjs.la));o!==null&&n.add(o);}return n}function Ls(e,t,n,r,o,i,a){for(let s of t.children)if(Ve(s)&&s.kind!=="drawing"){if(s.kind==="revisionDelete"||s.kind==="revisionMoveFrom"){r.inert||o(s,r);continue}if(s.kind==="table"){Ls(e,s,n,r,o,i,YP(e,s));continue}if(s.kind==="tableCell"||s.namespaceUri===chunkOSFOJTHU_cjs.la&&s.localName==="tc"){let l=a?.get(s);if(l===void 0){r.inert||o(s,r);continue}Ls(l,s,n,r,o,i,a);continue}if(s.kind==="paragraph"){let l=s.children.find(d=>d.kind==="paragraphProperties");Ls(e,s,n,r,o,l&&Ve(l)?l:null,a);continue}if(s.kind==="run"){if(s.children.some(c=>c.kind==="fldChar")){r.inert||o(s,r);continue}if(s.children.some(c=>c.kind==="instrText")||!r.inert&&r.stack.some(c=>c==="instr"))continue;let l=s.children.find(c=>c.kind==="runProperties"),d=pc(e.styles,i,l&&Ve(l)?l:null,e.tableRPr);if(zn(d,"vanish"))continue}if(s.namespaceUri===chunkOSFOJTHU_cjs.la&&(s.localName==="footnoteReference"||s.localName==="endnoteReference")){let l=gc(chunkOSFOJTHU_cjs.Yf(s,"id",chunkOSFOJTHU_cjs.la));l!==null&&n.push({kind:s.localName==="footnoteReference"?"footnote":"endnote",id:l});continue}Ls(e,s,n,r,o,i,a);}}function D2(e,t,n){if(e===null)return null;for(let r of e.children)if(!(!Ve(r)||r.namespaceUri!==chunkOSFOJTHU_cjs.la)&&!(r.localName!==t||rg(r))&&gc(chunkOSFOJTHU_cjs.Yf(r,"id",chunkOSFOJTHU_cjs.la))===n)return r;return null}function JP(e,t,n){let r={footnote:new Set(e.noteOrdinals.footnote.keys()),endnote:new Set(e.noteOrdinals.endnote.keys())},o=[];for(let i of ["footnote","endnote"])for(let a of r[i])o.push({kind:i,id:a});for(;o.length>0;){let i=o.pop(),a=D2(t[i.kind],i.kind,i.id);if(a===null)continue;let s={stack:[],inert:false};n(a,s);let l={stack:[],inert:s.stack.length>0},d=[];Ls(e,a,d,l,n,null);for(let c of d)e.availableNotes[c.kind].has(c.id)&&(r[c.kind].has(c.id)||(r[c.kind].add(c.id),o.push(c)));}return r}function ig(e,t,n,r,o){if(n===null)return "";let i=`/word/${t}s.xml`;for(let[l,d]of e.pkg.parts)d.root===n&&(i=l);let a=chunkOSFOJTHU_cjs.He(e.pkg,i),s="";for(let l of n.children){if(!Ve(l)||l.namespaceUri!==chunkOSFOJTHU_cjs.la||l.localName!==t||rg(l))continue;let d=chunkOSFOJTHU_cjs.Yf(l,"id",chunkOSFOJTHU_cjs.la),c=gc(d);if(d===void 0||c===null||!r.has(c))continue;let u=o({...e,noteBody:{kind:t,id:c},docRels:a},l.children);s+=`<div style="mso-element:${t}" id="${t==="footnote"?"ftn":"edn"}${c}">${u===""?"<p></p>":u}</div>`;}return s===""?"":`<div style="mso-element:${t}-list">${s}</div>`}function eT(e){if(!e)return null;let t=[];for(let n of e.children){if(!Ve(n)||n.localName!=="tab")continue;let r=tt(n),o=nn(chunkOSFOJTHU_cjs.Yf(n,"pos",chunkOSFOJTHU_cjs.la));if(o===null||o<0||r!=="left"&&r!=="center"&&r!=="right"&&r!=="decimal"&&r!=="bar")continue;let i=tt(n,"leader"),a=i==="dot"?"dotted":i==="hyphen"?"dashed":i==="underscore"?"lined":i==="middleDot"?"middledot":i==="heavy"?"heavy":"";t.push(`${r}${a?` ${a}`:""} ${Zn(o)}`);}return t.length>0?`tab-stops:${t.join(" ")}`:null}var ag="http://schemas.openxmlformats.org/officeDocument/2006/relationships",H2=`${ag}/numbering`,_2=`${ag}/footnotes`,B2=`${ag}/endnotes`,$2=2*1024*1024,q2=8*1024*1024,tT=9525,K2=new Map([["image/png","image/png"],["image/jpeg","image/jpeg"],["image/jpg","image/jpeg"],["image/gif","image/gif"],["image/bmp","image/bmp"],["image/x-ms-bmp","image/bmp"],["image/x-bmp","image/bmp"],["image/webp","image/webp"],["image/svg+xml","image/svg+xml"],["image/tiff","image/tiff"],["image/x-emf","image/x-emf"],["image/x-wmf","image/x-wmf"]]);function hc(e,t,n,r){let o=e.direct!==null&&pe(e.direct,r)!==null||Pn(e.defaults,r)!==null||Pn(e.tableLevel,r)!==null||Pn(e.paragraphLevel,r)!==null||Pn(e.characterLevel,r)!==null;return zn(e,t&&o?r:n)}function V2(e){let t=e.all;if(zn(e,"vanish"))return {css:"",vanish:true,vertAlign:null,lang:null,rtl:false};let n=[],r=dr(t,"rtl"),o=(r?St(t,"rFonts","cs"):void 0)??St(t,"rFonts","ascii")??St(t,"rFonts","hAnsi")??St(t,"rFonts","eastAsia")??(r?void 0:St(t,"rFonts","cs"));if(o!==void 0){let I=mx(o);I&&n.push(`font-family:${I}`);}let i=lo((r?St(t,"szCs","val"):void 0)??St(t,"sz","val")??(r?void 0:St(t,"szCs","val")));i!==null&&i>0&&n.push(`font-size:${Math.round(i/2*100)/100}pt`);let a={...e,direct:null},s=e.direct?t.slice(0,-1):t;hc(e,r,"b","bCs")?n.push("font-weight:bold"):hc(a,r,"b","bCs")&&n.push("font-weight:normal"),hc(e,r,"i","iCs")?n.push("font-style:italic"):hc(a,r,"i","iCs")&&n.push("font-style:normal");let l=[],d=Pn(t,"u"),c=d!==null&&tt(d)!=="none";c&&l.push("underline");let u=eg(e,"dstrike");if((zn(e,"strike")||u)&&l.push("line-through"),l.length>0)n.push(`text-decoration:${l.join(" ")}`);else {let I=Pn(s,"u");(I!==null&&tt(I)!=="none"||zn(a,"strike")||eg(a,"dstrike"))&&n.push("text-decoration:none");}c&&n.push(...hx(d)),u&&!c&&n.push("text-decoration-style:double");let p=fc(St(t,"color","val"));p&&n.push(`color:${p}`);let m=nn(St(t,"spacing","val"));m!==null&&n.push(`letter-spacing:${Math.round(m/20*100)/100}pt`);let g=tt(Pn(t,"highlight")),b=g!==void 0&&Object.hasOwn($f,g)?$f[g]:void 0,h=fc(St(t,"shd","fill"));b?n.push(`background-color:${b}`,`mso-highlight:${g}`):h&&n.push(`background-color:${h}`),zn(e,"caps")?n.push("text-transform:uppercase"):zn(a,"caps")&&n.push("text-transform:none"),zn(e,"smallCaps")?n.push("font-variant:small-caps"):zn(a,"smallCaps")&&n.push("font-variant:normal");let y=tt(Pn(t,"vertAlign")),S=y==="superscript"||y==="subscript"?y:null,x=No((r?St(t,"lang","bidi"):void 0)??St(t,"lang","val")??St(t,"lang","bidi")??St(t,"lang","eastAsia"));return {css:n.join(";"),vanish:false,vertAlign:S,lang:x,rtl:r}}function j2(e,t,n=false){let r=[],o=tt(Pn(e,"jc")),i=o!==void 0&&Object.hasOwn(qf,o)?qf[o]:void 0;i&&r.push(`text-align:${n&&i!=="center"&&i!=="justify"?i==="left"?"right":"left":i}`);let a=nn(St(e,"spacing","before"));a!==null&&a>=0&&r.push(`margin-top:${Zn(a)}`);let s=nn(St(e,"spacing","after"));s!==null&&s>=0&&r.push(`margin-bottom:${Zn(s)}`);let l=nn(St(e,"spacing","line")),d=St(e,"spacing","lineRule");r.push(...gx(l,d));let c=null,u=null,p=null,m=null;for(let y of e){let S=pe(y,"ind");if(!S)continue;let x=nn(Rn(S,"left",chunkOSFOJTHU_cjs.la)??Rn(S,"start",chunkOSFOJTHU_cjs.la));x!==null&&(c=x);let I=nn(Rn(S,"right",chunkOSFOJTHU_cjs.la)??Rn(S,"end",chunkOSFOJTHU_cjs.la));I!==null&&(u=I);let R=nn(Rn(S,"hanging",chunkOSFOJTHU_cjs.la)),T=nn(Rn(S,"firstLine",chunkOSFOJTHU_cjs.la));R!==null?(p=R,m=null):T!==null&&(m=T,p=null);}!t&&c!==null&&r.push(`margin-${n?"right":"left"}:${Zn(c)}`),u!==null&&r.push(`margin-${n?"left":"right"}:${Zn(u)}`),p!==null&&p!==0?r.push(`text-indent:${Zn(-p)}`):m!==null&&m!==0&&r.push(`text-indent:${Zn(m)}`);let g=eT(Pn(e,"tabs"));g&&r.push(g),dr(e,"pageBreakBefore")&&r.push("page-break-before:always"),dr(e,"keepNext")&&r.push("page-break-after:avoid"),dr(e,"keepLines")&&r.push("page-break-inside:avoid"),dr(e,"widowControl")&&r.push("widows:2","orphans:2");let b=fc(St(e,"shd","fill"));b&&r.push(`background-color:${b}`);let h=Pn(e,"pBdr");if(h)for(let y of ["top","left","bottom","right"]){let S=Do(pe(h,y));S&&r.push(`border-${y}:${S}`,`mso-border-${y}-alt:${S}`);}return r.join(";")}function W2(e,t,n){let r=e.noteOrdinals[t],o=r.get(n);if(o!==void 0)return o;let i=r.size+1;return r.set(n,i),i}var nT={decimal:"decimal",decimalZero:"decimal-leading-zero",lowerLetter:"lower-alpha",upperLetter:"upper-alpha",lowerRoman:"lower-roman",upperRoman:"upper-roman",none:"none"};function oT(e,t,n,r){let o=e.numbering.formatOverrides.get(`${t}:${r}`)??e.numbering.levelFormats.get(n)?.get(String(r))??"decimal",i=e.numbering.startOverrides.get(`${t}:${r}`)??e.numbering.levelStarts.get(n)?.get(String(r))??1;return {fmt:o,start:i}}function Z2(e,t){let n,r;for(let s of t){let l=pe(s,"numPr");if(!l)continue;let d=tt(pe(l,"numId"));d!==void 0&&(n=d);let c=tt(pe(l,"ilvl"));c!==void 0&&(r=c);}if(n===void 0||n==="0")return null;let o=e.numbering.numToAbstract.get(n);if(o===void 0)return null;for(let s=0;s<8&&!((e.numbering.levelFormats.get(o)?.size??0)>0);s+=1){let l=e.numbering.styleLinks.get(o),d=l===void 0?void 0:e.styles.byId.get(l),c=tt(pe(pe(pe(d??null,"pPr"),"numPr"),"numId")),u=c===void 0?void 0:e.numbering.numToAbstract.get(c);if(u===void 0||u===o)break;o=u;}let i=Math.min(Math.max(lo(r)??0,0),8),a=oT(e,n,o,i);return {numId:n,abstractId:o,level:i,fmt:a.fmt,start:a.start}}function z2(e,t){let n=chunkOSFOJTHU_cjs.G(e.pkg.contentTypes,t);if(n.ok){let i=K2.get(n.contentType.toLowerCase());if(i!==void 0)return i}let r=t.lastIndexOf("."),o=r===-1?"":t.slice(r+1).toLowerCase();return o==="png"?"image/png":o==="jpg"||o==="jpeg"?"image/jpeg":o==="gif"?"image/gif":o==="bmp"?"image/bmp":o==="webp"?"image/webp":o==="svg"?"image/svg+xml":o==="tif"||o==="tiff"?"image/tiff":o==="emf"?"image/x-emf":o==="wmf"?"image/x-wmf":null}function U2(e,t){let n=Yi(t,"inline",chunkOSFOJTHU_cjs.sa)??Yi(t,"anchor",chunkOSFOJTHU_cjs.sa);if(!n)return "";let r=Yi(n,"blip",chunkOSFOJTHU_cjs.ra);if(!r)return "";let o=chunkOSFOJTHU_cjs.Yf(r,"embed",chunkOSFOJTHU_cjs.ua);if(!o)return "";let i=e.docRels.find(b=>b.id===o&&b.targetMode!=="External");if(!i)return "";let a=chunkOSFOJTHU_cjs.B(i.ownerPart,i.rawTarget);if(!a.ok)return "";let s=e.pkg.partBytes.get(a.partName.replace(/^\//,""))??e.pkg.partBytes.get(a.partName);if(!s)return "";let l=z2(e,a.partName);if(!l||s.byteLength>e.maxImageBytes||e.imageBudget.used+s.byteLength>e.maxTotalImageBytes)return "";e.imageBudget.used+=s.byteLength;let d=e.imageDataUris.get(a.partName);d==null&&(d=`data:${l};base64,${ad(s)}`,e.imageDataUris.set(a.partName,d));let c=Yi(n,"extent",chunkOSFOJTHU_cjs.sa),u=c?lo(chunkOSFOJTHU_cjs.Yf(c,"cx","")):null,p=c?lo(chunkOSFOJTHU_cjs.Yf(c,"cy","")):null,m=b=>Math.round(b/12700*100)/100,g=u!==null&&p!==null&&u>0&&p>0?` width="${Math.round(u/tT)}" height="${Math.round(p/tT)}" style="width:${m(u)}pt;height:${m(p)}pt"`:"";return `<img src="${d}"${g}>`}function ei(e,t,n=0){if(n>=chunkOSFOJTHU_cjs.wa)return;let r=chunkOSFOJTHU_cjs.vf(e)?n+1:chunkOSFOJTHU_cjs.xa(e,n);for(let o of e.children)if(Ve(o)&&o.kind!=="drawing"){if(o.kind==="contentControl"){let i=o.children.find(a=>a.kind==="contentControlContent");i&&Ve(i)&&ei(i,t,r+1);continue}if(o.kind==="fldChar"){iT(o,t);continue}ei(o,t,r);}}function iT(e,t){let n=chunkOSFOJTHU_cjs.Yf(e,"fldCharType",chunkOSFOJTHU_cjs.la);n==="begin"?t.stack.push("instr"):n==="separate"&&t.stack.length>0?t.stack[t.stack.length-1]="result":n==="end"&&t.stack.pop();}function G2(e,t,n,r){let o=t.children.find(d=>d.kind==="runProperties"),i=pc(e.styles,n,o&&Ve(o)?o:null,e.tableRPr),a=V2(i),s="";for(let d of t.children){if(!Ve(d))continue;if(d.kind==="fldChar"){r.inert||iT(d,r);continue}if(d.kind==="instrText"||!r.inert&&r.stack.some(p=>p==="instr")||a.vanish)continue;let c=vx(d);if(c!==""){s+=c;continue}let u=bx(d,e.noteBody,(p,m)=>W2(e,p,m),(p,m)=>e.availableNotes[p].has(m));if(u!==""){s+=u;continue}switch(d.kind){case "text":s+=Qm(Ym(d));break;case "tab":s+='<span style="white-space:pre;mso-tab-count:1"> </span>';break;case "hardBreak":{let p=chunkOSFOJTHU_cjs.Yf(d,"type",chunkOSFOJTHU_cjs.la);s+=p==="page"?'<br style="page-break-before:always">':"<br>";break}case "bookmarkStart":{let p=qn(chunkOSFOJTHU_cjs.Yf(d,"name",chunkOSFOJTHU_cjs.la));p!==null&&(s+=`<a id="${lr(p)}"></a>`);break}case "drawing":s+=U2(e,d);break;default:s+=chunkDOHF6FA7_cjs.jb(d)?.text??"";break}}if(s==="")return "";a.vertAlign==="superscript"?s=`<sup>${s}</sup>`:a.vertAlign==="subscript"&&(s=`<sub>${s}</sub>`);let l=`${a.lang===null?"":` lang="${a.lang}"`}${a.rtl?' dir="rtl"':""}${a.css===""?"":` style="${lr(a.css)}"`}`;return l===""?s:`<span${l}>${s}</span>`}function Jo(e,t,n,r,o=0){if(o>=chunkOSFOJTHU_cjs.wa)return "";let i="";for(let a of t)if(Ve(a))switch(chunkOSFOJTHU_cjs.vf(a)?"fldSimple":a.kind){case "run":i+=G2(e,a,n,r);break;case "hyperlink":{let s=Jo(e,a.children,n,r,o+1);if(s==="")break;let l=chunkOSFOJTHU_cjs.Yf(a,"id",chunkOSFOJTHU_cjs.ua),d=l?e.docRels.find(p=>p.id===l):void 0,c=d===void 0?void 0:d.targetMode==="External"||d.rawTarget.startsWith("#")?d.rawTarget:void 0,u=qx(c,chunkOSFOJTHU_cjs.Yf(a,"anchor",chunkOSFOJTHU_cjs.la));i+=u!==null?`<a href="${lr(u)}">${s}</a>`:s;break}case "bookmarkStart":{let s=qn(chunkOSFOJTHU_cjs.Yf(a,"name",chunkOSFOJTHU_cjs.la));s!==null&&(i+=`<a id="${lr(s)}"></a>`);break}case "fldSimple":i+=Jo(e,a.children,n,r,o+1);break;case "contentControl":{let s=a.children.find(l=>l.kind==="contentControlContent");s&&Ve(s)&&(i+=Jo(e,s.children,n,r,o+1));break}case "revisionInsert":case "revisionMoveTo":i+=Jo(e,a.children,n,r,o+1);break;case "revisionDelete":case "revisionMoveFrom":ei(a,r,o);break;case "generic":if(chunkOSFOJTHU_cjs.Ye(a))i+=ax(a);else if(chunkOSFOJTHU_cjs.ya(a))i+=Jo(e,a.children,n,r,o+1);else {let s=chunkOSFOJTHU_cjs.Wc(a);s&&(i+=Jo(e,s,n,r,o+1));}break}return i}function X2(e,t){let n=tt(pe(t,"pStyle")),r=Hr(e.styles,n,"paragraph");for(let o=r.length-1;o>=0;o-=1){let i=chunkOSFOJTHU_cjs.Yf(r[o],"styleId",chunkOSFOJTHU_cjs.la),a=i?/^Heading([1-6])$/.exec(i):null;if(a)return {level:Number(a[1]),fromStyle:true}}if(n===void 0){let o=lo(tt(pe(t,"outlineLvl")));if(o!==null&&o>=0&&o<=5)return {level:o+1,fromStyle:false}}return null}function Y2(e,t){let n=Hr(e.styles,tt(pe(t,"pStyle")),"paragraph");for(let r=n.length-1;r>=0;r-=1){let o=px(chunkOSFOJTHU_cjs.Yf(n[r],"styleId",chunkOSFOJTHU_cjs.la));if(o!==null)return o}return null}function rT(e,t,n,r){let o=t.children.find(h=>h.kind==="paragraphProperties"),i=o&&Ve(o)?o:null,a=Jm(e.styles,i,e.tablePPr),s=j2(a,n.asListItem,dr(a,"bidi")),l=Jo(e,t.children,i,r),d=s===""?"":` style="${lr(s)}"`,c=dr(a,"bidi")?' dir="rtl"':"",u=Y2(e,i),p=u===null?"":` class="${u}"`,m=X2(e,i);if(n.asListItem)return `<li${m?.fromStyle===true?` class="Heading${m.level}"`:p}${c}${d}>${l}</li>`;let g=m===null?"p":`h${m.level}`,b=m===null?p:m.fromStyle?` class="Heading${m.level}"`:' class="docx-outline"';return `<${g}${b}${c}${d}>${l}</${g}>`}var Q2={renderBlocks:(e,t,n)=>yc(e,t,n),advanceFieldState:ei};function yc(e,t,n){let r="",o=[],i=null,a=new Map,s=n;if(s===void 0){let p={stack:[]};for(let m of t)Ve(m)&&ei(m,p);s={stack:[],inert:p.stack.length>0};}let l=()=>{let p=o.pop();p&&(r+=`</${p.tag}>`);},d=()=>{for(;o.length>0;)l();i=null;},c=(p,m)=>{for(i!==null&&m.level<i&&d();o.length>0&&o[o.length-1].abstractId!==m.abstractId;)l();o.length===0&&(i=m.level);let g=i??m.level,b=m.level-g+1;for(;o.length>b;)l();for(o.length===b&&o[b-1].numId!==m.numId&&l();o.length<b;){let S=g+o.length,x=oT(e,m.numId,m.abstractId,S),I=a.get(`${m.abstractId}:${m.numId}:${S}`)??0,R=x.start+I,T=x.fmt==="bullet"?"ul":"ol",P=T==="ol"?Object.hasOwn(nT,x.fmt)?nT[x.fmt]:"decimal":null,O=T==="ol"&&R!==1?` start="${R}"`:"";r+=P?`<${T}${O} style="list-style-type:${lr(P)}">`:`<${T}>`,o.push({tag:T,numId:m.numId,abstractId:m.abstractId});}let h=`${m.abstractId}:${m.numId}:${m.level}`;a.set(h,(a.get(h)??0)+1);let y=`${m.abstractId}:`;for(let S of a.keys()){if(!S.startsWith(y))continue;let x=S.slice(S.lastIndexOf(":")+1);/^\d+$/.test(x)&&Number(x)>m.level&&a.delete(S);}r+=rT(e,p,{asListItem:true},s);},u=p=>{for(let m of p)if(Ve(m))switch(m.kind){case "paragraph":{let g=m.children.find(y=>y.kind==="paragraphProperties"),b=g&&Ve(g)?g:null,h=Z2(e,Jm(e.styles,b));h?c(m,h):(d(),r+=rT(e,m,{asListItem:false},s));break}case "table":d(),r+=QP(e,m,s,Q2);break;case "contentControl":{let g=m.children.find(b=>b.kind==="contentControlContent");g&&Ve(g)&&u(g.children);break}case "generic":u(m.children);break;case "bookmarkStart":{let g=qn(chunkOSFOJTHU_cjs.Yf(m,"name",chunkOSFOJTHU_cjs.la));g!==null&&(r+=`<a id="${lr(g)}"></a>`);break}default:s.inert||ei(m,s);break}};return u(t),d(),r}function aT(e,t){let n=e.parts.get(e.mainDocumentPart);if(!n||!Ve(n.root))return "";let r=n.root.children.find(d=>d.kind==="body");if(!r||!Ve(r))return "";let o=Fs(e,_2,"/word/footnotes.xml"),i=Fs(e,B2,"/word/endnotes.xml"),a={pkg:e,styles:_P(e),numbering:$P(Fs(e,H2,"/word/numbering.xml")),docRels:chunkOSFOJTHU_cjs.He(e,e.mainDocumentPart),maxImageBytes:$2,maxTotalImageBytes:q2,imageBudget:{used:0},imageDataUris:new Map,noteOrdinals:{footnote:new Map,endnote:new Map},availableNotes:{footnote:og(o,"footnote"),endnote:og(i,"endnote")},noteBody:null},s=yc(a,r.children),l=JP(a,{footnote:o,endnote:i},ei);return s+ig(a,"footnote",o,l.footnote,yc)+ig(a,"endnote",i,l.endnote,yc)}var J2=12*1024*1024;function eH(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function tH(e){return `<div><table>${e.split(`
|
|
25
|
+
`).map(n=>`<tr>${n.split(" ").map(r=>`<td>${eH(r)}</td>`).join("")}</tr>`).join("")}</table></div>`}function sg(e){if(e.cellRectangle)return {text:e.text,html:tH(e.text)};if(!e.coverage||!e.pkg)return {text:e.text,html:null};let t=chunkT6K2QYNZ_cjs.N(e.pkg,e.coverage);if(!t.ok)return {text:e.text,html:null,...t.reason==="unsupported-content"?{reason:t.reason}:{}};let n=e.maxFragmentBytes??J2,r=t.bytes;if(t.bytes.byteLength>n){let a=chunkT6K2QYNZ_cjs.N(e.pkg,e.coverage,{omitMedia:true});r=a.ok&&a.bytes.byteLength<=n?a.bytes:null;}let o;try{o=aT(t.package);}catch(a){console.error("docx-editor: copy HTML flavour failed to render",a),o="";}let i=fx(o,r?{bytes:r,lastMarkCovered:t.lastMarkCovered}:null);return {text:e.text,html:i}}function sT(e,t){let n=()=>t.text.length===0?"none":(e.insertPlainText(t.text),"plain");if(t.forcePlain)return n();let r=t.html;if(r===null||r.length===0)return n();let o=Fi(r);if(!e.richLaneOpen)return o&&uc(o.bytes)?"unsupported-content":n();if(o){let a=e.pasteFragment(o.bytes,o.lastMarkCovered);if(a==="unsupported-content")return "unsupported-content";if(a)return "fragment"}let i=$w(r);if(i.ok&&i.truncated&&t.text.length>0)return n();if(i.ok){let a=e.pasteFragment(i.fragmentBytes,i.lastMarkCovered);if(a==="unsupported-content")return "unsupported-content";if(a)return "external-html"}return n()}function lT(e,t){let n=chunkDOHF6FA7_cjs.pe(e,t);if(!n.includes("\xAD"))return n;let r=n.split("");for(let{line:o}of chunkDOHF6FA7_cjs.ud(e,t)??[])for(let i of chunkDOHF6FA7_cjs.Na(o,t)?.spans??[])chunkDOHF6FA7_cjs.dd(i)&&i.range.start<r.length&&(r[i.range.start]=chunkOSFOJTHU_cjs.cb);return r.join("")}function dT(e){return e.includes(chunkOSFOJTHU_cjs.cb)?e.replaceAll(chunkOSFOJTHU_cjs.cb,""):e}function cT(e,t,n,r,o){if(!o||t.paragraphId!==n.paragraphId||/[\r\n\t]/.test(r)||!chunkOSFOJTHU_cjs.pj(e.settingsRoot()))return r;let i=Me(e,t.paragraphId)??e.part();if(!chunkOSFOJTHU_cjs.qj(i,t.paragraphId))return r;let a=chunkOSFOJTHU_cjs.Ta(i,t.paragraphId);if(a?.kind!=="paragraph")return r;let s=chunkOSFOJTHU_cjs.hj(a).find(h=>h.fieldNodeId===o&&h.start<=t.offset&&h.end>=n.offset);if(!s?.enabled||!chunkOSFOJTHU_cjs.Si(s)||s.maxLength<=0)return r;let l=(chunkOSFOJTHU_cjs.Vi(i,t.paragraphId)??"").slice(s.start,s.end),d=l.slice(0,t.offset-s.start),c=l.slice(n.offset-s.start),u=d+c,p=h=>chunkOSFOJTHU_cjs.Ti(d+h+c,s,u)<=s.maxLength;if(p(r))return r;let m=[...r],g=s.maxLength-[...u].length;if(s.type==="number"&&s.format)for(let h of u)(h===","&&s.format.includes(",")||h==="%"&&s.format.endsWith("%"))&&g++;let b=new Set;if(s.type==="date"){let h=0;for(let y=0;y<m.length;y++)if(/\S/.test(m[y])){if(++h>18)break;b.add(y+1);}else (y+1===m.length||/\S/.test(m[y+1]))&&b.add(y+1);}else if(s.type==="number"&&s.format)for(let h=1;h<=3;h++)b.add(g+h);for(let h of [...b].sort((y,S)=>S-y)){if(h<=Math.max(0,g)||h>m.length)continue;let y=m.slice(0,h).join("");if(p(y))return y}return m.slice(0,Math.max(0,g)).join("")}var uT=dT,nH=2e3;function fT(e){let{session:t}=e,n=null;function r(s){let l=Zw(s),d=e.orderedRange(),c=cT(t,d.from,d.to,l,e.textFormFieldId?.()??null).split(`
|
|
26
|
+
`),u=e.deleteSelectionPlan(),p=u.replaceAt??u.collapseTo,m=c.join(""),g=[...u.ops],b=e.consumePendingFormatOps(p.paragraphId,p.offset,m.length);m.length>0&&(g.push({op:"insertText",paragraphId:p.paragraphId,offset:p.offset,text:m}),g.push(...b));let h=[],y=0;for(let T=0;T<c.length-1;T+=1)y+=c[T].length,h.push(p.offset+y);if(h.length>0&&g.push({op:"splitParagraphMany",paragraphId:p.paragraphId,offsets:h}),g.length===0)return;let S=new Set(e.paragraphIds?.()??t.paragraphIdsIn(e.storyScope())),x=c[c.length-1],I=h.length===0?e.caretMark({paragraphId:p.paragraphId,offset:p.offset+x.length}):void 0,R=g.filter(T=>!b.includes(T));e.commit(()=>e.withoutPendingOnRejection(g,R,e.selectionMark(),I),()=>{if(h.length===0)return Ke({paragraphId:p.paragraphId,offset:p.offset+x.length});let T=(e.paragraphIds?.()??t.paragraphIdsIn(e.storyScope())).filter(O=>!S.has(O)),P=T[T.length-1];return P?Ke({paragraphId:P,offset:x.length}):null});}function o(){e.flushPendingInputAndLayout();let s=e.cellSelection(),l=e.orderedRange(),d=e.paragraphOrder(),c=s?chunkD7ZMDMPX_cjs.ga(e.layout(),s.cellIds):d.slice(d.indexOf(l.from.paragraphId),d.indexOf(l.to.paragraphId)+1),u=new Map(c.map(P=>[P,{start:!s&&P===l.from.paragraphId?l.from.offset:0,end:!s&&P===l.to.paragraphId?l.to.offset:1/0}])),m=e.storyScope().kind==="body"?t.part():Me(t,c[0]??l.from.paragraphId);if(m&&HP(m,u))return e.commit(()=>({committed:false,rejected:true,opCount:0,reason:"unsupported-content"})),{text:"",html:null,reason:"unsupported-content"};let g=ks(e.layout(),lT);if(s)return sg({text:uT(chunkD7ZMDMPX_cjs.ja(e.layout(),s,g.spelledText)),cellRectangle:true,coverage:null,pkg:null});let{from:b,to:h}=e.orderedRange(),y=t.part(),S=uT(ym(e.layout(),b,h,e.paragraphOrder(),(P,O)=>g.resultAt(P,O)??(y?FP(y,P,O):null),g.markedText)),x=e.storyScope();if(b.paragraphId===h.paragraphId&&b.offset===h.offset||x.kind!=="body")return {text:S,html:null};let R=t.part(),T=ck(e.layout(),R,b,h,e.paragraphOrder());return sg({text:S,cellRectangle:false,coverage:T,pkg:t.currentPackage()})}function i(s,l){if(e.editingMode()!=="edit"||e.storyScope().kind!=="body"||e.cellSelection())return false;e.flushPendingInputAndLayout();let d=e.deleteSelectionPlan(),c=d.replaceAt??d.collapseTo,u=false,p=false;return e.commit(()=>{let m=e.collaborationGate(d.ops,{kind:"body"});if(m)return {committed:false,rejected:true,opCount:0,reason:m};let g=e.actorId(),b=t.applyFragmentPaste({kind:"body"},{paragraphId:c.paragraphId,offset:c.offset,fragmentBytes:s,lastMarkCovered:l,priorOps:d.ops,...g!==void 0?{actorId:g}:{}});return u=b.ok,p=!b.ok&&b.detail==="fragment-merge:unsupported-content",{committed:b.ok,rejected:!b.ok,opCount:b.ok?1:0,...b.ok?{}:{reason:b.detail??b.reason}}},()=>Ke(c)),p?"unsupported-content":u}function a(s,l){let d=n!==null&&e.now()-n<nH;n=null;let c=sT({richLaneOpen:(e.richPasteAllowed?.()??true)&&e.editingMode()==="edit"&&e.storyScope().kind==="body"&&e.cellSelection()===null,pasteFragment:(u,p)=>i(u,p),insertPlainText:r},{html:l,text:s,forcePlain:d});return c==="unsupported-content"?(e.commit(()=>({committed:false,rejected:true,opCount:0,reason:"unsupported-content"})),false):c!=="none"}return {insertPlainText:r,copyFlavoursNow:o,pasteRichNow:a,armForcePlainPaste:()=>{n=e.now();}}}function pT(e){let{session:t}=e;function n(){return Go(e.selection())}function r(){e.flushPendingInputAndLayout();let g=e.selection(),b=g.anchor.paragraphId===g.head.paragraphId?void 0:e.paragraphOrder();return $d(e.layout(),g,b)}function o(){return r().from}function i(g){return chunkDOHF6FA7_cjs.pe(e.layout(),g)}function a(g,b){let h=t.partFor(e.storyScope())??t.part(),y=chunkOSFOJTHU_cjs.Ta(h,g.paragraphId);if(!y||y.kind!=="paragraph")return null;let S=b==="before"?chunkOSFOJTHU_cjs.mg(y,g.offset):chunkOSFOJTHU_cjs.ng(y,g.offset);if(!S)return null;let x=chunkOSFOJTHU_cjs._f(h,S.controlId),I=x?chunkOSFOJTHU_cjs.Zb(x):null;return I&&(I.lock==="contentLocked"||I.lock==="sdtContentLocked"||I.type==="checkbox"||I.type==="picture")?S:null}function s(g){if(e.trackedAuthorOrNone()!==void 0||e.cellSelection())return false;let b=r();return b.from.paragraphId===b.to.paragraphId&&b.from.offset===b.to.offset?e.atParagraphEnd(g.paragraphId,g.offset):e.atParagraphEnd(b.to.paragraphId,b.to.offset)}function l(g){let b=g?.trim()||void 0,h=d(),y=e.cellSelection(),S=null;return {...h,get replaceAt(){return S??=p(h,b,y),S}}}function d(){e.flushPendingInputAndLayout();let g=e.cellSelection();if(g){let S=[];for(let x of chunkD7ZMDMPX_cjs.ga(e.layout(),g.cellIds)){let I=chunkDOHF6FA7_cjs.pe(e.layout(),x).length;I>0&&S.push({op:"deleteText",paragraphId:x,start:0,end:I});}return {ops:S,collapseTo:o()}}let b=e.selection();if(b.anchor.paragraphId===b.head.paragraphId&&b.anchor.offset===b.head.offset)return {ops:[],collapseTo:chunkDOHF6FA7_cjs.wd(e.layout(),b.head)};let{from:h,to:y}=r();return uk(e.layout(),t.partFor(e.storyScope())??t.part(),h,y,e.paragraphOrder(),e.revisionView())}function c(){return l().ops}function u(g,b,h){if(!(h!==void 0||e.editingMode()==="suggest")||g.paragraphId!==b.paragraphId||b.offset<=g.offset)return g.offset;let S=(h??e.author())?.trim();if(!S)return chunkDOHF6FA7_cjs.wd(e.layout(),b).offset;let x=Me(t,b.paragraphId)??t.part(),I=chunkOSFOJTHU_cjs.Ta(x,b.paragraphId);if(!I||I.kind!=="paragraph")return chunkDOHF6FA7_cjs.wd(e.layout(),b).offset;let R={start:g.offset,end:b.offset},{past:T,landing:P}=chunkOSFOJTHU_cjs.sh(I,R,b.offset,S,e.trackedDate()),O=chunkOSFOJTHU_cjs.qh(I,g.offset,T,S);return (T-g.offset>O?P:T)-O}function p(g,b,h){let y=g.collapseTo;if(b===void 0&&e.editingMode()!=="suggest")return y;if(h){for(let K of h.cellIds){let E=chunkD7ZMDMPX_cjs.fa(e.layout(),[K]),_=E.length>0?E:chunkD7ZMDMPX_cjs.ga(e.layout(),[K]);if(_.length===0)continue;let X=new Map,z=U=>{let F=X.get(U);return F===void 0&&(F=u({paragraphId:U,offset:0},{paragraphId:U,offset:i(U).length},b),X.set(U,F)),F},oe=(b??e.author())?.trim(),j=U=>{let F=i(U);if(!oe)return /\S/.test(F);let N=chunkOSFOJTHU_cjs.Ta(Me(t,U)??t.part(),U);if(!N||N.kind!=="paragraph")return /\S/.test(F);let B="",$=0;for(let G of chunkOSFOJTHU_cjs.rh(N,0,F.length,oe))B+=F.slice($,Math.max($,G.start)),$=Math.max($,G.end);return B+=F.slice($),/\S/.test(B)},me=null;for(let U=_.length-1;U>=0;U-=1){let F=_[U];if(j(F)){me=F;break}}if(me===null)for(let U=_.length-1;U>=0;U-=1){let F=_[U];if(z(F)!==0){me=F;break}}return me??=_[_.length-1],{paragraphId:me,offset:z(me)}}return y}let{from:S,to:x}=r();if(S.paragraphId===x.paragraphId&&S.offset===x.offset)return y;if(S.paragraphId===x.paragraphId)return {paragraphId:x.paragraphId,offset:u(S,x,b)};let I=new Set(g.ops.flatMap(K=>K.op==="deleteBlock"?[K.blockId]:[])),R=Me(t,x.paragraphId)??t.part();if(I.size>0)for(let K=chunkOSFOJTHU_cjs.Ua(R,x.paragraphId);K;K=chunkOSFOJTHU_cjs.Ua(R,K.id)){if(!I.has(K.id))continue;let E={paragraphId:y.paragraphId,offset:i(y.paragraphId).length};return {paragraphId:y.paragraphId,offset:u(y,E,b)}}let T=(b??e.author())?.trim();if(!T)return y;let P=new Set(g.ops.flatMap(K=>K.op==="joinParagraphs"?[K.secondId]:[])),O=e.paragraphOrder(),v=O.indexOf(S.paragraphId),C=O.indexOf(x.paragraphId);if(v===-1||C===-1)return y;let L=K=>{let E=chunkOSFOJTHU_cjs.Ta(R,K);return E?.kind==="paragraph"&&chunkOSFOJTHU_cjs.cl(E,T)},A=C;for(;A>v&&P.has(O[A])&&L(O[A-1]);)A-=1;let q=0;for(let K=A;K<=C;K+=1){let E=O[K],_={paragraphId:E,offset:E===S.paragraphId?S.offset:0},X=E===x.paragraphId?chunkDOHF6FA7_cjs.wd(e.layout(),x):{paragraphId:E,offset:i(E).length};K===A&&(q+=_.offset),q+=X.offset-_.offset-m(_,X,T);}return {paragraphId:O[A],offset:q}}function m(g,b,h){let y=h?.trim();if(!y||g.paragraphId!==b.paragraphId)return 0;let S=Me(t,b.paragraphId)??t.partFor(e.storyScope())??t.part(),x=chunkOSFOJTHU_cjs.Ta(S,b.paragraphId);return !x||x.kind!=="paragraph"?0:chunkOSFOJTHU_cjs.qh(x,g.offset,b.offset,y)}return {selectionMark:n,orderedRange:r,orderedStart:o,textOf:i,inlineControlBeside:a,splitEndsTheParagraph:s,deleteSelectionPlan:l,deleteSelectionOps:c,replacementOffset:u}}function dg(e,t,n,r){if(r===n)return e;let o=i=>i.paragraphId===t?{...i,offset:chunkUHHYFIDT_cjs.c(i.offset,n,r)}:i;return {anchor:o(e.anchor),head:o(e.head)}}var gT=[24,16,12,8,6,4],rH=8;function mT(e,t,n,r,o){let i=r.textOf(e.paragraphId)??"",a=n.after.slice(0,rH);if(a&&i.slice(e.offset,e.offset+a.length)===a)return e;let s=new Set;for(let l of [e.paragraphId,t.paragraphId]){let d=o.indexOf(l);if(!(d<0))for(let c of [d,d-1,d+1])o[c]&&s.add(o[c]);}for(let l of gT){if(n.before.length<l)continue;let d=n.before.slice(-l);if(i.slice(Math.max(0,e.offset-l),e.offset)===d)return e;let c=null;for(let u of s){let p=r.textOf(u)??"";for(let m=p.indexOf(d);m>=0;m=p.indexOf(d,m+1)){if(c)return e;c={...e,paragraphId:u,offset:m+d.length};}}if(c)return c}return e}var bc="stale",oH=16;function lg(e,t){return e.anchor.paragraphId===t.anchor.paragraphId&&e.anchor.offset===t.anchor.offset&&e.head.paragraphId===t.head.paragraphId&&e.head.offset===t.head.offset}function hT(e){let t=null,n=false,r=o=>{let i=new Set(e.order());return o.filter(a=>i.has(a)).slice(0,oH).map(a=>({id:a,text:e.textOf(a)??""}))};return {expectHistory(o){n=o;},note(o,i,a){let s=n;if(n=false,t!==null){s&&t!==bc&&t.history.length===0&&(t={...t,history:r(i)});return}if(!a){t=bc;return}let l=new Map;for(let c of [o.anchor.paragraphId,o.head.paragraphId]){let u=e.textOf(c);u!==null&&l.set(c,u);}let d=c=>{let u=l.get(c.paragraphId)??"",p=gT[0];return {before:u.slice(Math.max(0,c.offset-p),c.offset),after:u.slice(c.offset,c.offset+p)}};t={selection:o,before:l,order:e.order(),context:{anchor:d(o.anchor),head:d(o.head)},history:s?r(i):[]};},noteLocal(){t!==null&&(t=bc);},discard(){t=null;},map(o){let i=t;if(t=null,!i)return o;let a=e.carried?.()??null,s=x=>a&&lg(a.from,x)&&lg(o,x)&&e.textOf(a.to.anchor.paragraphId)!==null&&e.textOf(a.to.head.paragraphId)!==null?a.to:null;if(i===bc)return s(o)??o;let l=e.order(),d=new Set(l);for(let{id:x,text:I}of i.history){if(!d.has(x))continue;let R=e.textOf(x)??I;if(R===I)continue;let T=0;for(;T<I.length&&T<R.length&&I[T]===R[T];)T+=1;let P={paragraphId:x,offset:T+Math.max(0,R.length-I.length)};return {anchor:P,head:P}}let c=new Set(l),u=s(i.selection);if(u)return u;let p=new Set(i.order),m=x=>{let I=i.before.get(x.paragraphId),R=e.textOf(x.paragraphId);if(I===void 0||R===null||R.length>=I.length||!I.startsWith(R)||x.offset<=R.length)return null;let T=l[l.indexOf(x.paragraphId)+1];return T===void 0||p.has(T)||!(e.textOf(T)??"").startsWith(I.slice(R.length))?null:{paragraphId:T,offset:x.offset-R.length}},g=m(o.anchor),b=m(o.head),h=o;for(let[x,I]of i.before)c.has(x)&&(h=dg(h,x,I,e.textOf(x)??I));h={anchor:g??h.anchor,head:b??h.head};let y=x=>{if(c.has(x.paragraphId))return x;let I=i.order.indexOf(x.paragraphId),R=null;for(let O=I-1;O>=0&&R===null;O-=1)c.has(i.order[O])&&(R=i.order[O]);let T=i.before.get(x.paragraphId),P=R===null?"":e.textOf(R)??"";if(R!==null&&T!==void 0&&P.endsWith(T)){let O=P.length-T.length+x.offset;return {paragraphId:R,offset:O}}for(let O=I+1;I>=0&&O<i.order.length;O+=1){let v=i.order[O];if(c.has(v))return {paragraphId:v,offset:0}}return R===null?x:{paragraphId:R,offset:P.length}};return !(l.length!==i.order.length||l.some((x,I)=>x!==i.order[I]))||!lg(o,i.selection)?{anchor:y(h.anchor),head:y(h.head)}:{anchor:mT(y(h.anchor),o.anchor,i.context.anchor,e,l),head:mT(y(h.head),o.head,i.context.head,e,l)}}}}function yT(e,t){let n=e?.historySelection?.()??null;return n&&t?iH(n,t):null}function bT(e){let t=e?.remoteSelectionMove?.();if(!t)return null;let n=o=>({paragraphId:o.nodeId,offset:o.offset}),r=o=>({anchor:n(o.anchor),head:n(o.head)});return {from:r(t.from),to:r(t.to)}}function iH(e,t){let n=i=>{let a=t.paragraphByStableId(i.paragraphId);return a?{paragraphId:a.nodeId,offset:Math.min(i.offset,a.text.length)}:null},r=n(e.anchor),o=n(e.head);return r&&o?{anchor:r,head:o}:null}function vT(e){return {atParagraphEnd(t,n){let r=chunkOSFOJTHU_cjs.Vi(e.partOf(t),t);return r!==null&&n===r.length},followerStyleId(t){let n=e.partOf(t),r=e.styleCascade();if(!r)return;let i=chunkOSFOJTHU_cjs.Dh(n,t).find(l=>l.localName==="pStyle")?.attributes?.val??r.defaultParagraphStyleId;if(i==null)return;let a=r.styles.get(i)?.next;if(!a||a===i)return;let s=r.styles.get(a);if(!(!s||s.type!=="paragraph"))return a===r.defaultParagraphStyleId?null:a}}}var xT=chunkDOHF6FA7_cjs.Ke;function wT(e){let{session:t,...n}=e;return chunkDOHF6FA7_cjs.Ye({view:t,...n})}function Vt(e){return e.closest(".docx-editor__scroll-container")}function ST(e,t,n){let r=e.getBoundingClientRect(),o=t.getBoundingClientRect();return {top:(t.scrollTop!==0&&r.top===0&&o.top===0?t.scrollTop-e.offsetTop:o.top+t.clientTop-r.top)/n,height:t.clientHeight/n}}function IT(e,t,n){let r=Vt(e);if(!r||r.clientHeight<=0||t.pages.length===0||n<=0)return null;let o=ST(e,r,n),i=o.top+o.height/2;for(let a of t.pages)if(i<a.box.y+a.box.height)return a.index+1;return t.pages.length}function kT(e,t,n,r){let o=Vt(e);if(!o||o.clientHeight===0)return;let i=ST(e,o,r),a=[];for(let s of [n.anchor,n.head]){let l=chunkDOHF6FA7_cjs.ne(t,s);l&&a.push(l.pageIndex);}return chunkD7ZMDMPX_cjs.ca({layout:t,viewport:i,overscanPages:1,pinnedPages:a})}function cg(e,t){if(e===t)return true;if(!e||!t||e.size!==t.size)return false;for(let n of e)if(!t.has(n))return false;return true}function vc(e,t){let n=e.pages[e.pages.length-1],r=n?n.box.y+n.box.height:0,o=t?e.pages.filter(s=>t.has(s.index)):e.pages,i=0;for(let s of o)i=Math.max(i,s.box.x+s.box.width);let a=new Map;if(new Set(o.map(s=>s.box.width)).size>1)for(let s of e.pages)a.set(s.index,(i-s.box.width)/2-s.box.x);return {width:i,height:r,pageOffsetX:a}}function RT(e,t){if(e.width!==t.width||e.height!==t.height||e.pageOffsetX.size!==t.pageOffsetX.size)return false;for(let[n,r]of e.pageOffsetX)if(t.pageOffsetX.get(n)!==r)return false;return true}function TT(e){if(typeof e.defaultView?.createImageBitmap!="function")return null;let t=e.defaultView;return Object.freeze({async decode(n,r,o){let i=new Blob([new Uint8Array(n)],{type:r}),a;try{a=await t.createImageBitmap(i,{imageOrientation:"from-image"});}catch(s){if(s?.name!=="TypeError")throw s;a=await t.createImageBitmap(i);}try{let s=a.width,l=a.height;if(s<=0||l<=0)throw new Error("image dimensions invalid");if(s*l>o.maxPixels)throw new Error("image dimensions exceed limits");return Object.freeze({pixelWidth:s,pixelHeight:l,dpiX:96,dpiY:96})}finally{a.close();}},convertPreserved(n,r,o){return r==="image/tiff"?lH(e,n,o):aH(n,r)}})}async function aH(e,t,n){let{convertEmfToDataUrl:r,convertWmfToDataUrl:o}=await import('emf-converter'),i=new Uint8Array(e),a=i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength),s={maxWidth:4096,maxHeight:4096},l=t==="image/x-emf"?await r(a,s):await o(a,s);if(!l)return null;let d="data:image/png;base64,";if(!l.startsWith(d))return null;let c=atob(l.slice(d.length)),u=new Uint8Array(c.length);for(let p=0;p<c.length;p+=1)u[p]=c.charCodeAt(p);return Object.freeze({bytes:u,mime:"image/png"})}function PT(e,t){let n=e[t];if(!Array.isArray(n)||n.length===0)return null;let r=Number(n[0]);return Number.isSafeInteger(r)&&r>0?r:null}async function sH(e,t){let n=await import('utif2'),r=n.default??n,o=e.slice().buffer,i=r.decode(o)[0];if(!i)return null;let a=PT(i,"t256"),s=PT(i,"t257");if(a===null||s===null||a>t.maxDimension||s>t.maxDimension||a>t.maxPixels/s)return null;let l=a*s;if(l*4>t.maxDecodedBytes||(r.decodeImage(o,i),i.width!==a||i.height!==s))return null;let d=r.toRGBA8(i);return d.length!==l*4?null:Object.freeze({rgba:d,pixelWidth:a,pixelHeight:s})}async function lH(e,t,n){let r=await sH(t,n);if(r===null)return null;let o=await dH(e,r.rgba,r.pixelWidth,r.pixelHeight);return o===null?null:Object.freeze({bytes:o,mime:"image/png"})}async function dH(e,t,n,r){let o=e.createElement("canvas");if(o.width=n,o.height=r,o.width!==n||o.height!==r)return null;let i=o.getContext("2d");if(!i)return null;let a=i.createImageData(n,r);a.data.set(t),i.putImageData(a,0,0);let s=await new Promise(l=>{o.toBlob(d=>l(d),"image/png");});return s?new Uint8Array(await s.arrayBuffer()):null}function CT(){return Object.freeze({async decode(){throw new Error("Image decode unavailable in headless environment")}})}function ET(e){return typeof URL.createObjectURL!="function"||typeof URL.revokeObjectURL!="function"?null:Object.freeze({create(t,n){let r=e.mintValidatedBytes(t,t.contentId);if(!r)throw new Error(`PaintImageUrlSource: validated bytes unavailable for ${t.resourceKey}`);let o=new Uint8Array(r);return URL.createObjectURL(new Blob([o],{type:n}))},revoke(t){URL.revokeObjectURL(t);}})}var cH="docx-editor-one-surface__caret",ug="docx-editor-one-surface__caret--steady",uH=530;function OT(e,t,n){let r=e.ownerDocument,o=r.createElement("div");o.className=cH,o.dataset.docxCaret="",o.dataset.docxMarker="",o.setAttribute("contenteditable","false"),o.setAttribute("aria-hidden","true"),o.dataset.noColorInvert="",o.style.position="absolute",o.style.pointerEvents="none",o.style.userSelect="none",o.style.setProperty("-webkit-user-select","none");let i=false,a=null,s=null,l=null;function d(){let S=r.activeElement;return S===e||!!S&&e.contains(S)}function c(S){return S.anchor.paragraphId===S.head.paragraphId&&S.anchor.offset===S.head.offset}function u(){s=null,a!==null&&(clearTimeout(a),a=null),o.classList.remove(ug),o.remove(),e.style.removeProperty("caret-color"),l?.style.removeProperty("caret-color"),l=null;}function p(){o.classList.add(ug),a!==null&&clearTimeout(a),a=setTimeout(()=>{a=null,o.classList.remove(ug);},uH);}function m(){if(i||!d()||n().suppress){u();return}let{layout:S,selection:x,scopedHost:I,scopedHostKind:R,scopedOrigin:T,preferredPageIndex:P,preferredLineId:O,measurer:v,typingStyle:C}=n(),L=t();if(!c(x)){u();return}let A=chunkDOHF6FA7_cjs.ne(S,x.head,{...v?{measurer:v}:{},...P!==void 0?{preferredPageIndex:P}:{},...O!==void 0?{preferredLineId:O}:{}});if(!A||!Number.isInteger(A.pageIndex)){u();return}if(C&&v){let{pageIndex:X,lineId:z}=A,oe=chunkDOHF6FA7_cjs.ud(S,x.head.paragraphId)?.find(me=>me.pageIndex===X&&me.line.id===z),j=oe?.line;if(j&&!j.drawings?.length&&!chunkDOHF6FA7_cjs.Vd(A)&&(j.spans.length>0||j.box.height>0)){let me=C();if(me){let U={...Wd(S,x)??chunkDOHF6FA7_cjs.$,...me},F=v.lineMetrics(U);if(F.height>0){let N=chunkDOHF6FA7_cjs.Dd({...A,width:0,y:j.spans.length>0?j.box.y+j.baseline-F.baseline-chunkDOHF6FA7_cjs.ea(U):A.y,height:F.height},oe?.clipBox);if(!N){u();return}A=N;}}}}let q=I??e.querySelector(`[data-page-index="${A.pageIndex}"] > .docx-page-content`);if(!q){u();return}if(!(A.height>0)){u();return}o.style.left=`${(A.x-(T?.x??0))*L}px`,o.style.top=`${(A.y-(T?.y??0))*L}px`,o.style.height=`${A.height*L}px`;let K=chunkDOHF6FA7_cjs.Vd(A);o.style.transformOrigin=K?"0 0":"",o.style.transform=K?"rotate(-90deg)":"",o.parentNode!==q&&q.append(o),e.style.caretColor="transparent",l&&l!==I&&l.style.removeProperty("caret-color"),l=I??null,l?.style.setProperty("caret-color","transparent");let E=q===I?R??"scoped":"body",_=`${A.pageIndex}:${E}:${A.x}:${A.y}:${A.height}`;_!==s&&(s=_,p());}let g=()=>{i=true,m();},b=()=>{i=false,m();},h=()=>m(),y=S=>{let x=S.relatedTarget;x&&e.contains(x)||u();};return e.addEventListener("compositionstart",g),e.addEventListener("compositionend",b),e.addEventListener("focusin",h),e.addEventListener("focusout",y),{update:m,destroy(){e.removeEventListener("compositionstart",g),e.removeEventListener("compositionend",b),e.removeEventListener("focusin",h),e.removeEventListener("focusout",y),u();}}}function fg(e){let t=e.indexOf("#");return t===-1?"":e.slice(0,t)}function ti(e,t){let n=fg(t);return n.length===0?e.part():e.currentPackage().parts.get(n)??e.part()}function pg(e,t){return !e||e.kind==="tableBody"?null:fg(e.tableId)===fg(t)?e:null}function Ns(e,t,n){let r=a=>{for(let s of a)if(s.kind==="table"){if(s.tableId===t)return s;for(let l of s.rows)for(let d of l.cells){let c=r(d.blocks);if(c)return c}}return null},o=e.pages[n];if(!o)return null;let i=r(o.fragments);if(i)return {table:i,origin:o.contentBox};for(let a of [o.header,o.footer]){if(!a)continue;let s=r(a.fragments);if(s)return {table:s,origin:a.box}}return null}function mg(e,t){for(let n of e)if(n.kind==="table"){t(n);for(let r of n.rows)for(let o of r.cells)mg(o.blocks,t);}}function fH(e,t){for(let n of e.pages){let r=o=>{for(let i=0;i<o.rows.length;i+=1)t({table:o,row:o.rows[i],rowIndex:i});};mg(n.fragments,r);for(let o of [n.header,n.footer])o&&mg(o.fragments,r);}}function gg(e,t,n,r){let o=null;return fH(e,i=>{i.table.tableId===t&&i.row.id===n&&i.row.isHeaderRepeat===r&&(o=i);}),o}function hg(e,t){return {sourceRevision:e,tableId:t.table.tableId,rowId:t.row.id,isHeaderRepeat:t.row.isHeaderRepeat}}function MT(e,t,n){let r=n.gridColumnId;return r?{sourceRevision:e,tableId:t.table.tableId,gridColumnId:r,isHeaderRepeat:t.row.isHeaderRepeat}:null}function AT(e,t,n,r){return {sourceRevision:e,tableId:t.table.tableId,leftGridColumnId:n,rightGridColumnId:r,isHeaderRepeat:t.row.isHeaderRepeat}}function FT(e,t,n){return {sourceRevision:e,tableId:t.table.tableId,gridColumnId:n,isHeaderRepeat:t.row.isHeaderRepeat}}var mH=120,LT=20;function xc(e){return chunkOSFOJTHU_cjs.nd(chunkOSFOJTHU_cjs._i(e,"w"))??0}function gH(e,t,n){let r=e.pagesLayer.getBoundingClientRect(),o=e.scale();return {x:(t-r.left)/o,y:(n-r.top)/o}}function yg(e){let t=e.editingMode==="view";return {editable:!t,viewing:t}}function bg(e,t){return t.kind==="insertColumn"?gg(e,t.tableId,t.rowId,t.isHeaderRepeat):"rowId"in t?gg(e,t.tableId,t.rowId,t.isHeaderRepeat):null}function NT(e){return Math.min(160,e)}function DT(e){let t=e.furnitureLayer;t.className="docx-table-furniture",t.setAttribute("contenteditable","false"),t.style.position="absolute",t.style.left="0",t.style.top="0",t.style.pointerEvents="none";let n=null,r=null,o=null,i=null,a=null,s=null,l=false,d=0,c=0,u=null,p=null,m=null;function g(H){return H instanceof HTMLButtonElement&&(H.classList.contains("docx-table-insert-row")||H.classList.contains("docx-table-insert-column"))}function b(){let H=document.activeElement;return H!==null&&g(H)&&H.closest(".docx-table-furniture")===t?H:null}function h(H){for(let W of [...t.children])g(W)&&W!==H&&W.remove();}function y(){p=null,m=null;}function S(){n!==null&&(clearTimeout(n),n=null);}function x(){for(let W of [...t.children])g(W)||W.remove();let H=b();if(!H){h(null),y();return}p=H,h(H);}function I(H){let W=p??b(),Z=W!==null&&document.activeElement===W;y(),t.replaceChildren(),H&&Z&&e.pagesLayer.focus({preventScroll:true});}function R(){for(let H of [...t.children])g(H)||H.remove();}function T(H,W,Z,re){let ee=e.read().layout.pages[H];if(!ee)return {left:0,top:0};let se=re??ee.contentBox,fe=e.scale(),Ce=e.pageOffsetX(H);return {left:(se.x+W+Ce)*fe,top:(se.y+Z)*fe}}function P(H,W){let Z=e.read(),re=Ns(Z.layout,W.tableId,W.pageIndex);if(!re)return;let{table:ne,origin:ee}=re,se=document.createElement("div");se.className="docx-table-resize-preview",se.style.position="absolute",se.style.pointerEvents="none";let fe=W.kind!=="rowDivider",Ce=T(W.pageIndex,fe?ne.box.x+H:ne.box.x,fe?ne.box.y:ne.box.y+H,ee);se.style.left=`${Ce.left}px`,se.style.top=`${Ce.top}px`,se.style.width=fe?"2px":`${ne.box.width*e.scale()}px`,se.style.height=fe?`${ne.box.height*e.scale()}px`:"2px",t.append(se);}function O(){let H=document.createElement("button");return H.type="button",H.textContent="+",H.style.position="absolute",H.style.pointerEvents="auto",H}function v(H){q(H);let W=m;if(!W)return;let Z=e.read();W.kind==="insertRow"?E(W,Z):W.kind==="insertColumn"&&_(W,Z);}function C(){queueMicrotask(()=>{!p||document.activeElement===p||l||r?.kind==="insertRow"||r?.kind==="insertColumn"||(p.remove(),y());});}function L(){if(p&&t.contains(p))return p;let H=b();if(H)return p=H,H;let W=O();return W.addEventListener("pointerenter",()=>{l=true,S();}),W.addEventListener("pointerleave",()=>{l=false;}),W.addEventListener("pointerdown",q),W.addEventListener("mousedown",q),W.addEventListener("click",v),W.addEventListener("blur",C),p=W,W}function A(H,W){let Z=Ns(W.layout,H.tableId,H.pageIndex);if(!Z)return;let{table:re,origin:ne}=Z,ee=L();if(h(ee),m=H,ee.dataset.tableId=H.tableId,H.kind==="insertRow"){let se=re.rows.find(Ee=>Ee.id===H.rowId);if(!se)return;ee.dataset.rowId=H.rowId,delete ee.dataset.gridColumnId,ee.className="docx-table-insert-row",ee.setAttribute("aria-label",e.label("table.insertRowBelow"));let fe=se.box.y+se.box.height/2,Ce=T(H.pageIndex,re.box.x-14,fe,ne);ee.style.left=`${Ce.left}px`,ee.style.top=`${Ce.top-8}px`;}else {let se=re.rows[0]?.cells.find(at=>at.gridColumnId===H.gridColumnId);if(!se)return;ee.dataset.gridColumnId=H.gridColumnId,delete ee.dataset.rowId;let fe=re.columnEdges[se.gridColumn]??0,Ce=re.columnEdges[se.gridColumn+1]??re.box.width;ee.className="docx-table-insert-column",ee.setAttribute("aria-label",e.label("table.insertColumnRight"));let Ee=T(H.pageIndex,re.box.x+(fe+Ce)/2-8,re.box.y-14,ne);ee.style.left=`${Ee.left}px`,ee.style.top=`${Ee.top}px`;}t.contains(ee)||t.append(ee);}function q(H){H.preventDefault(),H.stopPropagation();}function K(H,W){if(R(),h(p??b()),!(s||W.editingMode==="view")){if((H.kind==="columnDivider"||H.kind==="rightEdge")&&!H.isHeaderRepeat){let Z=Ns(W.layout,H.tableId,H.pageIndex);if(!Z)return;let{table:re,origin:ne}=Z,ee=document.createElement("div");ee.className=H.kind==="rightEdge"?"docx-table-edge-handle-right layout-table-edge-handle-right":"docx-table-divider-handle layout-table-resize-handle",ee.style.position="absolute",ee.style.pointerEvents="auto",ee.style.cursor="col-resize",ee.dataset.active="true";let se=T(H.pageIndex,re.box.x+H.edgeX,re.box.y,ne);ee.style.left=`${se.left-3}px`,ee.style.top=`${se.top}px`,ee.style.width="6px",ee.style.height=`${re.box.height*e.scale()}px`,ee.addEventListener("pointerdown",X),t.append(ee);}if(H.kind==="rowDivider"&&!H.isHeaderRepeat){let Z=Ns(W.layout,H.tableId,H.pageIndex);if(!Z)return;let{table:re,origin:ne}=Z,ee=document.createElement("div");ee.className="docx-table-row-divider-handle layout-table-row-resize-handle",ee.style.position="absolute",ee.style.pointerEvents="auto",ee.style.cursor="row-resize",ee.dataset.active="true";let se=T(H.pageIndex,re.box.x,re.box.y+H.edgeY,ne);ee.style.left=`${se.left}px`,ee.style.top=`${se.top-3}px`,ee.style.width=`${re.box.width*e.scale()}px`,ee.style.height="6px",ee.addEventListener("pointerdown",X),t.append(ee);}H.kind==="insertRow"&&!H.isHeaderRepeat&&A(H,W),H.kind==="insertColumn"&&!H.isHeaderRepeat&&A(H,W);}}function E(H,W){let Z=bg(W.layout,H);if(!Z)return;let re=yg(W),ne=Nr({command:{type:"insertRow",where:"below",target:hg(H.sourceRevision,Z)},part:ti(e.session(),H.tableId),layout:W.layout,storeRevision:W.storeRevision,selection:W.selection,cellSelection:W.cellSelection,themeColors:W.themeColors,...re});e.applyTableCommandPlan(ne);}function _(H,W){let Z=bg(W.layout,H);if(!Z)return;let re=Z.row.cells.find(fe=>fe.gridColumnId===H.gridColumnId);if(!re)return;let ne=MT(H.sourceRevision,Z,re);if(!ne)return;let ee=yg(W),se=Nr({command:{type:"insertColumn",where:"right",target:ne},part:ti(e.session(),H.tableId),layout:W.layout,storeRevision:W.storeRevision,selection:W.selection,cellSelection:W.cellSelection,themeColors:W.themeColors,...ee});e.applyTableCommandPlan(se);}function X(H){if(H.button!==0)return;let W=e.read();if(W.editingMode==="view"||!r||r.kind!=="columnDivider"&&r.kind!=="rightEdge"&&r.kind!=="rowDivider")return;H.preventDefault(),H.stopPropagation();let Z=r,re=bg(W.layout,Z);if(!re)return;let ne=chunkOSFOJTHU_cjs.aj(ti(e.session(),Z.tableId).root,Z.tableId);if(!ne.ok||Z.kind!=="rowDivider"&&chunkOSFOJTHU_cjs.Ck(ne.topology)!==null)return;let ee=0,se=0,fe=0,Ce=ne.topology.gridColumns.reduce((ot,Ne)=>ot+xc(Ne),0),Ee;if(Z.kind==="columnDivider"){let ot=ne.topology.gridColumns.find(Te=>Te.id===Z.leftGridColumnId),Ne=ne.topology.gridColumns.find(Te=>Te.id===Z.rightGridColumnId);if(!ot||!Ne)return;ee=xc(ot),se=xc(Ne),Ee=AT(Z.sourceRevision,re,Z.leftGridColumnId,Z.rightGridColumnId);}else if(Z.kind==="rightEdge"){let ot=ne.topology.gridColumns.find(Ne=>Ne.id===Z.gridColumnId);if(!ot)return;ee=xc(ot),se=0,Ee=FT(Z.sourceRevision,re,Z.gridColumnId);}else fe=Math.max(20,Math.round(re.row.box.height*LT)),Ee=hg(Z.sourceRevision,re);let at=H.currentTarget;at.setPointerCapture(H.pointerId),d=H.clientX,c=H.clientY,s={pointerId:H.pointerId,startClientX:H.clientX,startClientY:H.clientY,startEdgePt:Z.kind==="rowDivider"?Z.edgeY:Z.edgeX,leftTwips:ee,rightTwips:se,tableWidthTwips:Ce,rowHeightTwips:fe,target:Z,ref:re,resizeTarget:Ee,captureElement:at,rightEdge:Z.kind==="rightEdge",vertical:Z.kind==="rowDivider",cancelled:false};for(let ot of [...t.children])ot!==at&&ot.remove();P(Z.kind==="rowDivider"?Z.edgeY:Z.edgeX,Z);}function z(){if(s){try{s.captureElement.hasPointerCapture(s.pointerId)&&s.captureElement.releasePointerCapture(s.pointerId);}catch{}s.cancelled=true,s=null,x(),r=null;}}function oe(){if(!s||s.cancelled){s=null,x();return}let H=s;s=null;try{H.captureElement.hasPointerCapture(H.pointerId)&&H.captureElement.releasePointerCapture(H.pointerId);}catch{}if(H.vertical?c===H.startClientY:d===H.startClientX){x();return}let W=e.read(),Z=yg(W),re=(H.vertical?c-H.startClientY:d-H.startClientX)/e.scale(),ne=Math.round(re*LT),ee;if(H.target.kind==="rowDivider")ee=LS({part:ti(e.session(),H.target.tableId),layout:W.layout,storeRevision:W.storeRevision,selection:W.selection,cellSelection:W.cellSelection,themeColors:W.themeColors,...Z},H.resizeTarget,Math.max(NT(H.rowHeightTwips),H.rowHeightTwips+ne));else if(H.rightEdge&&H.target.kind==="rightEdge"){let se=Math.max(300,H.leftTwips+ne),fe=Math.max(se,H.tableWidthTwips+ne);ee=Nr({command:{type:"commitTableRightEdgeResize",target:H.resizeTarget,columnWidthTwips:se,tableWidthTwips:fe},part:ti(e.session(),H.target.tableId),layout:W.layout,storeRevision:W.storeRevision,selection:W.selection,cellSelection:W.cellSelection,themeColors:W.themeColors,...Z});}else if(H.target.kind==="columnDivider"){let se=H.leftTwips+ne,fe=H.rightTwips-ne;se=Math.max(300,se),fe=Math.max(300,fe);let Ce=H.leftTwips+H.rightTwips;se+fe!==Ce&&(se>Ce-300?(se=Ce-300,fe=300):fe=Ce-se),ee=Nr({command:{type:"commitTableColumnDividerResize",target:H.resizeTarget,leftWidthTwips:se,rightWidthTwips:fe},part:ti(e.session(),H.target.tableId),layout:W.layout,storeRevision:W.storeRevision,selection:W.selection,cellSelection:W.cellSelection,themeColors:W.themeColors,...Z});}else {x();return}e.applyTableCommandPlan(ee),x();}function j(H){if(!u)return null;o??=chunkDOHF6FA7_cjs.Oe(H.layout);let W=e.pageOffsetX(u.pageIndex);return chunkDOHF6FA7_cjs.Se(o,u.x,u.y,H.layout,W,u.pageIndex)}function me(H){if(!r||s||H.editingMode==="view")return;S();let W=j(H),Z=pg(W,H.selection.head.paragraphId);if(!Z){r=null,x();return}if(chunkDOHF6FA7_cjs.Qe(Z)!==chunkDOHF6FA7_cjs.Qe(r)){r=null,x();return}r=Z,K(Z,H);}function U(){let H=p??b(),W=H!==null&&document.activeElement===H;y(),H&&t.contains(H)&&H.remove(),W&&e.pagesLayer.focus({preventScroll:true});}function F(H){if(s||H.editingMode==="view")return;let W=p??b();if(!W||!t.contains(W)){m&&y();return}if(p=W,!m||m.kind!=="insertRow"&&m.kind!=="insertColumn")return;o??=chunkDOHF6FA7_cjs.Oe(H.layout);let Z=chunkDOHF6FA7_cjs.Qe(m),re=chunkDOHF6FA7_cjs.Re(o,m);if(!re||chunkDOHF6FA7_cjs.Qe(re)!==Z){U();return}m=re,A(re,H);}function N(H){let W=e.read();if(s&&H.pointerId===s.pointerId){d=H.clientX,c=H.clientY;let fe=(s.vertical?H.clientY-s.startClientY:H.clientX-s.startClientX)/e.scale();s.target.kind==="rowDivider"&&(fe=Math.max(fe,(NT(s.rowHeightTwips)-s.rowHeightTwips)/20));for(let Ce of [...t.children])Ce!==s.captureElement&&Ce.remove();P(s.startEdgePt+fe,s.target);return}if(W.editingMode==="view"){I(false);return}if(H.target instanceof Node&&p?.contains(H.target)){S();return}let Z=gH(e,H.clientX,H.clientY),re=chunkDOHF6FA7_cjs.Xd(W.layout,Z.y);re>=0&&(u={x:Z.x,y:Z.y,pageIndex:re});let ne=re>=0?e.pageOffsetX(re):0;o??=chunkDOHF6FA7_cjs.Oe(W.layout);let ee=o?chunkDOHF6FA7_cjs.Se(o,Z.x,Z.y,W.layout,ne,re>=0?re:void 0):null,se=pg(ee,W.selection.head.paragraphId);if(!se){if(l)return;!n&&r&&(n=setTimeout(()=>{n=null,r=null,x();},mH));return}n&&(clearTimeout(n),n=null),!(r&&chunkDOHF6FA7_cjs.Pe(se)===chunkDOHF6FA7_cjs.Pe(r))&&(r=se,K(se,W));}function B(H){if(!(!s||H.pointerId!==s.pointerId)){if(e.read().editingMode==="view"){z();return}oe();}}function $(H){!s||H.pointerId!==s.pointerId||z();}function G(H){H.key!=="Escape"||!s||z();}return e.pagesLayer.addEventListener("pointermove",N),document.addEventListener("pointermove",N),document.addEventListener("pointerup",B),document.addEventListener("pointercancel",$),e.pagesLayer.addEventListener("keydown",G),{update(){let H=e.read(),W=i,Z=a;o=null,i=H.layout.revision,a=H.storeRevision,H.editingMode==="view"?(z(),r=null,S(),I(true)):W!==null&&(W!==H.layout.revision||Z!==H.storeRevision)&&(r!==null&&me(H),F(H)),t.style.width=e.pagesLayer.style.width,t.style.height=e.pagesLayer.style.height;},refreshLabels(){let H=e.read();if(H.editingMode==="view")return;let W=p??b();if(W&&t.contains(W)&&m&&(m.kind==="insertRow"||m.kind==="insertColumn")){A(m,H);return}r&&(r.kind==="insertRow"||r.kind==="insertColumn")&&A(r,H);},destroy(){S(),z(),y(),x(),e.pagesLayer.removeEventListener("pointermove",N),document.removeEventListener("pointermove",N),document.removeEventListener("pointerup",B),document.removeEventListener("pointercancel",$),e.pagesLayer.removeEventListener("keydown",G),t.remove();}}}var hH=e=>e==="left"||e==="center"||e==="right"||e==="both";function HT(e,t){if(!t.some(r=>r.localName==="bidi"))return e;let n=e.map(r=>r.localName).lastIndexOf("bidi");return n===-1?e:e.filter((r,o)=>o!==n)}function wc(e,t,n,r=n){let o=()=>chunkDOHF6FA7_cjs.sd([...t,...n]);if(e.paragraphDirection!==void 0&&e.localName==="bidi"){let a=e.paragraphDirection==="rtl";return o()===a?null:a?chunkDOHF6FA7_cjs.sd(HT(t,r))?{localName:"bidi",remove:true}:{localName:"bidi"}:chunkDOHF6FA7_cjs.sd(HT(t,r))?{localName:"bidi",attributes:{val:"0"}}:{localName:"bidi",remove:true}}let i=e.attributes?.val;return !e.physicalAlignment||e.localName!=="jc"||!hH(i)?e:{localName:"jc",attributes:{val:chunkDOHF6FA7_cjs.cd(i,o())}}}function _T(e){let{runPropertyEdits:t,mergedParagraphMarkProperties:n}=chunkEKLM7NWB_cjs.b(()=>e.session.stylesRoot(),()=>e.session.settingsRoot(),()=>e.displayMode(),()=>e.authorFilter()),{session:r,commit:o,orderedRange:i,selectionMark:a,textOf:s}=e,l=()=>e.displayMode(),d=()=>e.authorFilter(),c=()=>r.partFor(e.storyScope())??r.part(),u=(x,I,R)=>{let T=P=>r.applyTreeOps(P,I,R,e.storyScope());return e.applyOutsideToc?e.applyOutsideToc(x,T):T(x)},p=()=>{let x=e.runFormatRefusal?.();return x?(e.commit(()=>({committed:false,rejected:true,opCount:0,reason:x})),true):false},m={get value(){return e.layout()}},g={get value(){return e.selection()}},b=(x,I,R)=>{let T=c();if(x.paragraphId===I.paragraphId){let L=t(T,x.paragraphId,x.offset,I.offset,R,l(),d());if(L.length===0)return;let A=n(T,x.paragraphId,R);o(()=>u([...L.map(q=>({op:"setRunProperties",paragraphId:x.paragraphId,start:q.start,end:q.end,properties:q.properties,...q.targetRunIds?{targetRunIds:q.targetRunIds}:{}})),...e.paragraphMarkVisible(x.paragraphId)?Ok(s(x.paragraphId),x,I,A):[]],a()));return}let P=e.paragraphOrder(),O=P.indexOf(x.paragraphId),v=P.indexOf(I.paragraphId);if(O===-1||v===-1)return;let C=[];for(let L=O;L<=v;L+=1){let A=P[L],q=s(A),K=L===O?x.offset:0,E=L===v?I.offset:q.length,_=K<E?t(T,A,K,E,R,l(),d()):[];for(let z of _)C.push({op:"setRunProperties",paragraphId:A,start:z.start,end:z.end,properties:z.properties,...z.targetRunIds?{targetRunIds:z.targetRunIds}:{}});(L<v||K===0&&E===q.length&&q.length>0)&&e.paragraphMarkVisible(A)&&C.push({op:"setParagraphMarkProperties",paragraphId:A,properties:n(T,A,R)});}C.length!==0&&o(()=>u(C,a()));},h=(x,I)=>{let R=c(),T=[];for(let P of chunkD7ZMDMPX_cjs.ga(m.value,x)){let O=s(P);for(let v of t(R,P,0,O.length,I,l(),d()))T.push({op:"setRunProperties",paragraphId:P,start:v.start,end:v.end,properties:v.properties,...v.targetRunIds?{targetRunIds:v.targetRunIds}:{}});e.paragraphMarkVisible(P)&&T.push({op:"setParagraphMarkProperties",paragraphId:P,properties:n(R,P,I)});}return T.length===0?false:(o(()=>u(T,a()),void 0,{keepCellSelection:true}),true)},y=x=>{chunkOSFOJTHU_cjs.Ah(x.localName)&&e.setPendingFormats(chunkOSFOJTHU_cjs.Fh(e.pendingFormats()??[],x));},S=x=>{if(x.length===0)return;let I=e.selectedCells?.(),R=I&&I.length>0?[...chunkD7ZMDMPX_cjs.ga(m.value,I)]:null,{from:T,to:P}=i(),O=R??e.paragraphOrder(),v=R?0:O.indexOf(T.paragraphId),C=R?O.length-1:O.indexOf(P.paragraphId);if(v===-1||C===-1)return;let L=c(),A=O.slice(v,C+1).filter(q=>e.paragraphMarkVisible(q)).flatMap(q=>{let K=chunkOSFOJTHU_cjs.Dh(L,q),E=K,_=sr(m.value,q),X=false;for(let z of x){let oe=wc(z,_,E,K);if(!oe)continue;if(X=true,oe.remove){E=E.filter(U=>U.localName!==oe.localName);continue}let j=oe.mergeAttributes?{...E.find(U=>U.localName===oe.localName)?.attributes??{},...oe.attributes}:oe.attributes??{},me=Object.fromEntries(Object.entries(j).filter(([,U])=>U!=null));E=chunkOSFOJTHU_cjs.Fh(E,{localName:oe.localName,...Object.keys(me).length>0?{attributes:me}:{}});}return X?[{op:"setParagraphProperties",paragraphId:q,properties:E}]:[]});A.length!==0&&o(()=>u(A,a()),void 0,{keepCellSelection:R!==null});};return {setRunProperty(x,I){if(p())return;let R={localName:x,...I?{attributes:I}:{}},T=e.selectedCells?.();if(T&&T.length>0){h(T,R);return}let{from:P,to:O}=i();if(P.paragraphId===O.paragraphId&&P.offset===O.offset){y(R);return}b(P,O,R);},setParagraphProperty(x,I,R){S([{localName:x,...I?{attributes:I}:{},...R??{}}]);},setParagraphProperties:S,formatting:()=>Ck(Ek(m.value,g.value,(x,I)=>{let R=r.effectiveRunDefaults(x,I);if(R.fontFamily!==null)return R;let T=e.defaultFontFamily?.()??null;return T===null?R:{...R,fontFamily:T}},e.selectedCells?.(),e.defaultParagraphStyleId?.()??null,g.value.anchor.paragraphId===g.value.head.paragraphId?[g.value.head.paragraphId]:e.paragraphOrder(),e.defaultFontFamily?.()??null),e.pendingFormats()),toggleRunProperty(x,I){if(p())return;let R=e.selectedCells?.(),T=I?.val,P=ji(e.pendingFormats(),x,T)??km(m.value,g.value,x,R,T,e.paragraphOrder()),O=P?{localName:x,attributes:{val:yH[x]??"0"}}:{localName:x,...I?{attributes:I}:{}};if(R&&R.length>0){h(R,O);return}let{from:v,to:C}=i();if(v.paragraphId===C.paragraphId&&v.offset===C.offset){let L=e.pendingFormats()??[],A=km(m.value,g.value,x,void 0,T,e.paragraphOrder());if(!P===A){let q=L.filter(K=>K.localName!==x);e.setPendingFormats(q.length>0?q:null);}else y(O);return}b(v,C,O);},clearFormatting(){if(p())return;e.setPendingFormats(null);let x=m.value,I=e.paragraphOrder(),R=e.selectedCells?.(),T=R&&R.length>0?[...chunkD7ZMDMPX_cjs.ga(x,R)]:jd(I,i());if(T.length===0)return;let{from:P,to:O}=i(),v=R!==void 0&&R.length>0,C=c(),L=[];for(let A of T){let q=s(A),K=v||A!==P.paragraphId?0:P.offset,E=v||A!==O.paragraphId?q.length:O.offset;for(let z of chunkOSFOJTHU_cjs.Rh(C,A,K,E,l(),d()))Tk(C,A,z.start,z.end,l(),d())&&L.push({op:"setRunProperties",paragraphId:A,start:z.start,end:z.end,properties:[]});e.paragraphMarkVisible(A)&&chunkOSFOJTHU_cjs.Eh(C,A).length>0&&L.push({op:"setParagraphMarkProperties",paragraphId:A,properties:[]});let _=chunkOSFOJTHU_cjs.Dh(C,A),X=_.filter(z=>z.localName==="bidi");e.paragraphMarkVisible(A)&&_.length>X.length&&L.push({op:"setParagraphProperties",paragraphId:A,properties:X});}L.length!==0&&o(()=>u(L,a()),void 0,{keepCellSelection:v});}}}var yH={u:"none",vertAlign:"baseline"};var bH=new Set,BT=500;function vH(e){let t=l=>({val:l?"1":"0"}),n=l=>String(Math.max(2,Math.min(3276,Math.round(l*2)))),r=e.latinLane??e,o=e.complexLane??e,i=n(r.fontSizePt),a=[{localName:"b",attributes:t(r.bold)},{localName:"i",attributes:t(r.italic)},{localName:"bCs",attributes:t(o.bold)},{localName:"iCs",attributes:t(o.italic)},{localName:"u",attributes:{val:e.underline?e.underline.variant:"none",color:e.underline?.color??"auto",themeColor:"none"}},{localName:"strike",attributes:t(e.strike)},{localName:"dstrike",attributes:t(e.doubleStrike)},{localName:"caps",attributes:t(e.caps)},{localName:"smallCaps",attributes:t(e.smallCaps)},{localName:"vertAlign",attributes:{val:e.verticalAlign}},{localName:"color",attributes:{val:e.color??"auto"}},{localName:"highlight",attributes:{val:e.highlight??"none"}},{localName:"sz",attributes:{val:i}},{localName:"szCs",attributes:{val:n(o.fontSizePt)}},{localName:"spacing",attributes:{val:String(Math.round(e.characterSpacingPt*20))}},{localName:"position",attributes:{val:String(Math.round(e.baselineShiftPt*2))}},{localName:"w",attributes:{val:String(Math.round(e.horizontalScalePercent))}},{localName:"kern",attributes:{val:String(Math.round(e.kerningMinPt*2))}}],s=e.complexLane?.fontFamily??null;return (r.fontFamily||r.fontFamilyEastAsia||s)&&a.push({localName:"rFonts",attributes:{...r.fontFamily?{ascii:r.fontFamily,hAnsi:r.fontFamily}:{},...r.fontFamilyEastAsia?{eastAsia:r.fontFamilyEastAsia}:{},...s?{cs:s}:{}}}),a}function $T(e){let{runPropertyEdits:t,mergedParagraphMarkProperties:n}=chunkEKLM7NWB_cjs.b(()=>e.session.stylesRoot(),()=>e.session.settingsRoot(),()=>e.displayMode(),()=>e.authorFilter()),r=e.session,o=()=>r.partFor(e.storyScope())??r.part(),i="off",a=null,s=null,l=null,d=wd,c=()=>{let S=a===null?"none":a.paragraphProperties?"paragraph":"run";return (d.mode!==i||d.level!==S)&&(d={mode:i,level:S}),d},u=(S,x,I)=>{if(I||S.paragraphId!==x.paragraphId||S.offset===x.offset)return true;let R=e.textOf(S.paragraphId);return S.offset===0&&x.offset===R.length&&R.length>0},p=()=>{let S=e.selectedCells?.(),x=S!==void 0&&S.length>0,{from:I,to:R}=e.orderedRange();if(!e.paragraphOrder().includes(I.paragraphId))return false;let T=Wd(e.layout(),e.selection(),S,e.paragraphOrder()),P=u(I,R,x)?chunkOSFOJTHU_cjs.Dh(o(),I.paragraphId):null;return !T&&P===null?false:(a={runProperties:T?vH(T):[],paragraphProperties:P},true)},m=()=>p()?(e.publish(),true):false,g=()=>{let S=a;if(!S)return {wrote:false,armed:false,built:false};let x=e.selectedCells?.(),I=x!==void 0&&x.length>0,{from:R,to:T}=e.orderedRange(),P=!I&&R.paragraphId===T.paragraphId&&R.offset===T.offset,O=P?Bd(e.layout(),R,bH):null,v=O?.from??R,C=O?.to??T,L=P&&v.offset===C.offset,A=I?[...chunkD7ZMDMPX_cjs.ga(e.layout(),x)]:jd(e.paragraphOrder(),{from:v,to:C});if(A.length===0)return {wrote:false,armed:false,built:false};let q=o(),K=e.displayMode(),E=[];for(let oe of A){let j=e.textOf(oe),me=I||oe!==v.paragraphId?0:v.offset,U=I||oe!==C.paragraphId?j.length:C.offset;if(me<U&&S.runProperties.length>0)for(let B of t(q,oe,me,U,S.runProperties,K,e.authorFilter()))E.push({op:"setRunProperties",paragraphId:oe,start:B.start,end:B.end,properties:B.properties,...B.targetRunIds?{targetRunIds:B.targetRunIds}:{}});let F=S.paragraphProperties!==null||I||oe!==C.paragraphId||me===0&&U===j.length&&j.length>0,N=e.paragraphMarkVisible(oe);F&&N&&S.runProperties.length>0&&E.push({op:"setParagraphMarkProperties",paragraphId:oe,properties:n(q,oe,S.runProperties)}),S.paragraphProperties&&N&&E.push({op:"setParagraphProperties",paragraphId:oe,properties:[...S.paragraphProperties]});}let _=r.packageRevision();E.length>0&&e.commit(()=>r.applyTreeOps(E,e.selectionMark(),void 0,e.storyScope()),void 0,{keepCellSelection:I});let X=r.packageRevision()!==_,z=L&&S.runProperties.length>0&&(X||E.length===0);return z&&e.armPendingFormats(S.runProperties),{wrote:X,armed:z,built:E.length>0}},b=()=>{let S=g();return S.wrote&&i==="once"&&y(),S.wrote?"painted":S.armed?"armed":S.built?"refused":"nothingToPaint"},h=()=>{i!=="off"&&(i="off",e.publish());},y=()=>{s=null,l=null,h();};return {state:c,capture:m,apply:b,disarm:y,press(){let S=e.now(),x=s!==null&&S-s<BT,I=i;s=S;let R=()=>(s=null,false);return I==="once"&&x?p()?(i="locked",e.publish(),true):(h(),R()):I!=="off"?(h(),l=I==="locked"?S:null,true):l!==null&&S-l<BT?(l=null,true):p()?(i="once",l=null,e.publish(),true):R()},applyIfArmed(){i==="off"||a===null||g().wrote&&i==="once"&&y();}}}var qT=new WeakMap;function xH(e){let t=qT.get(e);if(t!==void 0)return t;let n=[e],r=false;for(;n.length>0&&!r;){let o=n.pop();if(o.kind!=="textValue"){(o.localName==="bidi"||o.localName==="rtl")&&(r=true);for(let i of o.children)n.push(i);}}return qT.set(e,r),r}function KT(e,t=()=>null){let n=null;return {keydown(r){if(r.key==="Shift"&&(r.location===1||r.location===2)&&r.ctrlKey&&!r.altKey&&!r.metaKey&&!r.isComposing&&!r.defaultPrevented){n=r.location===2?"rtl":"ltr";return}r.key!=="Control"&&(n=null);},keyup(r){if(n===null||r.key!=="Shift"&&r.key!=="Control")return;let o=n;if(n=null,r.defaultPrevented)return;let i=t();i===null||!xH(i)||e.setParagraphProperties([{localName:"bidi",paragraphDirection:o}]);},disarm(){n=null;}}}function VT(e,t){return e.addEventListener("keyup",t.keyup),e.addEventListener("pointerdown",t.disarm,{capture:true}),e.addEventListener("focusout",t.disarm),()=>{e.removeEventListener("keyup",t.keyup),e.removeEventListener("pointerdown",t.disarm,{capture:true}),e.removeEventListener("focusout",t.disarm);}}var wH=500,jT=4,Ji=40,Sc=12;function SH(e,t){let n=Math.max(e.x,t.x),r=Math.max(e.y,t.y),o=Math.min(e.x+e.width,t.x+t.width),i=Math.min(e.y+e.height,t.y+t.height);return o<=n||i<=r?0:(o-n)*(i-r)}function WT(e,t){return SH(e,t)>0?true:e.width===0?t.x<=e.x&&e.x<=t.x+t.width&&!(e.y+e.height<t.y||t.y+t.height<e.y):false}function Tn(e,t,n){let r=chunkDOHF6FA7_cjs.Ra(e),o=r.indexOf(t.paragraphId),i=r.indexOf(n.paragraphId);return o!==i?o-i:t.offset-n.offset}function zT(e,t,n){if(!(t>chunkDOHF6FA7_cjs.Sd))for(let r of e){if(r.kind==="paragraph"){n(r);continue}if(!(t>=chunkDOHF6FA7_cjs.Sd)){for(let o of r.rows)if(!o.isHeaderRepeat)for(let i of o.cells)zT(i.blocks,t+1,n);}}}function Ds(e,t){if(!t.placeholder||t.fragments.length===0)return null;let n=null,r=null,o=(a,s)=>{(!n||Tn(e,a,n)<0)&&(n=a),(!r||Tn(e,s,r)>0)&&(r=s);},i=t.level!=="inline";for(let a of t.fragments){let s=e.pages[a.pageIndex];s&&zT(s.fragments,0,l=>{if(WT(a.box,l.box)){if(i){let d=chunkDOHF6FA7_cjs.pe(e,l.paragraphId).length;o({paragraphId:l.paragraphId,offset:0},{paragraphId:l.paragraphId,offset:d});return}for(let d of l.lines)for(let c of d.spans)WT(a.box,c.box)&&o({paragraphId:c.range.paragraphId,offset:c.range.start},{paragraphId:c.range.paragraphId,offset:c.range.end});}});}return !n||!r?null:{from:n,to:r}}function IH(e,t){return (e.contentControls??[]).find(n=>n.id===t)??null}function ZT(e,t){let n=t.contentControlId;if(!n){let o={x:t.caret.x,y:t.caret.y+t.caret.height/2},i=chunkDOHF6FA7_cjs.be(e,t.pageIndex,o);return i?.placeholder?i:null}let r=IH(e,n);return r?.placeholder?r:null}function Ic(e,t){let n=e.contentControls??[];if(n.length===0)return t;let r=Tn(e,t.anchor,t.head)<=0?t.anchor:t.head,o=Tn(e,t.anchor,t.head)<=0?t.head:t.anchor,i=true;for(;i;){i=false;for(let s of n){if(!s.placeholder)continue;let l=Ds(e,s);!l||!(Tn(e,r,o)===0?Tn(e,r,l.from)>=0&&Tn(e,r,l.to)<0:Tn(e,r,l.to)<0&&Tn(e,o,l.from)>0)||(Tn(e,l.from,r)<0&&(r=l.from,i=true),Tn(e,l.to,o)>0&&(o=l.to,i=true));}}return Tn(e,t.anchor,t.head)<=0?{anchor:r,head:o}:{anchor:o,head:r}}var kH=new Set(["dropdown","comboBox","date","buildingBlockGallery"]);function UT(e,t={}){if(t.mode==="native")return {dragging:()=>false,destroy:()=>{}};let{pagesLayer:n,container:r}=e,o=n.ownerDocument,i=o.defaultView,a=null,s=null,l=0,d=0,c=0,u=0,p=null;function m(N,B){if(!s){let G=n.getBoundingClientRect();s={left:G.left,top:G.top};}let $=e.scale()||1;return {x:(N-s.left)/$,y:(B-s.top)/$}}function g(N){return {scope:{kind:"headerFooter",rId:N.rId},pageIndex:N.pageIndex,kind:N.kind,partName:N.partName,variant:N.variant}}function b(N,B){let $=e.layout(),G=m(N,B),H=chunkDOHF6FA7_cjs.Xd($,G.y),W=$.pages[H];if(!W)return null;let Z=e.measurer();return chunkDOHF6FA7_cjs._d($,H,{x:G.x-W.contentBox.x-e.pageOffsetX(H),y:G.y-W.contentBox.y},Z?{measurer:Z}:{})}function h(N,B){let $=e.activeNote?.()??null;if($){let re=e.layout(),ne=yd(re,m(N,B),e.pageOffsetX);if(!ne||ne.scopeId!==$.scopeId)return null;let ee=e.measurer();return chunkDOHF6FA7_cjs.$d(re,ne.pageIndex,ne.fragments,ne.local,{...ee?{measurer:ee}:{}})}let G=e.activeHeaderFooter?.()??null;if(!G)return b(N,B);let H=e.layout(),W=m(N,B),Z=bp(H,W,e.pageOffsetX);if(Z&&hd(Z.story,g(G))){let re=e.measurer();return mp(H,Z.pageIndex,Z.story,Z.local,re?{measurer:re}:{})}return null}function y(N,B){let{story:$,pageIndex:G,kind:H}=N;return {rId:$.rId,pageIndex:G,kind:H,partName:$.partName,variant:$.variant,...B?{position:B}:{}}}function S(N){let B=e.measurer();return mp(e.layout(),N.pageIndex,N.story,N.local,B?{measurer:B}:{})?.position??void 0}let x=new WeakMap;function I(N,B){let $=e.activeNote?.();if($){let Z=Hi(N,null,$.scopeId).indexOf(B);return Z===-1?-1:Z}let G=e.activeHeaderFooter?.();if(G){let Z=Hi(N,g(G)).indexOf(B);return Z===-1?-1:Z}let H=x.get(N);return H||(H=new Map(chunkDOHF6FA7_cjs.Ra(N).map((W,Z)=>[W,Z])),x.set(N,H)),H.get(B)??-1}function R(N,B,$){let G=I(N,B.paragraphId),H=I(N,$.paragraphId);return G!==H?G<H:B.offset<$.offset}function T(N,B,$){if($==="character")return {from:B,to:B};let G=B.paragraphId;if($==="paragraph"){let H=chunkDOHF6FA7_cjs.pe(N,G);return {from:{paragraphId:G,offset:0},to:{paragraphId:G,offset:H.length}}}return Bd(N,B,chunkDOHF6FA7_cjs.qe(N,G))}function P(N,B,$,G,H){let W=H?ZT(N,H):null,Z=W?Ds(N,W)??T(N,$,G):T(N,$,G),re=R(N,Z.from,B.from)?{anchor:B.to,head:Z.from}:{anchor:B.from,head:Z.to};return Ic(N,re)}let O=r.closest(".docx-editor__scroll-container");function v(){return r.closest(".docx-editor__scroll-container")}function C(N,B,$){if($<N+Ji){let G=Math.max(0,N+Ji-$);return -Math.min(Sc,G/Ji*Sc)}if($>B-Ji){let G=Math.max(0,$-(B-Ji));return Math.min(Sc,G/Ji*Sc)}return 0}function L(){p!==null&&(i?.cancelAnimationFrame(p),p=null);}function A(){p=null;let N=a,B=v();if(!N||!B||!i)return;let $=B.getBoundingClientRect(),G=C($.top,$.bottom,N.clientY);G!==0&&(B.scrollTop+=G,s=null,K(N.clientX,N.clientY),p=i.requestAnimationFrame(A));}function q(){if(p!==null||!i||!a)return;let N=v();if(!N)return;let B=N.getBoundingClientRect();C(B.top,B.bottom,a.clientY)!==0&&(p=i.requestAnimationFrame(A));}function K(N,B){let $=a;if(!$)return;let G=h(N,B);G&&((e.isReadOnlyPosition?.(G.position)??e.isReadOnlyParagraph?.(G.position.paragraphId))||E($,G)||($.caret=G.caret,e.setSelection(P(e.layout(),$.anchorRange,G.position,$.granularity,G),G.caret)));}function E(N,B){let $=N.anchorCell;if(!$)return false;if(!B.cell||B.cell.tableId!==$.tableId)return N.cellDragging;if(!N.cellDragging&&B.cell.cellId===$.cellId)return false;let G=chunkD7ZMDMPX_cjs.ea(e.layout(),$,B.cell);return G?(N.cellDragging=true,e.setCellSelection(G),true):N.cellDragging}function _(N){let B=Date.now(),$=B-d;return l=Math.abs(N.clientX-c)<=jT&&Math.abs(N.clientY-u)<=jT&&$>=0&&$<=wH?l+1:1,d=B,c=N.clientX,u=N.clientY,l}let X=["character","word","paragraph"],z=N=>{if(N.button!==0)return;if(e.onChangeBarToggle&&N.target?.closest?.("[data-docx-change-bar-toggle]")){N.preventDefault(),N.stopPropagation(),e.onChangeBarToggle();return}let B=N.target?.closest?.("[data-docx-cc-widget]");if(B){if(N.preventDefault(),N.stopPropagation(),B.hasAttribute("disabled")||B.dataset.disabledReason)return;let He=B.dataset.docxCcId,Ae=B.dataset.docxCcWidget;He&&Ae&&e.onContentControlWidget?.(He,Ae);return}if(e.selectionLocked?.()||N.pointerType==="touch")return;a&&U(),s=null;let $=e.layout(),G=m(N.clientX,N.clientY),H=e.activeHeaderFooter?.()??null,W=e.activeNote?.()??null,Z=bp($,G,e.pageOffsetX),re=Z!==null&&oS($,Z,G,e.pageOffsetX,H!==null&&hd(Z.story,g(H)),e.measurer()),ne=re?null:Z,ee=yd($,G,e.pageOffsetX),se=re?null:N.target?.closest("[data-docx-hf]"),fe=!!(se||ne),Ce=N.target,Ee=Ce?.closest("[data-docx-note-ref]"),at=Ce?.closest("[data-docx-note-mark-back]"),ot=null,Ne=()=>ot??=_(N);if(Ee?.dataset.docxNoteScope){N.preventDefault(),e.focus(),e.enterNote?.(Ee.dataset.docxNoteScope);return}if(at){N.preventDefault(),e.focus(),e.exitNote?.(true);return}if(ee&&!fe){let He=e.measurer?.(),Ae=chunkDOHF6FA7_cjs.$d($,ee.pageIndex,ee.fragments,ee.local,{...He?{measurer:He}:{}});if(!W||W.scopeId!==ee.scopeId){N.preventDefault(),e.focus(),e.enterNote?.(ee.scopeId,Ae?{paragraphId:Ae.position.paragraphId,offset:Ae.position.offset}:void 0,ee.pageIndex);return}if(W.pageIndex!==ee.pageIndex){N.preventDefault(),e.focus(),e.enterNote?.(ee.scopeId,Ae?{paragraphId:Ae.position.paragraphId,offset:Ae.position.offset}:void 0,ee.pageIndex);return}}else if(W){if(!pp($,G,e.pageOffsetX))return;e.exitNote?.(false),e.focus();}if(H)if(ne&&hd(ne.story,g(H)))ne.pageIndex!==H.pageIndex&&e.enterHeaderFooter?.(y(ne,S(ne)));else if(ne&&ne.story.rId){N.preventDefault(),e.focus(),e.enterHeaderFooter?.(y(ne,S(ne)));return}else if(pp($,G,e.pageOffsetX)){N.preventDefault(),e.exitHeaderFooter?.(true),e.focus();return}else {let He=Ne()>=2?yp($,G,e.pageOffsetX):null;He&&(N.preventDefault(),e.focus(),e.enterEmptyHeaderFooter?.(He.kind,He.pageIndex));return}else if(fe&&Ne()>=2){if(ne?.story.rId)N.preventDefault(),e.focus(),e.enterHeaderFooter?.(y(ne,S(ne)));else if(se instanceof HTMLElement){let He=se.dataset.docxRId,Ae=se.dataset.docxHf,ye=se.closest("[data-page-index]")?.getAttribute("data-page-index"),Fe=ye!=null?Number(ye):NaN;if((Ae==="header"||Ae==="footer")&&Number.isInteger(Fe))if(He){let Se=$.pages[Fe]?.[Ae];N.preventDefault(),e.focus(),e.enterHeaderFooter?.({rId:He,pageIndex:Fe,kind:Ae,partName:Se?.partName??"",variant:Se?.variant??"default"});}else $.pages[Fe]?.[Ae]||(N.preventDefault(),e.focus(),e.enterEmptyHeaderFooter?.(Ae,Fe));}return}else if(Ne()>=2){let He=yp($,G,e.pageOffsetX);if(He){N.preventDefault(),e.focus(),e.enterEmptyHeaderFooter?.(He.kind,He.pageIndex);return}}let Te=h(N.clientX,N.clientY);if(!Te)return;if(e.isReadOnlyPosition?.(Te.position)??e.isReadOnlyParagraph?.(Te.position.paragraphId)){N.preventDefault();return}if(Ne()===2&&e.onTextFormDoubleClick?.(N))return;N.preventDefault(),e.focus();try{n.setPointerCapture(N.pointerId);}catch{}o.addEventListener("pointermove",j),o.addEventListener("pointerup",me),o.addEventListener("pointercancel",me);let Pt=Ne(),st=N.shiftKey?"character":X[(Pt-1)%X.length],Ye=ZT($,Te);if(Ye&&!N.shiftKey){let He=()=>{Pt===1&&kH.has(Ye.controlType)&&e.onContentControlWidget?.(Ye.id,Ye.controlType);};if(e.selectContentControl?.(Ye.id)){let ye=e.selection(),Fe=R($,ye.anchor,ye.head)||ye.anchor.paragraphId===ye.head.paragraphId&&ye.anchor.offset===ye.head.offset?{from:ye.anchor,to:ye.head}:{from:ye.head,to:ye.anchor};a={pointerId:N.pointerId,granularity:"character",anchorRange:Fe,anchorCell:Te.cell,cellDragging:false,clientX:N.clientX,clientY:N.clientY},He();return}let Ae=Ds($,Ye);if(Ae){a={pointerId:N.pointerId,granularity:"character",anchorRange:Ae,anchorCell:Te.cell,cellDragging:false,clientX:N.clientX,clientY:N.clientY},oe(()=>e.setSelection({anchor:Ae.from,head:Ae.to})),He();return}}if(N.shiftKey){let He=e.selection();a={pointerId:N.pointerId,granularity:st,caret:Te.caret,anchorRange:{from:He.anchor,to:He.anchor},anchorCell:Te.cell,cellDragging:false,clientX:N.clientX,clientY:N.clientY},oe(()=>e.setSelection(P($,{from:He.anchor,to:He.anchor},Te.position,st,Te),Te.caret));}else {let He=T($,Te.position,st);a={pointerId:N.pointerId,granularity:st,caret:Te.caret,anchorRange:He,anchorCell:Te.cell,cellDragging:false,clientX:N.clientX,clientY:N.clientY},oe(()=>e.setSelection(Ic($,{anchor:He.from,head:He.to}),Te.caret));}};function oe(N){try{N();}catch(B){throw U(),B}}let j=N=>{let B=a;if(!(!B||N.pointerId!==B.pointerId)){if(e.selectionLocked?.())return U();N.preventDefault(),B.clientX=N.clientX,B.clientY=N.clientY,K(N.clientX,N.clientY),q();}},me=N=>{let B=a;if(!B||N.pointerId!==B.pointerId)return;U();try{n.releasePointerCapture(B.pointerId);}catch{}let $=e.cellSelection();$?e.setCellSelection($):e.setSelection(e.selection(),B.caret),N.type==="pointerup"&&(e.onTextFormPointerUp?.(N),e.onSelectionSettled?.());};function U(){if(a)try{n.releasePointerCapture(a.pointerId);}catch{}a=null,s=null,L(),o.removeEventListener("pointermove",j),o.removeEventListener("pointerup",me),o.removeEventListener("pointercancel",me);}let F=()=>{s=null;};return n.addEventListener("pointerdown",z),O?.addEventListener("scroll",F,{passive:true}),i?.addEventListener("scroll",F,{capture:true,passive:true}),i?.addEventListener("resize",F,{passive:true}),{dragging:()=>a!==null,destroy(){U(),n.removeEventListener("pointerdown",z),O?.removeEventListener("scroll",F),i?.removeEventListener("scroll",F,{capture:true}),i?.removeEventListener("resize",F);}}}function GT(e,t,n){let r=e??chunkDOHF6FA7_cjs.Za;return {view:()=>r,projection:()=>chunkDOHF6FA7_cjs.Ya(r),changeBars:()=>t?r==="all-markup"||r==="simple-markup"?r:"none":"all-markup",set:o=>{r=o;},filter:o=>t&&chunkDOHF6FA7_cjs.Ya(r)!=="all-markup"?chunkDOHF6FA7_cjs._a(o):o,toggleByChangeBar:()=>{t&&n(r==="simple-markup"?"all-markup":"simple-markup");}}}function XT(e){let{document:t,pagesLayer:n,session:r}=e,o=false,i=null,a,s;function l(){let{head:v}=e.selection();return s&&s.position.paragraphId===v.paragraphId&&s.position.offset===v.offset?s.lineId:void 0}function d(v){let C=Qo(v?.anchorNode,n)??Qo(v?.focusNode,n);C!==void 0&&(a=C);}function c(v){return a??Qo(v?.anchorNode,n)??Qo(v?.focusNode,n)}let u=false,p=false,m=false,g=null,b=false;function h(){if(e.selectionLocked?.())return false;let v=t.getSelection(),C=Xi(n,v);return !C||(d(v),Mt(C,e.selection()))?false:(e.adoptSelection(C),true)}function y(){let v=t.activeElement;if(v&&n.contains(v))return true;if(v&&v!==t.body&&v!==t.documentElement)return false;let C=t.getSelection();if(!C||C.rangeCount===0)return true;let L=C.anchorNode;return !L||!L.isConnected?true:n.contains(L)}let S=()=>{if(e.selectionLocked?.())return;let v=t.getSelection(),C=Xi(n,v);if(!C){if(!Gm(n,v))return;u=false;let L=Ke(e.selection().head);if(Mt(L,e.selection()))return;e.setSelection(L);return}u=false,d(v),!Mt(C,e.selection())&&e.setSelection(C);};function x(v){let C=e.textOf(v),L=OP(n,v,C,t.getSelection()?.anchorNode??null);if(L===null)return;let A=MP(v,C,L);if(!A)return;let q=A.ops.find(oe=>oe.op==="deleteText"),K=A.ops.find(oe=>oe.op==="insertText"),E=K&&q?e.replacementOffset?.(v,q.start,q.end):void 0,_=K&&E!==void 0&&E!==K.offset?A.ops.map(oe=>oe===K?{...K,offset:E}:oe):A.ops,X=K?e.pendingFormatOps?.(v,E??K.offset,K.text.length,q?{start:q.start,end:q.end}:void 0)??[]:[],z=e.storyScope();e.commit(()=>{let oe=e.applyOps([..._,...X],e.selectionMark(),z);return X.length===0||!oe.rejected?oe:e.applyOps(_,e.selectionMark(),z)}),e.setSelection(Ke({paragraphId:v,offset:K&&E!==void 0?E+K.text.length:A.caret}));}function I(){o||m||e.isGesturing?.()||e.holdsCellSelection?.()||R()||u&&S();}function R(){if(!p||u)return false;if(!i)return true;let v=Xi(n,t.getSelection());return v!==null&&Mt(v,i)}function T(v){if(!(v instanceof PointerEvent&&v.button!==0)){if(v.type==="selectstart"&&e.selectionLocked?.()){v.preventDefault();return}u=true;}}let P=false;function O(v=false){if(e.updateCaret(),!v&&!y())return;o=true;let C=e.now(),L=e.domSelection?.()??e.selection();u=false;let A=t.getSelection(),q=c(A),K=l(),E=hP(n,L,A,{...q!==void 0?{preferredPageIndex:q}:{},...K!==void 0?{preferredLineId:K}:{}});E&&d(A),i=E?L:null,E||(p=true),e.recordSelectionMs(e.now()-C),queueMicrotask(()=>{o=false;});}return n.addEventListener("pointerdown",T,true),n.addEventListener("selectstart",T,true),{adoptBeforePaint(){let v=e.holdsCellSelection?.()===true||e.isGesturing?.()===true||e.hasPendingInput?.()===true,C=p||v||!u?false:h();return e.hasPendingInput?.()!==true&&(p=false),C},noteModelMoved(){p=true,s=void 0;},noteSelectionSettled(){p=false;},mirrorToDom:O,adoptBeforeInput:I,isComposing:()=>m,noteBrowserSelectionFixup(){P=true;},onSelectionChange:()=>{if(!o&&!m&&!e.isGesturing?.()&&!e.holdsCellSelection?.()){if(P&&Gm(n,t.getSelection())){let v=Xi(n,t.getSelection());if((v===null||!Mt(v,e.selection()))&&(P=false,!u)){O();return}}R()||S();}},onCompositionStart:()=>{I(),m=true;let v=e.selection();b=v.anchor.paragraphId!==v.head.paragraphId,g=v.head.paragraphId,r.beginComposition(e.storyScope());},onCompositionEnd:v=>{m=false;let C=g??e.selection().head.paragraphId;g=null;let L=b;b=false;let A=e.storyScope(),q=r.revisionFor(A);if(L){let K=v?.data??"";K.length>0&&e.replaceSelectionWith?.(K);}else x(C);r.endComposition(),r.revisionFor(A)===q&&e.discardPaint?.(),e.flushToPaint()||e.render();},selectionPageIndex:()=>a,selectionLineId:l,caretPreference(v=a){let C=l();return {...v!==void 0?{preferredPageIndex:v}:{},...C!==void 0?{preferredLineId:C}:{}}},notePointerCaret(v){s=v,v&&(a=v.pageIndex);},destroy(){n.removeEventListener("pointerdown",T,true),n.removeEventListener("selectstart",T,true),u=false;}}}var RH=32;function vg(e,t,n,r){if(!(e.kind==="textValue"||r>RH)){if(e.kind==="paragraph"){n.has(e.id)||n.set(e.id,t);return}for(let o of e.children)vg(o,t,n,r+1);}}var YT=new WeakMap;function QT(e,t,n,r){if(e.kind==="paragraph"||e.kind==="textValue"){vg(e,t,n,0);return}let o=YT.get(e);if(!o){let i=new Map;vg(e,0,i,0),o=[...i.keys()],YT.set(e,o);}for(let i of o)n.has(i)||n.set(i,t);}function CH(e,t){let n=chunkDOHF6FA7_cjs.qd(e),r=chunkDOHF6FA7_cjs.sc(n),o=0,i=chunkDOHF6FA7_cjs.Oc(e),a=new Map;for(let s=0;s<i.length;s+=1){let l=i[s];for(let d=l.blockStart;d<l.blockEndExclusive;d+=1){let c=n[d];if(c){for(;o<r.length&&r[o]!==c;)QT(r[o],s,a),o+=1;o+=1,QT(c,s,a);}}}return a}var JT=new WeakMap;function EH(e){return !(!e.story||e.origin===chunkOSFOJTHU_cjs.g.mutationUndo||e.origin===chunkOSFOJTHU_cjs.g.mutationRedo||e.impact!=="text-local"||e.created.length>0||e.deleted.length>0||e.splitJoin.length>0||e.dependencyKeys.includes(chunkOSFOJTHU_cjs.l.section))}function OH(e,t){t.story&&t.story.kind!=="body"||EH(t)||(e.map=null);}function MH(e,t){t.subscribed||(t.subscribed=true,e.subscribe(n=>OH(t,n)));}function AH(e,t){let n=JT.get(e);return n||(n={map:null,subscribed:false},JT.set(e,n)),MH(e,n),n.map||(n.map=CH(t)),n.map}function eC(e,t,n){return n.startsWith(`${t.name}#`)?AH(e,t).get(n)??null:null}var tC=32;function Hs(e,t,n,r,o="all-markup",i){let a=e.part(),s=chunkDOHF6FA7_cjs.Oc(a,o,i);if(s.length<=1)return 0;let l=chunkDOHF6FA7_cjs.Pc(a,o,i),d=p=>{let m=l.indexOf(p);if(m!==-1)return m;let g=l.findIndex(b=>b>p);return g===-1?Math.max(0,l.length-1):g},c=xg(e,t);if(c!==null)return d(c);if(n.kind==="headerFooter"){if(r!==void 0&&s[r]!==void 0)return r;let p=e.headerFooterResolutionBySection().findIndex(m=>[m.headers,m.footers].some(g=>[...g.values()].some(b=>b.rId===n.rId)));return p===-1?0:d(p)}let u=LH(e,t);if(u!==null){let p=xg(e,u);if(p!==null)return d(p)}return 0}function nC(e,t,n,r,o="all-markup",i){let a=e.part(),s=chunkDOHF6FA7_cjs.Oc(a);if(s.length<=1)return {kind:"whole-document"};let l=chunkDOHF6FA7_cjs.Pc(a,o,i),d=xg(e,t),c=Hs(e,t,n,r,o,i),u=l[c]??c;if(d!==null&&d===u)return {kind:"anchor",paragraphId:t};let p=s[u];if(!p)return {kind:"unaddressable"};let m=chunkDOHF6FA7_cjs.qd(a);for(let g=p.blockStart;g<p.blockEndExclusive;g+=1){let b=FH(m[g]);if(b!==null)return {kind:"anchor",paragraphId:b}}return {kind:"unaddressable"}}function FH(e){if(!e)return null;let t=(n,r)=>{if(n.kind==="textValue"||r>tC)return null;if(n.kind==="paragraph")return n.id;for(let o of n.children){let i=t(o,r+1);if(i!==null)return i}return null};return t(e,0)}function xg(e,t){return eC(e,e.part(),t)}function LH(e,t){let n=e.currentPackage();for(let r of ["footnote","endnote"]){let o=chunkOSFOJTHU_cjs.ch(n,r);if(!(!o||!t.startsWith(`${o.name}#`)))for(let i of chunkOSFOJTHU_cjs.Jc(o.root)){let a=chunkOSFOJTHU_cjs.yc(i);if(a===null||!NH(i,t))continue;return chunkOSFOJTHU_cjs.dh(e.part()).find(l=>l.noteKind===r&&l.noteId===a)?.paragraphId??null}}return null}function NH(e,t){let n=(r,o)=>{if(r.kind==="textValue"||o>tC)return false;if(r.kind==="paragraph"&&r.id===t)return true;for(let i of r.children)if(n(i,o+1))return true;return false};return n(e,0)}function ea(e,t){if(t===void 0)return {};let n=`${e}Autospacing`,r=`${e}Lines`;return t===null?{[e]:null,[n]:null,[r]:null}:{[e]:String(Math.round(t*20)),[n]:"0",[r]:null}}function kc(e){return e===void 0?{}:e===null?{line:null,lineRule:null}:e.rule==="multiple"?{line:String(Math.round(e.value*240)),lineRule:"auto"}:{line:String(Math.round(e.value*20)),lineRule:e.rule==="exact"?"exact":"atLeast"}}function rC(e){return {val:e?"1":"0"}}function iC(e){let t=null,n=null,r=null,o=(a,s)=>(e.setLastRejection(null),e.commit(()=>{let l=e.applyOps(Array.isArray(a)?a:[a],e.selectionMark());return l.rejected&&e.setLastRejection(String(l.reason??"rejected")),l},s),e.lastRejection()===null),i=(a,s,l)=>{let d=chunkOSFOJTHU_cjs.pc(a);if(!d)return e.setLastRejection("invalid note scope id"),false;let c=e.session.currentPackage(),u=chunkOSFOJTHU_cjs.ch(c,d.noteKind),p=u?chunkOSFOJTHU_cjs.Lc(u.root,d.noteId):null;if(!u||!p)return e.setLastRejection("note not found"),false;if(e.exitHeaderFooter?.(),e.activeScope().kind==="body"){let m=e.selection();r={anchor:{paragraphId:m.anchor.paragraphId,offset:m.anchor.offset},head:{paragraphId:m.head.paragraphId,offset:m.head.offset}};}if(t={kind:"note",id:chunkOSFOJTHU_cjs.oc(d.noteKind,d.noteId)},n=Number.isInteger(l)?l:null,s)e.setSelection({anchor:s,head:s});else {let m=DH(p),g=new Set(e.session.paragraphIdsIn({kind:"notesPart",noteKind:d.noteKind})),b=m.find(h=>g.has(h.id));if(b){let h=wg(b);e.setSelection({anchor:{paragraphId:b.id,offset:h},head:{paragraphId:b.id,offset:h}});}}return e.noteModelMoved(),e.render(),n??=e.revealNote(t.id),e.notify(),true};return {insertNote(a){if(e.activeScope().kind!=="body")return e.setLastRejection("insertNote requires body scope"),false;let s=e.deleteSelectionPlan(),l=s.collapseTo;if(!(s.ops.length===0||o(s.ops,()=>({anchor:{...l},head:{...l}}))))return false;let c=oC(e.session.currentPackage(),a);if(!o({op:"insertNote",noteKind:a,paragraphId:l.paragraphId,offset:l.offset},()=>{let g={paragraphId:l.paragraphId,offset:l.offset+1};return {anchor:g,head:g}}))return s.ops.length>0&&e.undo(),false;let m=[...oC(e.session.currentPackage(),a)].find(g=>!c.has(g));return m===void 0?true:i(chunkOSFOJTHU_cjs.oc(a,m))},deleteNote(a,s){return o({op:"deleteNote",noteKind:a,noteId:s})},convertNote(a,s){return o({op:"convertNote",fromKind:a,noteId:s})},convertAllNotes(a){return o({op:"convertAllNotes",fromKind:a})},setNoteProperties(a){return o({op:"setNoteProperties",scope:a.scope,sectionIndex:a.sectionIndex,footnote:a.footnote,endnote:a.endnote})},enterNote:i,exitNote(a=true){if(!t)return;let s=r;t=null,n=null,r=null,e.setActiveScopeBodyOrHf({kind:"body"}),a&&s&&e.setSelection(s),e.noteModelMoved(),e.render(),e.notify();},activeNoteScope(){return t},activeNotePageIndex(){return n},setActiveNotePageIndex(a){!t||!Number.isInteger(a)||n!==a&&(n=a);}}}function DH(e){let t=[],n=(r,o)=>{if(!(o>32)){if(r.kind==="paragraph"){t.push(r);return}if("children"in r)for(let i of r.children)n(i,o+1);}};return n(e,0),t}function wg(e){let t=chunkOSFOJTHU_cjs.hg(e)[0];return t&&chunkOSFOJTHU_cjs.uc(t.node)?t.end:0}function oC(e,t){let n=chunkOSFOJTHU_cjs.ch(e,t),r=new Set;if(!n)return r;for(let o of chunkOSFOJTHU_cjs.Jc(n.root)){if(!chunkOSFOJTHU_cjs.Ac(o))continue;let i=chunkOSFOJTHU_cjs.yc(o);i!==null&&r.add(i);}return r}var HH=720;function Sg(e,t,n=HH){return lC(e,t,e+t*n)}function sC(e,t,n){let r=t>0?Math.floor(e/n)+1:Math.ceil(e/n)-1;return lC(e,t,r*n)}function lC(e,t,n){return t>0?Math.max(e,Math.min(chunkDOHF6FA7_cjs.fd,n)):Math.max(0,n)}function Ig(e){let t;for(let r of e){if(r.localName!=="ind")continue;let o=r.attributes?.left??r.attributes?.start;o!==void 0&&(t=o);}let n=chunkOSFOJTHU_cjs.nd(t);return n===null||Math.abs(n)>9999999?0:n}function aC(e,t){return e.kind==="midLine"?false:e.kind==="empty"||t<=e.offset}function dC(e,t,n,r,o){let{from:i,to:a}=e;if(i.paragraphId===a.paragraphId&&i.offset===a.offset)return null;let s=t.length>1?n.start(a.paragraphId):null,d=s!==null&&aC(s,a.offset)&&!(s.kind==="empty"&&n.endsStory(a.paragraphId))?t.slice(0,-1):t;if(d.length>1)return {write:"stepLeft",paragraphs:d};if(!aC(n.start(i.paragraphId),i.offset))return null;let{resolved:c,direct:u}=n.firstLine(i.paragraphId);return r==="increase"?{write:c>=0&&c<o?"setFirstLine":"stepLeft",paragraphs:d}:{write:u&&c>0?"clearFirstLine":"stepLeft",paragraphs:d}}function _H(e,t){let n=Number.POSITIVE_INFINITY,r=false;for(let{line:o}of chunkDOHF6FA7_cjs.td(e).get(t)??[]){if(!r&&(r=true,chunkDOHF6FA7_cjs.Ma(o)[0]?.paragraphId!==t))return {kind:"midLine"};let i=chunkDOHF6FA7_cjs.Na(o,t);if(i){for(let a of i.spans)a.range.end>a.range.start&&(n=Math.min(n,a.range.start));for(let a of i.drawings)n=Math.min(n,a.start);if(Number.isFinite(n))break}}return Number.isFinite(n)?{kind:"start",offset:n}:{kind:"empty"}}var BH=["firstLine","hanging","firstLineChars","hangingChars"];function cC(e,t,n){let r=new Map;return {start(o){let i=r.get(o);if(i)return i;let a=_H(e,o);if(a.kind==="start"){let s=chunkOSFOJTHU_cjs.Ta(t,o),l=s?.kind==="paragraph"?wg(s):0;l>a.offset&&(a={kind:"start",offset:l});}return r.set(o,a),a},endsStory:o=>n[n.length-1]===o,firstLine(o){let i=Sm(e,o),a=chunkOSFOJTHU_cjs.Dh(t,o).find(l=>l.localName==="ind")?.attributes,s=BH.some(l=>a?.[l]!==void 0);return {resolved:i?Vd(i.indent):0,direct:s}}}}function uC(e,t){let n=(r,o)=>r.paragraphId===o.paragraphId&&r.offset===o.offset;return (e.contentControls??[]).some(r=>{if(!r.placeholder)return false;let o=Ds(e,r);return o!==null&&n(o.from,t.from)&&n(o.to,t.to)})}var _s="a section break that changes where the next section starts cannot be suggested; turn off suggesting to insert it",ta="a section break cannot be inserted inside a table cell",Pc="a section break cannot change a section that a locked or linked content control holds",Bs="a section break cannot be inserted in locked or linked content";function $H(e){let t=new Set,n=new Set,r=i=>{if(i.kind==="textValue"||!("localName"in i)||i.localName!=="sdt")return false;let a=i.children?.find(s=>s.kind!=="textValue"&&"localName"in s&&s.localName==="sdtPr");return !a||a.kind==="textValue"?false:(a.children??[]).some(s=>{if(s.kind==="textValue"||!("localName"in s)||s.namespaceUri!==chunkOSFOJTHU_cjs.la)return false;if(s.localName==="dataBinding")return true;if(s.localName!=="lock")return false;let l=s.attributes?.find(d=>d.localName==="val"&&d.namespaceUri===chunkOSFOJTHU_cjs.la)?.value;return l==="contentLocked"||l==="sdtContentLocked"})},o=(i,a,s)=>{if(i.kind==="textValue")return;if(i.kind==="paragraph"){a&&t.add(i.id),s&&n.add(i.id);return}let l=a||i.kind==="table",d=s||r(i);for(let c of i.children??[])o(c,l,d);};return o(e.root,false,false),{inCell:t,held:n}}var qH=32;function KH(e){let t=new Set(chunkOSFOJTHU_cjs.Fk(e).map(n=>chunkOSFOJTHU_cjs.Ik(n)));return chunkOSFOJTHU_cjs.Ek(e)||t.add("nextPage"),t.size===1?[...t][0]:null}function Rg(e,t){let n=t.replaceAt??t.collapseTo;return chunkOSFOJTHU_cjs.Gk(e,n.paragraphId)?t.collapseTo:n}var kg=(e,t)=>chunkOSFOJTHU_cjs.ag(e,t)||chunkOSFOJTHU_cjs.Zf(e,t).content;function Rc(e,t,n,r){if(chunkOSFOJTHU_cjs.Gk(e,t))return ta;if(kg(e,t))return Bs;let{section:o,ownerId:i}=chunkOSFOJTHU_cjs.Hk(e,t);return chunkOSFOJTHU_cjs.Ik(o)===n?null:i!==null&&kg(e,i)?Pc:r?_s:null}function fC(e){let{breakType:t,suggesting:n}=e;if(e.cellRectangle)return ta;if(e.caretParagraphId!==null)return Rc(e.part(),e.caretParagraphId,t,n);let r=$H(e.part());if(!n&&r.inCell.size===0&&r.held.size===0)return null;let{from:o,to:i}=e.orderedRange(),a=e.part(),s=chunkOSFOJTHU_cjs.Hk(a,o.paragraphId),l=chunkOSFOJTHU_cjs.Hk(a,i.paragraphId),d=s.section===l.section,c=d?chunkOSFOJTHU_cjs.Ik(s.section):KH(a),u=e.paragraphOrder(),p=u.indexOf(o.paragraphId),m=u.indexOf(i.paragraphId),g=p===-1||m===-1?null:u.slice(p,m+1),b=g!==null&&!g.some(y=>r.inCell.has(y))&&!g.some(y=>r.held.has(y));if(c!==null&&c!==t){if(b&&d&&s.ownerId!==null&&kg(a,s.ownerId))return Pc;if(n&&b)return _s}if(b&&c!==null)return null;if(g===null||g.length-1>qH)return n&&c!==null&&c!==t?_s:null;let h=Rg(a,e.deleteSelectionPlan());return Rc(a,h.paragraphId,t,n)}var VH=[["contextualSpacing","contextualSpacing"],["keepNext","keepNext"],["keepLines","keepLines"],["widowControl","widowControl"],["pageBreakBefore","pageBreakBefore"]];function jH(e,t){let n={...e??{}};return delete n.leftChars,delete n.startChars,e?.start!==void 0&&(n.start=t),(e?.start===void 0||e.left!==void 0)&&(n.left=t),n}function Tc(e,t,n,r){let o={...e};if(delete o[`${t}Chars`],delete o[`${n}Chars`],r===null)return delete o[t],delete o[n],o;let i=String(r),a=e[n]!==void 0;return a&&(o[n]=i),(!a||e[t]!==void 0)&&(o[t]=i),o}function pC(e,t){let n={...e};return delete n.firstLineChars,delete n.hangingChars,t===null?(delete n.firstLine,delete n.hanging,n):(t>=0?(n.firstLine=String(t),n.hanging="0"):(n.hanging=String(-t),n.firstLine="0"),n)}function mC(e){let{session:t,commit:n,orderedStart:r,orderedRange:o,selectionMark:i,collapsedAt:a}=e,s=e.deleteSelectionPlan,l=()=>t.partFor(e.storyScope())??t.part(),d=(v,C,L)=>t.applyTreeOps(v,C,L,e.storyScope()),c=Vk({session:t,storyPart:l}),u=()=>e.paragraphOrder(),p={get value(){return e.layout()}};function m(){let v=e.selectedCells?.();return v&&v.length>0?v:null}function g(v){let C=false;return n(()=>{let L=v();return C=L.committed,L},void 0,{keepCellSelection:m()!==null}),C}function b(v=o()){if(m()!==null)return [...chunkD7ZMDMPX_cjs.ga(p.value,m())];let{from:C,to:L}=v,A=u(),q=A.indexOf(C.paragraphId),K=A.indexOf(L.paragraphId);return q===-1||K===-1?null:A.slice(q,K+1)}let h=8;function y(v){return S(v)?.level??null}function S(v){return chunkDOHF6FA7_cjs.Qa(p.value,v)}function x(v){let C=S(v);return C?C.numFmt==="bullet"?"bullet":"ordered":null}function I(v,C){let L=u(),A=L.indexOf(v[0]??""),q=L.indexOf(v[v.length-1]??"");if(A===-1||q===-1)return null;for(let K of [A-1,q+1]){let E=L[K];if(!E)continue;let _=S(E);if(_&&(_.numFmt==="bullet"?"bullet":"ordered")===C)return _.numId}return null}function R(v,C){return C<0||C>h?false:e.numberingLevelExists(v.numId,C)}function T(v,C){return C<0||C>h?false:e.numberingLevelExists(v.numId,C)?true:t.ensureNumberingLevel(v.numId,C,v.numFmt==="bullet"?"bullet":"ordered")&&e.numberingLevelExists(v.numId,C)}function P(v,C,L){let A=C==="increase"?1:-1,q=[];for(let K of v){let E=sr(p.value,K),_=S(K),X=_?.level??null;if(_&&X!==null){let U=X+A;if(U<0||U>h||!T(_,U))continue;q.push({op:"setListLevel",paragraphId:K,level:U});continue}let z=Ig(E),oe=L===void 0?Sg(z,A):sC(z,A,L);if(oe===z)continue;let j=chunkOSFOJTHU_cjs.Dh(l(),K),me=j.find(U=>U.localName==="ind");q.push({op:"setParagraphProperties",paragraphId:K,properties:chunkOSFOJTHU_cjs.Fh(j,{localName:"ind",attributes:jH(me?.attributes,String(oe))})});}return q.length===0?false:g(()=>d(q,i()))}function O(v,C){let L=[];for(let A of v){let q=chunkOSFOJTHU_cjs.Dh(l(),A),E={...q.find(_=>_.localName==="ind")?.attributes??{}};C.left!==void 0&&(E=Tc(E,"left","start",C.left)),C.right!==void 0&&(E=Tc(E,"right","end",C.right)),C.firstLine!==void 0&&(E=pC(E,C.firstLine)),L.push({op:"setParagraphProperties",paragraphId:A,properties:chunkOSFOJTHU_cjs.Fh(q,{localName:"ind",...Object.keys(E).length>0?{attributes:E}:{}})});}return L.length===0?false:g(()=>d(L,i()))}return {insertTab(){let v=s(),C=v.replaceAt??v.collapseTo;n(()=>d([...v.ops,{op:"insertTab",paragraphId:C.paragraphId,offset:C.offset}],i()),()=>a({...C,offset:C.offset+1}));},insertLineBreak(){let v=s(),C=v.replaceAt??v.collapseTo;n(()=>d([...v.ops,{op:"insertHardBreak",paragraphId:C.paragraphId,offset:C.offset}],i()),()=>a({...C,offset:C.offset+1}));},insertPageBreak(){let v=s(),C=v.replaceAt??v.collapseTo;n(()=>d([...v.ops,{op:"insertPageBreak",paragraphId:C.paragraphId,offset:C.offset}],i()),()=>a({...C,offset:C.offset+1}));},exitListOnEmptyItem(){let{from:v,to:C}=o();if(v.paragraphId!==C.paragraphId||v.offset!==C.offset)return false;let L=S(v.paragraphId);if(!L||e.paragraphTextOf(v.paragraphId).length>0)return false;let q=L.level>0&&R(L,L.level-1),K=[];if(q)K.push({op:"setListLevel",paragraphId:v.paragraphId,level:L.level-1});else {let _=c.clearOp(v.paragraphId);_&&K.push(_),K.push({op:"setListNumbering",paragraphId:v.paragraphId,numId:null});}let E=false;return n(()=>{let _=d(K,i());return E=_.committed,_}),E},isListParagraph(){let{paragraphId:v}=r();return y(v)!==null},isListActive(v){let C=b();if(C===null)return false;let L=v==="bullet"?"bullet":"ordered";return C.length>0&&C.every(A=>x(A)===L)},toggleList(v){let C=b();if(C===null||C.length===0)return false;let L=C.every(K=>x(K)===v),A=L?null:I(C,v)??t.ensureListDefinition(v);if(!L&&A===null)return false;let q=L?[]:c.applyOps(C);for(let K of C){let E=y(K);q.push({op:"setListNumbering",paragraphId:K,numId:A,...E!==null?{level:E}:{}});}return g(()=>d(q,i()))},canAdjustIndent(v){let C=b();if(C===null)return false;let L=v==="increase"?1:-1;return C.some(A=>{let q=S(A);if(q){let E=q.level+L;return E>=0&&E<=h}let K=Ig(sr(p.value,A));return Sg(K,L)!==K})},adjustIndent(v){let C=b();return C!==null&&P(C,v)},setIndent(v){if(v.left===void 0&&v.right===void 0&&v.firstLine===void 0)return false;let C=b();return C!==null&&O(C,v)},indentWithTab(v){let C=o();if(C.from.paragraphId===C.to.paragraphId&&C.from.offset===C.to.offset&&m()===null||uC(p.value,C))return false;let A=b(C);if(A===null)return false;let q=Math.round(chunkDOHF6FA7_cjs.zb(t.settingsRoot())*20),K=cC(p.value,l(),u()),E=m()===null?dC(C,A,K,v,q):{write:"stepLeft",paragraphs:A};return E===null?false:(E.write==="stepLeft"?P(E.paragraphs,v,q):O(E.paragraphs,{firstLine:E.write==="setFirstLine"?q:null}),true)},setParagraphFormat(v){let C=b();if(C===null||C.length===0)return false;let L=[];v.direction!==void 0&&L.push({localName:"bidi",paragraphDirection:v.direction}),v.alignment!==void 0&&L.push({localName:"jc",attributes:{val:v.alignment},physicalAlignment:true});let A={...ea("before",v.spaceBeforePt),...ea("after",v.spaceAfterPt),...kc(v.lineSpacing)};Object.keys(A).length>0&&L.push({localName:"spacing",attributes:A,mergeAttributes:true});for(let[_,X]of VH){let z=v[_];z!==void 0&&L.push({localName:X,attributes:rC(z)});}let q=v.tabStops!==void 0,K=v.indentLeftTwips!==void 0||v.indentRightTwips!==void 0||v.indentFirstLineTwips!==void 0;if(L.length===0&&!K&&!q)return false;let E=[];for(let _ of C){let X=chunkOSFOJTHU_cjs.Dh(l(),_),z=X;if(K){let F={...X.find(N=>N.localName==="ind")?.attributes??{}};v.indentLeftTwips!==void 0&&(F=Tc(F,"left","start",v.indentLeftTwips)),v.indentRightTwips!==void 0&&(F=Tc(F,"right","end",v.indentRightTwips)),v.indentFirstLineTwips!==void 0&&(F=pC(F,v.indentFirstLineTwips)),z=chunkOSFOJTHU_cjs.Fh(z,{localName:"ind",...Object.keys(F).length>0?{attributes:F}:{}});}let oe=sr(p.value,_),j=X,me=false;for(let U of L){let F=wc(U,oe,z,j);if(!F)continue;if(me=true,F.remove){z=z.filter($=>$.localName!==F.localName);continue}let N=F.mergeAttributes?{...z.find($=>$.localName===F.localName)?.attributes??{},...F.attributes}:F.attributes??{},B=Object.fromEntries(Object.entries(N).filter(([,$])=>$!=null));z=chunkOSFOJTHU_cjs.Fh(z,{localName:F.localName,...Object.keys(B).length>0?{attributes:B}:{}});}if((me||K)&&E.push({op:"setParagraphProperties",paragraphId:_,properties:z}),q){let U=Ts(e.layout(),_);E.push({op:"setParagraphTabStops",paragraphId:_,stops:v.tabStops.map(F=>({positionTwips:Math.round(F.positionTwips),alignment:F.alignment,...F.leader&&F.leader!=="none"?{leader:F.leader}:{}})),...U?{inForcePositionsTwips:U.stops.map(F=>Math.round(F.positionPt*20))}:{}});}}return E.length===0?false:g(()=>d(E,i()))},sectionProperties:()=>chunkDOHF6FA7_cjs.Nc(t.part()),sectionPropertiesAt(v){let C=chunkDOHF6FA7_cjs.Oc(t.part(),e.revisionDisplayMode(),e.revisionAuthorFilter()),L=Hs(t,v,e.storyScope(),e.headerFooterSectionIndex?.(),e.revisionDisplayMode(),e.revisionAuthorFilter());return (C[L]??C[C.length-1]).properties},sectionAnchorParagraphAt(v){return nC(t,v,e.storyScope(),e.headerFooterSectionIndex?.(),e.revisionDisplayMode(),e.revisionAuthorFilter())},setSectionProperties(v){let C=false;return n(()=>{let L=e.storyScope().kind==="body",A=t.applyTreeOps([{op:"setSectionProperties",...v}],L?i():void 0,void 0,{kind:"body"});return C=A.committed,A}),C},sectionBreakRefusal(v="nextPage"){return e.storyScope().kind!=="body"?null:fC({part:()=>t.part(),breakType:v,suggesting:e.editingMode?.()==="suggest",cellRectangle:(e.selectedCells?.()?.length??0)>0,caretParagraphId:e.caretParagraphId?.()??null,orderedRange:o,paragraphOrder:u,deleteSelectionPlan:s})},insertSectionBreak(v="nextPage"){if(e.storyScope().kind!=="body")return false;let C=s(),L=Rg(t.part(),C),A=(chunkOSFOJTHU_cjs.Gk(t.part(),L.paragraphId)?ta:null)??Rc(t.part(),L.paragraphId,v,e.editingMode?.()==="suggest");if(A!==null)return e.publishRefusal?.(A),false;let q=new Set(t.paragraphIds()),K=false,E=false;return n(()=>{let _=t.applyTreeOps([...C.ops,{op:"splitParagraph",paragraphId:L.paragraphId,offset:L.offset},{op:"setSectionMark",paragraphId:L.paragraphId,breakType:v}],i(),void 0,{kind:"body"});return K=_.committed,E=_.reason==="locked"||_.reason==="bound",_},()=>{let _=t.paragraphIds().find(X=>!q.has(X));return _?a({paragraphId:_,offset:0}):null}),!K&&E&&e.publishRefusal?.(Bs),K}}}var vC="http://schemas.openxmlformats.org/wordprocessingml/2006/main";function xC(e){return e.kind==="textValue"?false:e.kind==="contentControl"?true:e.kind==="generic"&&e.localName==="sdt"&&e.namespaceUri===vC}function WH(e){return e.kind==="textValue"?false:e.kind==="contentControlContent"?true:e.kind==="generic"&&e.localName==="sdtContent"&&e.namespaceUri===vC}function Pg(e){return e.kind==="textValue"?[]:e.children}function wC(e,t=0){if(e.kind==="textValue")return e.value;if(t>=chunkOSFOJTHU_cjs.wa||e.kind==="deletedText"||ZH(e.kind)||chunkOSFOJTHU_cjs.tf(e)||e.kind==="runProperties")return "";let n=chunkOSFOJTHU_cjs.fb(e);if(n!==null)return n;if(e.kind==="generic"&&!chunkOSFOJTHU_cjs.ya(e)&&!xC(e))return "";if(e.kind==="tab")return " ";if(e.kind==="hardBreak")return chunkOSFOJTHU_cjs.pb(e);let r=chunkOSFOJTHU_cjs.xa(e,t),o="";for(let i of e.children)o+=wC(i,r);return o}function ZH(e){return e==="revisionDelete"||e==="revisionMoveFrom"}function Tg(e,t,n){if(!(t>=chunkOSFOJTHU_cjs.wa))for(let r of e){if(r.kind==="hyperlink"){chunkOSFOJTHU_cjs.xa(r,t)<chunkOSFOJTHU_cjs.wa&&n(r,t);continue}if(chunkOSFOJTHU_cjs.ya(r)){Tg(Pg(r),chunkOSFOJTHU_cjs.xa(r,t),n);continue}if(xC(r)){for(let o of Pg(r))WH(o)&&Tg(Pg(o),chunkOSFOJTHU_cjs.xa(r,t),n);continue}n(r,t);}}function gC(e,t,n){let r=zH(e,t);if(!r||r.kind!=="paragraph")return [];let o=chunkOSFOJTHU_cjs.jg(r),i=[],a=0;return Tg(r.children,0,(s,l)=>{let d=o.spanOf(s);if(d&&(a=Math.max(a,d.end)),s.kind!=="hyperlink")return;let c=d?d.start:a,u=d?d.end:a,p=chunkOSFOJTHU_cjs.Bd(s,n);i.push({id:s.id,paragraphId:t,start:c,end:u,text:chunkOSFOJTHU_cjs.jb(wC(s,l)),kind:p.kind,href:p.href,authored:p.authored,...p.anchor!==void 0?{anchor:p.anchor}:{},...p.tooltip!==void 0?{tooltip:p.tooltip}:{}});}),i}function zH(e,t){let n=r=>{if(r.kind==="textValue")return r.id===t?r:null;if(r.id===t)return r;for(let o of r.children){let i=n(o);if(i)return i}return null};return n(e.root)}function UH(e,t){for(let n of e)if(n.paragraphId===t.paragraphId&&t.offset>=n.start&&t.offset<=n.end)return n;return null}function GH(e,t){for(let n of chunkDOHF6FA7_cjs.Ga(e,t.paragraphId))for(let r of n.lines)for(let o of r.spans)if(!(!o.fieldAtom||!o.link)&&t.offset>=o.range.start&&t.offset<=o.range.end)return o.link.id;return null}function SC(e){let t=()=>e.storyScope(),n=()=>e.session.partFor(t()),r=d=>e.session.relationshipTarget(d,t()),o=(d,c,u)=>e.session.applyTreeOps(d,c,u,t()),i=d=>{let c=n();return c?gC(c,d,r):[]},a=()=>UH(i(e.selection().head.paragraphId),e.selection().head),s=()=>{let d=e.selection().head,c=GH(e.layout(),d);return c===null?null:e.fieldLinkById(c)},l=d=>{let c=e.selection().head.paragraphId,u=i(c).find(p=>p.id===d);if(u)return u;for(let p of e.session.storyParts()){let m=g=>chunkOSFOJTHU_cjs.Ig(e.session.currentPackage(),p.name,g);for(let g of chunkOSFOJTHU_cjs.Oc(p))for(let b of chunkOSFOJTHU_cjs.Rc(g.root)){let h=b.id,y=gC(p,h,m).find(S=>S.id===d);if(y)return y}}return null};return {linksInCaretParagraph:()=>i(e.selection().head.paragraphId),linkAtCaret:a,fieldLinkAtCaret:s,linkById:l,applyHyperlink(d){let c=d.text===void 0?d:{...d,text:chunkOSFOJTHU_cjs.kb(d.text)},u=c.url!==void 0&&c.url.length>0,p=c.anchor!==void 0&&c.anchor.length>0;if(u===p)return false;let m=t();if(!n()||e.refusesWrite())return false;let g;if(u){let C=()=>e.session.ensureHyperlinkRelationship(c.url,m),L=e.withMintActor?e.withMintActor(C):C();if(!L)return false;g=L;}let b={...g!==void 0?{relationshipId:g}:{},...p?{anchor:c.anchor}:{},...c.tooltip!==void 0?{tooltip:c.tooltip}:{}},h=a(),y=e.orderedRange(),S=y.from.paragraphId===y.to.paragraphId&&y.from.offset===y.to.offset;if(h&&(S||XH(h,y))){let C=[];if(c.text!==void 0&&c.text!==chunkOSFOJTHU_cjs.kb(h.text)){if(c.text.length===0)return false;let A=e.replacementLanding?.(h.paragraphId,h.start,h.end),q=e.textOf(h.paragraphId).slice(h.start,h.start+2),K=h.start+(q.length===2&&q.charCodeAt(0)>=55296&&q.charCodeAt(0)<=56319&&q.charCodeAt(1)>=56320&&q.charCodeAt(1)<=57343?2:1);if(A!=null&&A>h.start&&K<h.end)C.push({op:"setHyperlinkTarget",linkId:h.id,...b},{op:"deleteText",paragraphId:h.paragraphId,start:h.start,end:h.end},{op:"insertText",paragraphId:h.paragraphId,offset:K,text:c.text});else if(A!=null){let E=hC(e.session);C.push({op:"setHyperlinkTarget",linkId:h.id,...b},...yC(h,A,c.text),{op:"insertHyperlink",paragraphId:h.paragraphId,start:A,end:A+c.text.length,...b,...E?{styleId:E}:{}});}else {let E=bC(h.paragraphId,h.start,h.end,c.text);if(!E)return false;C.push({op:"setHyperlinkTarget",linkId:h.id,...b},...E);}}else C.push({op:"setHyperlinkTarget",linkId:h.id,...b});let L=false;return e.commit(()=>{let A=o(C,e.selectionMark());return L=A.committed,A},()=>null),L}let x=y.from.paragraphId;if(y.to.paragraphId!==x)return false;let I=[],R=y.from.offset,T=y.to.offset;if(S){let C=c.text??c.url??c.anchor??"";if(C.length===0)return false;R=e.insertionLanding?.(x,R)??R,I.push({op:"insertText",paragraphId:x,offset:R,text:C}),T=R+C.length;}else {let C=e.replacementLanding?.(x,R,T);if(C!=null){let L=c.text??e.textOf(x).slice(R,T);if(L.length===0)return false;I.push(...yC({paragraphId:x,start:R,end:T},C,L)),R=C,T=C+L.length;}else if(c.text!==void 0&&c.text!==e.textOf(x).slice(R,T)){let L=bC(x,R,T,c.text);if(!L)return false;I.push(...L),T=R+c.text.length;}}if(T<=R)return false;let P=hC(e.session);I.push({op:"insertHyperlink",paragraphId:x,start:R,end:T,...b,...P?{styleId:P}:{}});let O=false,v={paragraphId:x,offset:T};return e.commit(()=>{let C=o(I,e.selectionMark(),{paragraphId:x,start:T,end:T});return O=C.committed,C},()=>({anchor:v,head:v})),O},removeHyperlink(d){if(!n())return false;let c=d?l(d):a();if(!c)return false;let u=false,p={paragraphId:c.paragraphId,offset:c.end};return e.commit(()=>{let m=o([{op:"removeHyperlink",linkId:c.id}],e.selectionMark());return u=m.committed,m},()=>({anchor:p,head:p})),u}}}function hC(e){for(let t of e.documentStyles())if(t.type==="character"&&t.styleId.toLowerCase()==="hyperlink")return t.styleId;return null}function XH(e,t){return t.from.paragraphId===e.paragraphId&&t.to.paragraphId===e.paragraphId&&t.from.offset>=e.start&&t.to.offset<=e.end}function yC(e,t,n){return [{op:"deleteText",paragraphId:e.paragraphId,start:e.start,end:e.end},{op:"insertText",paragraphId:e.paragraphId,offset:t,text:n}]}function bC(e,t,n,r){if(r.length===0)return null;let o=[{op:"insertText",paragraphId:e,offset:t,text:r,bias:"right"}];return n>t&&o.push({op:"deleteText",paragraphId:e,start:t+r.length,end:n+r.length}),o}var YH=24;function IC(e){let{pagesLayer:t}=e,n=t.ownerDocument.defaultView;function r(){return e.container.closest(".docx-editor__scroll-container")}let o=p=>{if(!p||p.length===0||p.startsWith("#"))return false;let m=chunkOSFOJTHU_cjs.Q(p);return !m.ok||!m.href||!n?false:(n.open(m.href,"_blank","noopener,noreferrer"),true)},i=p=>{if(e.enterStoryFor&&!e.enterStoryFor(p.paragraphId))return false;let m=e.layout(),g=chunkDOHF6FA7_cjs.ne(m,p);if(!g)return false;let b=m.pages[g.pageIndex];if(!b)return false;let h=b.box.y+(b.contentBox.y-b.box.y)+g.y,y=r();return y&&(y.scrollTop=Math.max(0,h*e.scale()-YH),e.onScrolled?.()),e.setSelection(p),true},a=p=>{let m=e.bookmarks().get(p);return m?i(m):false},s=null;function l(p){if(!p||p.closest("[data-docx-hf]"))return null;let m=p.closest("a.docx-hyperlink");if(m){let b=m.dataset.docxLink;return b?{linkId:b,drawing:false}:null}let g=p.closest("[data-docx-drawing-link]");if(g){let b=g.dataset.docxDrawingLink;return b?{linkId:b,drawing:true}:null}return null}let d=p=>{s=null;let m=p.target,g=l(m);if(!g)return;let h=m.closest("[data-docx-drawing-link], a.docx-hyperlink").getBoundingClientRect();s={linkId:g.linkId,drawing:g.drawing,rect:{left:h.left,top:h.top,bottom:h.bottom,right:h.right}};},c=p=>{let m=p.target,g=l(m);if(!g){let y=s;if(s=null,!y)return;p.preventDefault(),u(y.linkId,y.rect,p,y.drawing);return}s=null,p.preventDefault();let h=m.closest("[data-docx-drawing-link], a.docx-hyperlink").getBoundingClientRect();u(g.linkId,{left:h.left,top:h.top,bottom:h.bottom,right:h.right},p,g.drawing);};function u(p,m,g,b){let h=b?e.drawingLinkById?.(p)??null:e.linkById(p);if(!h)return;if(g.metaKey||g.ctrlKey){h.kind==="external"?o(h.href):h.anchor&&a(h.anchor);return}if(e.isCollapsedSelection()){if(h.kind==="internal"){h.anchor&&a(h.anchor);return}e.onPopover?.({link:h,rect:m});}}return t.addEventListener("pointerdown",d,true),t.addEventListener("click",c),{goToPosition:i,goToBookmark:a,openExternal:o,destroy(){t.removeEventListener("pointerdown",d,true),t.removeEventListener("click",c);}}}function QH(e){let t=e.hyperlinkHref;if(!t)return null;let n=e.kind==="anchoredDrawing"?e.anchorParagraphId:e.paragraphId,r=e.kind==="inlineDrawing"?e.start:0,o=t.startsWith("#")?"internal":"external";return Object.freeze({id:e.drawingNodeId,paragraphId:n,start:r,end:r+1,text:"",kind:o,href:t,authored:t,...o==="internal"?{anchor:t.slice(1)}:{}})}function Cg(e,t){return e.drawingNodeId!==t?null:QH(e)}function kC(e,t){if(!e)return null;for(let n of e.anchoredDrawings??[]){let r=Cg(n,t);if(r)return r}return null}function JH(e,t){for(let r of e.anchoredDrawings??[]){let o=Cg(r,t);if(o)return o}for(let r of e.fragments){if(r.kind==="table"){for(let i of r.rows)for(let a of i.cells)for(let s of a.blocks){let l=PC(s,t);if(l)return l}continue}let o=RC(r,t);if(o)return o}let n=kC(e.header,t);return n||kC(e.footer,t)}function RC(e,t){for(let n of e.lines)for(let r of n.drawings??[]){let o=Cg(r,t);if(o)return o}return null}function PC(e,t){if(e.kind==="table"){for(let n of e.rows)for(let r of n.cells)for(let o of r.blocks){let i=PC(o,t);if(i)return i}return null}return RC(e,t)}function TC(e,t){for(let n of e.pages){let r=JH(n,t);if(r)return r}return null}var Cc=24;function CC(e){let t=null,n=false;return {without(r){let o=n;n=true;try{return r()}finally{n=o;}},follow(r,o){let i=n?"none":o;if(e.storyScopeOpen())return;let a=e.selection();if(!(a.anchor.paragraphId===a.head.paragraphId&&a.anchor.offset===a.head.offset)&&i!=="head")return;let l=e.pagesLayer.ownerDocument.activeElement;if(l!==e.pagesLayer&&(!l||!e.pagesLayer.contains(l)))return;let d=e.preferredPageIndex(),c=e.preferredLineId?.(),u=e.layout(),p=chunkDOHF6FA7_cjs.ne(u,a.head,{measurer:e.measurer(),...d!==void 0?{preferredPageIndex:d}:{},...c!==void 0?{preferredLineId:c}:{}});if(!p)return;let m=t!==null&&t!==p.pageIndex;if(t=p.pageIndex,i==="none"||!r&&!m)return;let g=u.pages[p.pageIndex],b=e.scroller();if(!g||!b||b.clientHeight<=0)return;let h=e.scale(),y=g.contentBox.y-g.box.y,S=(g.box.y+y+p.y)*h+e.container.offsetTop,x=S+p.height*h,I=b.scrollTop,R=I+b.clientHeight,T=I;if(S<I+Cc)T=S-Cc;else if(x>R-Cc)T=x+Cc-b.clientHeight;else return;let P=Math.max(0,b.scrollHeight-b.clientHeight),O=Math.max(0,Math.min(T,P));Math.abs(O-b.scrollTop)<.5||(b.scrollTop=O,e.scheduleRematerialize());}}}function EC(e,t){let n=[],r=a=>{for(let s of a){if(s.kind==="paragraph"){n.push({id:s.id,length:chunkOSFOJTHU_cjs.jg(s).length});continue}if(s.kind==="textValue")continue;if(s.kind==="contentControl"){r(t.contentChildrenOf(s));continue}r(s.children);}};if(r(t.contentChildrenOf(e)),n.length>0){let a=n[0],s=n[n.length-1];return {anchor:{paragraphId:a.id,offset:0},head:{paragraphId:s.id,offset:s.length}}}let o=null,i=a=>{for(let s of a){if(s.kind==="paragraph"){let l=chunkOSFOJTHU_cjs.jg(s).spanOf(e);if(!l)continue;return o={anchor:{paragraphId:s.id,offset:l.start},head:{paragraphId:s.id,offset:l.end}},true}if(s.kind!=="textValue"&&i(s.children))return true}return false};return i(t.searchRoots()),o}function OC(e){return {applyHeaderFooterLifecycle(t){let n=null;return e.commit(()=>{let r=e.applyOps([t]);return r.rejected&&(n=String(r.reason??"rejected")),r}),n?{ok:false,reason:n}:{ok:true}},insertPageField(t){if(!e.isHeaderFooterOpen())return false;let n=e.deleteSelectionPlan(),r=n.replaceAt??n.collapseTo;return e.commit(()=>e.applyOps([...n.ops,{op:"insertPageField",paragraphId:r.paragraphId,offset:r.offset,field:t}],e.selectionMark()),()=>e.collapsedAt({paragraphId:r.paragraphId,offset:r.offset+(t==="PAGE_X_OF_Y"?6:1)})),e.lastRejection()===null}}}var $s="the document is open for viewing",Eg="image changes are not supported in suggesting mode",MC="tracked changes need a non-empty author";function AC(e){function t(){return {committed:false,rejected:true,opCount:0,reason:$s}}function n(){return {committed:false,rejected:true,opCount:0,reason:Eg}}return {applyDrawingOps(r){if(e.editingMode()==="view")return t();if(e.editingMode()==="suggest")return n();let o=e.selectionMark(),i={committed:false,rejected:true,opCount:0};return e.commit(()=>(i=e.applyOps(r,o,o),i)),i},applyImageProperties(r){if(e.editingMode()==="view")return {ok:false,reason:"invalidArgs",detail:$s};if(e.editingMode()==="suggest")return {ok:false,reason:"invalidArgs",detail:Eg};let o={ok:false,reason:"invalidArgs"};return e.commit(()=>(o=e.session.applyImageProperties(e.storyScope(),r),{committed:o.ok,rejected:!o.ok,opCount:o.ok?1:0,...o.ok?{}:{reason:o.detail??o.reason}})),o},deleteImage(r){if(e.editingMode()==="view")return {ok:false,reason:"invalidArgs",detail:$s};let o=e.editingMode()==="suggest",i=e.author();if(o&&(i===void 0||i===""))return {ok:false,reason:"invalidArgs",detail:MC};let a={ok:false,reason:"invalidArgs"};return e.commit(()=>(a=o?e.session.deleteImageTracked(e.storyScope(),r,{author:i,date:e.trackedDate()}):e.session.deleteImage(e.storyScope(),r),{committed:a.ok,rejected:!a.ok,opCount:a.ok?1:0,...a.ok?{}:{reason:a.detail??a.reason}})),a},insertImage(r){if(e.editingMode()==="view")return Promise.resolve({ok:false,reason:"invalidArgs",detail:$s});let o=e.editingMode()==="suggest",i=e.author();if(o&&(i===void 0||i===""))return Promise.resolve({ok:false,reason:"invalidArgs",detail:MC});let a=e.actorId();return e.session.insertImage(e.storyScope(),{...r,decodePort:e.decodePort(),...o?{revision:{author:i,date:e.trackedDate()}}:{},...a?{actorId:a}:{}})},replaceImage(r,o,i,a){if(e.editingMode()==="view")return Promise.resolve({ok:false,reason:"invalidArgs",detail:$s});if(e.editingMode()==="suggest")return Promise.resolve({ok:false,reason:"invalidArgs",detail:Eg});let s=e.actorId();return e.session.replaceImage(e.storyScope(),r,o,i,e.decodePort(),{...a,commitGuard:()=>e.editingMode()==="edit"&&a.commitGuard?.()!==false,...s?{actorId:s}:{}})}}}function FC(e){let t=null,n=null,r="",o=()=>{let d=e.session.part(),c=e.revisionDisplayMode(),u=e.revisionAuthorFilter();return {sections:chunkDOHF6FA7_cjs.Oc(d,c,u),sourceIndexes:chunkDOHF6FA7_cjs.Pc(d,c,u)}},i=d=>{let{sourceIndexes:c}=o(),u=c.indexOf(d);if(u!==-1)return u;let p=c.findIndex(m=>m>d);return p===-1?Math.max(0,c.length-1):p},a=()=>{if(!t)return;let d=eS(e.layout(),t,e.materializedPages?.());d!==t.pageIndex&&(t={...t,pageIndex:d,sectionIndex:e.sectionAtPage(d).sectionIndex});},s=d=>{if(e.entryRefused?.()===true&&t?.scope.rId!==d.rId||!d.rId||e.session.partFor({kind:"headerFooter",rId:d.rId})===null)return false;t?.scope.rId!==d.rId&&e.leaveOtherStories?.();let c=e.layout(),u=Yw(c,d.rId),p=t,m=p?.scope.rId===d.rId,g=u?null:e8(e.session,d.rId);if(!u&&!g)return false;let b=d.pageIndex??(m&&p?p.pageIndex:u?.pageIndex??0),h=d.kind??(m&&p?p.kind:u?.kind??g.kind),y=d.variant??(m&&p?p.variant:u?.story.variant??g.variant),S=m&&p?p.partName:u?.story.partName??g.partName,x=c.pages[b]??c.pages[u?.pageIndex??0],I=(x?Di(x,{scope:{kind:"headerFooter",rId:d.rId},kind:h,partName:S}):null)??u?.story??{scope:{rId:d.rId},variant:y,partName:S},R=e.selection(),T=p?p.savedBodySelection:{anchor:{...R.anchor},head:{...R.head}},P=m&&p?.sectionIndex!==void 0&&b===p.pageIndex,O=d.sectionIndex??(P?p.sectionIndex:u?e.sectionAtPage(b).sectionIndex:g?i(g.sectionIndex):void 0);t={scope:{kind:"headerFooter",rId:d.rId},pageIndex:b,...O!==void 0?{sectionIndex:O}:{},kind:h,variant:I.variant,partName:I.partName,savedBodySelection:T};let C=e.session.paragraphIdsIn(gd(t))[0];if(!C)return t=null,false;let L=d.position?bd(c,{anchor:d.position,head:d.position},t):m?bd(c,R,t):{anchor:{paragraphId:C,offset:0},head:{paragraphId:C,offset:0}};return e.setScopeSelection(L),e.noteModelMoved(),e.render(),e.mirrorToDom(),e.notify(),true},l=()=>{if(!t)return;let d=t.savedBodySelection;t=null,e.setScopeSelection(bd(e.layout(),d,null)),e.noteModelMoved(),e.render(),e.mirrorToDom(),e.notify();};return {getActive:()=>t,activeScope:()=>Xw(t),setActiveScope(d){return d.kind==="body"?(l(),true):d.kind==="headerFooter"?s({rId:d.rId}):false},enterHeaderFooter:s,exitHeaderFooter:l,reconcileOccurrence:a,headerFooterState(){if(!t)return null;let d=e.session.headerFooterResolutionBySection(),c=t.sectionIndex??0,u=o(),p,m,g,b=x=>{let I=u.sourceIndexes[x]??x,R=d[I];if(!R)return false;let P=(t.kind==="header"?R.headers:R.footers).get(t.variant);return !P||P.rId!==t.scope.rId?false:(c=x,p=P.inherited,m=R.titlePage,g=R.evenAndOddHeaders,true)};if(!(t.sectionIndex!==void 0&&b(t.sectionIndex))){let x;d.forEach((I,R)=>{let P=(t.kind==="header"?I.headers:I.footers).get(t.variant);!P||P.rId!==t.scope.rId||!(x===void 0||x&&!P.inherited||x===P.inherited&&i(R)<c)||(c=i(R),p=P.inherited,m=I.titlePage,g=I.evenAndOddHeaders,x=P.inherited);});}let h=u.sections[c]?.properties??u.sections.at(-1)?.properties,y=h?.margins.headerTwips,S=h?.margins.footerTwips;return {editing:t.kind,sectionIndex:c,variant:t.variant,rId:t.scope.rId,partName:t.partName,...p!==void 0?{inherited:p}:{},...m!==void 0?{titlePage:m}:{},...g!==void 0?{evenAndOddHeaders:g}:{},...y!==void 0?{headerDistanceTwips:y}:{},...S!==void 0?{footerDistanceTwips:S}:{}}},headerFooterStateStable(d){if(!t)return n=null,r="",null;let c=this.headerFooterState();if(!c)return null;let u=[d,c.editing,c.sectionIndex,c.variant??"",c.rId??"",c.partName??"",String(c.inherited),String(c.titlePage),String(c.evenAndOddHeaders),String(c.headerDistanceTwips??""),String(c.footerDistanceTwips??"")].join("|");return n&&r===u||(n=Object.freeze({...c}),r=u),n}}}function LC(e){return e.length>0&&e.every(t=>t.op==="setDocumentProtection")}function e8(e,t){let n=e.headerFooterResolutionBySection();for(let r=0;r<n.length;r+=1){let o=n[r];for(let i of ["header","footer"]){let a=i==="header"?o.headers:o.footers;for(let[s,l]of a)if(l.rId===t)return {sectionIndex:r,kind:i,variant:s,partName:l.partName}}}return null}function NC(e,t,n){let{sectionIndex:r,sectionStart:o}=e.sectionAtPage(n),i=p=>p[Math.min(r,Math.max(0,p.length-1))],a=p=>{let m=i(p);return t==="header"?m?.headers:m?.footers},s=e.session.headerFooterResolutionBySection(),l=i(s),d=e.layout.pages[n]?.pageFieldSource?.pageNumber??n+1,c=l?.evenAndOddHeaders&&d%2===0?"even":l?.titlePage&&n===o?"first":"default",u=a(s)?.get(c)?.rId;if(!u){if(!e.create({op:"createHeaderFooter",sectionIndex:r,kind:t,variant:c,...c==="first"?{titlePage:true}:{},...c==="even"?{evenAndOddHeaders:true}:{}})?.ok)return;u=a(e.session.headerFooterResolutionBySection())?.get(c)?.rId,e.flushLayout();}u&&e.enter({rId:u,pageIndex:n,sectionIndex:r,kind:t,variant:c});}var t8=500;function n8(e,t,n,r){let o=e.part(),i=chunkDOHF6FA7_cjs.qd(o,n,r),a=chunkDOHF6FA7_cjs.Lc(o);return t.map((s,l)=>{let d=s.blockStart<s.blockEndExclusive?i[s.blockEndExclusive-1]:void 0,c=d?.kind==="paragraph"?chunkDOHF6FA7_cjs.Mc(d):void 0;return c||(l===t.length-1&&a?.kind!=="textValue"?a:void 0)})}function DC(e,t){if(!e)return null;let n=e.session,r=chunkDOHF6FA7_cjs.Ya(e.revisionDisplayMode()),o=e.state().selection.head.paragraphId,i=Hs(n,o,e.activeScope().kind==="headerFooter"?{kind:"headerFooter",rId:e.headerFooterState()?.rId??""}:Rt(n,o,{kind:"body"}),e.headerFooterState()?.sectionIndex,r,t),a=n.currentPackage(),s=chunkOSFOJTHU_cjs.Tg(a),l=chunkOSFOJTHU_cjs.Ug(s),d=chunkOSFOJTHU_cjs.Vg(s),c=chunkDOHF6FA7_cjs.Oc(n.part(),r,t),u=n8(n,c,r,t),p=chunkOSFOJTHU_cjs.Rg(u[i]),m=chunkOSFOJTHU_cjs.Sg(u[i]),g=chunkOSFOJTHU_cjs.Wg(p,l),b=chunkOSFOJTHU_cjs.Xg(m,d);return {sectionIndex:i,footnote:{resolved:g,...l?{documentAuthored:l}:{},...p?{sectionAuthored:p}:{}},endnote:{resolved:b,...d?{documentAuthored:d}:{},...m?{sectionAuthored:m}:{}}}}function HC(e,t){let n=chunkOSFOJTHU_cjs.pc(t);if(!n)return null;let r=chunkOSFOJTHU_cjs.ch(e.currentPackage(),n.noteKind);if(!r)return null;let o=r,i=chunkOSFOJTHU_cjs.Lc(o.root,n.noteId);if(!i)return null;let a=[],s=t8,l=(c,u)=>{if(!(u>32||s<=0)){if(c.kind==="paragraph"&&typeof c.id=="string"){let p=(chunkOSFOJTHU_cjs.Vi(o,c.id)??"").replace(/\uFFFC/g,"").trim();if(p){let m=p.slice(0,s);a.push(m),s-=m.length;}return}if(c.kind!=="textValue")for(let p of c.children)l(p,u+1);}};l(i,0);let d=a.filter(Boolean).join(" ").trim();return d.length>0?d:null}function _C(e){return [()=>{chunkOSFOJTHU_cjs.zb(e().root);},()=>{chunkOSFOJTHU_cjs.lj(e());},()=>{chunkOSFOJTHU_cjs._j(e());}]}var r8=50,o8=16;function BC(e){let t=e.schedule??((s,l)=>{let d=setTimeout(s,l);return ()=>clearTimeout(d)}),n=false,r=null,o=0,i=0,a=s=>{r=t(()=>{if(r=null,!(n||i>=e.steps.length||!e.shouldRun())){if(e.hasPendingInput()){if(o+=1,o>r8)return;a(o8);return}try{e.steps[i]();}catch{return}i+=1,i<e.steps.length&&a(0);}},s);};return a(0),()=>{n=true,r&&r(),r=null;}}var _r=null;function qs(e,t,n){let r=_r;_r=t===void 0?null:{owner:e,group:t};try{return n()}finally{_r=r;}}function Og(e){if(_r===null||_r.owner!==e)return;let{group:t}=_r;return _r=null,t}function i8(e,t){_r===null&&(_r={owner:e,group:t});}var Ec=class{current;get value(){return this.current}around(t,n,r,o=true){let i=this.current,a=Og(t);this.current=a??(o?Symbol("command"):void 0);let s;try{s=n();}finally{this.current=i;}return a!==void 0&&!r(s)&&i8(t,a),s}};function $C(e,t){let n=t.indexOf("#"),r=n>0?t.slice(0,n):e.mainDocumentPart,o=e.parts.get(r);return o?chunkOSFOJTHU_cjs.Ta(o,t):null}function qC(e){let{anchor:t,head:n}=e;return t.paragraphId!==n.paragraphId||t.offset!==n.offset?null:`${n.paragraphId}\0${n.offset}`}var a8=1e3,s8=2e3,Oc=class{constructor(t,n=()=>performance.now()){this.currentPackage=t;this.now=n;}currentPackage;now;group;expected=null;startedAt=0;lastTypedAt=0;paragraphId=null;landedNode=null;groupAt(t){let n=this.now();return (this.group===void 0||qC(t)!==this.expected||n-this.lastTypedAt>=a8||n-this.startedAt>=s8||n<this.lastTypedAt)&&(this.group=Symbol("typing"),this.startedAt=n),this.lastTypedAt=n,this.group}landed(t){this.expected=qC(t),this.paragraphId=this.expected===null?null:t.head.paragraphId;let n=this.paragraphId;this.landedNode=n===null?null:$C(this.currentPackage(),n),this.expected===null&&(this.group=void 0);}noteForeignChange(t){let n=this.paragraphId;if(n===null||t.origin===chunkOSFOJTHU_cjs.g.projection||t.origin===chunkOSFOJTHU_cjs.g.awareness)return;if(t.dirty.includes(n)||t.deleted.includes(n))return this.end();if(t.dirty.length>0||t.deleted.length>0)return;let r=this.landedNode,o=$C(this.currentPackage(),n);r!==o&&(r===null||o===null||!chunkOSFOJTHU_cjs.Da(r,o))&&this.end();}end(){this.group=void 0,this.expected=null,this.paragraphId=null,this.landedNode=null;}};function Mg(e){return e.bound?"bound":e.effectiveLock==="contentLocked"||e.effectiveLock==="sdtContentLocked"?"locked":null}function KC(e){return e.effectiveLock==="sdtLocked"||e.effectiveLock==="sdtContentLocked"?"locked":null}function VC(e,t){for(let n of e.children)if(n.kind!=="textValue"&&!(n.kind!=="contentControlProperties"&&n.localName!=="sdtPr")){if(n.children.some(r=>r.kind!=="textValue"&&r.localName==="dataBinding")&&t==="edit")return "bound";for(let r of n.children){if(r.kind==="textValue"||r.localName!=="lock")continue;let o=r.attributes.find(i=>i.localName==="val")?.value;if(t==="remove"){if(o==="sdtLocked"||o==="sdtContentLocked")return "locked"}else if(o==="contentLocked"||o==="sdtContentLocked")return "locked"}}return null}function na(e,t,n=true){let r=e.createElement("div");return r.className=t,r.contentEditable="false",n&&r.setAttribute("aria-hidden","true"),r.style.position="absolute",r.style.left="0",r.style.top="0",r.style.pointerEvents="none",r}function jC(e,t,n){for(let r of e)r.style.width=t,r.style.height=n;}var WC=64;function Ag(e,t,n={}){let r=n,o=sc(n),i=r.openedSession??chunk6JPL6ZAS_cjs.j(t,n.reviewModel?{reviewModel:n.reviewModel}:{});if(!i.ok)return {ok:false,reason:i.reason,...i.detail?{detail:i.detail}:{},..."limit"in i&&i.limit?{limit:i.limit}:{}};let a=XR(i.session,o),s=dR(a),l=s.index,d=n.collaborationModel?.session,c=n.author,u=n.scale??96/72,p={resolve:n.tableInteractionLabel??(f=>dm(f))},m="the document is open for viewing",g="the table of contents is generated and read-only",b=false,h="\0range\0",y=()=>`${new Date().toISOString().slice(0,19)}Z`,S=n.measurer?null:chunkD7ZMDMPX_cjs.S(u,{context:Ui(e.ownerDocument),...n.fontAlias?{fontAlias:n.fontAlias}:{}}),x=n.measurer??S.measurer,I=chunkDOHF6FA7_cjs.Ge(),R=chunkDOHF6FA7_cjs.Gf();function T(){return n.measurer?n.producer??"host-measurer":`${n.producer??S?.producer??"fixed-measurer"}@scale:${u}`}let P=T(),O=e.ownerDocument,v=O.createElement("div");v.className="docx-pages",v.style.position="relative",o.listeners(v),v.contentEditable="true",v.spellcheck=false,v.setAttribute("role","textbox"),v.setAttribute("aria-multiline","true"),Rm(v,n.translate),v.style.outline="none";let C=na(O,"docx-selection-overlay"),L=na(O,"docx-comment-overlay"),A=na(O,"docx-text-highlight-overlay"),q=null,K=na(O,"docx-remote-selection-overlay"),E=na(O,"docx-table-furniture",false);e.style.position="relative",e.replaceChildren(v,E,L,A,K,C);let _=OT(v,()=>u,()=>{let f=ye?.getActive()??null,w=Fe?.activeNoteScope()??null,k=Fe?.activeNotePageIndex()??null,D=f?Qw(v,f.pageIndex):w?Jw(v,w.id,k):null;return {layout:Se(),selection:Lt.shownSelection(j),...Ue.caretPreference(f?.pageIndex??k??void 0),measurer:x,...st()?{typingStyle:()=>{let V=Q.formatting();return V.fontSizeHalfPoints?{fontSizePt:V.fontSizeHalfPoints/2,fontFamily:V.fontFamily,bold:V.bold,italic:V.italic,verticalAlign:V.superscript?"superscript":V.subscript?"subscript":"baseline"}:null}}:{},scopedHost:D,...f?{scopedHostKind:"headerFooter"}:w?{scopedHostKind:"note"}:{},..._e?.caretInput(be)}}),X=Sd(a.part()),z=a.paragraphIds(),oe=z.find(f=>!X.has(f))??z[0]??"",j=r.initialSelection??{anchor:{paragraphId:oe,offset:0},head:{paragraphId:oe,offset:0}},me=r.initialDrawingSelectionIntent??{kind:"none"};function U(f,w){f.kind===me.kind&&(f.kind!=="pointer"||me.kind==="pointer"&&f.drawingNodeId===me.drawingNodeId)||(me=f,w&&n.onChange?.(gt()));}let F=null,N=null;function B(f){return N=$(f),n.onChange?.(gt()),false}function $(f,w=f){return n.onRejection?.(w),f}let G=new Ec,H=new Oc(()=>a.currentPackage()),W="suggesting needs an author before it can propose a change",Z=false,re=false,ne=null,ee=new Map;function se(){ne=null;for(let f of ee.values())ne=f;}function fe(f,w){if(f.paragraphId===w.paragraphId)return f.offset-w.offset;let k=ct();return k.indexOf(f.paragraphId)-k.indexOf(w.paragraphId)}function Ce(f){if(!ne)return;let{from:w,to:k}=$d(Se(),ne),D=f.head;fe(D,w)>=0&&fe(D,k)<=0||(ee.clear(),ne=null);}let Ee=null,at=new qd(d??a),ot=new _d(d??a,()=>j,()=>Me(a,j.head.paragraphId)??a.part(),()=>a.packageRevision());function Ne(f){let w=null;d&&We.expectHistory(true);let k;try{k=ot.step(f,()=>{if(d)return d[f]();let V=a.packageRevision();return w=a[f](),a.packageRevision()!==V});}finally{d&&We.expectHistory(false);}if(!k.changed)return;let D=f==="undo"?yT(d,tl):null;kA(D??k.selection??w);}function Te(f){Ue.noteModelMoved(),Ht();let w=mk(f,Se(),ct());yt(w.selection),Ee=w.format,_.update(),n.onChange?.(gt());}function Pt(){return st()?.properties??null}function st(){return vm(Ee,j)}function Ye(f){if(!Ee)return;let w=Ee.position;f.anchor.paragraphId===w.paragraphId&&f.anchor.offset===w.offset&&f.head.paragraphId===w.paragraphId&&f.head.offset===w.offset||(Ee=null);}function He(f,w,k,D,V){let Y=et([...f],k,D,ze(),true,V);return f.length===w.length||!Y.rejected?Y:et([...w],k,D,ze(),true,V)}function Ae(f,w,k,D){let V=_e?.replacementFormatOps(f,w,k);if(V?.length)return V;let Y=st()??(_t(j.head.paragraphId).length===0?{base:[],properties:Wi(Me(a,j.head.paragraphId)??a.part(),j.head.paragraphId,j.head.offset,Ft(),It())}:null);if(!Y||k===0||Y.properties.length===0&&Y.base.length===0)return [];let J=Ee?.position??j.head,le=D&&J.paragraphId===f&&J.offset>=D.start&&J.offset<=D.end?{paragraphId:f,offset:wu({paragraphId:f,offset:D.start},{paragraphId:f,offset:D.end})}:chunkDOHF6FA7_cjs.wd(Se(),J);return le.paragraphId!==f||le.offset!==w?[]:[{op:"setRunProperties",paragraphId:f,start:w,end:w+k,properties:chunkOSFOJTHU_cjs.Mh(Y.base,Y.properties,el(f,w))}]}let ye=null,Fe=null,_e=null,Se=()=>_e?.layout(be)??be,fo=()=>_e?.active()?_e.paragraphIds():a.paragraphIdsIn(ze()),cr=null,ze=()=>gd(ye?.getActive()??null,Fe?.activeNoteScope()??null),Oe=()=>Fe?.activeNoteScope()?.id??null,Jt=f=>{let w=R.multi?.spans,k=0,D=0;if(w&&w.length>0)for(let V=0;V<w.length;V+=1){let Y=w[V];if(k=V,D=Y.startIndex,f<Y.startIndex+Y.pageCount)break}return {sectionIndex:k,sectionStart:D}},po=(f,w)=>{if(_e?.active()){let J=_e.paragraphIds();return J.includes(f)?f:J[J.indexOf(w)+1]??null}let k=Me(a,f)??Me(a,w)??a.part();if(chunkOSFOJTHU_cjs.Ta(k,f))return f;let D=chunkOSFOJTHU_cjs.Ua(k,w),V=D?D.children.findIndex(J=>J.id===w):-1,Y=D&&V>=0?D.children[V+1]:void 0;return Y?.kind==="paragraph"?Y.id:null},ct=()=>Hi(Se(),ye?.getActive()??null,Oe()),We=hT({textOf:f=>_t(f),order:ct,carried:()=>bT(d)}),nt=()=>globalThis.performance?.now()??Date.now(),mo=0,Cn=0,$r=0,Zt=f=>{YI(f)&&n.onTiming?.("input",f.timeStamp);},{styleCascade:pn,numberingIndex:En,defaultTabStopPt:ai,compatibilityMode:Gs}=xT(a),go=vT({styleCascade:pn,partOf:f=>Me(a,f)??a.part()}),ur=null,sa=n.imageDecodePort??TT(O)??CT(),en=chunkDOHF6FA7_cjs.Me({session:a,decodePort:sa,onResourcesChanged:()=>ur?.()}),si=n.drawingStrings??chunkCAJEXXVG_cjs.k,li=chunkCAJEXXVG_cjs.f(n.translate),Gn=n.tocLabels,Xs=()=>j.anchor.paragraphId!==j.head.paragraphId||j.anchor.offset!==j.head.offset?null:{paragraphId:j.head.paragraphId,offset:j.head.offset},Ys=Jk(a),la=ET({mintValidatedBytes:(f,w)=>en.mintValidatedBytes(f,w)}),tn=false,Xn=GT(n.revisionDisplayMode,!!n.reviewModel,f=>Le.setRevisionDisplayMode(f)),Qs=Xn.view,Ft=Xn.projection,Js=Xn.changeBars,On=r.revisionAuthorVisibility??ac(n.hiddenRevisionAuthors),Lt=tk({layout:Se,part:()=>a.partFor(ze())??a.part(),view:Kh}),di=gk(n.revisionMarkup,()=>Xn.filter(On.filterForSession(a)),()=>Je(),()=>{rn=Yn(It()),lt.invalidateAll(a.packageRevision(),"revision-markup"),lt.flush(),vt(false);}),It=di.filter,el=Ak(a,Ft,It),da=f=>{let w=Me(a,f)??a.part();return yk(w,f,Ft(),It())},rn,on=chunkDOHF6FA7_cjs.$e(a),fr=chunkDOHF6FA7_cjs.af(),Yn=(f,w=tn)=>wT({session:a,measurer:x,producer:P,cache:I,styleCascade:pn,numberingIndex:En,defaultTabStopPt:ai,compatibilityMode:Gs,displayMode:Ft(),showFieldCodes:w,revisionAuthorFilter:f,inlineDrawingLayoutForPart:k=>en.contextForPart(k),drawingLayoutTokenForPart:k=>en.cacheTokenForPart(k),drawingTokenForParagraphForPart:(k,D)=>en.drawingTokenForParagraph(D,k),linkProjectors:on,projectFieldLink:k=>fr.project(k)});rn=Yn(It());let Mn={...a,applyTreeOps:(f,w,k,D)=>et(f,w,k,D),ensureListDefinition:f=>chunkOSFOJTHU_cjs.Hb(d?.identity.actorId,()=>a.ensureListDefinition(f)),applyPmDoc:f=>De==="view"?{committed:false,rejected:true,opCount:0,reason:m}:d?{committed:false,rejected:true,opCount:0,reason:"collaboration-pm-doc-unproven"}:hu()?{committed:false,rejected:true,opCount:0,reason:g}:a.applyPmDoc(f)},pr=()=>{},ci=lR({now:nt,pageAfterView:()=>{let f=Qc();return f&&f.size>0?Math.max(...f)+1:void 0},current:()=>be,revision:()=>a.packageRevision(),publish:f=>o.wrap(()=>ui(f))(),snapshot:()=>{let f={...R};return ()=>{Object.assign(R,f);}},pendingChanged:f=>e.toggleAttribute("data-docx-layout-pending",f),passTimed:f=>n.onTiming?.("layout",f)}),mr=r.progressiveOpen?WC:null,be=Dt(),Qn=n.revisionStyles,ho=xR(n.showParagraphMarks??false,Je,()=>vt(false)),qr=r.reviewAuthorSlots??chunkCAJEXXVG_cjs.e(),Nt=JR({layout:Se,items:()=>a.reviewItems(),styles:()=>Qn,slots:qr});function M(f){bt(),d?.flushPendingJournals();let w={selection:j,format:Ee},k=JSON.stringify(Q.formatting()),D=pk(j,Ee,f,()=>Wi(a.partFor(ze())??a.part(),j.head.paragraphId,j.head.offset,Ft(),It()));D!==void 0&&(Ee=D,k!==JSON.stringify(Q.formatting())&&at.record(w,{selection:j,format:Ee},Og(Le)),H.end(),_.update(),n.onChange?.(gt()));}let Q=_T({runFormatRefusal:()=>Vn({type:"toggleMark"},Le)?.reason??null,session:Mn,applyOutsideToc:(f,w)=>{let k=f.filter(D=>!ey(D));if(k.length===0)return w(f);b=true;try{return w(k)}finally{b=false;}},storyScope:ze,paragraphOrder:ct,layout:Se,selection:()=>Lt.shownSelection(j),displayMode:()=>Ft(),authorFilter:It,paragraphMarkVisible:da,commit:(f,w,k)=>Be(f,w,k),orderedRange:()=>Lt.shownRange(Zr()),selectionMark:()=>Xe(),textOf:f=>_t(f),selectedCells:()=>F?.cellIds,defaultParagraphStyleId:()=>pn()?.defaultParagraphStyleId??null,defaultFontFamily:()=>n.defaultFontFamily??null,pendingFormats:()=>Pt(),setPendingFormats:M}),te=$T({session:Mn,storyScope:ze,layout:Se,selection:()=>Lt.shownSelection(j),displayMode:()=>Ft(),authorFilter:It,paragraphMarkVisible:da,commit:(f,w,k)=>Be(f,w,k),orderedRange:()=>Lt.shownRange(Zr()),selectionMark:()=>Xe(),textOf:f=>_t(f),paragraphOrder:ct,selectedCells:()=>F?.cellIds,armPendingFormats:f=>M(f),now:nt,publish:()=>{te.state().mode!=="off"?v.dataset.formatPainter="":delete v.dataset.formatPainter,n.onChange?.(gt());}}),we=mC({session:Mn,storyScope:ze,headerFooterSectionIndex:()=>ye?.getActive()?.sectionIndex,revisionDisplayMode:Ft,revisionAuthorFilter:It,paragraphOrder:ct,selectedCells:()=>F?.cellIds,editingMode:()=>De,publishRefusal:B,caretParagraphId:()=>j.anchor.paragraphId===j.head.paragraphId&&j.anchor.offset===j.head.offset?j.head.paragraphId:null,layout:Se,commit:(f,w,k)=>Be(f,w,{rearmPending:st()??void 0,...k?.keepCellSelection?{keepCellSelection:true}:{}}),orderedStart:()=>xu(),orderedRange:()=>Zr(),selectionMark:()=>Xe(),collapsedAt:f=>Ke(f),deleteSelectionPlan:()=>wr(),paragraphTextOf:f=>_t(f),numberingLevelExists:(f,w)=>chunkDOHF6FA7_cjs.mc(chunkDOHF6FA7_cjs.wc(En(),pn()),f,w)!==null});function ve(f,w,k){return De!=="suggest"?null:wu({paragraphId:f,offset:w},{paragraphId:f,offset:k})}let ke=SC({session:Mn,layout:Se,fieldLinkById:f=>fr.linkById(f),refusesWrite:()=>jr(true)!==null,withMintActor:f=>chunkOSFOJTHU_cjs.Hb(d?.identity.actorId,f),storyScope:ze,replacementLanding:ve,insertionLanding:(f,w)=>chunkDOHF6FA7_cjs.wd(Se(),{paragraphId:f,offset:w}).offset,selection:()=>j,orderedRange:()=>Zr(),selectionMark:()=>Xe(),textOf:f=>_t(f),commit:(f,w)=>Be(f,w)}),Ze=DP({session:Mn,storyScope:ze,editingMode:()=>De,writeRefusal:f=>jr(true,[f]),selection:()=>j,selectionMark:()=>Xe(),commit:(f,w)=>Be(f,w)}),ae=f=>{let w=Rt(a,f,{kind:"body"});if(w.kind==="body")return Fe?.exitNote(),ye?.exitHeaderFooter(),true;if(w.kind==="headerFooter"){let D=ye?.activeScope();return D?.kind==="headerFooter"&&D.rId===w.rId?true:(Fe?.exitNote(),ye?.enterHeaderFooter({rId:w.rId})??false)}let k=Re(f);return k?Fe?.activeNoteScope()?.id===k?true:(ye?.exitHeaderFooter(),Fe?.enterNote(k)??false):false},Re=f=>{for(let w of be.pages)for(let k of [w.footnotes,w.endnotes])if(k){for(let D of k.notes)for(let V of chunkDOHF6FA7_cjs.ya(D.fragments))if(V.paragraphId===f)return D.scopeId}return null},je=IC({pagesLayer:v,container:e,scale:()=>u,layout:Se,bookmarks:()=>a.bookmarks(),linkById:f=>fr.linkById(f)??ke.linkById(f),drawingLinkById:f=>TC(be,f),setSelection:f=>yt(Ke(f)),enterStoryFor:f=>ae(f),isCollapsedSelection:()=>De==="view"||Mt(j,Ke(j.head)),onScrolled:()=>ol(),...n.onHyperlinkPopover?{onPopover:n.onHyperlinkPopover}:{}}),rt=NP({pagesLayer:v,equationById:f=>Ze.equationById(f),setSelection:f=>yt(f,false,"none"),...n.onEquationPopover?{onPopover:n.onEquationPopover}:{}});v.addEventListener("contextmenu",Lh),v.addEventListener("click",Nh),v.addEventListener("pointermove",Ch),v.addEventListener("pointerleave",Oh);let an=yR(v),At=null;function gr(f,w,k,D){return pr(),ci.finish(),chunkDOHF6FA7_cjs.ff(hr(f,w,k,D))}function*hr(f,w,k,D){let V=k?k.authorFilter:It(),Y=k?.layoutSession??R,J=k?.furnitureSource??rn;return w&&chunkDOHF6FA7_cjs.uc(Y,w),!k&&D===void 0&&(mr=null),en.sync(a),yield*chunkW35WTWAO_cjs.a({view:a,revision:f,measurer:x,cache:I,session:Y,producer:P,styleCascade:pn,defaultTabStopPt:ai,numberingIndex:En,furniture:J,compatibilityMode:Gs,linkProjectors:on,projectFieldLink:le=>fr.project(le),inlineDrawingLayout:en.bodyContext,inlineDrawingLayoutForPart:le=>en.contextForPart(le),drawingTokenForParagraph:le=>en.drawingTokenForParagraph(le,a.part().name),drawingTokenForParagraphForPart:(le,ge)=>en.drawingTokenForParagraph(ge,le),drawingLayoutEpoch:en.cacheTokenForPart(a.part().name),drawingLayoutEpochForPart:le=>en.cacheTokenForPart(le),displayMode:Ft(),showFieldCodes:k?false:tn,fieldResults:o.mode,revisionAuthorFilter:V,bodyBlockLimit:D})}function Tt(){return gr(a.packageRevision(),void 0,{layoutSession:chunkDOHF6FA7_cjs.Gf(),furnitureSource:Yn(void 0,false)})}function Dt(){let f=nt(),w=gr(a.packageRevision(),void 0,void 0,mr??void 0);return mo=nt()-f,w}let zt=null,yo=0,yr=false,Kr=null,ca=false;function br(){if(ca)return;ca=true;let f=a.packageRevision();Kr=BC({steps:_C(()=>a.part()),shouldRun:()=>De!=="view"&&a.editable&&a.packageRevision()===f,hasPendingInput:bo});}function bo(f=true){return $k(e,f)}function Qe(){if(yo>0){yr=true,br();return}if(!bo()){vt(),br();return}zt===null&&(zt=setTimeout(o.wrap(()=>{zt=null,lt.pending()===null&&(vt(),br());}),0));}let mt="",An=null,mn=false;function bt(){if(mn||(An!==null&&(clearTimeout(An),An=null),mt.length===0))return;let f=mt;mt="",mn=true;try{qs(Le,H.groupAt(j),()=>Le.type(f)),H.landed(j);}catch(w){throw mt=f+mt,w}finally{mn=false;}}function vo(f){mt+=f,An===null&&(An=setTimeout(o.wrap(()=>{An=null,bt();}),0));}function Uc(f,w,k){bt();let D=k?.trim()||c?.trim();if(!D)return B("tracked changes need a non-empty author");if(f!=="deletion"&&w.length===0)return B(`${f} requires non-empty text`);if(f!=="deletion"&&/[\r\n\v\f\u2028\u2029]/.test(w))return B(`${f} requires text without a paragraph mark`);let V={author:D,date:y()},Y=Zr(),J=Y.from.paragraphId===Y.to.paragraphId&&Y.from.offset===Y.to.offset;if(f!=="insertion"&&J&&!(f==="replacement"&&F))return B(`${f} needs a non-collapsed selection`);let le=f==="insertion"?{ops:[],collapseTo:chunkDOHF6FA7_cjs.wd(Se(),Y.from)}:wr(D),ge=qh(le.ops,V,$h()),Pe=le.collapseTo;if(f==="insertion"||f==="replacement"){let ue=f==="replacement"?le.replaceAt??le.collapseTo:le.collapseTo;ge.push({op:"insertText",paragraphId:ue.paragraphId,offset:ue.offset,text:w,revision:V}),Pe={paragraphId:ue.paragraphId,offset:ue.offset+w.length};}let xe=false;return Be(()=>{let ue=et(ge,Xe(),xr(Pe));return xe=ue.committed,ue},()=>Ke(Pe)),xe}let lt=chunkD7ZMDMPX_cjs.da({run:f=>{let w=nt();pr(),ci.abandon();let k=hr(f.revision,f),D=ci.run(k,f.revision,QI(f));return mo=nt()-w,D},currentRevision:()=>a.packageRevision(),schedule:f=>{let w=setTimeout(o.wrap(f),0);return ()=>clearTimeout(w)},publish:f=>ui(f)});function ui(f){Nt.releaseLayout(),be=f;let w=We.map(j);w!==j&&(j=w,/* arbi patch: the model moved the caret */Ue.noteModelMoved(),xo()),Qe();}let Gc=false;ur=()=>{lt.invalidateAll(a.packageRevision(),"drawing-resources"),!Gc&&(Gc=true,setTimeout(o.wrap(()=>{Gc=false,Ht();}),0));};let VM=a.subscribe(f=>{s.retain(f),f.origin!==chunkOSFOJTHU_cjs.g.mutationRemote&&f.origin!==chunkOSFOJTHU_cjs.g.mutationUndo&&f.origin!==chunkOSFOJTHU_cjs.g.mutationRedo&&at.noteEdit(),Ee=null,mn||H.noteForeignChange(f),f.origin===chunkOSFOJTHU_cjs.g.mutationRemote?We.note(j,f.dirty,be.revision===f.fromRevision):We.noteLocal(),lt.notify(f);}),tl=d?a.collaborationPort(d.documentId):null,Sh=()=>{},Ih=()=>{},Xc=false,Yc=null,kh=null,jM=d?d.subscribeRemoteSelections(()=>{Xc&&ll();}):()=>{};function Qc(){let f=kT(e,be,j,u),w=ye?.getActive()?.pageIndex??Ue.selectionPageIndex();return w===void 0||f===void 0||f.has(w)?f:new Set([...f,w])}function Rh(){yr&&vt();}function Ht(){return lt.pending()?lt.flush():false}let WM=8;function ZM(f){!f&<.pending()!==null&&mo>WM&&bo(false)||(!Ht()||f&&yr)&&vt();}function Je(){bt(),Ht();}function Jc(){bt();let f=Ht();return zt!==null||yr?(vt(),br(),true):f}let ua=null;function Ph(f){return vS(f,a.part())}function zM(){for(let f of v.querySelectorAll(".docx-content-control-chrome[data-docx-toc]")){if(f.getAttribute("data-docx-content-control")===ua){f.dataset.hover="",f.dataset.boundaryVisible="";continue}delete f.dataset.hover,Z||delete f.dataset.boundaryVisible;}}function Th(f){ua!==f&&(ua=f,zM());}function eu(f){return xS(a.part(),Eh(f),f.target)}function Ch(f){let w=eu(f);Th(w?Ph(w):null);}function Eh(f){let w=f.target,k=w?.isConnected?w.closest("[data-paragraph-id]"):void 0;if(k)return k.dataset.paragraphId;let D=v.ownerDocument;return typeof D.elementFromPoint!="function"?void 0:D.elementFromPoint(f.clientX,f.clientY)?.closest("[data-paragraph-id]")?.dataset.paragraphId}function Oh(){Th(null);}function UM(){let f=Vr(),w=chunkDOHF6FA7_cjs.mb(a.part()),k=chunkOSFOJTHU_cjs.Rf(a.part()),D=k.map(ue=>{let kt=tR(ue,be,a.part(),x);return kt?{...kt,empty:w.has(ue.beginParagraphId)}:null}).filter(ue=>ue!==null),V=new Set(D.map(ue=>ue.boundary.id)),Y=new Set(D.filter(ue=>ue.empty).map(ue=>ue.boundary.id));for(let ue of k)ue.contentControlId&&Ph(ue)!==ue.contentControlId&&Y.add(ue.contentControlId);let J=f&&!V.has(f.id)?new Set([f.id]):void 0,le=ua?new Set([ua]):void 0,ge=new Set(chunkDOHF6FA7_cjs.oe(be).filter(ue=>ue.controlType==="checkbox"&&nu(ue.id)).map(ue=>ue.id)),Pe=D.filter(ue=>ue.additional&&!ue.empty).map(ue=>ue.boundary),xe=Bh()!==null;if(!(!Z&&!J&&!le&&!xe&&ge.size===0&&Pe.length===0&&V.size===0))return {...xe?{readOnly:true}:{},...Z?{showAll:true}:{},...J?{activeIds:J}:{},...le?{hoverIds:le}:{},...ge.size>0?{checkedIds:ge}:{},...Pe.length>0?{additionalBoundaries:Pe}:{},...V.size>0?{tocControlIds:V}:{},...Y.size>0?{suppressedIds:Y}:{}}}let fa=null;function Vr(){let f=ze();if(f.kind!=="body")return YM(f);if(fa&&fa.layout===be&&fa.selection===j)return fa.result;let w=GM();return fa={layout:be,selection:j,result:w},w}function GM(){let f=bR(be,j,x);return f&&XM(f.id)===a.part().name?f:null}function XM(f){let w=f.indexOf("#");return w===-1?"":f.slice(0,w)}function YM(f){let w=a.partFor(f);return w?chunkDOHF6FA7_cjs.df(w,j.head.paragraphId):null}function QM(f){return chunkOSFOJTHU_cjs.Uc(f)}function Jn(f){let w=Me(a,f),k=chunkOSFOJTHU_cjs.Ta(w??a.part(),f);return !k||!QM(k)?null:k}function Mh(f){let w=Jn(f);if(!w)return null;for(let k of w.children)if(k.kind!=="textValue"&&(k.kind==="contentControlProperties"||k.localName==="sdtPr"))for(let D of k.children){if(D.kind==="textValue"||D.localName!=="tabIndex")continue;let V=D.attributes.find(J=>J.localName==="val")?.value;if(V===void 0)return null;let Y=Number(V);return Number.isFinite(Y)?Y:null}return null}function JM(){let f=ze(),w=f.kind==="body"?null:a.partFor(f),k=f.kind==="notesPart"?new Set(ct()):void 0;return (w?[...chunkDOHF6FA7_cjs.cf(w,k)]:[...chunkDOHF6FA7_cjs.oe(be)]).filter(V=>Mg(V)===null).sort((V,Y)=>{let J=Mh(V.id),le=Mh(Y.id);return J!==null&&le!==null&&J!==le?J-le:J!==null&&le===null?-1:J===null&&le!==null?1:0})}function eA(f){for(let w of f.children)if(w.kind!=="textValue"&&(w.kind==="contentControlContent"||w.localName==="sdtContent"))return w.children;return []}function tu(f){ye?.getActive()||Fe?.activeNoteScope()||Rt(a,f.paragraphId,{kind:"body"}).kind==="body"&&Le.revealPosition(f);}function tA(f){let w=Jn(f);if(!w)return false;let k=EC(w,{contentChildrenOf:eA,searchRoots:()=>(a.partFor(Rt(a,f,ze()))??a.part()).root.children});if(!k)return false;let D=j;return yt(k,false,"none"),(j!==D||Mt(j,k))&&tu(j.anchor),true}let Ah=f=>Gk(Jn(f),()=>a.currentPackage());function nu(f){let w=Jn(f);if(!w)return false;for(let k of w.children)if(k.kind!=="textValue"&&!(k.kind!=="contentControlProperties"&&k.localName!=="sdtPr")){for(let D of k.children)if(D.kind==="contentControlCheckbox")for(let V of D.children){if(V.kind!=="contentControlChecked")continue;let Y=V.attributes.find(J=>J.localName==="val")?.value;return !(Y==="0"||Y==="false"||Y==="off")}}return false}let Fh=f=>Xk(Jn(f));function nl(f,w){for(let k of v.querySelectorAll("[data-docx-content-control]"))k.getAttribute("data-docx-content-control")===f&&(w?k.dataset.open="":delete k.dataset.open);}let fi=pR({document:O,layer:v,find:Jn,layout:Se,selectDrawing:(f,w)=>Le.selectDrawing(f,w),allowed:f=>!vr.disabledReason(f,"edit"),translate:f=>ha?.(f)??f,replaceImage:(f,w,k,D)=>Le.replaceImage(f,w,k,{expectedPackageRevision:a.packageRevision(),commitGuard:D}),setOpen:nl,reject:B}),ru=Uk({find:Jn,allowed:f=>!vr.disabledReason(f,"edit"),apply:(f,w)=>vr.setValue(f,w),items:Ah,date:Fh,checked:nu,picture:fi.drawingOf,replaceImage:fi.replace,locale:()=>al.get(),layer:v,setOpen:nl,request:n.onRequestContentControlWidget}),rl=null,ou;function iu(f){rl===f&&(rl=null,ou?.(),ou=void 0);let w=f.dataset.docxCcId,k=f.contains(O.activeElement);f.remove(),w&&nl(w,false),k&&v.focus({preventScroll:true});}function au(){ru.cancel();let f=rl;return f&&iu(f),f}function Lh(f){let w=eu(f);nA(w&&vu(w.id)?w.id:null);}let pa=null;function nA(f){pa!==f&&(pa=f,n.onChange?.(gt()));}function Nh(f){if(f.button!==0||f.target?.closest("a.docx-hyperlink")||De!=="view"&&!Mt(j,Ke(j.head)))return;let w=Eh(f);if(!w)return;let k=chunkOSFOJTHU_cjs.Rf(a.part()).find(Y=>Y.resultParagraphIds.includes(w));if(!k||eu(f)?.id!==k.id)return;let V=chunkOSFOJTHU_cjs.wg(a.part(),k,a.documentOutline(),yu(k))[k.resultParagraphIds.indexOf(w)];V&&(f.preventDefault(),je.goToPosition({paragraphId:V,offset:0}));}let Dh={document:O,locale:()=>al.get(),translate:f=>ha?.(f)??f,setValue:(f,w)=>vr.setValue(f,w),close:f=>iu(f)};function rA(f,w){let k=vr.disabledReason(f,"edit");if(k){N=$(k),n.onChange?.(gt());return}if(fi.cancel(),au()?.dataset.docxCcId===f||(w==="picture"&&fi.select(f),ru.open(f,w)))return;if(w==="picture")return fi.pick(f);if(w==="checkbox"){vr.setValue(f,nu(f)?"false":"true");return}let D=chunkDOHF6FA7_cjs.oe(be).find(Y=>Y.id===f)?.alias,V;if(w==="dropdown"||w==="comboBox"||w==="buildingBlockGallery"){let Y=Ah(f);if(Y.length===0&&w==="dropdown")return;V=_R(Dh,f,w,Y,D,Cm(Jn(f),Y));}else if(w==="date")V=BR(Dh,f,Fh(f),D);else return;rl=V,HR(V,v,Wk(be,u,f,v,ht?.pageOffsetX)),nl(f,true),ou=zd(V,()=>iu(V)),w==="date"?ic(V):(V.querySelector("input")??V.querySelector('[role=option][tabindex="0"]')??V.querySelector("button,[data-docx-part=empty]"))?.focus({preventScroll:true});}let vr={setShowAll(f){Z!==f&&(Z=f,vt());},setFormFill(f){re!==f&&(re=f,n.onChange?.(gt()));},showAll:()=>Z,formFill:()=>re,atCaret:()=>Vr(),navigate(f){let w=JM();if(w.length===0)return false;let k=Vr(),D=k?w.findIndex(Y=>Y.id===k.id):-1;f==="next"?D=D<0?0:(D+1)%w.length:D=D<0?w.length-1:(D-1+w.length)%w.length;let V=w[D];return tA(V.id)},setValue(f,w){let k=vr.disabledReason(f,"edit");if(k)return B(k);let D=Qk(Jn(f),()=>a.currentPackage(),f,w);if(!D)return B("unknown-building-block");let V=false;return Be(()=>{let Y=et(D,Xe(),void 0,Rt(a,f,ze()),false);return V=Y.committed,Y}),V},remove(f){let w=f??Vr()?.id;if(!w)return B("notFound");let k=vr.disabledReason(w,"remove");if(k)return B(k);let D=false;return Be(()=>{let V=et([{op:"removeContentControl",controlId:w}],Xe(),void 0,Rt(a,w,ze()),false);return D=V.committed,V}),D},disabledReason(f,w){let k=Bh();if(k!==null)return k;let D=chunkDOHF6FA7_cjs.oe(be).find(Y=>Y.id===f);if(D)return w==="remove"?KC(D):Mg(D);let V=Jn(f);return V?VC(V,w):"notFound"}};function su(){let f=cu&&De!=="view";v.contentEditable=f?"true":"false",v.setAttribute("aria-readonly",f?"false":"true");}function gt(){return {revision:a.packageRevision(),pageCount:be.pages.length,selection:j,cellSelection:F,canUndo:at.canUndo||(d?.canUndo()??a.canUndo()),canRedo:at.canRedo||(d?.canRedo()??a.canRedo()),collaborationStatus:d?.status()??"inactive",lastRejection:N,pendingFormat:Pt(),contentControls:{showAll:Z,formFill:re,activeControlId:Vr()?.id??null},contextTocId:pa,formatPainter:te.state(),perf:{layoutMs:mo,paintMs:Cn,selectionMs:$r,placed:R.stats.placed,total:R.stats.total,reusedPages:R.stats.reusedPages,fullPasses:R.stats.fullPasses,staleDiscards:lt.staleDiscards,cancelledRuns:lt.cancelledRuns}}}let Ut,ht,ma=false,ga=null,lu=null;function oA(f){for(let w of be.pages){let k=v.children.item(w.index);if(k?.dataset.pageIndex!==String(w.index))continue;let D=f.pageOffsetX.get(w.index)??0;k.style.left=`${(w.box.x+D)*u}px`;}}function vt(f=true){zt!==null&&(clearTimeout(zt),zt=null,f=true),yr=false;let w=Ue.adoptBeforePaint(),k=nt();Ut=Qc(),ye?.reconcileOccurrence();let D=ye?.getActive()??null,V=UM(),Y=chunkDOHF6FA7_cjs.mb(a.part());chunkCAJEXXVG_cjs.q(v,be,{scale:u,readOnlyParagraphIds:Sd(a.part()),...Y.size>0?{emptyTocPlaceholderIds:Y}:{},...n.fontAlias?{fontAlias:n.fontAlias}:{},...n.defaultFontFamily?{defaultFontFamily:n.defaultFontFamily}:{},materialize:Ut,ariaHidden:false,drawingStrings:si,breakMarkStrings:li,...n.fieldShading?{fieldShading:n.fieldShading}:{},...Qn!==void 0?{revisionStyles:Qn}:{},revisionMarkup:di.current(),facingPages:hk(chunkOSFOJTHU_cjs.Tg(a.currentPackage())),shadeFormFields:Ys(),showParagraphMarks:ho.get(),changeBars:Js(),changeBarsToggle:!!n.reviewModel,...la?{imageUrlPort:la}:{},...D?{activeHeaderFooterRId:D.scope.rId,activeHeaderFooterPageIndex:D.pageIndex}:{},...V?{contentControlChrome:V}:{}},Nt.get().value),_e?.syncDom(),Vm(v,Xs(),{domReplaced:true}),nS(e,v,D!=null),gp(e,De),ht=vc(be,Ut),oA(ht),v.style.width=`${ht.width*u}px`,v.style.height=`${ht.height*u}px`,e.style.width=`${ht.width*u}px`,e.style.height=`${ht.height*u}px`,jC([C,L,A,K,E],`${ht.width*u}px`,`${ht.height*u}px`),Pa.update(),Cn=nt()-k,n.onTiming?.("paint",Cn),Ia(),ll(),pi(true),gu(),wy(),Ue.mirrorToDom(),Hh(ma),ma=false,(f||w)&&n.onChange?.(gt());}function ol(){Je();let f=Qc(),w=vc(be,f);ht&&cg(f,Ut)&&RT(w,ht)||vt(false);}let du=CC({storyScopeOpen:()=>!!(ye?.getActive()||Fe?.activeNoteScope()),selection:()=>Lt.shownSelection(j),layout:Se,measurer:()=>x,preferredPageIndex:()=>Ue.selectionPageIndex(),preferredLineId:()=>Ue.selectionLineId(),pagesLayer:v,container:e,scroller:()=>Vt(e),scale:()=>u,scheduleRematerialize:()=>Iu()});function Hh(f=false,w="caret"){du.follow(f,w);}let De=n.editingMode??"edit",cu=true,il=Object.freeze({kind:"body"}),_h=0,al=AR(n.locale,bt),ha=n.translate,xt=null,sl=null,uu=null;function et(f,w,k,D=ze(),V=true,Y){bt();let J=jr(f.some(iA)||!!Y?.length,f,V);if(J!==null)return {committed:false,rejected:true,opCount:0,reason:J};let le=sA(V&&xt?xt.annotate(f):f),ge=ya(le,w,k,D,Y);return V&&xt?.afterApply(ge.committed),ge.committed&&le.some(qm)&&r.onTrackedChange?.(),ge}function ya(f,w,k,D=ze(),V){let Y=d?.gateOperations(f,D);if(Y)return {committed:false,rejected:true,opCount:0,reason:Y};_h+=1;let J=G.value;return a.applyTreeOps(f,w,k,D,d?{packageEdits:V,origin:chunkOSFOJTHU_cjs.g.mutationHuman,actorId:d.identity.actorId,operationId:`${d.identity.actorId}:${d.sessionId}:browser:${_h}`,recordsHistory:false,historyGroup:J}:{packageEdits:V,historyGroup:J})}function jr(f,w=[],k=true){if(Wn(e))return "An external document refresh is in progress.";let D=LC(w);return De==="view"&&!D?m:tn&&f&&k&&!D&&eR(V=>Me(a,V),j)?Zi:f&&!D&&(k&&!b&&hu()||w.some(V=>ey(V)))?g:De==="suggest"&&!c?.trim()&&f?W:De==="suggest"&&w.some(V=>V.op==="deleteNote")?"suggesting cannot delete a note outright; strike its reference to propose the deletion":null}let Bh=YS(()=>jr(true,[],false),()=>a.editable);function iA(f){return f.op!=="acceptRevision"&&f.op!=="rejectRevision"&&f.op!=="acceptAllRevisions"&&f.op!=="rejectAllRevisions"&&f.op!=="setRevisionAttribution"}let aA=f=>chunkOSFOJTHU_cjs.Sj.has(f),$h=()=>di.current().trackFormatting&&!a.trackingSettings().doNotTrackFormatting;function qh(f,w,k){return f.flatMap(D=>$m(D)?!k&&aA(D.op)?[D]:[D.revision!==void 0?D:{...D,revision:w}]:D.op==="splitParagraphMany"?[{...D,revision:w}]:D.op==="splitParagraph"?[D,{op:"setParagraphMarkRevision",paragraphId:D.paragraphId,kind:"ins",revision:w}]:D.op==="joinParagraphs"?[{op:"proposeParagraphMerge",paragraphId:D.secondId,revision:w}]:[D])}function fu(){let f=c?.trim();return De==="suggest"&&f?f:void 0}function sA(f){let w=fu();return w===void 0?[...f]:qh(f,{author:w,date:y()},$h())}function Kh(){return {displayMode:Ft(),authorFilter:It()}}function Vh(f){let w=Lt.removedCaretEdit(j.head,f);return w===null?false:(Be(()=>et(w.ops,Xe(),xr(w.caret)),()=>Ke(w.caret)),true)}function xr(f){return {paragraphId:f.paragraphId,start:f.offset,end:f.offset}}function Be(...f){if(Wn(e))return;let w=CR(e);try{lA(...f);}finally{w();}}function lA(f,w,k={}){bt(),mn||H.end();let D=ot.begin();k?.keepCellSelection||(F=null),Ee=null,Ue.noteModelMoved(),yo+=1;let V=false;try{let Y=G.around(Le,f,le=>typeof le=="boolean"?le:le.committed,!k?.automation),J=typeof Y=="boolean"||!Y.rejected?null:Y;if(V=J!==null,J){let le=String(J.reason??"rejected");N=$(GS(le,a.settingsRoot()),le);}else {N=null;let le=w?.();le&&(wa(),j=le,U({kind:"none"},!1),At=null,ma=!0);let ge=k?.rearmPending;if(ge&&ge.properties.length>0){let{anchor:Pe,head:xe}=j;Pe.paragraphId===xe.paragraphId&&Pe.offset===xe.offset&&(Ee={properties:ge.properties,base:ge.base,position:xe});}}D(),xo();}catch(Y){if((yo-=1)===0&&yr)try{vt();}catch{}throw Y}yo-=1,ZM(V);}function dA(){if(!Ut)return true;for(let f of [j.anchor,j.head]){let w=chunkDOHF6FA7_cjs.ne(Se(),f);if(w&&!Ut.has(w.pageIndex))return false}return true}function xo(){let f=d;if(!f)return;let w=tl?rP(F?.text??j,D=>{let V=Me(a,D)??a.part();return oP(V,D)},F?"cells":void 0):null,k=w?`${w.anchor.paragraphId}:${w.anchor.offset}|${w.head.paragraphId}:${w.head.offset}|${w.kind??""}`:"";k!==kh&&(kh=k,f.setLocalSelection(w));}function yt(f,w=false,k="caret",D){let V=!Mt(f,j);_e?.active()&&(!_e.contains(f.anchor.paragraphId)||!_e.contains(f.head.paragraphId))&&_e.exit(false),V&&mt.length>0&&bt();let Y=xt?.beforeSelect(f);if(Y===null)return;V&&!mn&&(H.end(),at.endGroup()),f=Y??f,Ye(f),Ce(f);let J=Vr()?.id??null,le=xn(a.part(),j.head)?.id;wa(),j=f,F=null,w||(At=null),dA()||(Ue.noteModelMoved(),k==="none"?du.without(()=>vt(false)):vt(false)),Ue.noteSelectionSettled(),Ue.notePointerCaret(D),Ue.mirrorToDom(true),Hh(true,k),Ia(),wo.clear(),pi();let ge=Vr()?.id??null,Pe=xn(a.part(),j.head)?.id;(J!==ge||le!==Pe)&&vt(false),xo(),n.onChange?.(gt());}let Ue=XT({session:a,storyScope:ze,document:O,pagesLayer:v,selection:()=>j,setSelection:f=>yt(f),adoptSelection:f=>{let w=xt?.beforeSelect(f);w!==null&&(f=w??f,Ye(f),Ce(f),wa(),j=f,At=null,ma=true,xo());},commit:f=>Be(f),applyOps:(f,w,k)=>et(f,w,void 0,k),hasPendingInput:()=>mt.length>0,replacementOffset:(f,w,k)=>wu({paragraphId:f,offset:w},{paragraphId:f,offset:k}),render:()=>vt(),flushLayout:()=>Ht(),flushToPaint:()=>Jc(),updateCaret:()=>{_.update(),Vm(v,Xs());},textOf:f=>_t(f),pendingFormatOps:(f,w,k,D)=>Ae(f,w,k,D),selectionMark:()=>Xe(),now:nt,recordSelectionMs:f=>{$r=f;},isGesturing:()=>me.kind==="pointer"||(Su?.dragging()??false),selectionLocked:()=>De==="view",domSelection:()=>F?Ke(F.text.anchor):j,holdsCellSelection:()=>F!==null,replaceSelectionWith:f=>Le.type(f),discardPaint:()=>chunkCAJEXXVG_cjs.o(v)});ye=FC({session:a,layout:Se,sectionAtPage:Jt,revisionDisplayMode:Ft,revisionAuthorFilter:It,selection:()=>j,setScopeSelection:f=>{bt(),wa(),Ye(f),wo.clear(),j=f,F=null,At=null,xo();},noteModelMoved:()=>Ue.noteModelMoved(),render:()=>vt(),mirrorToDom:()=>Ue.mirrorToDom(),notify:()=>n.onChange?.(gt()),materializedPages:()=>Ut,entryRefused:()=>De==="view",leaveOtherStories:()=>{Fe?.exitNote(),_e?.exit();}}),Fe=iC({session:a,exitHeaderFooter:()=>{ye?.exitHeaderFooter(),_e?.exit();},applyOps:et,commit:Be,selection:()=>j,selectionMark:()=>Xe(),orderedStart:()=>xu(),deleteSelectionPlan:()=>wr(),undo:()=>Le.undo(),activeScope:()=>{let f=_e?.active();if(f)return f;let w=Fe?.activeNoteScope();return w||(ye?.activeScope()??{kind:"body"})},setActiveScopeBodyOrHf:f=>ye.setActiveScope(f),setSelection:f=>yt(f),noteModelMoved:()=>Ue.noteModelMoved(),render:()=>{Ht()||vt();},revealNote:f=>{Ht();for(let w of be.pages){let k=[...w.footnotes?.notes??[],...w.endnotes?.notes??[]].find(D=>D.scopeId===f);if(k)return Ra(k.box.y,k.box.height,{block:"nearest",offsetPx:48}),w.index}return null},notify:()=>n.onChange?.(gt()),lastRejection:()=>N,setLastRejection:f=>{N=f===null?null:$(f);}});function jh(f){f&&bt(),F=f,f&&(Ye(f.text),wa(),j=f.text),At=null,Ue.noteSelectionSettled(),Ue.mirrorToDom(),Ia(),wo.clear(),pi(),xo(),n.onChange?.(gt());}let Wr=null;function cA(){let w=chunkDOHF6FA7_cjs.ne(Se(),j.head)?.pageIndex??0,k=new Set;for(let D=w-1;D<=w+1;D+=1)D>=0&&D<be.pages.length&&k.add(D);return k}let Wh=new WeakMap;function uA(f){let w=Wh.get(f);if(w)return w;let k=new Map;for(let D of f.pages)for(let V of chunkDOHF6FA7_cjs.xa(D))k.has(V.paragraphId)||k.set(V.paragraphId,D.index);return Wh.set(f,k),k}function fA(){let f=a.revision(),w=Ut??cA();if(Wr?.layout===be&&Wr.revision===f&&cg(Wr.pages,w))return Wr.rects;let k=(J,le)=>{if(!w)return true;let ge=uA(be),Pe=ge.get(J),xe=ge.get(le);if(Pe===void 0||xe===void 0)return true;for(let ue=Math.min(Pe,xe);ue<=Math.max(Pe,xe);ue+=1)if(w.has(ue))return true;return false},D=[];for(let J of Sa()){if(J.kind==="comment"){if(J.range===null||!k(J.range.start.paragraphId,J.range.end.paragraphId))continue;D.push({key:chunkOSFOJTHU_cjs.xj(J),from:{paragraphId:J.range.start.paragraphId,offset:J.range.start.offset},to:{paragraphId:J.range.end.paragraphId,offset:J.range.end.offset}});continue}let le=chunkOSFOJTHU_cjs.xj(J),ge=J.kind==="revision"?J.ranges:J.range?[J.range]:[];for(let[Pe,xe]of ge.entries())k(xe.start.paragraphId,xe.end.paragraphId)&&D.push({key:ge.length===1?le:`${le}${h}${Pe}`,from:{paragraphId:xe.start.paragraphId,offset:xe.start.offset},to:{paragraphId:xe.end.paragraphId,offset:xe.end.offset}});}let V=chunkDOHF6FA7_cjs.we(be,D,w,x),Y=[];for(let[J,le]of V)for(let ge of le)Y.push({...ge,key:J});return Wr={layout:be,revision:f,pages:w,rects:Y},Y}let wo=new Set,ba=null,va,xa=null,pu=false,Zh=false;function wa(){pu||(xa=null);}function zh(){let f=xa;if(!f||!j)return null;let w=(D,V)=>D.paragraphId===V.paragraphId&&D.offset===V.offset;if(!w(j.anchor,f.anchor)||!w(j.head,f.head))return null;let k=Sa().find(D=>chunkOSFOJTHU_cjs.xj(D)===f.key);return !k||k.kind==="custom"&&!k.carded||k.kind==="revision"&&ba!==null&&ba.has(k.revisionKind)&&(k.revisionKind!=="format"||va===void 0||va.has(k.formattingKind??""))&&!Zh?null:k}function mu(){let f=zh();if(f)return Uh(f);if(!j)return null;let k=chunkOSFOJTHU_cjs.Cj(Sa(),j.anchor,j.head,l()).filter(D=>!(D.kind==="comment"&&D.resolved)&&!wo.has(chunkOSFOJTHU_cjs.xj(D))&&!(D.kind==="custom"&&!D.carded)&&!(D.kind==="revision"&&ba!==null&&ba.has(D.revisionKind)&&(D.revisionKind!=="format"||va===void 0||va.has(D.formattingKind??""))))[0];return k?Uh(k):null}function Uh(f){if(f.kind!=="comment")return f;let w=chunkOSFOJTHU_cjs.Ej(Sa(),f);return wo.has(chunkOSFOJTHU_cjs.xj(w))?null:w}function Sa(){return On.filterItems(a.reviewItems())}let Gh=eP({roster:Nt.get,styles:()=>Qn,slots:qr}),Xh=Gh.forAuthor,pA=Gh.declaredFor;function mA(f,w,k){let D=f.split(h),V=D[0],Y=w!==null&&V===chunkOSFOJTHU_cjs.xj(w);if(f.startsWith("comment-")){let xe=k.get(V),ue=xe?.kind==="comment"&&xe.resolved;return ue&&!Y?null:Y?`docx-comment-band docx-comment-band--active${ue?" docx-comment-band--resolved-active":""}`:"docx-comment-band"}if(f.startsWith("custom-"))return Y?"docx-comment-band docx-comment-band--active":null;let J=k.get(V);if(!J||J.kind!=="revision")return null;let le=D.length>1?Number(D[1]):0;return `docx-revision-band docx-revision-band--${(xe=>xe==="delete"||xe==="moveFrom"?"delete":xe==="insert"||xe==="moveTo"?"insert":xe==="replace"&&J.replacedRangeCount!==void 0?le<J.replacedRangeCount?"delete":"insert":"other")(J.revisionKind)}${Y?" docx-revision-band--active":""}`}let Yh=null,Qh,Jh=null;function pi(f=false){let w=mu(),k=w?chunkOSFOJTHU_cjs.xj(w):null,D=Nt.get();if(!f&&Yh===be&&Qh===k&&Jh===D.resolved)return;let V=new Map;for(let J of Sa())V.set(chunkOSFOJTHU_cjs.xj(J),J);let Y=[];for(let J of fA()){let le=mA(J.key,w,V);if(!le)continue;let ge=J.key.split(h)[0],Pe=V.get(ge),xe=Pe?Zm(Pe):null,ue=xe===null||xe===""?void 0:D.resolved.get(xe),kt=Pe?.kind==="revision"&&w!==null&&ge===chunkOSFOJTHU_cjs.xj(w)?ue?.style?.activeBackground:void 0;Y.push({...J,className:le,...ue?{reviewAuthor:ue}:{},...kt!==void 0?{activeBackground:kt}:{}});}chunkCAJEXXVG_cjs.r(L,be,Y,{scale:u,...ht?{pageOffsetX:ht.pageOffsetX}:{}}),Yh=be,Qh=k,Jh=D.resolved;}function Ia(){xt?.update();let f=F?chunkD7ZMDMPX_cjs.ia(be,F.cellIds):ne?chunkDOHF6FA7_cjs.ue(Se(),ne,ct(),x):fk(Se(),j,ct,x);chunkCAJEXXVG_cjs.r(C,be,f,{scale:u,pageOffsetX:ht?.pageOffsetX,...F?{}:{className:ne?"docx-retained-selection-rect":"docx-selection-mark-rect"}});}function gu(){q?.({layer:A,layout:be,revision:a.packageRevision(),scale:u,measurer:x,...Ut?{pages:Ut}:{},...ht?{pageOffsetX:ht.pageOffsetX}:{}});}function ll(){if(!Xc){K.replaceChildren();return}let f=d;if(!f){K.replaceChildren();return}iP(K,be,f.remoteSelections(),{scale:u,pageOffsetX:ht?.pageOffsetX,...Ut?{pages:Ut}:{},colorForAuthor:Xh,declaredColorFor:pA,labelHost:Yc,measurer:x});}function dl(f){let w=chunkOSFOJTHU_cjs.Rf(a.part());if(f)return w.find(V=>V.id===f)??null;let k=pa?w.find(V=>V.id===pa):void 0;if(k)return k;let D=j.head.paragraphId;return w.find(V=>V.beginParagraphId===D||V.endParagraphId===D||V.resultParagraphIds.includes(D))??(w.length===1?w[0]:null)}function hu(){return hS(a.part(),j)}function ey(f){return yS(a.part(),f)}function ty(){return new Set(chunkOSFOJTHU_cjs.Rf(a.part()).flatMap(f=>[f.beginParagraphId,...f.resultParagraphIds,f.endParagraphId]))}function yu(f){return new Set([f.beginParagraphId,f.endParagraphId,...f.resultParagraphIds])}function gA(f){let w=0;for(let k of be.pages)for(let D of chunkDOHF6FA7_cjs.xa(k))f.has(D.paragraphId)&&(w+=D.lines.length);return w}function bu(f,w){let k=new Set(w),D=new Map;for(let V of f.pages)for(let Y of chunkDOHF6FA7_cjs.xa(V)){if(!k.has(Y.paragraphId)||D.has(Y.paragraphId))continue;let J=V.pageFieldSource;D.set(Y.paragraphId,chunkDOHF6FA7_cjs.ec(J?.pageNumber??V.index+1,J?.format));}return D}function vu(f){if(De==="view"||!a.editable)return false;let w=dl(f);return !w||!chunkOSFOJTHU_cjs.Tf(a.part(),a.documentOutline(),w.instruction)?false:chunkOSFOJTHU_cjs.Xk(a.part(),{op:"rewriteTocPageNumbers",tocId:w.id,updates:[]})===null}function ny(f,w){if(!Number.isInteger(f)||!Number.isInteger(w)||f<1||w<1)return null;let k=we.sectionPropertiesAt(j.head.paragraphId),D=k.pageSize.widthTwips-k.margins.leftTwips-k.margins.rightTwips-k.margins.gutterTwips,V=Math.max(300,Math.floor(D/w));return {op:"insertTable",beforeParagraphId:j.head.paragraphId,rows:f,cols:w,columnWidthTwips:V}}function ry(f,w){if(_e?.active()||De==="view"||!a.editable)return false;let k=ny(f,w),D=a.partFor(ze())??a.part();return k!==null&&chunkOSFOJTHU_cjs.Xk(D,k)===null}function hA(f,w){if(!ry(f,w))return false;let k=ny(f,w);if(!k)return false;let D=null,V=a.subscribe(J=>{J.caret&&(D=J.caret);}),Y=false;try{Be(()=>{let J=et([k],Xe());return J.committed||(N=$(J.reason??"the table could not be inserted here",J.reason??"table-insert-refused")),Y=J.committed,J},()=>{let J=D;return J?Ke({paragraphId:J.paragraphId,offset:J.start}):null});}finally{V();}return Y}let oy='TOC \\o "1-3" \\h';function iy(){let f=chunkOSFOJTHU_cjs.Pf(oy);if(!f)return null;let w=a.documentOutline(),k=chunkOSFOJTHU_cjs.ug(a.part(),w,f,bu(Le.layout(),w.map(D=>D.blockId)),ty(),d?.identity.actorId);return {op:"insertToc",beforeParagraphId:j.head.paragraphId,instruction:oy,alias:Gn?.title??"TOC",entries:k.entries,bookmarksToCreate:k.bookmarksToCreate}}function ay(){if(De==="view"||!a.editable||hu())return false;let f=iy();return f!==null&&chunkOSFOJTHU_cjs.Xk(a.part(),f)===null}function yA(){if(!ay())return false;let f=iy();if(!f)return false;let w=new Set(chunkOSFOJTHU_cjs.Rf(a.part()).map(V=>V.id)),k=ya([f],void 0,void 0,il);if(!k.committed)return N=$(k.reason??"the table of contents could not be inserted",k.reason??"table-of-contents-refused"),false;let D=chunkOSFOJTHU_cjs.Rf(a.part()).find(V=>!w.has(V.id));return D?sy(D.id,"pageNumbers"):true}function sy(f,w="entire"){let k=dl(f);if(!k||!vu(k.id))return false;let D=Le.layout(),V=a.documentOutline(),Y=chunkOSFOJTHU_cjs.Tf(a.part(),V,k.instruction);if(!Y)return false;let J=Y.map(ge=>ge.blockId);if(w==="entire"){let ge=chunkOSFOJTHU_cjs.ug(a.part(),V,k.instruction,bu(D,J),yu(k),d?.identity.actorId),Pe=ya([{op:"replaceTocResult",tocId:k.id,entries:ge.entries,bookmarksToCreate:ge.bookmarksToCreate}],void 0,void 0,il);if(!Pe.committed)return N=$(Pe.reason??"the table of contents could not be refreshed",Pe.reason??"table-of-contents-refused"),false;if(D=Le.layout(),k=dl(k.id),!k)return true}let le="";for(let ge=0;ge<3;ge+=1){let Pe=bu(D,J),xe=chunkOSFOJTHU_cjs.wg(a.part(),k,V,yu(k)),ue=k.resultParagraphIds.flatMap((Bt,ul)=>{let fl=xe[ul],Ta=fl?Pe.get(fl):void 0;return Ta===void 0?[]:[{paragraphId:Bt,pageNumberText:Ta}]});if(ue.length===0)break;let kt=ue.map(Bt=>`${Bt.paragraphId}\0${Bt.pageNumberText}`).join("");if(kt===le)break;le=kt;let Sr=ya([{op:"rewriteTocPageNumbers",tocId:k.id,updates:ue}],void 0,void 0,il);if(!Sr.committed){if(Sr.rejected)return N=$(Sr.reason??"the table of contents page numbers were refused",Sr.reason??"table-of-contents-refused"),false;break}D=Le.layout(),k=dl(k.id)??k;}return true}function bA(){return ZR({session:a,editingMode:De,collaborationActive:d!==void 0,reviewerFilterActive:On.filterForSession(a)!==void 0,layout:Le.layout(),canonicalUnfilteredLayout:Tt,styleCascade:pn(),numberingIndex:En(),displayMode:Ft()})}let{selectionMark:Xe,orderedRange:Zr,orderedStart:xu,textOf:_t,inlineControlBeside:ly,splitEndsTheParagraph:vA,deleteSelectionPlan:wr,deleteSelectionOps:xA,replacementOffset:wu}=pT({session:a,layout:Se,selection:()=>j,cellSelection:()=>F,editingMode:()=>De,author:()=>c,trackedDate:y,storyScope:ze,paragraphOrder:ct,flushPendingInputAndLayout:Je,trackedAuthorOrNone:fu,atParagraphEnd:(f,w)=>go.atParagraphEnd(f,w),revisionView:Kh}),{insertPlainText:dy,copyFlavoursNow:wA,pasteRichNow:SA,armForcePlainPaste:IA}=fT({session:a,textFormFieldId:()=>xt?.fieldId()??null,richPasteAllowed:()=>!_e?.active(),paragraphIds:fo,layout:Se,cellSelection:()=>F,editingMode:()=>De,storyScope:ze,paragraphOrder:ct,actorId:()=>d?.identity.actorId,collaborationGate:(f,w)=>d?.gateOperations(f,w)??null,now:nt,flushPendingInputAndLayout:Je,orderedRange:Zr,selectionMark:Xe,deleteSelectionPlan:wr,consumePendingFormatOps:Ae,withoutPendingOnRejection:He,caretMark:xr,commit:Be});function ka(f){f&&(cr=null,Je(),rn=Yn(It()),lt.invalidateAll(a.packageRevision(),"tracked-change-filter"),lt.flush(),n.onChange?.(gt()));}let mi=false,Le={session:a,applyGatedTreeOps:(f,w,k,D)=>ya(f,w,k,D??ze()),storyScope:ze,imageDecodePort:()=>sa,layout:()=>(Je(),be),state:gt,currentPage:(f="caret")=>{if(Je(),f==="viewport"){let k=IT(e,be,u);if(k!==null)return k}let w=chunkDOHF6FA7_cjs.ne(Se(),j.head);return w?w.pageIndex+1:1},setScale(f){if(!(f>0)||!Number.isFinite(f))return false;if(f===u)return true;let w={scale:u,defaults:S,measurer:x,producer:P,furnitureSource:rn};try{let k=Vt(e),D=k?{x:(k.scrollLeft-e.offsetLeft+k.clientWidth/2)/u,y:(k.scrollTop-e.offsetTop+k.clientHeight/2)/u}:null;if(u=f,n.measurer||(S=chunkD7ZMDMPX_cjs.S(u,{context:Ui(e.ownerDocument),...n.fontAlias?{fontAlias:n.fontAlias}:{}}),x=S.measurer),P=T(),rn=Yn(It()),Ut=void 0,ht=void 0,Wr=null,lt.invalidateAll(a.packageRevision(),"zoom"),lt.flush(),Rh(),k&&D){let V=Math.max(0,D.x*u+e.offsetLeft-k.clientWidth/2),Y=Math.max(0,D.y*u+e.offsetTop-k.clientHeight/2),J=Number.isFinite(k.scrollWidth)?Math.max(0,k.scrollWidth-k.clientWidth):null,le=Number.isFinite(k.scrollHeight)?Math.max(0,k.scrollHeight-k.clientHeight):null;k.scrollLeft=J===null?V:Math.min(V,J),k.scrollTop=le===null?Y:Math.min(Y,le),ol();}return !0}catch{(({scale:u,defaults:S,measurer:x,producer:P,furnitureSource:rn}=w)),Ut=void 0,ht=void 0,Wr=null;try{lt.invalidateAll(a.packageRevision(),"zoom-rollback"),lt.flush();}catch{}return false}},enqueueType:vo,flushPendingInput:Je,type(f){let w=wr(),k=w.replaceAt??w.collapseTo,D=Ae(k.paragraphId,k.offset,f.length),V=w.ops.length===0?gR(Vr()):void 0,Y=[...w.ops,hR(k,f,V)],J=mR(Me(a,k.paragraphId)??a.part(),k.paragraphId,k.offset,f.length),le={paragraphId:k.paragraphId,start:J,end:J};Be(()=>He([...Y,...D],Y,Xe(),le),()=>Ke({paragraphId:k.paragraphId,offset:J}));},proposeTextChange:(f,w,k)=>Uc(f,w,k),insertPlainText:f=>dy(f),deleteBackward(){if(xt?.selectForDeletion("backward"))return;let f=wr();if(f.ops.length>0){Be(()=>et(f.ops,Xe(),xr(f.collapseTo)),()=>Ke(f.collapseTo));return}if(Vh("backward"))return;let w=st()??void 0,k=Lt.shown(j.head);if(k.offset===0){for(let Pe of chunkDOHF6FA7_cjs.Oa(Se(),k.paragraphId)){let xe=_t(Pe);if(xe.length!==0){Be(()=>et([{op:"deleteText",paragraphId:Pe,start:xe.length-1,end:xe.length}],Xe(),xr({paragraphId:Pe,offset:xe.length-1})),()=>Ke({paragraphId:Pe,offset:xe.length-1}),{rearmPending:w});return}}let V=ct(),Y=V.indexOf(k.paragraphId),J=V[Y-1];if(!J)return;let le=Lt.joinOps(J,k.paragraphId);if(!le){yt(Ke({paragraphId:J,offset:_t(J).length}));return}let ge=_t(J).length;Be(()=>et(le,Xe(),xr({paragraphId:J,offset:ge})),()=>Ke({paragraphId:J,offset:ge}),{rearmPending:w});return}let D=ly(k,"before");if(D){Be(()=>et([{op:"removeContentControl",controlId:D.controlId,keepContent:false}],Xe(),xr({paragraphId:k.paragraphId,offset:D.start})),()=>Ke({paragraphId:k.paragraphId,offset:D.start}),{rearmPending:w});return}Be(()=>et([{op:"deleteText",paragraphId:k.paragraphId,start:k.offset-1,end:k.offset}],Xe(),xr({...k,offset:k.offset-1})),()=>Ke({...k,offset:k.offset-1}),{rearmPending:w});},splitParagraph(){let f=wr(),w=f.replaceAt??f.collapseTo,k=st()??{properties:Wi(Me(a,w.paragraphId)??a.part(),w.paragraphId,w.offset,Ft(),It()),base:[]},D=vA(w),V=D?go.followerStyleId(w.paragraphId):void 0,Y=chunkOSFOJTHU_cjs.Mh(k.base,k.properties,el(w.paragraphId,w.offset)),J=D&&De==="edit"&&Y.length>0?[{op:"setParagraphMarkProperties",paragraphId:w.paragraphId,properties:Y}]:[],le={op:"splitParagraph",paragraphId:w.paragraphId,offset:w.offset,tailStyleId:V},ge=fu(),Pe=ge?{author:ge,date:y()}:void 0,xe=a.documentStyles(),ue=Zd(xe),kt=ue??"ListParagraph",Sr=new Set(xe.map(Ir=>Ir.styleId));for(let Ir=1;!ue&&Sr.has(kt);Ir++)kt=`ListParagraph${Ir}`;let Bt=De!=="view"&&f.ops.every(Ir=>Ir.op==="deleteText"&&Ir.paragraphId===w.paragraphId)&&V===void 0?Bk(Me(a,w.paragraphId)??a.part(),be,w,Y,kt,pn(),Pe,d?.identity.actorId):null,ul=Pe?[{op:"setParagraphMarkRevision",paragraphId:w.paragraphId,kind:"ins",revision:Pe}]:[],fl=Bt?[Bt,...J,...ul]:[le],Ta=Bt?new Set(fo()):null;TR(a,w.paragraphId,Ir=>Be(()=>He([...f.ops,...J,...fl],[...f.ops,...Bt?[Bt,...ul]:[le]],Xe(),void 0,Bt&&!ue?[jk(pn()?.defaultParagraphStyleId??null,kt)]:void 0),()=>{if(!Ta)return Ir();let Sy=fo().filter(EA=>!Ta.has(EA)),Iy=Bt?Sy.at(-1):Sy[0];return Iy?Ke({paragraphId:Iy,offset:0}):null},{rearmPending:k}),po);},navigate(f,w=false){if(Je(),!w&&(f==="left"||f==="right")&&(j.anchor.paragraphId!==j.head.paragraphId||j.anchor.offset!==j.head.offset)){let xe=Zr();At=null;let ue=vR(Se(),xe,ct(),f,x);yt(Ke(ue),true);return}let k=hp(Se(),Lt.shown(j.head),f,At,ye?.getActive()??null,Oe(),x,Ue.selectionLineId());if(!k)return;let D=ty(),V=bS(a.part(),k.position,["left","wordLeft","lineStart","up","pageUp"].includes(f));if(V&&(k={...k,position:V,caret:void 0}),xn(a.part(),k.position)){if(w)return;let ue=new Set(["left","wordLeft","lineStart","up","pageUp"]).has(f)?"up":"down",kt=gA(D)+4;for(let Sr=0;Sr<kt;Sr+=1){let Bt=hp(Se(),k.position,ue,k.desiredX,ye?.getActive()??null,Oe(),x);if(!Bt||Bt.position.paragraphId===k.position.paragraphId&&Bt.position.offset===k.position.offset)return;if(k=Bt,!xn(a.part(),k.position))break}if(xn(a.part(),k.position))return}At=k.desiredX,Fe?.activeNoteScope()&&k.pageIndex!==void 0&&Number.isInteger(k.pageIndex)&&Fe.setActiveNotePageIndex(k.pageIndex);let J={anchor:w?Lt.shown(j.anchor):k.position,head:k.position},le=w?J:Ic(be,J),ge=!w&&!Mt(le,J),Pe=j;yt(le,true,ge?"none":"head",ge?void 0:k.caret),ge&&(j!==Pe||Mt(j,le))&&tu(j.anchor);},deleteWordBackward(){if(Le.deleteSelection())return;let f=j.head,w=(xt?.wordDeletionBoundary??chunkDOHF6FA7_cjs.he)(_t(f.paragraphId),f.offset,-1,chunkDOHF6FA7_cjs.qe(Se(),f.paragraphId));if(w===f.offset){Le.deleteBackward();return}Be(()=>et([{op:"deleteText",paragraphId:f.paragraphId,start:w,end:f.offset}],Xe()),()=>Ke({...f,offset:w}),{rearmPending:st()??void 0});},deleteWordForward(){if(Le.deleteSelection())return;let f=j.head,w=(xt?.wordDeletionBoundary??chunkDOHF6FA7_cjs.he)(_t(f.paragraphId),f.offset,1,chunkDOHF6FA7_cjs.qe(Se(),f.paragraphId));if(w===f.offset){Le.deleteForward();return}Be(()=>et([{op:"deleteText",paragraphId:f.paragraphId,start:f.offset,end:w}],Xe()),void 0,{rearmPending:st()??void 0});},deleteForward(){if(xt?.selectForDeletion("forward")||Le.deleteSelection()||Vh("forward"))return;let f=st()??void 0,w=Lt.shown(j.head),k=_t(w.paragraphId);if(w.offset<k.length){let Y=ly(w,"after");if(Y){Be(()=>et([{op:"removeContentControl",controlId:Y.controlId,keepContent:false}],Xe()),()=>Ke(w),{rearmPending:f});return}Be(()=>et([{op:"deleteText",paragraphId:w.paragraphId,start:w.offset,end:w.offset+1}],Xe()),void 0,{rearmPending:f});return}let D=ct(),V=D[D.indexOf(w.paragraphId)+1];if(V){if(chunkDOHF6FA7_cjs.Oa(Se(),V).includes(w.paragraphId)){if(_t(V).length===0)return;Be(()=>et([{op:"deleteText",paragraphId:V,start:0,end:1}],Xe()),()=>Ke(w),{rearmPending:f});return}Be(()=>et(Lt.forwardJoinOps(w.paragraphId,V)??[{op:"joinParagraphs",firstId:w.paragraphId,secondId:V}],Xe()),()=>Ke(w),{rearmPending:f});}},...we,...Q,setSelection:f=>{Mt(f,j)||U({kind:"programmatic"},false),We.discard(),yt(f);},selectDrawing(f,w){Ht();let k=zi(be,f,w);if(!k)return false;let D=Ke(k);return U({kind:"pointer",drawingNodeId:f},Mt(D,j)),yt(D,true,"none"),Sn(Le)?.drawingNodeId===f},revealPage(f,w){Ht();let k=be.pages.find(D=>D.index===f);return k?Ra(k.box.y,k.box.height,w):false},revealParagraph(f,w){Ht();let k=chunkDOHF6FA7_cjs.ne(Se(),{paragraphId:f,offset:0});if(!k)return false;let D=be.pages.find(V=>V.index===k.pageIndex);return D?Ra(D.contentBox.y+k.y,k.height,w):false},revealPosition(f,w){Ht();let k=chunkDOHF6FA7_cjs.ne(Se(),f);if(!k)return false;let D=be.pages.find(V=>V.index===k.pageIndex);return D?Ra(D.contentBox.y+k.y,k.height,{block:"nearest",...w}):false},setEditable(f){cu=f,f||_e?.exit(),su();},selectAll(){let f=ct(),w=f[0],k=f[f.length-1];!w||!k||yt({anchor:{paragraphId:w,offset:0},head:{paragraphId:k,offset:_t(k).length}});},hyperlinks:ke,equations:Ze,contentControls:vr,formatPainter:te,canInsertTable:ry,insertTable:hA,canInsertToc:ay,insertToc:yA,canRefreshToc:vu,canEditTextFormField:()=>xt?.canEdit()??false,editTextFormField:()=>xt?.edit()??false,refreshToc:sy,refreshRefFieldResults:bA,save:()=>OR(Le,e,()=>mi),isInsideToc:f=>chunkOSFOJTHU_cjs.Rf(a.part()).some(w=>w.beginParagraphId===f||w.endParagraphId===f||w.resultParagraphIds.includes(f)),retainSelection:()=>{let f=Symbol("selection-pin");return ee.set(f,j),ne=j,Ia(),f},releaseSelection:f=>{ee.delete(f)&&(se(),Ia());},retainedSelection:()=>ne,publishedLayout:()=>be,drawingSelectionIntent:()=>me,overlayCoordinates:()=>Object.freeze({paintScale:u,pageOffsetX:ht?.pageOffsetX??new Map}),commitReviewOps:(f,w)=>{Je();let k=j.head.paragraphId,D=_t(k);return Be(()=>{if(De==="view")return {committed:false,rejected:true,opCount:0,reason:m};if(d&&(w===void 0||!qk.has(w)))return {committed:false,rejected:true,opCount:0,reason:"experimental-collaboration-body-text-only"};if(d){let Y=d.gateOperations([],ze());if(Y)return {committed:false,rejected:true,opCount:0,reason:Y}}let V=chunkOSFOJTHU_cjs.Hb(d?.identity.actorId,f);return {committed:V.committed,rejected:!V.committed,opCount:0,...typeof V.reason=="string"?{reason:V.reason}:{}}},()=>{Ht(),Ue.noteModelMoved();let V=ct();if(V.length===0)return null;let Y=dg(j,k,D,_t(k));return io(Se(),V,Y)})},revisionDisplayMode:Qs,replacementLanding:ve,applyAutomationOps:(f,w,k,D=false)=>{let V={committed:false,rejected:false,opCount:0},Y=w??il;return Be(()=>{let J=jr(false);if(J!==null)return V={committed:false,rejected:true,opCount:0,reason:J};let le=null,ge=f(Pe=>{let xe=jr(true,[],false);return xe===null?chunkOSFOJTHU_cjs.Hb(d?.identity.actorId,()=>a.ensureHyperlinkRelationship(Pe,Y)):(le=xe,null)});return ge===null?V={committed:false,rejected:true,opCount:0,reason:le??"this engine will not author that hyperlink target"}:!n.reviewModel&&(D||ge.some(qm))?V={committed:false,rejected:true,opCount:0,reason:"review-module-required"}:V=et(ge,void 0,void 0,Y,false,k)},()=>{Ht(),Ue.noteModelMoved();let J=ct();return J.length===0?null:io(Se(),J,j)},{automation:true}),V},editingMode:()=>De,author:()=>c,setAuthor:f=>{c!==f&&(bt(),c=f,f?.trim()&&VR(N)&&(N=null,n.onChange?.(gt())));},setDrawingStrings:f=>{si!==f&&chunkCAJEXXVG_cjs.j(si)!==chunkCAJEXXVG_cjs.j(f)&&(si=f,Je(),vt(false));},setLocale:al.set,setTranslate:f=>{if(ha===f)return;ha=f,Rm(v,f),xt?.update();let w=chunkCAJEXXVG_cjs.f(f),k=chunkCAJEXXVG_cjs.g(w)!==chunkCAJEXXVG_cjs.g(li);li=w,k&&ho.get()&&(Je(),vt(false));},setTocLabels:f=>{Gn=f;},setEditingMode:f=>{Je();let w=De!==f;De=f,w&&f!=="edit"&&_e?.exit(),w&&f==="view"&&ye?.exitHeaderFooter(),w&&f==="view"&&Fe?.exitNote(),w&&f==="view"&&te.disarm(),au(),su(),gp(e,De),w&&vt(false),N=null,n.onChange?.(gt());},revisionAuthors:()=>Nt.get().value,setRevisionDisplayMode(f){mi||f===Xn.view()||(Je(),Xn.set(f),ka(true));},hiddenRevisionAuthors:()=>On.hiddenAuthors,setRevisionAuthorVisible(f,w){ka(On.setVisible(f,w));},setAllRevisionAuthorsVisible(f){ka(On.setAllVisible(Nt.get().value.keys(),f));},showAllRevisionAuthors(){ka(On.showAll());},setTrackedChangesFilter(f,w){ka(On.setPredicate(f,w));},collaborationSession:()=>d??null,remotePresenceColor:Xh,setShowParagraphMarks:ho.set,setRevisionMarkup:di.set,setRevisionStyles:f=>{f!==Qn&&(Qn=f,Je(),vt(false));},setHighlightPainter(f){q=f,f||A.replaceChildren(),gu();},repaintHighlights:gu,setRemoteCaretLabelHost:f=>{f!==Yc&&(Yc=f,ll());},setReviewActivationExclusions(f,w){va=w?.formattingKinds?new Set(w.formattingKinds):void 0,ba=f===null?null:new Set(f),pi(),n.onChange?.(gt());},activeReviewKey:()=>{let f=mu();return f?chunkOSFOJTHU_cjs.xj(f):null},activateReview:(f,w,k)=>{if(wo.clear(),Zh=k?.allowExcluded??false,xa=w?{key:f,anchor:w.anchor,head:w.head}:{key:f,anchor:j.anchor,head:j.head},w){pu=true;try{yt(w);}finally{pu=false;}return}pi(),n.onChange?.(gt());},activatedReviewKey:()=>zh()===null?null:xa?.key??null,dismissActiveReview:()=>{let f=mu();f&&(wo.add(chunkOSFOJTHU_cjs.xj(f)),xa=null,pi(),n.onChange?.(gt()));},navigation:je,bookmarks:()=>a.bookmarks(),selectedText(){if(F)return ak(be,F);let{from:f,to:w}=Zr();return ik(Se(),f,w,ct())},copyFlavours:()=>wA(),pasteRich:(f,w)=>SA(f,w),armForcePlainPaste:IA,deleteSelection(){let f=wr();return f.ops.length===0?false:(Be(()=>et(f.ops,Xe(),xr(f.collapseTo)),()=>Ke(f.collapseTo)),true)},setCellSelection:jh,layoutSession:()=>R,undo:()=>{if(De==="view"||Wn(e)){N=$(m),n.onChange?.(gt());return}bt(),H.end(),d?.flushPendingJournals(),at.step("undo",Te,()=>Ne("undo"));},redo:()=>{if(De==="view"||Wn(e)){N=$(m),n.onChange?.(gt());return}bt(),H.end(),d?.flushPendingJournals(),at.step("redo",Te,()=>Ne("redo"));},sectionAtPage:Jt,activeScope:()=>{let f=_e?.active();if(f)return f;let w=Fe?.activeNoteScope();return w||ye.activeScope()},setActiveScope:f=>(Je(),f.kind==="frame"?_e.enter(f):f.kind!=="body"&&f.kind!=="headerFooter"&&f.kind!=="note"?false:(_e?.exit(),f.kind==="note"?Fe.enterNote(f.id):(Fe?.exitNote(),ye.setActiveScope(f)))),insertNote:f=>(Je(),Fe.insertNote(f)),deleteNote:(f,w)=>Fe.deleteNote(f,w),convertNote:(f,w)=>Fe.convertNote(f,w),convertAllNotes:f=>Fe.convertAllNotes(f),setNoteProperties:f=>Fe.setNoteProperties(f),enterNote:(f,w)=>(Je(),Fe.enterNote(f,w)),exitNote:()=>(Je(),Fe.exitNote()),notePropertiesState:()=>{let f=Le.state().selection.head.paragraphId,w=a.packageRevision(),k=a.currentPackage(),D=a.part(),V=chunkOSFOJTHU_cjs.Tg(k),Y=chunkOSFOJTHU_cjs.ch(k,"footnote"),J=chunkOSFOJTHU_cjs.ch(k,"endnote"),le=Le.activeScope().kind==="headerFooter",ge=Le.headerFooterState(),Pe=ge?.rId??null,xe=ge?.sectionIndex??null,ue=cr;if(ue&&ue.packageRevision===w&&ue.paragraphId===f&&ue.bodyPart===D&&ue.settingsPart===V&&ue.footnotesPart===Y&&ue.endnotesPart===J&&ue.headerFooterOpen===le&&ue.headerFooterRId===Pe&&ue.headerFooterSectionIndex===xe)return ue.result;let kt=DC(Le,It());return cr={packageRevision:w,paragraphId:f,bodyPart:D,settingsPart:V,footnotesPart:Y,endnotesPart:J,headerFooterOpen:le,headerFooterRId:Pe,headerFooterSectionIndex:xe,result:kt},kt},notePreviewText:f=>HC(a,f),applyTableCommandPlan(f){if(!f.ok)return {ok:false,code:f.code,reason:f.reason};let w=null,k=a.subscribe(D=>{D.caret&&(w=D.caret);});try{let D=Xe(),V=f.selection.kind==="adoptCommittedCaret";Be(()=>et(f.ops,D),V?()=>{let Y=w;return Y?Ke({paragraphId:Y.paragraphId,offset:Y.start}):null}:void 0,f.selection.kind==="preserveSelection"?{keepCellSelection:!0}:void 0);}finally{k();}return N?{ok:false,code:"invalidArgs",reason:N}:{ok:true,changed:true}},enterHeaderFooter:f=>{Je();let w=ye.enterHeaderFooter(f);if(!w)return w;let k=ye.getActive(),D=k?be.pages[k.pageIndex]:void 0;if(k&&D){let V=k.kind==="header"?D.header:D.footer,Y=V?.box.y??(k.kind==="header"?D.box.y:D.box.y+D.box.height-1),J=V?.box.height??1;Ra(Y,J,{block:"nearest"});}return w},exitHeaderFooter:()=>(Je(),ye.exitHeaderFooter()),headerFooterState:()=>ye.headerFooterStateStable(a.packageRevision()),...OC({applyOps:et,commit:Be,deleteSelectionOps:xA,deleteSelectionPlan:()=>wr(),orderedStart:xu,selectionMark:Xe,collapsedAt:Ke,isHeaderFooterOpen:()=>ye?.getActive()!==null,lastRejection:()=>N}),...AC({session:a,applyOps:et,commit:Be,storyScope:ze,selectionMark:Xe,editingMode:()=>De,author:()=>c,trackedDate:y,decodePort:()=>sa,actorId:()=>d?.identity.actorId}),focus:()=>{O.activeElement!==v&&(v.focus({preventScroll:true}),Ue.mirrorToDom(true));},setTableInteractionLabel(f){p.resolve=f;},refreshTableInteractionLabels(){Pa.refreshLabels();},destroy(){if(!mi){mi=true,ci.cancel();try{Jc();}finally{O.removeEventListener("selectionchange",cy),v.removeEventListener("pointerdown",vy,{capture:true}),v.removeEventListener("keydown",cl,{capture:true}),v.removeEventListener("keydown",Zt,{capture:true}),v.removeEventListener("pointerdown",Zt,{capture:true}),v.removeEventListener("beforeinput",cl,{capture:true}),v.removeEventListener("keydown",my),CA(),v.removeEventListener("beforeinput",by),v.removeEventListener("copy",gy),v.removeEventListener("cut",hy),v.removeEventListener("paste",yy),v.removeEventListener("compositionstart",fy),v.removeEventListener("compositionend",uy),O.removeEventListener("scroll",xy,{capture:true}),e.ownerDocument.defaultView?.removeEventListener("resize",ku),ga?.disconnect(),lu=null,au(),ru.destroy(),fi.destroy(),xt?.destroy(),sl?.destroy(),uu?.destroy(),Su?.destroy(),Pa.destroy(),je.destroy(),rt.destroy(),Ue.destroy(),v.removeEventListener("contextmenu",Lh),v.removeEventListener("click",Nh),v.removeEventListener("pointermove",Ch),v.removeEventListener("pointerleave",Oh),an.destroy(),lt.cancel(),zt!==null&&clearTimeout(zt),zt=null,Kr&&Kr(),Kr=null,en.dispose(),chunkCAJEXXVG_cjs.i(v),_.destroy(),jM(),Ih(),Sh(),VM(),e.replaceChildren();}}}};function kA(f){Ee=null;let w=xt?.restoreAfterHistory();if(!f&&w&&(j=w),Ue.noteModelMoved(),Ht(),!f){yt(io(Se(),ct(),j));return}if("anchor"in f){let D=ct(),V=!d&&[f.anchor,f.head].every(Y=>D.includes(Y.paragraphId));yt(V?f:io(Se(),D,f));return}let k={anchor:{paragraphId:f.paragraphId,offset:f.start},head:{paragraphId:f.paragraphId,offset:f.end}};yt(ct().includes(f.paragraphId)?k:io(Se(),ct(),k));}function Ra(f,w,k){let D=Vt(e);if(!D||D.clientHeight===0)return false;Rh();let V=f*u+e.offsetTop,Y=w*u,J=k?.offsetPx??24,le=k?.block??"start",ge=D.clientHeight;if(le==="nearest"||le==="centerIfNeeded"){let ue=V<D.scrollTop,kt=V+Y>D.scrollTop+ge;if(!ue&&!kt)return true}let Pe=le==="center"||le==="centerIfNeeded"?V-Math.max(0,(ge-Y)/2):le==="nearest"&&V>D.scrollTop?V+Y+J-ge:V-J,xe=Math.max(0,D.scrollHeight-ge);return D.scrollTo({top:Math.max(0,Math.min(Pe,xe)),behavior:k?.behavior??"auto"}),ol(),true}let{onSelectionChange:cy,onCompositionEnd:uy}=o.methods({...Ue}),fy=(...f)=>{Ue.adoptBeforeInput(),Jc(),Ue.onCompositionStart(...f);},Su=null,RA=PR({onRequest:n.onRequestTextFormField,onInvalidRequest:n.onRequestInvalidTextFormField,locale:al.get,translate:(f,w)=>ha?.(f,w)??f,pagesLayer:v,container:e,part:f=>Me(a,f??j.head.paragraphId)??a.part(),parts:()=>a.storyParts(),protected:(f=j.head.paragraphId)=>chunkOSFOJTHU_cjs.pj(a.settingsRoot())&&chunkOSFOJTHU_cjs.qj(Me(a,f)??a.part(),f),selection:()=>j,select:(f,w)=>yt(f,false,w?"none":"caret"),reveal:tu,editable:()=>De==="edit"&&!tn,apply:f=>ec(f,Be,et),save:(f,w)=>MR(f,w,{session:a,commit:Be,refusal:()=>jr(true,f,false),gate:(k,D)=>d?.gateOperations(k,D)??null,collaborationActive:d!==void 0})},r.initialTextFormInput);xt=YR(RA,{part:f=>Me(a,f),selection:()=>j,select:f=>yt(f),writable:()=>De!=="view"&&!tn,compare:fe},o),US(Le,xt.fieldId),uu=qR({pagesLayer:v,part:f=>Me(a,f??j.head.paragraphId)??a.part(),editable:()=>De==="edit"&&!tn,protected:f=>chunkOSFOJTHU_cjs.pj(a.settingsRoot())&&chunkOSFOJTHU_cjs.qj(Me(a,f)??a.part(),f),selection:()=>j,select:f=>yt(f,false,"none"),apply:f=>ec(f,Be,et)}),sl=Dk({pagesLayer:v,settings:()=>chunkOSFOJTHU_cjs.Tg(a.currentPackage()),part:f=>Me(a,f??j.head.paragraphId)??a.part(),editable:()=>De==="edit"&&!tn,select:f=>yt(f,false,"none"),canApply:f=>a.editable&&jr(true,[f],false)===null,history:f=>Le[f](),apply:f=>ec(f,Be,et)});let PA=TP(Le,{...n,onToggleFieldCodes:()=>{Je(),tn=!tn,rn=Yn(It()),lt.invalidateAll(a.packageRevision(),"field-code-view"),lt.flush();}}),py=KT(Le,()=>(Me(a,j.head.paragraphId)??a.part()).root),my=f=>{py.keydown(f),!sl?.keydown(f)&&(f.defaultPrevented||Ue.adoptBeforeInput(),!(uu?.keydown(f)||xt?.keydown(f))&&PA(f));},{onCopy:gy,onCut:hy,onPaste:yy}=CP(Le),TA=EP(Le,{isComposing:()=>Ue.isComposing(),insertPlainText:dy,onBrowserSelectionFixup:()=>{Ue.mirrorToDom(),Ue.noteBrowserSelectionFixup();}}),by=f=>{Ue.adoptBeforeInput(),TA(f);};O.addEventListener("selectionchange",cy);let{onDrawingPointerGesture:vy,onDrawingKeyGesture:cl}=bk({surface:Le,textbox:()=>_e,intent:()=>me,setIntent:f=>U(f,true)});v.addEventListener("pointerdown",vy,{capture:true}),v.addEventListener("keydown",cl,{capture:true}),v.addEventListener("beforeinput",cl,{capture:true}),v.addEventListener("keydown",Zt,{capture:true}),v.addEventListener("pointerdown",Zt,{capture:true}),v.addEventListener("keydown",my);let CA=VT(v,py);v.addEventListener("beforeinput",by),v.addEventListener("copy",gy),v.addEventListener("cut",hy),v.addEventListener("paste",yy),v.addEventListener("compositionstart",fy),v.addEventListener("compositionend",uy);let Iu=QR(O,o.wrap(ol)),xy=f=>{let w=Vt(e);!w||f.target!==w||Iu();};O.addEventListener("scroll",xy,{capture:true,passive:true});let ku=()=>{Iu();},Ru=e.ownerDocument.defaultView;Ru?.addEventListener("resize",ku,{passive:true}),ga=typeof Ru?.ResizeObserver=="function"?new Ru.ResizeObserver(ku):null;function wy(){if(!ga)return;let f=Vt(e);f!==lu&&(ga.disconnect(),lu=f,f&&ga.observe(f));}wy(),_e=Mk({session:a,pagesLayer:v,layout:()=>be,selection:()=>j,setSelection:f=>yt(f,false,"none"),flush:Je,leaveOtherStories:()=>{Fe?.exitNote(),ye?.exitHeaderFooter();},writable:()=>cu&&De==="edit"&&a.editable}),Su=UT({onTextFormDoubleClick:f=>xt?.doubleClick(f)??false,onTextFormPointerUp:f=>xt?.pointerUp(f),pagesLayer:v,container:e,scale:()=>u,pageOffsetX:f=>ht?.pageOffsetX.get(f)??0,layout:()=>(ma=false,du.without(Ht),Se()),measurer:()=>x,selection:()=>Lt.shownSelection(j),setSelection:(f,w)=>yt(f,false,"none",w),cellSelection:()=>F,setCellSelection:f=>jh(f),focus:()=>v.focus({preventScroll:true}),onSelectionSettled:()=>te.applyIfArmed(),selectionLocked:()=>De==="view",activeHeaderFooter:()=>tS(ye?.getActive()??null),activeNote:()=>{let f=Fe?.activeNoteScope();return f?{scopeId:f.id,pageIndex:Fe?.activeNotePageIndex()??null}:null},enterHeaderFooter:f=>{Je(),ye?.enterHeaderFooter({rId:f.rId,pageIndex:f.pageIndex,sectionIndex:Jt(f.pageIndex).sectionIndex,kind:f.kind,...f.position?{position:f.position}:{}});},enterNote:(f,w,k)=>{Je(),Fe?.enterNote(f,w,k);},exitNote:f=>{Je(),Fe?.exitNote(f);},exitHeaderFooter:()=>(Je(),ye?.exitHeaderFooter()),enterEmptyHeaderFooter:(f,w)=>{if(De==="view")return;Je();let k=ye;k&&NC({session:a,layout:be,sectionAtPage:Jt,create:D=>Le.applyHeaderFooterLifecycle?.(D),flushLayout:Ht,enter:D=>k.enterHeaderFooter(D)},f,w);},onContentControlWidget:(f,w)=>rA(f,w),...n.reviewModel?{onChangeBarToggle:Xn.toggleByChangeBar}:{},isReadOnlyPosition:f=>xn(a.part(),f)!==void 0},n.pointer?{mode:n.pointer}:{});let Pa=DT({pagesLayer:v,furnitureLayer:E,scale:()=>u,pageOffsetX:f=>ht?.pageOffsetX.get(f)??0,read:()=>({layout:be,storeRevision:a.packageRevision(),selection:j,cellSelection:F,editingMode:De,themeColors:a.documentThemeColors()}),session:()=>a,applyTableCommandPlan:f=>Le.applyTableCommandPlan(f),label:f=>p.resolve(f)});if(vt(),sl?.sync(),Xc=true,ll(),d&&(Ih=d.subscribeStatus(()=>{n.onChange?.(gt());})),d&&tl)try{Sh=d.attach(tl);}catch{try{d.destroy();}catch{}}return xo(),su(),Le.setTableInteractionLabel=f=>{p.resolve=f,Pa.refreshLabels();},Le.refreshTableInteractionLabels=()=>{Pa.refreshLabels();},rR(Le,()=>({measurer:n.measurer,producer:n.producer,fontAlias:n.fontAlias,defaultFontFamily:n.defaultFontFamily}),f=>{n={...n,...f},x=n.measurer??S.measurer,P=T();},()=>{mi||(rn=Yn(It()),Ut=void 0,ht=void 0,Wr=null,lt.invalidateAll(a.packageRevision(),"fonts"),lt.flush());}),Lk(Le,()=>Ue.isComposing()),pr=sR(Le,e,{now:nt,destroyed:()=>mi,limit:()=>mr,setLimit:f=>mr=f,bodyBlockCount:()=>chunkDOHF6FA7_cjs.Ff(R),prefixPass:f=>hr(a.packageRevision(),void 0,void 0,f),finish:o.wrap(()=>{lt.invalidateAll(a.packageRevision(),"opening"),lt.flush(),mr=null;})},WC),{ok:true,surface:o.methods(Le)}}function ZC(e){let t={change:new Set,selectionChange:new Set,error:new Set,historyDiagnostic:new Set,diagnostic:new Set,revisionMarkupChange:new Set,reviewItemReveal:new Set};return {emitError(n){for(let r of [...t.error])r(n);},emitDocumentChange(n){for(let r of [...t.change])r(n);},emitSelectionChange(){if(!t.selectionChange.size)return;let n=e();for(let r of [...t.selectionChange])r(n);},emitHistoryDiagnostic(n){for(let r of [...t.historyDiagnostic])r(n);},emitDiagnostic(n){for(let r of [...t.diagnostic])r(n);},emitRevisionMarkupChange(n){for(let r of [...t.revisionMarkupChange])r(n);},emitReviewItemReveal(n){let r=Object.freeze({...n});for(let o of [...t.reviewItemReveal])o(r);},hasErrorHandlers:()=>t.error.size>0,hasDiagnosticHandlers:()=>t.diagnostic.size>0,clear(){for(let n of Object.values(t))n.clear();},on(n,r){return t[n].add(r),()=>{t[n].delete(r);}}}}var zC={"paragraph-count-unexplained":"edit.unmapped-change","paragraph-reordered":"edit.unmapped-change","unknown-paragraph-id":"edit.unmapped-change","unknown-content-moved":"edit.unmapped-change","unsupported-node":"edit.unsupported-content","split-not-clean":"edit.unmapped-change","join-not-clean":"edit.unmapped-change"},XC=new Map([["the document is open for viewing","edit.read-only"],["the document is read-only","edit.read-only"],["this content is locked","edit.protected-content"],[jo,"edit.read-only"],[Wo,"edit.protected-content"],[Zo,"edit.protected-content"],[Td,"edit.protected-content"],[ir,"edit.suggesting-needs-author"],[Up,"edit.suggesting-needs-author"],[Qt,"edit.review-module-required"],[VS,"edit.unsupported-content"],[Wm,"edit.unsupported-story"],[Zi,"edit.field-structure"],[_s,"edit.tracked-structure-unsupported"],[ta,"edit.section-mark"],[Pc,"edit.protected-content"],[Bs,"edit.protected-content"],["An external document refresh is in progress.","edit.refresh-in-progress"],["invalid note scope id","edit.stale-target"],[Vp,"edit.tracking-required"],[gs,"edit.tracked-image-replace-unsupported"],[nm,"edit.picture-selected"],[_i,"edit.revision-unsupported"],["note not found","edit.stale-target"]]);function Fg(e){let t=String(e??"refused");return XC.get(t)??t}function Mc(e,t){return (Object.hasOwn(zC,e)?zC[e]:void 0)??chunkEKLM7NWB_cjs.s(e)??XC.get(e)??(t!==void 0&&Object.hasOwn(UC,t)?UC[t]:void 0)??"edit.refused"}var UC={notFound:"edit.stale-target",ambiguous:"edit.invalid-argument",locked:"edit.protected-content",bound:"edit.protected-content",typeMismatch:"edit.invalid-argument",kindMismatch:"edit.invalid-argument",outOfBounds:"edit.invalid-argument",unsupported:"edit.unsupported-content",invalidArgs:"edit.invalid-argument"},GC={wasmUnavailable:"font.shaper-unavailable",initializationFailed:"font.shaper-unavailable",missing:"font.missing",forbidden:"font.load-failed",overLimit:"font.size-limit",malformed:"font.malformed",fontFaceLoadFailed:"font.load-failed",loadFailed:"font.load-failed",missingFont:"font.missing",hashMismatch:"font.integrity-mismatch",hashInvalid:"font.integrity-mismatch",metadataMismatch:"font.integrity-mismatch",fontMismatch:"font.integrity-mismatch",unsupportedFaceIndex:"font.unsupported-face",unsupportedFace:"font.unsupported-face"};function YC(e){return e!==void 0&&Object.hasOwn(GC,e)?GC[e]:"font.load-failed"}var Lg=Object.freeze([16,33,50,100,200,500,1e3]),QC=2048,l8=6e4,d8=200,c8=20,u8=256,f8=6e4;function p8(){return {now:()=>globalThis.performance?.now()??Date.now(),afterNextFrame(t,n){let r=globalThis.requestAnimationFrame;return typeof r!="function"?false:(r(()=>{t(),setTimeout(n,0);}),true)},setTimer(t,n){let r=setTimeout(t,n);return r.unref?.(),r},clearTimer:t=>clearTimeout(t)}}function ra(){return {count:0,max:0,bands:new Array(Lg.length+1).fill(0),samples:[]}}function JC(e,t){return e[Math.min(e.length-1,Math.ceil(t*e.length)-1)]}function m8(e){let t=[...e.samples].sort((n,r)=>n-r);return Object.freeze({count:e.count,p50Ms:Math.round(JC(t,.5)),p95Ms:Math.round(JC(t,.95)),maxMs:Math.round(e.max),bands:Object.freeze([...e.bands])})}function eE(e){let t=e.clock??p8(),n=e.windowMs??l8,r={interaction:ra(),layout:ra(),paint:ra()},o=null,i=null,a=null,s=[],l=false;function d(m,g){if(!Number.isFinite(g)||g<0)return;let b=r[m];b.count+=1,b.max=Math.max(b.max,g);let h=Lg.findIndex(y=>g<=y);if(b.bands[h===-1?Lg.length:h]+=1,b.samples.length<QC)b.samples.push(g);else {let y=Math.floor(Math.random()*b.count);y<QC&&(b.samples[y]=g);}o===null&&(o=t.now(),i=t.setTimer(c,n));}function c(){i!==null&&t.clearTimer(i),i=null;let m=o;o=null;let g=r;if(r={interaction:ra(),layout:ra(),paint:ra()},m===null)return;let b={};for(let y of ["interaction","layout","paint"])g[y].count>0&&(b[y]=m8(g[y]));let h=(b.interaction?.count??0)>=c8&&b.interaction.p95Ms>d8;e.deliver({kind:"performance",...h?{code:"performance.slow-interaction"}:{},windowMs:Math.max(0,Math.round(t.now()-m)),...a===null?{}:{pagesBucket:chunkEKLM7NWB_cjs.v(a)},...b});}let u=()=>{globalThis.document?.visibilityState==="hidden"&&(s=[],c());};globalThis.document?.addEventListener?.("visibilitychange",u);let p=()=>globalThis.document?.visibilityState==="hidden";return {timing(m,g,b){if(l||!e.enabled())return;if(b&&(a=b()),m!=="input"){d(m,g);return}if(s.length>=u8||p())return;let h=t.now(),y=g>0&&g<=h?g:h;if(s.push(y),s.length>1)return;let S=s,x=false;t.afterNextFrame(()=>{S===s&&(s=[],x=true);},()=>{if(!x||l)return;let R=t.now();for(let T of S)R-T<=f8&&d("interaction",R-T);})||(s=[]);},flush:c,dispose(){l||(c(),l=true,globalThis.document?.removeEventListener?.("visibilitychange",u));}}}var g8=new Set(["insertImage","openRevisionMarkupDialog","proposeDeletion","proposeInsertion","proposeReplacement","replaceImage","setEditingMode","setReviewDisplayMode","toggleDocumentProtection","toggleParagraphMarks","toggleReviewPane"]);function tE(e){if(g8.has(e.type))return e.type;try{let t=Vo(e);return t.supported||t.reason!==qp(e.type)?e.type:void 0}catch{return}}function h8(e){let t=e.type;if(t==="acceptRevision"||t==="acceptAllRevisions")return "accept";if(t==="rejectRevision"||t==="rejectAllRevisions")return "reject";let n=e.action;return n==="accept"||n==="reject"?n:void 0}var nE=new WeakMap;function rE(e,t){let n=nE.get(e);return n?n(t):t()}var Ng=new WeakMap;function y8(e,t,n,r){Ng.get(e)?.(t,n,r);}function b8(e,t,n){Ng.get(e)?.("edit.internal-invariant",n,"exception",{thrown:t});}var v8=new Set(["split","possible-ungrouped-gesture","possible-fragmented-gesture"]);function oE(e){let t=()=>globalThis.performance?.now()??Date.now(),n=chunkEKLM7NWB_cjs.w(()=>[...e.modules.diagnosticListeners,e.events.emitDiagnostic],e.now),r=n.deliver,o=null,i=0,a=0;e.events.on("historyDiagnostic",m=>{v8.has(m.kind)&&r({kind:"history",code:`history.${m.kind}`});}),e.customNodes?.observe(m=>{let g=m?.code;(g==="payload-invalid"||g==="payload-missing")&&r({kind:"custom-node",code:`custom-node.${g}`});});let s=e.modules.collaboration?.session,l=s?w8(s,r,t):()=>{},d=eE({deliver:r,enabled:()=>e.events.hasDiagnosticHandlers?.()===true||e.modules.wantsDiagnostic("performance"),...e.performance}),c=m=>{let g=new Map;for(let[b,h]of m)for(let{reason:y,revision:S,detail:x}of b){let I=chunkEKLM7NWB_cjs.t(y);if(!I)continue;let R=chunkEKLM7NWB_cjs.C(S?.revisionKind),T=R==="format"?chunkEKLM7NWB_cjs.D(S?.formattingKind):void 0,P=chunkEKLM7NWB_cjs.B(S?.partName),O=chunkEKLM7NWB_cjs.y(x),v=[I,O,h,R,T,P].join("|"),C=g.get(v);C?C.count+=1:g.set(v,{count:1,event:{code:I,...h?{operation:h}:{},...R?{changeKind:R}:{},...T?{formattingKind:T}:{},...P?{part:P}:{},...O?{cause:O}:{}}});}for(let{event:b,count:h}of g.values())r({kind:"review.skipped",...b,count:h});},u=(m,g)=>c([[g.revisions?.skipped??[],h8(m)],[g.revisionAuthors?.skipped??[],"reassign"]]),p=(m,g,b)=>{try{r({kind:"edit.rejected",code:"edit.internal-invariant",origin:"command",...b,cause:chunkEKLM7NWB_cjs.z(),errorName:chunkEKLM7NWB_cjs.A(m),stage:g});}catch{}};return {editorSessionId:n.editorSessionId,openStarted(m){o={sizeBucket:chunkEKLM7NWB_cjs.u(m.byteLength),start:t()};},openDeferred(){o&&(o.start=null);},openMounting(){o&&o.start===null&&(o.start=t());},openSettled(m){if(!o)return;let{sizeBucket:g,start:b}=o;o=null,r({kind:"document.open",outcome:"opened",sizeBucket:g,pagesBucket:chunkEKLM7NWB_cjs.v(qi(m)),durationMs:b===null?0:Math.max(0,Math.round(t()-b)),...x8(m)});},openRejected(m,g,b){let h=o?.sizeBucket;o=null;let y=chunkEKLM7NWB_cjs.y(m),S=chunkEKLM7NWB_cjs.B(b);r({kind:"document.open",outcome:"rejected",code:chunkEKLM7NWB_cjs.r(m,g),...h?{sizeBucket:h}:{},...y?{cause:y}:{},...S?{part:S}:{}});},openCrashed(m,g="open-mount"){if(!o)return;let{sizeBucket:b}=o;o=null,r({kind:"document.open",outcome:"rejected",code:"open.failed",sizeBucket:b,cause:chunkEKLM7NWB_cjs.z(),errorName:chunkEKLM7NWB_cjs.A(m),stage:g});},continueOpen(m){try{return m()}catch(g){throw this.openCrashed(g,"open-layout"),g}},reviewItem(m,g,b,h){return (y,S)=>{let x=g(y),I;try{I=m(y,S);}catch(T){throw i===0&&p(T,"review-item",{tracked:h()}),T}if(I.ok||i>0)return I;if(I.code==="notFound"||I.code==="unsupported"&&x){let T=x?b(x,S):{},P=x&&{revisionKind:x.revisionKind,partName:T.partName??"",...x.formattingKind?{formattingKind:x.formattingKind}:{}},O=I.reason===_i?T.detail??"read-only":chunkEKLM7NWB_cjs.y(I.reason)??T.detail;return c([[[{reason:I.code==="notFound"?"unknown-revision":"unsupported-revision",...P?{revision:P}:{},detail:O}],S]]),I}let R=chunkEKLM7NWB_cjs.y(I.reason);return r({kind:"edit.rejected",code:Mc(I.reason,I.code),origin:"command",tracked:h(),...R?{cause:R}:{}}),I}},exec(m,g,b){i+=1;let h;try{h=b();}catch(y){if(i===1){let S;try{S=tE(m);}catch{S=void 0;}p(y,"command",{tracked:g,...S?{command:S}:{}});}throw y}finally{i-=1;}if(i>0)return h;if(!h.ok){let y=tE(m),S=chunkEKLM7NWB_cjs.y(h.reason);r({kind:"edit.rejected",code:Mc(h.reason,h.code),origin:"command",tracked:g,...y?{command:y}:{},...S?{cause:S}:{}});}return u(m,h),h},inputRejected(m,g){if(i>0||a>0)return;let b=Mc(m),h=chunkEKLM7NWB_cjs.y(m);r({kind:"edit.rejected",code:b,origin:"input",tracked:g,...h?{cause:h}:{}});},fontFailed(m){r({kind:"font.failed",code:YC(m)});},attach(m,g){let b=m.exec;m.exec=(h,y)=>this.exec(h,g(),()=>b(h,y)),nE.set(m,h=>{a+=1;try{return h()}finally{a-=1;}}),nI(m,(h,y)=>{this.exec(h,g(),()=>y);}),Ng.set(m,(h,y,S,x)=>{let I=chunkEKLM7NWB_cjs.y(S);r({kind:"edit.rejected",code:h,origin:"automation",tracked:y,...I?{cause:I}:{},...x?{errorName:chunkEKLM7NWB_cjs.A(x.thrown),stage:"automation"}:{}});});},timing(m,g,b){d.timing(m,g,m==="paint"&&b?()=>qi(b):void 0);},dispose(){d.dispose(),l();}}}function x8(e){try{let{session:t}=e;return {shape:{parts:chunkEKLM7NWB_cjs.v(t.currentPackage().parts.size),paragraphs:chunkEKLM7NWB_cjs.v(t.paragraphIds().length),reviewItems:chunkEKLM7NWB_cjs.v(t.reviewItems().length),embeddedFonts:chunkEKLM7NWB_cjs.v(t.embeddedFonts().length)}}}catch{return {}}}function w8(e,t,n){let r=n(),o="none",i,a=false,s=false,l=-1,d=()=>{let p=e.statusSnapshot(),m=p.reason?.code,g=p.recovering===true;if(p.status===o&&m===i&&g===a)return;let b=p.status==="ready"&&!s,h=b&&o!=="none";b&&(s=true),t({kind:"collab.status",status:p.status,previous:o,...m?{code:`collab.${m}`}:{},recovering:g,...h?{connectMs:Math.max(0,Math.round(n()-r))}:{}}),o=p.status,i=m,a=g;},c=()=>{let p=e.participants().length;p!==l&&(l=p,t({kind:"collab.participants",count:p}));},u=[e.subscribeStatus(d),e.subscribeParticipants(c)];return d(),()=>{for(let p of u)p();}}function iE(e,t){let n=e.code==="wasmUnavailable"||e.cause instanceof chunkD7ZMDMPX_cjs.f&&e.cause.code==="unsupportedRuntime";n&&!t.config.onFontError&&!t.events.hasErrorHandlers()&&Q0(e);try{t.config.onFontError?.(e);}catch{}t.events.emitError(e),t.diagnostics.fontFailed(n?"wasmUnavailable":e.code);}function Ks(e){let t=[],n=(r,o)=>{let i=o.kind,a=r.handlers.kinds??e;return typeof i!="string"||!a||a.includes(i)};return {request(r){let o=t.filter(l=>n(l,r)),i=[...o].reverse().find(l=>!l.fallback)??o.at(-1);if(!i?.handlers.onRequest)return false;let{sessions:a,handlers:s}=i;return a.add(r),r.signal.addEventListener("abort",()=>a.delete(r),{once:true}),s.onRequest(r),true},register(r,o){let i={handlers:r,fallback:o?.fallback===true,sessions:new Set};return t.push(i),()=>{let a=t.indexOf(i);if(!(a<0)){t.splice(a,1);for(let s of i.sessions)s.cancel();}}}}}var S8=()=>Ks();function aE(){let e=S8(),t=Ks(["dropdown","comboBox","date","buildingBlockGallery"]),n=Ks();return {surfaceOptions:{onRequestTextFormField:e.request,onRequestContentControlWidget:t.request,onRequestInvalidTextFormField:n.request},setters:{setTextFormFieldChrome:e.register,setContentControlWidgetChrome:t.register,setInvalidTextFormFieldChrome:n.register}}}function sE(e,t){let n=chunkDOHF6FA7_cjs.Va(e),r=null,o=null,i=null,a=Ks(),s=()=>t.destroyed()?{ok:false,code:"notFound",reason:"the editor was destroyed"}:t.contribution()?.createRevisionMarkupDialog?t.container()?{ok:true}:{ok:false,code:"notFound",reason:"the editor is not attached"}:{ok:false,code:"unsupported",reason:"the review module does not supply a settings dialog"},l=p=>{if(t.destroyed())return;let m=chunkDOHF6FA7_cjs.Va(p,n);JSON.stringify(m)!==JSON.stringify(n)&&(n=m,t.apply(n),i?.(),t.changed(n));},d=()=>{if(o){o.cancel();return}let p=r;r=null,p?.destroy();},c=()=>{let p=new AbortController,m=new Set,g=n,b=y=>{if(!(p.signal.aborted||JSON.stringify(y)===JSON.stringify(g))){g=y;for(let S of [...m])S();}},h={signal:p.signal,get:()=>g,set(y){p.signal.aborted||b(chunkDOHF6FA7_cjs.Va(y,g));},reset:()=>b(chunkDOHF6FA7_cjs.Ua),subscribe(y){return p.signal.aborted?()=>{}:(m.add(y),()=>{m.delete(y);})},canApply:()=>o===h&&!p.signal.aborted&&s().ok,apply(){return h.canApply()?(l(g),h.cancel(),true):false},cancel(){if(p.signal.aborted)return;o===h&&(o=null,i=null),m.clear();let y=r;r=null,p.abort(),y?.destroy();}};return i=()=>b(n),h},u=p=>{r=t.contribution().createRevisionMarkupDialog({...p,container:t.container(),translate:m=>t.translate()?.(m)}),p.signal.aborted?d():r.open();};return {current:()=>n,set:l,canOpen:s,register(p,m){return a.register(p??{onRequest:u},m)},open(){let p=s();if(!p.ok)return p;d();let m=c();o=m;try{a.request(m)||u(m);}catch(g){throw m.cancel(),g}return {ok:true,changed:false}},destroyDialog:d}}var lE=new WeakMap;function P8(e){return !(!e.story||e.origin===chunkOSFOJTHU_cjs.g.mutationUndo||e.origin===chunkOSFOJTHU_cjs.g.mutationRedo||e.impact!=="text-local"||e.created.length>0||e.deleted.length>0||e.splitJoin.length>0||e.dependencyKeys.some(t=>t!==chunkOSFOJTHU_cjs.l.story))}function T8(e,t){P8(t)||(e.summaries=null);}function C8(e,t){t.subscribed||(t.subscribed=true,e.subscribe(n=>T8(t,n)));}function cE(e){}function uE(e,t){let n=lE.get(e);return n||(n={summaries:null,subscribed:false},lE.set(e,n)),C8(e,n),n.summaries||(n.summaries=t()),n.summaries}var E8=new Map([["richText","richText"],["plainText","plainText"],["dropdown","dropDownList"],["dropDownList","dropDownList"],["comboBox","comboBox"],["date","date"]]);function O8(e){return typeof e=="object"&&e!==null&&"from"in e&&"to"in e}function M8(e,t){let n=e.session.part(),r=e.session.paragraphAnchors();if(Et(t)){let o=un(n,r,t);return o.ok?{ok:true,span:{paragraphId:o.span.nodeId,start:o.span.start,end:o.span.end}}:{ok:false,code:o.code,reason:o.reason,target:t}}if(O8(t)){if(!Et(t.from)||!Et(t.to))return {ok:false,code:"unsupported",reason:"address the span with paraId anchors; DocLocation endpoints are not supported",target:t};let o=un(n,r,t.from);if(!o.ok)return {ok:false,code:o.code,reason:o.reason,target:t};let i=un(n,r,t.to);if(!i.ok)return {ok:false,code:i.code,reason:i.reason,target:t};if(o.span.nodeId!==i.span.nodeId)return {ok:false,code:"unsupported",reason:"wrapping several paragraphs in one content control is not supported",target:t};let a=Math.min(o.span.start,i.span.start),s=Math.max(o.span.end,i.span.end);return {ok:true,span:{paragraphId:o.span.nodeId,start:a,end:s}}}return {ok:false,code:"unsupported",reason:"address the span with a paraId anchor; DocLocation targeting is not supported",target:t}}function Dg(e,t){let n=E8.get(t.subtype);if(!n)return {ok:false,code:"invalidArgs",reason:`that control type cannot be inserted (${String(t.subtype)})`,...t.target===void 0?{}:{target:t.target}};let r;if(t.target===void 0){let o=Go(e.state().selection);if(!o)return {ok:false,code:"unsupported",reason:"wrapping several paragraphs in one content control is not supported"};r=o;}else {let o=M8(e,t.target);if(!o.ok)return o;r=o.span;}return {ok:true,span:r,op:{op:"insertContentControl",paragraphId:r.paragraphId,start:r.start,end:r.end,type:n,...t.tag===void 0?{}:{tag:t.tag},...t.title===void 0?{}:{alias:t.title}}}}var A8="http://schemas.microsoft.com/office/word/2010/wordml",F8="http://schemas.microsoft.com/office/word/2012/wordml";function ni(e){return chunkOSFOJTHU_cjs.Uc(e)}function Vs(e){for(let t of e.children)if(t.kind!=="textValue"&&(t.kind==="contentControlProperties"||t.localName==="sdtPr"))return t}function L8(e){if(e.kind!=="textValue"){for(let t of e.attributes)if(t.localName==="val"&&t.namespaceUri===chunkOSFOJTHU_cjs.la)return t.value}}function Hg(e,t){if(e){for(let n of e.children)if(n.kind!=="textValue"&&n.localName===t)return L8(n)}}function N8(e){if(!e)return "richText";for(let t of e.children){if(t.kind==="textValue")continue;let n=D8(t);if(n!==void 0)return n}return "richText"}function D8(e){if(e.kind==="textValue")return;let t=e.kind,n=e.localName,r=e.namespaceUri;if(t==="contentControlDropDownList"||n==="dropDownList")return "dropdown";if(t==="contentControlComboBox"||n==="comboBox")return "comboBox";if(t==="contentControlDate"||n==="date")return "date";if(n==="picture")return "picture";if(n==="docPartList")return "buildingBlockGallery";if(t==="contentControlText"||n==="text")return "plainText";if(n==="richText")return "richText";if(n==="checkbox"&&(r===A8||t==="contentControlCheckbox"))return "checkbox";if(n==="repeatingSection"&&r===F8)return "repeatingSection"}function Ac(e){let t=Hg(e,"lock");return t==="contentLocked"||t==="sdtContentLocked"}function H8(e,t){if(Ac(Vs(t)))return true;let n=chunkOSFOJTHU_cjs.Ua(e,t.id);for(;n;){if(ni(n)&&Ac(Vs(n)))return true;n=chunkOSFOJTHU_cjs.Ua(e,n.id);}return false}function Bg(e,t){let n=Vs(e),r=Hg(n,"tag"),o=Hg(n,"alias"),i=t?H8(t,e):Ac(n);return {id:e.id,controlType:N8(n),...r!==void 0?{tag:r}:{},...o!==void 0?{alias:o}:{},...i?{locked:true}:{}}}var fE=new WeakMap;function _8(e,t){let n=[],r=chunkOSFOJTHU_cjs.Ua(e,t.id);for(;r;)ni(r)&&n.push(`${r.id}:${Ac(Vs(r))?1:0}`),r=chunkOSFOJTHU_cjs.Ua(e,r.id);return n.join("|")}function mE(e){return Object.freeze({...e,...e.tag!==void 0?{tag:e.tag}:{},...e.alias!==void 0?{alias:e.alias}:{},...e.locked?{locked:true}:{}})}function B8(e){return Object.freeze(e.map(t=>mE(t)))}function $8(e,t){let n=e.node,r=Vs(n),o=_8(t,n),i=fE.get(n);if(i&&i.properties===r&&i.lockAncestors===o)return i.summary;let a=mE(Bg(n,t));return fE.set(n,{properties:r,lockAncestors:o,summary:a}),a}function q8(e){let t=chunkOSFOJTHU_cjs.$b(e.root);return cE(t.length),t.map(n=>$8(n,e))}function K8(e){return B8(e.storyParts().flatMap(t=>q8(t)))}function V8(e){return uE(e,()=>K8(e))}function _g(e,t){return t?!(t.tag!==void 0&&e.tag!==t.tag||t.alias!==void 0&&e.alias!==t.alias||t.controlType!==void 0&&e.controlType!==t.controlType):true}function j8(e){let t=[];if(e.kind!=="paragraph")return t;let n=(r,o,i,a)=>{if(a>=chunkOSFOJTHU_cjs.wa)return o;let s=o;for(let l of r)if(l.kind!=="paragraphProperties"){if(l.kind==="run"){s+=chunkOSFOJTHU_cjs.kg(e,l);continue}if(chunkOSFOJTHU_cjs.ya(l)){s=n(l.children,s,i,a+1);continue}if(ni(l)){let d=s,c=i+1;s=n(chunkOSFOJTHU_cjs.Tb(l),s,c,a+1),t.push({control:l,start:d,end:s,depth:c});continue}s+=chunkOSFOJTHU_cjs.kg(e,l);}return s};return n(e.children,0,-1,0),t}function $g(e,t,n){return j8(e).filter(r=>t>=r.start&&t<r.end).sort((r,o)=>o.depth-r.depth).map(r=>Bg(r.control,n))}function qg(e,t){let n=[],r=chunkOSFOJTHU_cjs.Ua(e,t);for(;r;)ni(r)&&n.push(Bg(r,e)),r=chunkOSFOJTHU_cjs.Ua(e,r.id);return n.reverse()}function gE(e,t){if(!e)return [];let n=V8(e.session);return t?n.filter(r=>_g(r,t)):n}function Kg(e,t){if(!e)return null;let{paragraphId:n,offset:r}=e.state().selection.head,o=Me(e.session,n)??e.session.part(),i=chunkOSFOJTHU_cjs.Ta(o,n);if(i&&i.kind==="paragraph"){for(let s of $g(i,r,o))if(_g(s,t))return s}let a=qg(o,n);for(let s=a.length-1;s>=0;s-=1){let l=a[s];if(_g(l,t))return l}return null}function Vg(e){return e.type==="insertContentControl"||e.type==="setContentControlValue"||e.type==="removeContentControl"}function W8(e){return typeof e=="object"&&e!==null&&"container"in e&&"path"in e}function Z8(e){return typeof e=="object"&&e!==null&&"from"in e&&"to"in e}function z8(e){let t=n=>{if(n.kind==="textValue")return null;if(n.kind==="body")return n;for(let r of n.children){let o=t(r);if(o)return o}return null};return t(e.root)}function Fc(e){let t=[];for(let n of e)n.kind!=="textValue"&&(n.kind==="paragraph"||n.kind==="table"||ni(n))&&t.push(n);return t}function U8(e){let t=[];for(let n of e.children)if(n.kind==="tableRow")for(let r of n.children)r.kind==="tableCell"&&t.push(...Fc(r.children));return t}function G8(e){return e.kind==="table"?U8(e):ni(e)?Fc(chunkOSFOJTHU_cjs.Tb(e)):e.kind==="body"?Fc(e.children):[]}function X8(e,t,n){if(ni(t))return {ok:true,controlId:t.id};if(t.kind==="paragraph"){let r=n??0;for(let a of $g(t,r,e))return {ok:true,controlId:a.id};let i=qg(e,t.id).at(-1);if(i)return {ok:true,controlId:i.id}}return {ok:false,code:"notFound",reason:"no content control at the addressed block"}}function Y8(e,t){if(t.container.part!=="body")return {ok:false,code:"unsupported",reason:"only the body container is supported",target:t};let n=z8(e);if(!n)return {ok:false,code:"notFound",reason:"the document body was not found",target:t};if(t.path.length===0)return {ok:false,code:"notFound",reason:"DocLocation path is empty",target:t};let r=Fc(n.children),o=null;for(let a=0;a<t.path.length;a+=1){if(o=r[t.path[a]]??null,!o)return {ok:false,code:"notFound",reason:`block index ${t.path[a]} is out of range`,target:t};a<t.path.length-1&&(r=G8(o));}if(!o)return {ok:false,code:"notFound",reason:"the addressed block was not found",target:t};let i=X8(e,o,t.offset);return i.ok?i:{...i,target:t}}function Q8(e,t,n){let r=un(e,t,n);if(!r.ok)return {ok:false,code:r.code,reason:r.reason,target:n};let o=t.partByNode.get(r.span.nodeId)??e,i=chunkOSFOJTHU_cjs.Ta(o,r.span.nodeId);if(!i||i.kind!=="paragraph")return {ok:false,code:"notFound",reason:`paragraph '${n.paraId}' was not found`,target:n};let a=r.span.start;for(let d of $g(i,a,o))return {ok:true,controlId:d.id};let l=qg(o,i.id).at(-1);return l?{ok:true,controlId:l.id}:{ok:false,code:"notFound",reason:`no content control encloses paragraph '${n.paraId}'`,target:n}}function hE(e,t){if(t===void 0){let r=Kg(e);return r?{ok:true,controlId:r.id}:{ok:false,code:"notFound",reason:"no content control at the current selection"}}if(Z8(t))return {ok:false,code:"unsupported",reason:"DocRange targeting is not supported for content controls",target:t};let n=e.session.part();return W8(t)?Y8(n,t):Et(t)?Q8(n,e.session.paragraphAnchors(),t):{ok:false,code:"invalidArgs",reason:"unrecognized target shape",target:t}}function yE(e){switch(e){case "locked":case "bound":case "typeMismatch":case "invalidArgs":case "unsupported":return e;case "unknown-control":return "notFound";case "indivisible-content":return "unsupported";default:return "unsupported"}}function bE(e){switch(e){case "locked":return "the content control is locked";case "bound":return "the content control is bound to external data";case "typeMismatch":return "the value does not match the control type";case "invalidArgs":return "the value is not valid for this control";case "unsupported":return "this control type is not supported";case "unknown-control":return "the content control was not found";case "indivisible-content":return "a content control cannot start or end inside a hyperlink, a field, or another inline control";default:return `the edit was refused (${e})`}}function vE(e,t){return {ok:false,code:yE(e),reason:bE(e),...t!==void 0?{target:t}:{}}}function J8(e,t,n,r){return r?.scope&&r.scope.kind!=="body"&&e.target!==void 0?{ok:false,refusal:{ok:false,code:"unsupported",reason:"a location or anchor target resolves in the body only; omit it to use the caret"}}:t?n==="view"||!t.session.editable?{ok:false,refusal:{ok:false,code:"locked",reason:"the document is read-only"}}:e.type==="setContentControlValue"&&typeof e.value!="string"?{ok:false,refusal:{ok:false,code:"invalidArgs",reason:"setContentControlValue requires a string value"}}:{ok:true}:{ok:false,refusal:{ok:false,code:"notFound",reason:"no document is loaded"}}}function jg(e){return e==="viewing"?"view":e==="suggesting"?"suggesting":"edit"}function Wg(e,t,n,r){let o=J8(e,t,n,r);if(!o.ok)return o.refusal;if(e.type==="insertContentControl"){let s=Dg(t,e);return s.ok?pE(t,s.op,s.span.paragraphId):{ok:false,code:s.code,reason:s.reason}}let i=hE(t,e.target);if(!i.ok)return {ok:false,code:i.code,reason:i.reason};let a=e.type==="setContentControlValue"?{op:"setContentControlValue",controlId:i.controlId,value:e.value}:{op:"removeContentControl",controlId:i.controlId};return pE(t,a,i.controlId)}function pE(e,t,n){let r=Me(e.session,n)??e.session.part(),o=chunkOSFOJTHU_cjs.Tg(e.session.currentPackage()),i=chunkOSFOJTHU_cjs.nj(o,t)??chunkOSFOJTHU_cjs.qk(r,o,t)??chunkOSFOJTHU_cjs.Xk(r,t);return i?{ok:false,code:yE(i),reason:bE(i)}:{ok:true}}function xE(e,t,n,r){t?.flushPendingInput();let o=Wg(e,t,n,r);return o.ok?e6(t,e):o}function wE(e,t,n,r,o){let i=e.applyGatedTreeOps;return typeof i=="function"?i.call(e,t,n,r,o):e.session.applyTreeOps(t,n,r,o)}function e6(e,t){if(t.type==="insertContentControl")return t6(e,t);let n=hE(e,t.target);if(!n.ok){let a=n.target??t.target;return {ok:false,code:n.code,reason:n.reason,...a!==void 0?{target:a}:{}}}e.flushPendingInput();let r=Go(e.state().selection),o=t.type==="setContentControlValue"?{op:"setContentControlValue",controlId:n.controlId,value:t.value}:{op:"removeContentControl",controlId:n.controlId},i=wE(e,[o],r,r,Rt(e.session,n.controlId,{kind:"body"}));return i.rejected?vE(i.reason??"unsupported",t.target):(e.layout(),{ok:true,changed:i.committed})}function t6(e,t){e.flushPendingInput();let n=Dg(e,t);if(!n.ok){let d=n.target??t.target;return {ok:false,code:n.code,reason:n.reason,...d!==void 0?{target:d}:{}}}let{paragraphId:r,start:o,end:i}=n.span,a=Go(e.state().selection),s={paragraphId:r,start:o,end:i},l=wE(e,[n.op],a,s,Rt(e.session,r,{kind:"body"}));return l.rejected?vE(l.reason??"unsupported",t.target):(e.layout(),{ok:true,changed:l.committed})}function SE(e,t,n){switch(n.type){case "selectedText":return e?.selectedText()??"";case "selectionFormatting":return e?t():null;case "selection":return Md(e);case "paragraphs":return vI(e,n.container);case "isInsideToc":return II(e);case "hyperlinkAt":return bI(e);case "contentControls":return gE(e,n.filter);case "trackedChanges":case "revisions":case "findText":case "comments":return [];case "styles":return {paragraph:new Map,character:new Map,table:new Map};case "variables":return {};case "contentControlAt":return Kg(e,n.filter);case "tableContext":return Fd(e);default:return null}}var IE=new WeakMap;function kE(e){let t=IE.get(e);if(!t)throw new Error("External refresh requires a mounted createDocxEditor instance.");return t}function RE(e,t){let n=null,r=null,o={...t,epoch:0,revision:0,mountedRevision:0,source:void 0,invalidated:new Set,cancel(){if(!r||r.mountedRevision!==null)return;t.cancelLoad();let i=r;r=null,ao(i.container,false),t.surface()?.setEditable(e.snapshot().editingMode!=="viewing"),o.source=void 0,i.resolve(false);try{t.changed();}catch{}},invalidate(){o.cancel(),o.epoch++,n=null,r&&(ao(r.container,false),r.resolve(false),r=null),o.source=void 0;for(let i of o.invalidated)i();},contentMounted(i){r?.bytes===i&&(r.mountedRevision=o.revision);},mounted(i,a){if(!r||r.bytes!==i)return;let s=r,l=!a&&!!t.surface();o.mountedRevision=s.mountedRevision??o.revision,l?n=null:n={top:s.top,left:s.left};let d=Vt(s.container);if(l&&d&&(d.scrollTop=Math.max(0,Math.min(s.top,d.scrollHeight-d.clientHeight)),d.scrollLeft=Math.max(0,Math.min(s.left,d.scrollWidth-d.clientWidth)),d.dispatchEvent(new Event("scroll"))),r===s){r=null,ao(s.container,false),t.surface()?.setEditable(e.snapshot().editingMode!=="viewing"),o.source=void 0,s.resolve(l);try{t.changed();}catch{}}},replace(i,a){let s=t.container();if(!s||r)return Promise.resolve(false);let l=Vt(s);return new Promise(d=>{r={bytes:i,resolve:d,container:s,top:a==="recovery"&&n?n.top:l?.scrollTop??0,left:a==="recovery"&&n?n.left:l?.scrollLeft??0,mountedRevision:null},o.source=a,ao(s,true),t.surface()?.setEditable(false);try{t.load(i);}catch(c){o.mounted(i,c);}})}};return e.on("change",i=>{i.source||o.revision++;}),IE.set(e,o),o}function PE(e,t,n,r,o){let i=new Map,a=chunkD7ZMDMPX_cjs.ba(e,{resolveFont:l=>{let d=l.fontFamily??t.defaultFont.family;if(d.trim().length===0)return null;let c={family:d,weight:l.bold?700:400,style:l.italic?"italic":"normal"},u=chunkDOHF6FA7_cjs.h(c);if(i.has(u))return i.get(u)??null;let p;try{p=e.fonts.resolve(c);}catch{return i.set(u,null),null}let m=p instanceof chunkDOHF6FA7_cjs.d?null:p;return i.set(u,m),m},fallback:n.measurer}),s=`shaped:${e.operation.extensionFingerprint}+algorithm:${e.operation.shapingHash}+producer:${e.operation.producerVersion}+fallback:${n.producer}@scale:${r}+fonts:${o}`;return {measurer:a,producer:s}}var n6="The quick brown fox 0123 \u2014 {}#@",r6=["monospace","serif"],o6=/^[\p{L}\p{N}\p{M} \-.+_,;]{1,64}$/u;function CE(e){if(!e)return ()=>true;let t=new Map,n=r=>(e.font=r,e.measureText(n6).width);return r=>{let o=t.get(r);if(o!==void 0)return o;if(!o6.test(r))return t.set(r,true),true;let i=false;for(let a of r6){let s=n(`32px ${a}`);if(n(`32px "${r}", ${a}`)!==s){i=true;break}}return t.set(r,i),i}}var TE=4;function EE(e,t,n){let r=new Set,o=[];for(let c of t){let u=c.toLowerCase();r.has(u)||(r.add(u),o.push(c));}let i=c=>new Set(e.slice(0,Math.max(c,0)).map(u=>u.toLowerCase())),a=0;for(let c=0;c<=TE;c+=1){let u=i(n-a),p=o.filter(g=>!u.has(g.toLowerCase())).length,m=Math.min(p,TE,Math.floor(n/2));if(m===a)break;a=m;}let s=e.slice(0,Math.max(n-a,0)),l=i(n-a),d=o.filter(c=>!l.has(c.toLowerCase()));return [...s,...d].slice(0,n)}function OE(e,t,n,r=new Set){let o=[];for(let i of e){if(r.has(i.toLowerCase())){o.push(i);continue}if(t(i)||n(i))continue;let a=chunkD7ZMDMPX_cjs.P.get(i.toLowerCase());a!==void 0&&n(a)||o.push(i);}return o}function ME(e,t){let n=new Set(e.map(r=>r.request.family.toLowerCase()));for(let r=0;r<t.length;r+=1){let o=false;for(let i of t){let a=i.from.family.toLowerCase();n.has(a)||!n.has(i.to.family.toLowerCase())||(n.add(a),o=true);}if(!o)break}return n}var AE=new WeakMap,i6=0,a6=chunkJLVBDYVQ_cjs.p((e,t)=>{if(e.kind==="paragraphProperties"){let n=AE.get(e);return n||(n=String(++i6),AE.set(e,n)),{families:[n],children:[]}}return {families:e.kind==="paragraph"&&!e.children.some(n=>n.kind==="paragraphProperties")?["default-paragraph"]:[],children:chunkJLVBDYVQ_cjs.q(e,t)}});function Lc(e){return a6(e,{key:""})}var FE=new WeakMap,LE=new WeakMap;function Zg(e){let t=LE.get(e);return t||LE.set(e,t=chunkJLVBDYVQ_cjs.r()),t}function zg(e,t){Zg(e)(t,e.stylesRoot(),e.documentThemeFonts()),chunkJLVBDYVQ_cjs.t(t),Lc(t);}function NE(e,t,n,r){let o=Zg(e).warmTableRows(t,n,r,e.stylesRoot(),e.documentThemeFonts()),i=t.children.slice(n,r);return chunkJLVBDYVQ_cjs.t(i),Lc(i),Math.max(o,t.children.length)}function DE(e){let t=e.packageRevision(),n=FE.get(e);if(n?.revision===t)return n.families;let r=n?.eastAsianFonts??Zg(e),o=e.storyParts().map(p=>p.root),i=e.stylesRoot(),a=e.numberingRoot(),s=e.documentThemeFonts(),l=Lc(o),c=n&&n.stylesRoot===i&&n.numberingRoot===a&&n.theme===s&&n.numberingInputs.length===l.length&&n.numberingInputs.every((p,m)=>p===l[m])?n.numberingFamilies:chunkJLVBDYVQ_cjs.v(o,a,i,s),u=[...e.symbolFontFamilies(),...r(o,i,s),...chunkJLVBDYVQ_cjs.t(o),...c];return FE.set(e,{eastAsianFonts:r,revision:t,families:u,numberingInputs:l,numberingFamilies:c,numberingRoot:a,stylesRoot:i,theme:s}),u}function HE(e,t,n){let[r]=chunkJLVBDYVQ_cjs.a([[t]]);return EE([...new Set([...r&&r!==n?[r]:[],...e.documentFonts()])],DE(e),chunkJLVBDYVQ_cjs.c)}function _E(e,t){let n,r=false,o=()=>{r=false;let a=e();if(!a)return;let s=n?.generation!==a.generation;s&&(n={generation:a.generation,requested:new Set,running:false});let l=n;if(l.running||!s&&!a.dynamic)return;let d=a.dynamic?a.families().filter(u=>!l.requested.has(u.toLowerCase())):[];if(!s&&d.length===0)return;for(let u of d)l.requested.add(u.toLowerCase());l.running=true;let c=t(d);return c.finally(()=>{l.running=false,n===l&&i();}),c},i=(a=false)=>{if(a)return o();r||(r=true,queueMicrotask(o));};return {schedule:i}}var $E="replace:",s6=`revision-${$E}`,js=new WeakMap;function Ug(e){return e?js.get(e)??null:null}function Nc(e){let t=js.get(e);return t?[e,t.deletion,t.insertion]:[e]}function l6(e,t){let n=e.ranges[e.ranges.length-1],r=t.ranges[0];return n!==void 0&&r!==void 0&&n.partName===r.partName&&n.end.paragraphId===r.start.paragraphId&&n.end.offset===r.start.offset}function d6(e,t){return e.revisionKind==="delete"&&t.revisionKind==="insert"&&e.author===t.author&&e.readOnly===t.readOnly&&e.nesting===t.nesting&&l6(e,t)}var BE=new WeakMap;function c6(e,t){let n=BE.get(e);if(n&&js.get(n)?.insertion===t)return n;let r=t.date??e.date,o={kind:"revision",id:`${$E}${e.id}+${t.id}`,address:e.address,addresses:[...e.addresses,...t.addresses],replacedText:e.text,revisionKind:"replace",author:t.author,...r!==void 0?{date:r}:{},text:t.text,ranges:[...e.ranges,...t.ranges],nesting:e.nesting,replacedRangeCount:e.ranges.length,readOnly:e.readOnly||t.readOnly,replyIds:[...e.replyIds,...t.replyIds]};return js.set(o,{deletion:e,insertion:t}),BE.set(e,o),chunkOSFOJTHU_cjs.vj(o,[...chunkOSFOJTHU_cjs.wj(e),...chunkOSFOJTHU_cjs.wj(t)])}function u6(e){let t=e.filter(a=>a.kind==="revision"),n=new Map,r=new Set,o=new Map;for(let a=0;a+1<t.length;a+=1){let s=t[a],l=t[a+1];if(!d6(s,l))continue;let d=c6(s,l);n.set(s,d),r.add(l),o.set(s.id,d.id),o.set(l.id,d.id),a+=1;}if(n.size===0)return {items:e,renamed:o};let i=[];for(let a of e)r.has(a)||i.push(n.get(a)??a);return {items:i,renamed:o}}function qE(e,t){let n=new Set(t?.excludeRevisionKinds??[]),r=s=>s.kind!=="revision"||!n.has(s.revisionKind),o=n.size>0?e.filter(r):e,i=new Map;if(t?.pairReplacements===true){let s=u6(o);i=s.renamed,o=n.size>0?s.items.filter(r):s.items;}if(n.size===0&&i.size===0)return o;let a=new Set(o.filter(s=>s.kind==="revision").map(s=>s.id));return o.map(s=>{if(s.kind!=="comment"||s.parentRevisionId===void 0)return s;let l=i.get(s.parentRevisionId)??s.parentRevisionId;if(a.has(l))return l===s.parentRevisionId?s:{...s,parentRevisionId:l};let{parentRevisionId:d,...c}=s;return c})}function ri(e){return e.startsWith(s6)}function Br(e,t){let n=ri(t)?{placement:false,pairReplacements:true}:{placement:false};return e(n).find(r=>r.key===t)}function Dc(e){let t=js.get(e);return t?[chunkOSFOJTHU_cjs.xj(t.deletion),chunkOSFOJTHU_cjs.xj(t.insertion)]:[chunkOSFOJTHU_cjs.xj(e)]}function Gg(e,t,n){return t===null||n?.pairReplacements!==true?t:e({...n,placement:false}).find(o=>ri(o.key)&&Dc(o.item).includes(t))?.key??t}function Xg(e,t){let n=ri(t.key)?t.key:Gg(e,t.key,{pairReplacements:true});return n!==null&&ri(n)?{...t,pairKey:n}:t}function VE(e){return e.kind==="custom"?`custom node '${e.name}' has no reviewCard, so it has no card to activate`:`review items of kind '${e.kind==="revision"?e.revisionKind:e.kind}' are excluded from activation`}function Yg(e,t){let n=e.review;return n?{reviewModel:{...n,collectReviewItems:r=>n.collectReviewItems(e.customNodes.length>0?{...r,customNodes:e.customNodes,...e.customNodeDiagnostics.length>0?{reportCustomNodeDiagnostic:t}:{}}:r)}}:{}}var f6=["all-markup","simple-markup","proposed","original"];function jE(e){let t=()=>e.placements().filter(y=>y.kind==="revision"&&(y.activatable||y.revisionKind==="format")),n=()=>e.surface()?.session.reviewItems().filter(y=>y.kind==="revision")??[],r=y=>{let S=n(),x,I=O=>(x??=new Map(e.placements({placement:false,pairReplacements:true}).filter(v=>ri(v.key)).map(v=>[v.key,v])),x.get(O)),R=new Set(y.keys?.flatMap(O=>{if(!ri(O))return [O];let v=I(O);return v?Dc(v.item):[O]})??(y.scope==="document"?S:e.visible()).filter(O=>O.kind==="revision").map(chunkOSFOJTHU_cjs.xj)),T=new Map,P=y.scope==="document"&&y.keys===void 0;if(P){let O=e.surface().session;for(let v of O.storyParts())T.set(v.name,{scope:Rt(O,v.root.id,{kind:"body"}),part:v,keys:[]});}for(let O of S){let v=e.scope(O),C=Me(e.surface().session,chunkOSFOJTHU_cjs.wj(O)[0]);if(!C)continue;let L=T.get(C.name);L||(L={scope:v,part:C,keys:[]},T.set(C.name,L));let A=chunkOSFOJTHU_cjs.xj(O);R.delete(A)&&L.keys.push(A);}return {scopes:[...T.values()],missing:[...R],unfilteredDocument:P}},o=y=>{let S=chunkOSFOJTHU_cjs.bd(e.surface().session.currentPackage()),x=[],I=[];for(let{scope:R,part:T,ops:P}of y)P.length&&(T.name===S?.name?I.push({partName:T.name,ops:P}):x.push({scope:R,ops:P}));return {groups:x,partOps:I}},i=y=>{let{scopes:S,missing:x,unfilteredDocument:I}=r(y),R=[],T=x.map(v=>({key:v,reason:"unknown-revision"})),P=[],O=0;for(let{scope:v,part:C,keys:L}of S){let A=chunkT6K2QYNZ_cjs.va(C,y.action,I?void 0:L);R.push(...A.result.resolved),T.push(...A.result.skipped),O+=A.result.remaining,P.push({scope:v,part:C,ops:A.ops});}return {...o(P),result:{resolved:R,skipped:T,remaining:O}}},a=y=>y.author===void 0?e.surface()?.author():y.author,s=y=>{let{scopes:S,missing:x}=r(y),I={author:a(y)??"",...y.date===void 0?{}:{date:y.date}},R=x.map(O=>({key:O,reason:"unknown-revision"})),T=[];for(let{scope:O,part:v,keys:C}of S){if(!C.length)continue;let L=chunkOSFOJTHU_cjs.lk(v,I,C,void 0,y.authors);T.push({scope:O,part:v,ops:L.ops,plan:L});}let P=O=>({updated:O.flatMap(v=>v.updated),skipped:[...R,...O.flatMap(v=>v.skipped)]});return {...o(T),result:P(T.map(({plan:O})=>O.result)),finish:()=>{let O=e.surface().session.currentPackage().parts;return P(T.map(({part:v,plan:C})=>{let L=O.get(v.name);return L?C.finish(L):C.result}))}}},l=()=>e.destroyed()?{ok:false,code:"notFound",reason:"the editor was destroyed"}:e.enabled()?e.surface()?{ok:true}:{ok:false,code:"notFound",reason:"no document is open"}:{ok:false,code:"unsupported",reason:Qt},d=y=>y.scope!==void 0&&!["visible","document"].includes(y.scope)||y.unsupported!==void 0&&!["skip","fail"].includes(y.unsupported)||y.keys!==void 0&&(!Array.isArray(y.keys)||y.keys.some(S=>typeof S!="string"))?{ok:false,code:"invalidArgs",reason:"invalid bulk revision selection"}:null,c=y=>{let S=l();if(!S.ok)return {gate:S};if(e.viewing())return {gate:{ok:false,code:"locked",reason:"the document is open for viewing"}};let x=Vn(y,e.surface());if(x)return {gate:x};let I=a(y);if(I===void 0)return {gate:{ok:false,code:"invalidArgs",reason:"pass an author, or configure the editor author, to change the author"}};if(typeof I!="string"||y.date!==void 0&&typeof y.date!="string"||chunkOSFOJTHU_cjs.kk({author:I,...y.date===void 0?{}:{date:y.date}}))return {gate:{ok:false,code:"invalidArgs",reason:"author must be nonblank text, and date an ISO 8601 date and time"}};let R=d(y);if(R)return {gate:R};if(y.keys!==void 0&&(y.scope!==void 0||y.authors!==void 0)||y.authors!==void 0&&(!Array.isArray(y.authors)||y.authors.some(O=>typeof O!="string")))return {gate:{ok:false,code:"invalidArgs",reason:"select by keys, or by scope and authors; authors must be a list of names"}};let T=s(y),{result:P}=T;return y.unsupported==="fail"&&P.skipped.length?{gate:{ok:false,code:"unsupported",reason:"some selected changes cannot change author"},plan:T}:P.updated.length?{gate:{ok:true},plan:T}:{gate:{ok:false,code:P.skipped.some(O=>O.reason==="unsupported-revision")?"unsupported":"notFound",reason:"no eligible selected changes to update"},plan:T}},u=y=>{e.surface()?.flushPendingInput();let{gate:S,plan:x}=c(y);if(!S.ok)return x?{...S,revisionAuthors:{...x.result,updated:[]}}:S;let I=e.surface(),{groups:R,partOps:T}=x;if(!R.length&&!T.length)return {ok:true,changed:false,revisionAuthors:x.result};let P=e.placements().find(L=>L.isActive)?.key,O;if(I.commitReviewOps(()=>(O=I.session.applyTreeOpsAtomic(R,{partOps:T}),O),"revision-attribution"),!O?.committed)return {ok:false,code:"unsupported",reason:typeof O?.reason=="string"?O.reason:"the changes were refused"};let v=x.finish(),C=v.updated.find(L=>L.previousKey===P);return C&&e.activate(C.key),{ok:true,changed:true,revisionAuthors:v}},p=y=>{if(y.type==="setReviewChangesAuthor")return c(y).gate;if(y.type!=="navigateReviewChange"&&y.type!=="resolveAllReviewChanges"&&y.type!=="setReviewDisplayMode")return null;let S=l();if(!S.ok)return S;if(y.type==="setReviewDisplayMode")return f6.includes(y.mode)?{ok:true}:{ok:false,code:"invalidArgs",reason:"unknown review display mode"};if(y.type==="navigateReviewChange"&&!["next","previous"].includes(y.direction))return {ok:false,code:"invalidArgs",reason:"unknown review navigation direction"};if(y.type==="resolveAllReviewChanges"&&!["accept","reject"].includes(y.action))return {ok:false,code:"invalidArgs",reason:"unknown review resolution action"};if(y.type==="navigateReviewChange")return t().length?{ok:true}:{ok:false,code:"notFound",reason:"no visible changes to review"};if(e.viewing())return {ok:false,code:"locked",reason:"the document is open for viewing"};let x=Vn(y,e.surface());if(x)return x;let I=d(y);if(I)return I;let{result:R,groups:T,partOps:P}=i(y);return y.unsupported==="fail"&&R.skipped.length?{ok:false,code:"unsupported",reason:"some selected changes cannot be resolved"}:!R.resolved.length&&!T.length&&!P.length?{ok:false,code:R.skipped.length?"unsupported":"notFound",reason:"no eligible selected changes to review"}:{ok:true}},m=(y,S)=>{let x=l();if(!x.ok)return x;if(e.viewing())return e.surface().commitReviewOps(()=>({committed:false,reason:"the document is open for viewing"}),"revision-resolve"),{ok:false,code:"locked",reason:"the document is open for viewing"};let I=Vn({type:"resolveAllReviewChanges"},e.surface());if(I)return I;e.surface().flushPendingInput();let R=Br(e.placements,y)?.item;if(!R||R.kind!=="revision")return {ok:false,code:"notFound",reason:"no revision with that key"};if(R.readOnly)return {ok:false,code:"unsupported",reason:_i};let T;return e.surface().commitReviewOps(()=>{let P=e.surface().session,O=Me(P,chunkOSFOJTHU_cjs.wj(R)[0]);return O&&O.name===chunkOSFOJTHU_cjs.bd(P.currentPackage())?.name?(T=P.applyTreeOpsAtomic([],{partOps:[{partName:O.name,ops:KE(R,S,O)}]}),T):(T=e.surface().session.applyTreeOps(KE(R,S,e.surface().session.partFor(e.scope(R))),void 0,void 0,e.scope(R)),T)},"revision-resolve"),T?.committed?{ok:true,changed:true}:{ok:false,code:"unsupported",reason:typeof T?.reason=="string"?T.reason:"the revision was refused"}},g=y=>{if(y.type==="setReviewChangesAuthor")return u(y);if(!["navigateReviewChange","resolveAllReviewChanges","setReviewDisplayMode"].includes(y.type))return null;e.surface()?.flushPendingInput();let S=p(y);if(!S)return null;if(!S.ok){if(y.type==="resolveAllReviewChanges"&&(S.code==="notFound"||S.code==="unsupported")&&l().ok&&!e.viewing()){let{result:O}=i(y);return {...S,revisions:{...O,resolved:[],remaining:O.remaining+O.resolved.length}}}return S}let x=e.surface();if(y.type==="setReviewDisplayMode")return e.setDisplayMode(y.mode),{ok:true,changed:false};if(y.type==="navigateReviewChange"){let O=t(),v=O.findIndex(K=>K.isActive),C=y.direction==="next"?1:-1,L=v<0?p6(O,x,C):(v+C+O.length)%O.length,A=O[L],q=e.activate(A.key,!A.activatable&&A.revisionKind==="format");return q.ok&&e.reveal({key:A.key,source:"navigate"}),q}if(y.type!=="resolveAllReviewChanges")return null;let{groups:I,partOps:R,result:T}=i(y),P;return x.commitReviewOps(()=>(P=x.session.applyTreeOpsAtomic(I,{partOps:R}),P),"revision-resolve"),P?.committed?(e.activate(null),{ok:true,changed:true,revisions:{...T,remaining:n().length}}):{ok:false,code:"unsupported",reason:typeof P?.reason=="string"?P.reason:"the revisions were refused"}},b=y=>{let S=Br(e.placements,y)?.item;return S?.kind==="revision"?S:void 0},h=e.report?e.report.diagnostics.reviewItem(m,b,(y,S)=>{let x=e.surface()?.session,I=x&&Me(x,chunkOSFOJTHU_cjs.wj(y)[0]);if(!I)return {};try{let T=chunkT6K2QYNZ_cjs.va(I,S,[chunkOSFOJTHU_cjs.xj(y)]).result.skipped[0]?.detail;return {partName:I.name,...T?{detail:T}:{}}}catch{return {partName:I.name}}},e.report.tracked):m;return {can:p,exec:g,resolveReviewItem:h}}function p6(e,t,n){let r=t.state().selection.head,o=t.session.storyParts().find(s=>r.paragraphId.startsWith(`${s.name}#`)),i=o?chunkOSFOJTHU_cjs.lj(o):new Map,a=i.get(r.paragraphId);if(a!==void 0)for(let s=n>0?0:e.length-1;s>=0&&s<e.length;s+=n){let l=e[s],d=l.kind==="revision"?l.item.ranges[0]?.start:void 0,c=d?i.get(d.paragraphId):void 0;if(d&&c!==void 0&&(n>0?c>a||c===a&&d.offset>=r.offset:c<a||c===a&&d.offset<=r.offset))return s}return n>0?0:e.length-1}function KE(e,t,n){let r=t==="accept"?"acceptRevision":"rejectRevision";if(!n)return [];if(e.revisionKind==="structural"||chunkOSFOJTHU_cjs.tj(n.root).length>0||e.revisionKind==="format"&&chunkOSFOJTHU_cjs.wj(e).length>1)return [...chunkT6K2QYNZ_cjs.va(n,t,Dc(e)).ops];let o=new Set(chunkOSFOJTHU_cjs.wj(e)),i=new Map;for(let a of chunkOSFOJTHU_cjs._j(n)){if(!o.has(a.node.id))continue;let s=p=>a.node.attributes.find(m=>m.namespaceUri===chunkOSFOJTHU_cjs.la&&m.localName===p)?.value,l=e.addresses.find(p=>p.id===s("id")&&p.author===(s("author")??"")&&(p.date??"")===(s("date")??""));if(!l)continue;let d=a.node.localName,c=JSON.stringify([l,d]),u=i.get(c);u?u.siteNodeIds.push(a.node.id):i.set(c,{revision:l,localName:d,siteNodeIds:[a.node.id]});}return [...i.values()].map(({revision:a,localName:s,siteNodeIds:l})=>({op:r,revision:a,...s===void 0?{}:{localName:s},siteNodeIds:l}))}function Qg(e){return e.kind==="comment"?e.comment.date:e.kind==="revision"?e.date:void 0}function Jg(e,t,n,r){return e.type!=="toggleReviewPane"&&e.type!=="toggleParagraphMarks"&&e.type!=="setEditingMode"?null:t?{ok:false,code:"notFound",reason:"the editor was destroyed"}:e.type==="toggleReviewPane"&&!n?{ok:false,code:"unsupported",reason:Qt}:e.type==="setEditingMode"?r(e.mode)??{ok:true}:{ok:true}}function WE(e){let t=false;return {get:()=>t,toggle:()=>{t=!t,e(t);}}}function ZE(e,t,n){if(!t)return false;switch(e.type){case "toggleMark":switch(e.mark){case "bold":return t.bold===true;case "italic":return t.italic===true;case "underline":return t.underline===true;case "strike":return t.strike===true;case "superscript":return t.superscript===true;case "subscript":return t.subscript===true;default:return false}case "setParagraphDirection":return t.direction===e.direction;case "setAlignment":return t.alignment===(e.align==="justify"?"both":e.align);case "toggleList":return n(e.kind);default:return false}}function Hc(e,t,n){return t.kind==="note"?e.enterNote?.(t.id,n)?{ok:true,changed:false}:{ok:false,code:"unsupported",reason:"the note could not be opened"}:(t.furnitureKind?e.enterHeaderFooter?.({rId:t.rId,kind:t.furnitureKind,position:n}):e.enterHeaderFooter?.({rId:t.rId,position:n}))?{ok:true,changed:false}:{ok:false,code:"unsupported",reason:"the header or footer could not be opened"}}function m6(e){return e?.kind==="headerFooter"||e?.kind==="note"}function zE(e,t){return t!=="viewing"&&typeof e.enterHeaderFooter=="function"&&typeof e.enterNote=="function"?"all":"body"}function _c(e,t){e.activeScope().kind!=="body"&&e.session.paragraphIds().includes(t)&&(e.activeScope().kind==="frame"&&e.setActiveScope({kind:"body"}),e.exitNote?.(),e.exitHeaderFooter?.());}function UE(e,t){if(typeof t?.blockId!="string"||t.blockId.length===0||!Number.isInteger(t.start)||t.start<0||!Number.isInteger(t.length)||t.length<0)return {ok:false,code:"invalidArgs",reason:"match must carry a blockId and offsets"};if(t.scope?.kind==="frame"){let{drawingNodeId:r,hostParagraphId:o}=t.scope;if(typeof r!="string"||r.length===0||typeof o!="string"||o.length===0)return {ok:false,code:"invalidArgs",reason:"a frame match must carry drawing and host paragraph ids"};let i={ok:false,code:"unsupported",reason:"the text box drawing could not be selected"};if(!zi(e.layout(),r,o))return i;let a=t.scope.owner;if(a){let s=Hc(e,a,{paragraphId:o,offset:0});if(!s.ok)return s}else _c(e,o);return e.revealParagraph(o),e.selectDrawing(r,o)?{ok:true,changed:false}:i}let n={paragraphId:t.blockId,offset:t.start};if(m6(t.scope)){let r=Hc(e,t.scope,n);if(!r.ok)return r}else {if(t.scope&&t.scope.kind!=="body")return {ok:false,code:"unsupported",reason:"the match scope cannot be opened"};_c(e,t.blockId);}return e.setSelection({anchor:n,head:{paragraphId:t.blockId,offset:t.start+t.length}}),e.revealParagraph(t.blockId),{ok:true,changed:false}}function oa(e,t,n){let r=e.block??t,o=e.behavior??"instant",i=e.offsetPx??24;if(!["start","center","centerIfNeeded","nearest"].includes(r))throw new TypeError("block must be start, center, centerIfNeeded, or nearest.");if(!["instant","smooth"].includes(o))throw new TypeError("behavior must be instant or smooth.");if(!Number.isFinite(i)||i<0)throw new RangeError("offsetPx must be finite and nonnegative.");let a=n?.ownerDocument.defaultView?.matchMedia?.("(prefers-reduced-motion: reduce)").matches??false;return {block:r,offsetPx:i,behavior:a?"instant":o}}function GE(e,t,n=()=>null){return {scrollToPage(r){return !Number.isInteger(r)||r<1?false:(t(),e()?.revealPage(r-1)??false)},scrollToBlock(r,o){if(typeof r!="string"||r.length===0)return false;let i;try{i=oa(o??{},"start",n());}catch{return false}t();let a=e();return a&&_c(a,r),a?.revealParagraph(r,i)??false}}}var XE="cubic-bezier(0.23, 1, 0.32, 1)";function oi(e,t,n,r=1/0){let o=e??t;if(!Number.isFinite(o)||o<0||o>r)throw new RangeError(r===1/0?`${n} must be a finite, nonnegative number.`:`${n} must be finite and between 0 and ${r}.`);return o}function YE(e,t=180){if(e!==void 0&&typeof e!="boolean"&&(typeof e!="object"||e===null||Array.isArray(e)))throw new TypeError("animation must be a boolean or a durationMs settings object.");return e===false?0:oi(typeof e=="object"?e.durationMs:void 0,e===true||typeof e=="object"?180:t,"animation.durationMs",1e4)}function Bc(e,t,{marker:n,defaultColor:r},o){let i=[],a=new Map,s=new Set,l=null,d=null,c=r,u=.14,p=4,m=6,g=0,b=r,h="solid",y="",S=180,x=180,I,R=XE,T,P=0,O=()=>{P++,T!==void 0&&clearTimeout(T),T=void 0;},v=U=>{let F=t.container()?.ownerDocument.defaultView?.CSS??globalThis.CSS;if(U!==void 0&&(typeof U!="string"||!U.trim()||/var\(|^(inherit|initial|unset|revert|revert-layer)$/i.test(U.trim())||F?.supports&&!F.supports("animation-timing-function",U)))throw new TypeError("animation.easing must be a CSS timing function without variables.");let N=t.container()?.ownerDocument.defaultView?.KeyframeEffect??globalThis.KeyframeEffect;if(U!==void 0&&N)try{new N(null,[],{easing:U});}catch{throw new TypeError("animation.easing must be one valid animation timing function.")}return U},C=(U,F)=>oi(typeof U=="object"?U.exitDurationMs:void 0,F,"animation.exitDurationMs",1e4),L=(U={})=>{if(U.includePrevious!==void 0&&typeof U.includePrevious!="boolean")throw new TypeError("includePrevious must be a boolean.");let F=oi(U.opacity,.14,"opacity",1),N=oi(U.padding,4,"padding"),B=oi(U.borderRadius,6,"borderRadius"),$=YE(U.animation),G=C(U.animation,$),H=v(typeof U.animation=="object"?U.animation.easing:void 0),W=U.timeoutMs===null?null:oi(U.timeoutMs,3e3,"timeoutMs",2147483647),Z=U.color??r,re=oi(U.borderWidth,0,"borderWidth"),ne=U.borderColor??Z,ee=U.borderStyle??"solid",se=U.className??"";if(!["solid","dashed","dotted"].includes(ee))throw new TypeError("borderStyle must be solid, dashed, or dotted.");if(typeof se!="string")throw new TypeError("className must be a string.");let fe=t.container()?.ownerDocument.defaultView?.CSS??globalThis.CSS;if(typeof Z!="string"||!Z.trim()||fe?.supports&&!fe.supports("color",Z))throw new TypeError("color must be a CSS color or var() expression.");if(fe?.supports&&!fe.supports("color",`color-mix(in srgb, ${Z} ${F*100}%, transparent)`))throw new TypeError("color must be valid inside color-mix(), including var() expressions.");if(typeof ne!="string"||!ne.trim()||fe?.supports&&!fe.supports("color",ne))throw new TypeError("borderColor must be a CSS color or var() expression.");if(U.changeIds!==void 0&&(!Array.isArray(U.changeIds)||U.changeIds.length>1e4||U.changeIds.some(Ce=>typeof Ce!="string"||!Ce)))throw new TypeError("changeIds must contain at most 10000 nonempty string IDs.");return {nextOpacity:F,nextPadding:N,nextRadius:B,nextDuration:$,nextExitDuration:G,nextEasing:H,nextTimeout:W,nextColor:Z,nextBorderWidth:re,nextBorderColor:ne,nextBorderStyle:ee,nextClassName:se}},A=()=>I||t.container()?.ownerDocument.defaultView?.getComputedStyle(t.container()).getPropertyValue("--doc-motion-ease-out").trim()||XE,q=U=>{U.animation&&(U.animation.onfinish=null,U.animation.cancel(),U.animation=void 0);},K=(U,F)=>{q(F),F.element.remove(),a.get(U)===F&&a.delete(U);},E=()=>(d||(d=t.container()?.ownerDocument.defaultView?.matchMedia?.("(prefers-reduced-motion: reduce)")??null,d?.addEventListener("change",X)),d?.matches??false),_=()=>{d?.removeEventListener("change",X),d=null;};function X(){if(d?.matches){for(let[U,F]of a)q(F),F.exiting&&K(U,F);a.size||_();}}let z=(U,F,N,B,$=false)=>{if(!$&&F.target===N&&!F.exiting)return;let G=F.element.ownerDocument.defaultView,H=$?0:Number.parseFloat(G?.getComputedStyle(F.element).opacity??String(F.target));q(F),F.target=N,F.element.style.opacity=String(N);let W=E()?Math.min(B,125):B;if(W===0||typeof F.element.animate!="function"){F.exiting&&K(U,F);return}try{let Z=F.element.animate([{opacity:Number.isFinite(H)?H:N},{opacity:N}],{duration:W,easing:R});F.animation=Z,Z.onfinish=()=>{F.animation===Z&&(F.animation=void 0,F.exiting&&K(U,F),a.size||_());};}catch{F.exiting&&K(U,F);}},oe=()=>{l?.disconnect();let U=t.surface(),F=t.container();if(!U||!F||i.length===0)return;R=A();let N=new Set(i.map(W=>W.paragraphId)),B=e.getRenderScale(),$=e.snapshot().zoom,G=new Set,H=new Set;for(let W of U.layout().pages){let Z=F.querySelector(`[data-page-index="${W.index}"] > .docx-page-content`);if(Z)for(let re of chunkDOHF6FA7_cjs.xa(W)){if(!N.has(re.paragraphId))continue;let ne=`${W.index}:${re.id}`;G.add(ne);let ee=chunkDOHF6FA7_cjs.Ed(re),se=re.lines.length&&!re.clipToBox?1/0:ee.y,fe=re.lines.length&&!re.clipToBox?-1/0:ee.y+ee.height;for(let Ye of re.clipToBox?[]:re.lines)se=Math.min(se,Ye.box.y),fe=Math.max(fe,Ye.box.y+Ye.box.height);let Ce=re.clipToBox?0:p*$,Ee=W.contentBox.x-W.box.x,at=W.contentBox.y-W.box.y,ot=Math.max(-Ee*B,ee.x*B-Ce),Ne=Math.min((W.box.width-Ee)*B,(ee.x+ee.width)*B+Ce);se=Math.max(-at*B,se*B-Ce),fe=Math.min((W.box.height-at)*B,fe*B+Ce);let Te=a.get(ne);Te&&Te.element.parentElement!==Z&&(K(ne,Te),Te=void 0);let Pt=!Te;if(!Te){let Ye=F.ownerDocument.createElement("div");Ye.setAttribute("data-docx-marker",""),Ye.setAttribute(n,""),Ye.setAttribute("contenteditable","false"),Ye.setAttribute("aria-hidden","true"),Ye.style.cssText="position:absolute;pointer-events:none;box-sizing:border-box;",Te={element:Ye,paragraphId:re.paragraphId,target:-1,exiting:false},a.set(ne,Te),Z.append(Ye);}let st=Te.exiting;Te.exiting=false,st&&(Te.target=-1),Te.element.className=y,Object.assign(Te.element.style,{border:g?`${g*$}px ${h} ${b}`:"0",backgroundColor:`color-mix(in srgb, ${c} ${u*100}%, transparent)`,borderRadius:`${m*$}px`,left:`${ot}px`,top:`${se}px`,width:`${Math.max(0,Ne-ot)}px`,height:`${Math.max(0,fe-se)}px`}),z(ne,Te,1,Pt&&s.has(re.paragraphId)?0:S,Pt),H.add(re.paragraphId);}}for(let W of H)s.add(W);for(let[W,Z]of a)G.has(W)||(!Z.element.isConnected||N.has(Z.paragraphId)||x===0?K(W,Z):Z.exiting||(Z.exiting=true,z(W,Z,0,x)));l??=new MutationObserver(oe),l.observe(F,{childList:true,subtree:true});},j=()=>{O(),i=[],s.clear(),l?.disconnect();for(let[U,F]of a)K(U,F);_();},me=(U={})=>{let F=C(U.animation,YE(U.animation,x));R=v(typeof U.animation=="object"?U.animation.easing:void 0)??A(),O(),i=[],s.clear(),l?.disconnect();for(let[B,$]of a)$.exiting&&F>0||($.exiting=true,z(B,$,0,F));a.size||_();};return e.on("selectionChange",()=>{i.length&&oe();}),{show(U,F={}){let{nextOpacity:N,nextPadding:B,nextRadius:$,nextDuration:G,nextExitDuration:H,nextEasing:W,nextTimeout:Z,nextColor:re,nextBorderWidth:ne,nextBorderColor:ee,nextBorderStyle:se,nextClassName:fe}=L(F),Ce=new Set(i.map(Ee=>Ee.paragraphId));if(s=new Set([...s].filter(Ee=>Ce.has(Ee))),c=re,g=ne,b=ee,h=se,y=fe,u=N,p=B,m=$,S=G,x=H,I=W,i=U,S===0)for(let Ee of a.values())Ee.exiting||q(Ee);if(!i.length){me();return}if(oe(),O(),Z!==null){let Ee=P;T=setTimeout(()=>{Ee===P&&(T=void 0,me(),o());},Z);}},validate:L,hide:me,clear:j,repaint:oe}}function QE(e,t){e.flushPendingInput();let n=un(e.session.part(),e.session.paragraphAnchors(),t);return n.ok?n.span:null}function JE(e,t,n){let r=null,o=i=>{if(r)return r;let a=e(),s=Bc(a,i,{marker:"data-docx-anchor-highlight",defaultColor:"var(--doc-anchor-highlight-color)"},()=>{});return i.invalidated.add(()=>s.clear()),a.on("change",l=>{l.source&&s.clear();}),r=s,s};return {scrollToAnchor(i,a={}){let s=t(),l=oa(a,"centerIfNeeded",s?.container()??null);if(!Et(i))return false;n();let d=s?.surface();if(!d)return false;let c=QE(d,i);return !!c&&d.revealPosition({paragraphId:c.nodeId,offset:c.start},l)},highlightAnchor(i,a){let s=t();if(!s)return false;let l=o(s);if(l.validate(a),!Et(i))return false;n();let d=s.surface();if(!d||!s.container()||s.source)return false;let c=QE(d,i)?.nodeId;return !c||!d.layout().pages.some(p=>chunkDOHF6FA7_cjs.xa(p).some(m=>m.paragraphId===c))?false:(l.show([{paragraphId:c}],a),true)},clearAnchorHighlight(i){let a=t();a&&o(a).hide(i);}}}function eO(e,t){if(!t.some(o=>o.scope?.kind==="frame"))return t;let n=e.publishedLayout();if(n.revision!==e.session.packageRevision())return t;let r=new Map;return t.filter(o=>{let i=o.scope;if(i?.kind!=="frame")return true;let a=`${i.drawingNodeId}\0${i.hostParagraphId}`,s=r.get(a);return s===void 0&&(s=!!zi(n,i.drawingNodeId,i.hostParagraphId),r.set(a,s)),s})}var g6=/^[A-Za-z][A-Za-z0-9_-]{0,63}$/,h6=/^-?[A-Za-z_][A-Za-z0-9_-]*$/,y6=1e4,tO=32,eh=1e3;function b6(e,t,n){let r=e?.ownerDocument.defaultView?.CSS??globalThis.CSS;return !r?.supports||r.supports(t,n)}function nO(e,t,n){if(e!==void 0){if(typeof e!="string"||!e.trim()||!b6(n,"color",e))throw new TypeError(`${t} must be a CSS color or var() expression.`);return e}}function rO(e){if(typeof e!="string"||!g6.test(e))throw new TypeError('Highlight set names are 1 to 64 letters, digits, "-", or "_", starting with a letter.');return e}function v6(e,t,n,r,o){if(!Array.isArray(t))throw new TypeError("ranges must be an array of HighlightRange.");if(n!==void 0&&(typeof n!="object"||n===null))throw new TypeError("options must be an object.");let i=t.slice(0,y6),a=t.length-i.length,s=[],l=new Int32Array(i.length),d=new Int32Array(i.length);for(let[h,y]of i.entries()){if(!(typeof y=="object"&&y!==null&&typeof y.blockId=="string"&&y.blockId.length>0&&Number.isSafeInteger(y.start)&&y.start>=0&&Number.isSafeInteger(y.length)&&y.length>=0&&y.start+y.length<=2147483647&&(y.expectedText===void 0||typeof y.expectedText=="string")))throw new TypeError(`ranges[${h}] must have a blockId string, nonnegative integer start and length, and an optional expectedText string.`);s.push(y.blockId),l[h]=y.start,d[h]=y.start+y.length;}let c=n?.activeIndex??-1;if(!Number.isInteger(c)||c<-1)throw new RangeError("activeIndex must be an integer of -1 or more.");let u=n?.priority??0;if(!Number.isInteger(u)||Math.abs(u)>eh)throw new RangeError(`priority must be an integer from -${eh} to ${eh}.`);let p=n?.className??"";if(typeof p!="string")throw new TypeError("className must be a string.");let m=p.split(/\s+/).filter(Boolean);if(m.some(h=>!h6.test(h)))throw new TypeError("className must hold space-separated CSS class names.");let g=nO(n?.color,"color",o),b=nO(n?.activeColor,"activeColor",o);return {name:e,ranges:i,overflow:a,blockIds:s,starts:l,ends:d,...g!==void 0?{color:g}:{},...b!==void 0?{activeColor:b}:{},activeIndex:c,classes:m,priority:u,order:r,expected:null,seen:new Array(i.length).fill(null),resolved:new Uint8Array(i.length),live:new Uint8Array(i.length),checkedAt:null}}function x6(e,t){let n=Math.min(e.length,t.length),r=0;for(;r<n&&e.charCodeAt(r)===t.charCodeAt(r);)r+=1;let o=0;for(;o<n-r&&e.charCodeAt(e.length-1-o)===t.charCodeAt(t.length-1-o);)o+=1;return {from:r,oldTo:e.length-o,delta:t.length-e.length}}function w6(e,t,n){return t<=n.from?0:e>=n.oldTo?n.delta:0}var oh=new WeakMap,dO=new WeakMap,oO=new WeakSet,th=new WeakMap,nh=new WeakMap;function S6(e,t){return oh.has(e)?oh.get(e):typeof e.expectedText=="string"?e.expectedText:(th.has(e)||th.set(e,t),th.get(e))}var rh=new WeakMap;function cO(e){let t=new Map;return n=>{if(t.has(n))return t.get(n);let r=Me(e.session,n),o=r?chunkOSFOJTHU_cjs.Ta(r,n):null,i=null;return r&&o&&(rh.has(o)?i=rh.get(o):(i=chunkOSFOJTHU_cjs.Vi(r,n),rh.set(o,i))),t.set(n,i),i}}function iO(e,t,n){let r=t.session,o=r.packageRevision(),i=e.checkedAt;if(i?.session===r&&i.revision===o&&i.layout===n)return;let a=cO(t),s=chunkDOHF6FA7_cjs.Ce(n),l=e.expected===null,d=e.expected??new Array(e.ranges.length).fill(null),c=new Map;for(let u=0;u<e.ranges.length;u+=1){let p=e.ranges[u],m=e.ends[u]>e.starts[u]?a(e.blockIds[u]):null;if(!l&&m!==null&&m===e.seen[u]){e.live[u]=e.resolved[u]&&s.has(e.blockIds[u])?1:0;continue}let g=l?dO.get(p)??nh.get(p)??m:e.seen[u];if(m!==null&&g!==null&&g!==m){let x=e.blockIds[u],I=c.get(x);I?.seen!==g&&(I={seen:g,edit:x6(g,m)},c.set(x,I));let R=w6(e.starts[u],e.ends[u],I.edit);e.starts[u]=e.starts[u]+R,e.ends[u]=e.ends[u]+R;}e.seen[u]=m;let b=e.starts[u],h=e.ends[u],y=m!==null&&h<=m.length?m.slice(b,h):null;if(!l&&m!==null&&y!==d[u]&&g!==null){let x=m.length-g.length,I=b+x>=0?m.slice(b+x,h+x):null;x!==0&&I!==null&&I===d[u]&&(e.starts[u]=b+x,e.ends[u]=h+x,y=I);}l&&(d[u]=S6(p,y),m!==null&&!nh.has(p)&&nh.set(p,m));let S=y!==null&&y===d[u];e.resolved[u]=S?1:0,e.live[u]=S&&s.has(e.blockIds[u])?1:0;}e.expected=d,e.checkedAt={session:r,revision:o,layout:n};}var aO=new WeakMap,sO=new WeakMap,lO=new WeakMap;function I6(e){let t=new Map;for(let n=0;n<e.ranges.length;n+=1){if(!e.live[n])continue;let r=e.blockIds[n],o=t.get(r)??[];o.push({key:n,start:e.starts[n],end:e.ends[n]}),t.set(r,o);}return t}function k6(e,t,n,r,o){let i=t.children[n];i||(i=e.createElement("div"),i.style.position="absolute",t.append(i));let a=r.index===o.activeIndex,s=`${r.index}|${a?1:0}|${r.left}|${r.top}|${r.width}|${r.height}`;lO.get(i)?.key!==s&&(i.className=a?"docx-text-highlight docx-text-highlight--active":"docx-text-highlight",o.classes.length>0&&i.classList.add(...o.classes),i.setAttribute("data-highlight-index",String(r.index)),i.style.left=`${r.left}px`,i.style.top=`${r.top}px`,i.style.width=`${r.width}px`,i.style.height=`${r.height}px`,lO.set(i,{key:s}));}function R6(e){return e?[...e].sort((t,n)=>t-n).join(","):"*"}function P6(e){return e?[...e].map(([t,n])=>`${t}:${n}`).join(","):""}function uO(e){let t=new Map,n=0,r=0,o=[],i=null,a=null,s=null,l=null,d=()=>[...t.values()].sort((h,y)=>h.priority-y.priority||h.order-y.order);function c(h){let y=e.surface();if(i=h.layer,l=h,!y||t.size===0){h.layer.childElementCount>0&&h.layer.replaceChildren(),o=[],a=null;return}let S=d();for(let v of S)iO(v,y,h.layout);let x=Yo(h.layout),I=[r,y.session.packageRevision(),R6(h.pages),h.scale,P6(h.pageOffsetX)].join("|");if(I===a&&x===s&&h.layer.childElementCount>0)return;a=I,s=x;let R=h.layer.ownerDocument,T=[],P=[];for(let v of S){let C=u(v,x,h),L=p(R,v),A=0;for(let q of C){let K=x.pages[q.pageIndex];if(!K)continue;let E=h.pageOffsetX?.get(q.pageIndex)??0,_={set:v,index:q.key,left:(K.contentBox.x+q.x+E)*h.scale,top:(K.contentBox.y+q.y)*h.scale,width:q.width*h.scale,height:q.height*h.scale};k6(R,L,A,_,v),A+=1,P.push(_);}for(;L.childElementCount>A;)L.lastElementChild.remove();T.push(L);}let O=h.layer.children;(O.length!==T.length||T.some((v,C)=>O[C]!==v))&&h.layer.replaceChildren(...T),o=P;}function u(h,y,S){let x=aO.get(h);x||(x=new WeakMap,aO.set(h,x));let I=[],R=new Map;for(let P of y.pages)S.pages&&!S.pages.has(P.index)||(I.push(P),x.has(P)||R.set(P.index,{page:P,rects:[]}));if(R.size>0){let P=chunkDOHF6FA7_cjs.Be(y,I6(h),new Set(R.keys()),S.measurer);for(let O of P)R.get(O.pageIndex).rects.push(O);for(let{page:O,rects:v}of R.values())x.set(O,v);}let T=[];for(let P of I)for(let O of x.get(P))T.push(O);return h.activeIndex>=0&&T.sort((P,O)=>+(P.key===h.activeIndex)-+(O.key===h.activeIndex)),T}function p(h,y){let S=sO.get(y);if(S)return S;let x=h.createElement("div");return x.className="docx-text-highlight-set",x.setAttribute("data-highlight-set",y.name),y.color&&x.style.setProperty("--doc-text-highlight-set-color",y.color),y.activeColor&&x.style.setProperty("--doc-text-highlight-set-active-color",y.activeColor),sO.set(y,x),x}function m(){r+=1,e.surface()?.repaintHighlights();}function g(h){let y=e.surface();if(!y)return {applied:0,unavailable:h.ranges.length+h.overflow};let S=y.publishedLayout();iO(h,y,S);let x=S.revision!==y.session.packageRevision(),I=0;for(let R=0;R<h.ranges.length;R+=1)I+=x?h.resolved[R]:h.live[R];return {applied:I,unavailable:h.ranges.length-I+h.overflow}}return {members:{setHighlights(h,y,S){rO(h),Array.isArray(y)&&y.length>0&&e.flushOpen();let x=t.get(h),I=v6(h,y,S,x?.order??n,e.container());if(!x&&I.ranges.length>0&&t.size>=tO)throw new RangeError(`At most ${tO} highlight sets exist at once.`);if(I.ranges.length===0)return x&&(t.delete(h),m()),{applied:0,unavailable:0};x||(n+=1),t.set(h,I);let R=g(I);return m(),R},clearHighlights(h){if(h===void 0){if(t.size===0)return;t.clear();}else if(!t.delete(rO(h)))return;m();},getHighlightsAt(h,y){if(!Number.isFinite(h)||!Number.isFinite(y))return [];let S=i;if(!S?.isConnected||o.length===0)return [];let x=S.getBoundingClientRect(),I=h-x.left,R=y-x.top,T=[],P=new Set;for(let O=o.length-1;O>=0;O-=1){let v=o[O];if(I<v.left||I>=v.left+v.width||R<v.top||R>=v.top+v.height)continue;let C=`${v.set.name}\0${v.index}`;if(P.has(C)||t.get(v.set.name)!==v.set)continue;P.add(C);let L=x.left+v.left,A=x.top+v.top;T.push({name:v.set.name,index:v.index,range:v.set.ranges[v.index],start:v.set.starts[v.index],length:v.set.ends[v.index]-v.set.starts[v.index],active:v.index===v.set.activeIndex,rect:{x:L,y:A,left:L,top:A,width:v.width,height:v.height,right:L+v.width,bottom:A+v.height}});}return T}},frame:()=>{let h=e.surface();if(!l||!h)return l;let y=h.session.packageRevision();if(l.layout.revision===y)return l;let S=h.layout();return l.layout===S?l:{...l,layout:S,revision:y}},noteMatches(h){let y=e.surface();if(!y||oO.has(h))return h;let S=eO(y,h);oO.add(S);let x=cO(y);for(let I of S){let R=x(I.blockId);R!==null&&dO.set(I,R);let T=I.start+I.length;oh.set(I,R!==null&&T<=R.length?R.slice(I.start,T):null);}return S},attach(h,y=false){a=null,l=null,y&&t.clear(),h?.setHighlightPainter(c);},reset(){t.size!==0&&(t.clear(),m());}}}var fO=new WeakMap;function pO(e){let t=fO.get(e);if(t)return t;let n=new Map,r=new Map,o=(s,l)=>{if(n.has(l))return;let d=r.get(s);d||(d=[],r.set(s,d)),n.set(l,{story:s,index:d.length}),d.push(l);},i=(s,l)=>{for(let d of chunkDOHF6FA7_cjs.ya(l)){for(let c of d.lines)for(let u of chunkDOHF6FA7_cjs.Ma(c))o(s,u.paragraphId);d.lines.length===0&&o(s,d.paragraphId);}};for(let s of e.pages){i("body",s.fragments);for(let l of [s.header,s.footer])l&&i(`part:${l.partName}`,l.fragments);for(let l of [s.footnotes,s.endnotes])for(let d of l?.notes??[])i(`notes:${d.noteKind}`,d.fragments);}let a={positions:n,paragraphs:r};return fO.set(e,a),a}function T6(e,t,n,r){let o=(c,u,p)=>{if(p<=u)return;let m=r.get(c);m?m.push({key:t,start:u,end:p}):r.set(c,[{key:t,start:u,end:p}]);},{start:i,end:a}=e;if(i.paragraphId===a.paragraphId){o(i.paragraphId,i.offset,a.offset);return}let s=n.positions.get(i.paragraphId),l=n.positions.get(a.paragraphId);if(o(i.paragraphId,i.offset,Number.POSITIVE_INFINITY),o(a.paragraphId,0,a.offset),!s||!l||s.story!==l.story||l.index<=s.index)return;let d=n.paragraphs.get(s.story);for(let c=s.index+1;c<l.index;c+=1)o(d[c],0,Number.POSITIVE_INFINITY);}function C6(e,t){if(e.start.paragraphId===e.end.paragraphId)return e.end.offset-e.start.offset;let n=t.positions.get(e.start.paragraphId),r=t.positions.get(e.end.paragraphId);return !n||!r||n.story!==r.story?Number.MAX_SAFE_INTEGER:(r.index-n.index)*1e6+(e.end.offset-e.start.offset)}function E6(e){let t=e.item;return t.kind==="revision"?t.ranges:t.range?[t.range]:[]}var mO={comment:0,custom:1,revision:2};function gO(e,t){let n=new Map,r=[];return e.forEach((o,i)=>{for(let a of E6(o)){let s=r.length;r.push({placement:i,width:C6(a,t)}),T6(a,s,t,n);}}),{byParagraph:n,sources:r}}function hO(e,t){return !e.pages||e.pages.has(t.index)}function yO(e,t,n,r){let o=e.pageOffsetX?.get(n.index)??0,i=t.left+(n.contentBox.x+r.x+o)*e.scale,a=t.top+(n.contentBox.y+r.y)*e.scale,s=r.width*e.scale,l=r.height*e.scale;return {x:i,y:a,left:i,top:a,width:s,height:l,right:i+s,bottom:a+l}}function bO(e){function t(){let n=e.frame();return !n?.layer.isConnected||!(n.scale>0)?null:{frame:n,origin:n.layer.getBoundingClientRect()}}return {getReviewItemsAt(n,r,o){if(!Number.isFinite(n)||!Number.isFinite(r))return [];let i=t();if(!i)return [];let{frame:a,origin:s}=i,l=(n-s.left)/a.scale,d=(r-s.top)/a.scale,c=a.layout.pages.find(I=>{if(!hO(a,I))return false;let R=I.box.x+(a.pageOffsetX?.get(I.index)??0);return l>=R&&l<R+I.box.width&&d>=I.box.y&&d<I.box.y+I.box.height});if(!c)return [];let u=e.placements(o);if(u.length===0)return [];let p=pO(a.layout),{byParagraph:m,sources:g}=gO(u,p),b=l-(a.pageOffsetX?.get(c.index)??0)-c.contentBox.x,h=d-c.contentBox.y,y=new Map,S=chunkDOHF6FA7_cjs.Be(Yo(a.layout),m,new Set([c.index]),a.measurer);for(let I of S){if(b<I.x||b>=I.x+I.width||h<I.y||h>=I.y+I.height)continue;let R=g[I.key],T=y.get(R.placement);(!T||R.width<T.width)&&y.set(R.placement,{width:R.width,rect:I});}let x=[...y.entries()].map(([I,R])=>({at:I,...R}));return x.sort((I,R)=>{if(I.width!==R.width)return I.width-R.width;let T=u[I.at],P=u[R.at];if(T.kind!==P.kind)return mO[T.kind]-mO[P.kind];if(T.kind==="revision"&&P.kind==="revision"){let O=P.item.nesting-T.item.nesting;if(O!==0)return O}return I.at-R.at}),x.map(I=>({placement:u[I.at],rect:yO(a,s,c,I.rect)}))},getReviewItemRects(n){if(typeof n!="string"||n.length===0)return [];let r=t();if(!r)return [];let{frame:o,origin:i}=r,a=Br(e.placements,n);if(!a)return [];let s=new Set(o.layout.pages.filter(d=>hO(o,d)).map(d=>d.index)),{byParagraph:l}=gO([a],pO(o.layout));return chunkDOHF6FA7_cjs.Be(Yo(o.layout),l,s,o.measurer).map(d=>yO(o,i,o.layout.pages[d.pageIndex],d))}}}var vO=new WeakMap;function ih(e,t){let n=t(e?.matches??[]);return vO.set(n,e?.truncated??false),n}function xO(e){return vO.get(e)}function O6(e){return e==="password"?{ok:false,code:"locked",reason:wO}:e==="other-restriction"?{ok:false,code:"locked",reason:"this document declares a different editing restriction; open it in Word to change that"}:e==="no-change"?{ok:false,code:"invalidArgs",reason:"the document protection is already set"}:{ok:false,code:"unsupported",reason:"document protection could not be written"}}var wO="this document is protected with a password; open it in Word to change that";function SO(e){let t=null,n=null,r=()=>{let l=e.tracking();return [l.restrictedToReadOnly,l.restrictedToComments,l.restrictedToForms,l.restrictedToTrackedChanges].join("|")},o,i=null,a=()=>{let l=e.surface();if(!l)return null;let d=l.session.settingsRoot();return (d!==o||i===null)&&(o=d,i=d?chunkOSFOJTHU_cjs.Lg(d):chunkOSFOJTHU_cjs.Kg),i},s=()=>{if(e.destroyed())return {ok:false,code:"notFound",reason:"the editor was destroyed"};let l=a();return l===null?{ok:false,code:"notFound",reason:"no document is loaded"}:e.hostViewOnly()?{ok:false,code:"locked",reason:"this document was opened for viewing"}:l.enforced&&l.password?{ok:false,code:"locked",reason:wO}:!l.enforced&&l.edit!=="none"&&l.edit!=="forms"?{ok:false,code:"locked",reason:"this document declares a different editing restriction; open it in Word to change that"}:null};return {sync(){let l=e.surface()?.session.settingsRoot()??null;if(l===n&&t!==null)return;n=l;let d=r();d!==t&&(t=d,e.adopt(e.decision()));},prime:()=>{n=e.surface()?.session.settingsRoot()??null,t=r();},state:a,isActive:()=>a()?.enforced===true,can(l){return l.type!=="toggleDocumentProtection"?null:s()??{ok:true}},exec(l){if(l.type!=="toggleDocumentProtection")return null;let d=s();if(d&&!d.ok)return d;let c=e.surface(),u=!a().enforced,p=c.applyHeaderFooterLifecycle?.({op:"setDocumentProtection",enforce:u});return p?p.ok?(e.publish(),{ok:true,changed:true}):O6(p.reason):{ok:false,code:"unsupported",reason:"document protection is not available"}}}}function IO(e,t){return Ff(e.revisionsIn,t)}function kO(e,t){let n=od(e);return {current:()=>n,set(r){if(!t.enabled)return {ok:false,code:"unsupported",reason:Qt};let o;try{o=od(r,n);}catch(a){return {ok:false,code:"invalidArgs",reason:a.message}}if(o===n)return {ok:true,changed:false};let i=n;return n=o,t.changed(n,i),{ok:true,changed:false}},shows:r=>r.some(o=>IO(n,o)),opensOnLoad:r=>n.opening==="auto"&&r.some(o=>IO(n,o)),opensOnTrackedChange:()=>n.opening==="auto"&&n.revisionsIn==="pane"}}var M6=e=>chunkDOHF6FA7_cjs.xa(e);function PO(){let e=new WeakMap;return t=>{let n=e.get(t);if(n)return n;let r=chunkD7ZMDMPX_cjs.Y(t,M6);for(let o of t.pages){for(let i of [o.header,o.footer])i&&RO(r,i.fragments,o.index,i.box.y);for(let i of [o.footnotes,o.endnotes])if(i)for(let a of i.notes)RO(r,a.fragments,o.index,a.box.y);}return e.set(t,r),r}}function RO(e,t,n,r){for(let o of chunkDOHF6FA7_cjs.ya(t))for(let i of chunkDOHF6FA7_cjs.Pa(o))e.has(i)||e.set(i,{pageIndex:n,contentY:r,fragmentY:o.box.y,...o.lines?{lines:o.lines}:{}});}var TO=new WeakMap;function EO(e){let t=TO.get(e);if(t)return t;let n=new Map;for(let r of e.pages)for(let o of [r.footnotes,r.endnotes])if(o)for(let i of o.notes)for(let a of chunkDOHF6FA7_cjs.ya(i.fragments))for(let s of chunkDOHF6FA7_cjs.Pa(a))n.has(s)||n.set(s,i.scopeId);return TO.set(e,n),n}var CO=new WeakMap;function OO(e){let t=CO.get(e);if(t)return t;let n=new Map;for(let[r,o]of chunkDOHF6FA7_cjs.Ra(e).entries())n.set(o,r);return CO.set(e,n),n}function MO(e){if(e==="")return;let t=globalThis.navigator?.clipboard;if(t?.writeText)try{t.writeText(e).catch(()=>{});}catch{}}function ah(e,t){if(e===""&&(t===null||t===""))return;let n=globalThis.navigator?.clipboard;if(!n)return;let r=globalThis.ClipboardItem;if(t&&n.write&&r&&typeof Blob<"u")try{let o=new r({"text/plain":new Blob([e],{type:"text/plain"}),"text/html":new Blob([t],{type:"text/html"})});n.write([o]).catch(()=>{MO(e);});return}catch{}MO(e);}function A6(e){return typeof e=="object"&&e!==null&&"container"in e&&Array.isArray(e.path)}function F6(e){return typeof e=="object"&&e!==null&&"from"in e&&"to"in e}function AO(e){return FO(e.children)}function FO(e){let t=[];for(let n of e)n.kind!=="textValue"&&(n.kind==="paragraph"||n.kind==="table"||chunkOSFOJTHU_cjs.Qb(n))&&t.push(n);return t}function L6(e){if(chunkOSFOJTHU_cjs.Qb(e))return FO(chunkOSFOJTHU_cjs.Tb(e));if(e.kind!=="table")return [];let t=[];for(let n of e.children)if(n.kind==="tableRow")for(let r of n.children)r.kind==="tableCell"&&t.push(...AO(r));return t}function N6(e,t,n){let r=t.container,o=r.part==="body"?{kind:"body"}:r.part==="header"||r.part==="footer"?{kind:"headerFooter",rId:r.rId}:{kind:"notesPart",noteKind:r.part==="footnote"?"footnote":"endnote"},i=e.session.partFor(o);if(!i)return {ok:false,code:"notFound",reason:"the target story was not found"};let a="noteId"in r?r.noteId:null,s=r.part==="body"?chunkOSFOJTHU_cjs.Qc(i):chunkOSFOJTHU_cjs.Oc(i).find(m=>r.part==="header"||r.part==="footer"?m.kind===r.part:m.kind==="note"&&chunkOSFOJTHU_cjs.yc(m.root)===a)?.root;if(!s||s.kind==="textValue")return {ok:false,code:"notFound",reason:"the target story was not found"};if(t.path.length===0)return {ok:false,code:"invalidArgs",reason:"DocLocation path must not be empty"};let l=AO(s),d;for(let m=0;m<t.path.length;m+=1){let g=t.path[m];if(!Number.isInteger(g)||g<0)return {ok:false,code:"invalidArgs",reason:"DocLocation indices must be non-negative"};if(d=l[g],!d)return {ok:false,code:"notFound",reason:`block index ${g} is out of range`};m<t.path.length-1&&(l=L6(d));}if(!d||d.kind!=="paragraph"||!chunkOSFOJTHU_cjs.Ta(i,d.id))return {ok:false,code:"invalidArgs",reason:"DocLocation must resolve to a paragraph"};let c=(chunkOSFOJTHU_cjs.Vi(i,d.id)??"").length,u=t.offset??(n==="start"?0:c);if(!Number.isInteger(u)||u<0||u>c)return {ok:false,code:"invalidArgs",reason:"DocLocation offset is outside the paragraph"};let p={paragraphId:d.id,offset:u};return {ok:true,selection:{anchor:p,head:p}}}function $c(e,t,n){if(A6(t))return N6(e,t,n);if(!Et(t))return {ok:false,code:"invalidArgs",reason:"unrecognized DocTarget endpoint"};let r=e.session.paragraphAnchors(),o=r.nodeByParaId.get(t.paraId.toUpperCase());if(!o)return {ok:false,code:"notFound",reason:"the paragraph was not found"};let i=Rt(e.session,o,{kind:"body"}),a=e.session.partFor(i);if(!a)return {ok:false,code:"notFound",reason:"the target story was not found"};let s=un(a,r,t);if(!s.ok)return s;let l=n==="start"?s.span.start:s.span.end,d={paragraphId:s.span.nodeId,offset:l};return {ok:true,selection:{anchor:d,head:d}}}function qc(e,t){if(!F6(t)){let o=$c(e,t,"start");if(!o.ok)return o;let i=$c(e,t,"end");return i.ok?{ok:true,selection:{anchor:o.selection.anchor,head:i.selection.head}}:i}let n=$c(e,t.from,"start");if(!n.ok)return n;let r=$c(e,t.to,"end");return r.ok?{ok:true,selection:{anchor:n.selection.anchor,head:r.selection.head}}:r}function D6(e){return e.evenPage?"even":e.firstPage?"first":"default"}function LO(e){return e.variant!==void 0?e.variant==="default"||e.variant==="first"||e.variant==="even"?e.variant:{ok:false,reason:"variant must be 'default', 'first', or 'even'"}:D6(e)}function sh(e,t){let n=e.headerFooterState(),r=t.position??n?.editing??null;if(r!=="header"&&r!=="footer")return {ok:false,refusal:{ok:false,code:"invalidArgs",reason:"header/footer position is required when no furniture scope is open"}};let i=t.variant!==void 0||t.firstPage!==void 0||t.evenPage!==void 0?LO(t):n?.variant??"default";if(typeof i=="object"&&i.ok===false)return {ok:false,refusal:{ok:false,code:"invalidArgs",reason:i.reason}};let a=i,s=t.sectionIndex??n?.sectionIndex??0;return !Number.isInteger(s)||s<0?{ok:false,refusal:{ok:false,code:"invalidArgs",reason:"sectionIndex must be a non-negative integer"}}:{ok:true,sectionIndex:s,kind:r,variant:a}}function H6(e){let t=e??"rejected";return t==="first-section"||t.includes("first-section")?{ok:false,code:"invalidArgs",reason:"the first section cannot link to a previous header or footer"}:{ok:false,code:"invalidArgs",reason:`header/footer lifecycle refused: ${t}`}}function Ws(e,t){if(typeof e.applyHeaderFooterLifecycle!="function")return {ok:false,code:"unsupported",reason:"header/footer lifecycle is not available"};let n=e.applyHeaderFooterLifecycle(t);return n.ok?{ok:true,changed:true}:H6(n.reason)}function Kc(e,t,n,r){let i=e.session.headerFooterResolutionBySection()[t];if(!i)return null;let s=(n==="header"?i.headers:i.footers).get(r);return s?{rId:s.rId,partName:s.partName,inherited:s.inherited,titlePage:i.titlePage,evenAndOddHeaders:i.evenAndOddHeaders}:null}function NO(e,t){if(typeof e.enterHeaderFooter!="function")return {ok:false,code:"unsupported",reason:"header/footer editing is not available"};let n=t.sectionIndex??0;if(!Number.isInteger(n)||n<0)return {ok:false,code:"invalidArgs",reason:"sectionIndex must be a non-negative integer"};let r=t.position,o=LO(t);if(typeof o=="object"&&o.ok===false)return {ok:false,code:"invalidArgs",reason:o.reason};let i=o,s=Kc(e,n,r,i)?.rId,l=false;if(!s){let c=Ws(e,{op:"createHeaderFooter",sectionIndex:n,kind:r,variant:i,...i==="first"?{titlePage:true}:{},...i==="even"?{evenAndOddHeaders:true}:{}});if(!c.ok)return c;l=true,s=Kc(e,n,r,i)?.rId;}return s?e.enterHeaderFooter({rId:s,kind:r,sectionIndex:n,variant:i})?{ok:true,changed:l}:{ok:false,code:"invalidArgs",reason:"the header/footer relationship could not be opened"}:{ok:false,code:"notFound",reason:`no ${r} story is available to edit`}}function DO(e,t){let n=sh(e,t);if(!n.ok)return n.refusal;let r=e.headerFooterState(),o=r?.rId,i=Ws(e,{op:"deleteHeaderFooter",sectionIndex:n.sectionIndex,kind:n.kind,variant:n.variant});return i.ok&&o&&r?.editing===n.kind&&r.sectionIndex===n.sectionIndex&&r.variant===n.variant&&e.exitHeaderFooter(),i}function HO(e,t){let n=sh(e,t);if(!n.ok)return n.refusal;if(n.sectionIndex===0)return {ok:false,code:"invalidArgs",reason:"the first section cannot link to a previous header or footer"};let r=e.headerFooterState(),o=r?.editing===n.kind&&r.sectionIndex===n.sectionIndex&&r.variant===n.variant,i=Ws(e,{op:"linkToPrevious",sectionIndex:n.sectionIndex,kind:n.kind,variant:n.variant});if(!i.ok)return i;if(o){let a=Kc(e,n.sectionIndex,n.kind,n.variant);a?e.enterHeaderFooter({rId:a.rId,kind:n.kind,sectionIndex:n.sectionIndex}):e.exitHeaderFooter();}return i}function _O(e,t){let n=sh(e,t);if(!n.ok)return n.refusal;let r=e.headerFooterState(),o=!!r&&r.editing===n.kind&&r.sectionIndex===n.sectionIndex&&r.variant===n.variant,i=r?.rId,a=Ws(e,{op:"unlinkFromPrevious",sectionIndex:n.sectionIndex,kind:n.kind,variant:n.variant});if(!a.ok)return a;let s=Kc(e,n.sectionIndex,n.kind,n.variant);return o&&s&&s.rId!==i&&e.enterHeaderFooter({rId:s.rId,kind:n.kind,sectionIndex:n.sectionIndex}),a}function BO(e,t){let n=e.headerFooterState(),r=t.sectionIndex??n?.sectionIndex;return Ws(e,{op:"setSectionFurnitureOptions",...r!==void 0?{sectionIndex:r}:{},...t.titlePage!==void 0?{titlePage:t.titlePage}:{},...t.evenAndOddHeaders!==void 0?{evenAndOddHeaders:t.evenAndOddHeaders}:{},...t.headerDistanceTwips!==void 0?{headerDistanceTwips:t.headerDistanceTwips}:{},...t.footerDistanceTwips!==void 0?{footerDistanceTwips:t.footerDistanceTwips}:{}})}function $O(e,t){return e.activeScope().kind!=="headerFooter"?{ok:false,code:"unsupported",reason:"insertPageField requires an open header or footer scope"}:typeof e.insertPageField!="function"?{ok:false,code:"unsupported",reason:"page field insertion is not available"}:e.insertPageField(t.field)?{ok:true,changed:true}:{ok:false,code:"invalidArgs",reason:e.state().lastRejection??"page field insertion was refused"}}function qO(e,t){let n=e.activeScope();return n.kind==="headerFooter"?{ok:false,code:"invalidArgs",reason:"cannot insert a note reference inside a header or footer"}:n.kind==="note"?{ok:false,code:"invalidArgs",reason:"cannot insert a note reference inside another note"}:typeof e.insertNote!="function"?{ok:false,code:"unsupported",reason:"insertNote is not available"}:e.insertNote(t.noteKind)?null:{ok:false,code:"invalidArgs",reason:e.state().lastRejection??"insertNote was refused"}}function KO(e,t){return typeof e.deleteNote!="function"?{ok:false,code:"unsupported",reason:"deleteNote is not available"}:e.deleteNote(t.noteKind,t.noteId)?null:{ok:false,code:"invalidArgs",reason:e.state().lastRejection??"deleteNote was refused"}}function VO(e,t){return typeof e.convertNote!="function"?{ok:false,code:"unsupported",reason:"convertNote is not available"}:e.convertNote(t.fromKind,t.noteId)?null:{ok:false,code:"invalidArgs",reason:e.state().lastRejection??"convertNote was refused"}}function jO(e,t){return typeof e.convertAllNotes!="function"?{ok:false,code:"unsupported",reason:"convertAllNotes is not available"}:e.convertAllNotes(t.fromKind)?null:{ok:false,code:"invalidArgs",reason:e.state().lastRejection??"convertAllNotes was refused"}}function WO(e,t){if(typeof e.setNoteProperties!="function")return {ok:false,code:"unsupported",reason:"setNoteProperties is not available"};let n=t.scope??"document";return e.setNoteProperties({scope:n,sectionIndex:t.sectionIndex,footnote:t.footnote,endnote:t.endnote})?null:{ok:false,code:"invalidArgs",reason:e.state().lastRejection??"setNoteProperties was refused"}}function zO(e,t,n){switch(t.type){case "toggleMark":{let r=Dp.get(t.mark);e.toggleRunProperty(r.localName,r.attributes);break}case "setMarkAttr":{let r=Hp(t);if(!r.ok)return {ok:false,code:r.code,reason:r.reason};e.setRunProperty(r.localName,r.attributes);break}case "clearFormatting":e.clearFormatting();break;case "copyFormatting":return e.formatPainter.capture()?{ok:true,changed:false}:{ok:false,code:"notFound",reason:xd};case "pasteFormatting":{let r=e.formatPainter.apply();if(r==="nothingToPaint")return {ok:false,code:"notFound",reason:xp};if(r==="refused")return {ok:false,code:"locked",reason:e.state().lastRejection??xp};break}case "setLineSpacing":e.setParagraphProperty("spacing",kc({rule:t.rule,value:t.value}),{mergeAttributes:true});break;case "setParagraphSpacing":e.setParagraphProperty("spacing",{...ea("before",t.beforePt),...ea("after",t.afterPt)},{mergeAttributes:true});break;case "setAlignment":e.setParagraphProperties([{localName:"jc",attributes:{val:t.align==="justify"?"both":t.align},physicalAlignment:true}]);break;case "setParagraphDirection":e.setParagraphProperties([{localName:"bidi",paragraphDirection:t.direction}]);break;case "setParagraphStyle":{if(!e.session.documentStyles().some(o=>o.type==="paragraph"&&o.styleId===t.styleId))return {ok:false,code:"invalidArgs",reason:`style '${t.styleId}' is not a paragraph style of this document`};e.setParagraphProperty("pStyle",{val:t.styleId});break}case "setIndent":{e.setIndent({...t.left!==void 0?{left:t.left}:{},...t.right!==void 0?{right:t.right}:{},...t.firstLine!==void 0?{firstLine:t.firstLine}:{}});break}case "setParagraphFormat":{if(!e.setParagraphFormat({...t.alignment!==void 0?{alignment:t.alignment==="justify"?"both":t.alignment}:{},...t.direction!==void 0?{direction:t.direction}:{},...t.spaceBeforePt!==void 0?{spaceBeforePt:t.spaceBeforePt}:{},...t.spaceAfterPt!==void 0?{spaceAfterPt:t.spaceAfterPt}:{},...t.lineSpacing!==void 0?{lineSpacing:t.lineSpacing}:{},...t.indentLeftTwips!==void 0?{indentLeftTwips:t.indentLeftTwips}:{},...t.indentRightTwips!==void 0?{indentRightTwips:t.indentRightTwips}:{},...t.indentFirstLineTwips!==void 0?{indentFirstLineTwips:t.indentFirstLineTwips}:{},...t.contextualSpacing!==void 0?{contextualSpacing:t.contextualSpacing}:{},...t.keepNext!==void 0?{keepNext:t.keepNext}:{},...t.keepLines!==void 0?{keepLines:t.keepLines}:{},...t.widowControl!==void 0?{widowControl:t.widowControl}:{},...t.pageBreakBefore!==void 0?{pageBreakBefore:t.pageBreakBefore}:{},...t.tabStops!==void 0?{tabStops:t.tabStops}:{}}))return {ok:false,code:"unsupported",reason:e.state().lastRejection??"the paragraph format could not be written here"};break}case "setPageSetup":{let r;if(t.scope==="section"){let s=e.sectionAnchorParagraphAt(e.state().selection.head.paragraphId);if(s.kind==="unaddressable")return {ok:false,code:"unsupported",reason:"this section holds no paragraph to address it by"};r=s.kind==="anchor"?s.paragraphId:void 0;}let o=t.pageWidth,i=t.pageHeight;if(t.orientation!==void 0&&(o!==void 0||i!==void 0)){let s=r?e.sectionPropertiesAt(r):e.sectionProperties(),l=o??s.pageSize.widthTwips,d=i??s.pageSize.heightTwips;o=t.orientation==="landscape"?Math.max(l,d):Math.min(l,d),i=t.orientation==="landscape"?Math.min(l,d):Math.max(l,d);}if(!e.setSectionProperties({...o!==void 0?{pageWidthTwips:o}:{},...i!==void 0?{pageHeightTwips:i}:{},...t.orientation!==void 0?{orientation:t.orientation}:{},...t.marginTop!==void 0?{marginTopTwips:t.marginTop}:{},...t.marginRight!==void 0?{marginRightTwips:t.marginRight}:{},...t.marginBottom!==void 0?{marginBottomTwips:t.marginBottom}:{},...t.marginLeft!==void 0?{marginLeftTwips:t.marginLeft}:{},...r!==void 0?{anchorParagraphId:r}:{}}))return {ok:false,code:"invalidArgs",reason:e.state().lastRejection??"the page setup change was refused"};break}case "toggleList":if(!e.toggleList(t.kind))return {ok:false,code:"invalidArgs",reason:e.state().lastRejection??"the list change was refused"};break;case "adjustIndent":if(!e.adjustIndent(t.direction))return {ok:false,code:"invalidArgs",reason:e.state().lastRejection??"the selection is already at that indent level"};break;case "insertBreak":if(t.kind==="section"||t.kind==="sectionContinuous"){let r=t.kind==="section"?"nextPage":"continuous";if(!e.insertSectionBreak(r))return {ok:false,code:"invalidArgs",reason:e.sectionBreakRefusal(r)??e.state().lastRejection??"the section break was refused"};break}if(t.kind==="page"){e.insertPageBreak();break}e.insertLineBreak();break;case "insertHyperlink":{let r=t.href.startsWith("#");if(!e.hyperlinks.applyHyperlink({...r?{anchor:t.href.slice(1)}:{url:t.href},...t.text!==void 0?{text:t.text}:{}}))return {ok:false,code:"invalidArgs",reason:e.state().lastRejection??"the link was refused: the target is not an allowed scheme, or there is no text to link"};break}case "removeHyperlink":if(!e.hyperlinks.removeHyperlink())return {ok:false,code:"notFound",reason:"there is no hyperlink at the selection"};break;case "insertTextBox":return gS(e);case "insertText":if(e.type(t.text),e.state().lastRejection==="the table of contents is generated and read-only"||e.state().lastRejection===Zi)return {ok:false,code:"invalidArgs",reason:e.state().lastRejection};break;case "deleteText":if(Sn(e))return om(e,{type:"deleteImage"},n?.editor);e.deleteSelection();break;case "proposeInsertion":case "proposeDeletion":case "proposeReplacement":{if(t.target!==void 0){let i=qc(e,t.target);if(!i.ok)return {ok:false,code:i.code,reason:i.reason};e.setSelection(i.selection);}let r=t.type==="proposeInsertion"?"insertion":t.type==="proposeDeletion"?"deletion":"replacement",o=t.type==="proposeInsertion"?t.text:t.type==="proposeReplacement"?t.replaceWith:"";if(!e.proposeTextChange(r,o,t.author))return {ok:false,code:"invalidArgs",reason:e.state().lastRejection??`${t.type} was refused`};break}case "undo":e.undo();break;case "redo":e.redo();break;case "insertTable":if(!e.insertTable(t.rows,t.cols))return {ok:false,code:"unsupported",reason:e.state().lastRejection??"the table could not be inserted here"};break;case "insertToc":if(!e.insertToc())return {ok:false,code:"unsupported",reason:e.state().lastRejection??"the table of contents could not be inserted"};break;case "editTextFormField":return e.editTextFormField()?{ok:true,changed:false}:{ok:false,code:"unsupported",reason:"field options are unavailable"};case "refreshToc":if(!e.refreshToc(t.tocId,t.mode))return {ok:false,code:"unsupported",reason:e.state().lastRejection??"the table of contents could not be refreshed"};break;case "editHeaderFooter":return NO(e,t);case "exitHeaderFooter":return typeof e.exitHeaderFooter=="function"&&e.exitHeaderFooter(),{ok:true,changed:false};case "removeHeaderFooter":return DO(e,t);case "linkHeaderFooterToPrevious":return HO(e,t);case "unlinkHeaderFooterFromPrevious":return _O(e,t);case "setHeaderFooterOptions":return BO(e,t);case "insertPageField":return $O(e,t);case "insertNote":return qO(e,t);case "deleteNote":return KO(e,t);case "convertNote":return VO(e,t);case "convertAllNotes":return jO(e,t);case "setNoteProperties":return WO(e,t);case "insertRow":case "deleteRow":case "insertColumn":case "deleteColumn":case "deleteTable":case "setCellFill":case "setTableCellVerticalAlignment":case "setTableBorders":case "commitTableColumnDividerResize":case "commitTableRightEdgeResize":case "mergeCells":case "splitCell":case "toggleHeaderRow":case "selectTableRegion":case "setTableProperties":{if(!no(t))return {ok:false,code:"unsupported",reason:"unsupported command"};let r=n?.admittedTablePlan??Nr({command:t,part:e.session.part(),layout:e.layout(),storeRevision:e.session.packageRevision(),selection:e.state().selection,cellSelection:e.state().cellSelection,themeColors:e.session.documentThemeColors(),editable:e.session.editable,viewing:e.editingMode()==="view"});return e.applyTableCommandPlan(r)}case "selectAll":return e.selectAll(),{ok:true,changed:false};case "copy":{let r=e.copyFlavours();return r.reason?{ok:false,code:"unsupported",reason:r.reason}:(ah(r.text,r.html),{ok:true,changed:false})}case "cut":{let r=e.copyFlavours();if(r.reason)return {ok:false,code:"unsupported",reason:r.reason};ah(r.text,r.html),e.deleteSelection();break}case "paste":{let r=t.html?Fi(t.html):null;if(r&&uc(r.bytes))return {ok:false,code:"unsupported",reason:"unsupported-content"};if(!e.pasteRich(t.text,t.html??null))return {ok:true,changed:false};break}case "pasteWithoutFormatting":e.insertPlainText(t.text);break;case "setSelection":{if("range"in t&&_p(t.range))return e.setSelection(t.range),e.revealPosition(t.range.head,{block:"centerIfNeeded"}),{ok:true,changed:false};let r="anchor"in t&&Et(t.anchor)?{anchor:t.anchor}:"range"in t&&Ko(t.range)?{range:t.range}:null;if(r===null)return {ok:false,code:"unsupported",reason:"unsupported selection form"};let o=HS(e.session.part(),e.session.paragraphAnchors(),r);if(!o.ok)return o;let i=$6(e,o.selection);return i.ok?(e.setSelection(o.selection),e.revealPosition(o.selection.head,{block:"centerIfNeeded"}),{ok:true,changed:false}):i}default:return bs(t)?om(e,t,n?.editor):{ok:false,code:"unsupported",reason:"unsupported command"}}return null}function ZO(e,t){for(let n of e.layout().pages)for(let r of [n.footnotes,n.endnotes])if(r){for(let o of r.notes)for(let i of chunkDOHF6FA7_cjs.ya(o.fragments))if(i.paragraphId===t)return o.scopeId}return null}function _6(e,t){let n=e.layout().pages;for(let r=0;r<n.length;r+=1){let o=n[r];for(let i of [o.header,o.footer])if(i){for(let a of chunkDOHF6FA7_cjs.ya(i.fragments))if(a.paragraphId===t)return {pageIndex:r,sectionIndex:e.sectionAtPage(r).sectionIndex}}}return null}function B6(e,t){return e.kind!==t.kind?false:e.kind==="headerFooter"&&t.kind==="headerFooter"?e.rId===t.rId:e.kind==="notesPart"&&t.kind==="notesPart"?e.noteKind===t.noteKind:true}function $6(e,t){let n=Rt(e.session,t.head.paragraphId,{kind:"body"}),r=Rt(e.session,t.anchor.paragraphId,{kind:"body"});if(!B6(n,r))return {ok:false,code:"unsupported",reason:"a selection cannot span two stories"};let o=e.activeScope();if(n.kind==="body")return o.kind!=="body"&&(e.exitNote?.(),e.exitHeaderFooter?.()),{ok:true,changed:false};if(n.kind==="headerFooter"){if(o.kind==="headerFooter"&&o.rId===n.rId)return {ok:true,changed:false};e.exitNote?.();let l=_6(e,t.head.paragraphId);return e.enterHeaderFooter?.({rId:n.rId,...l?{pageIndex:l.pageIndex,sectionIndex:l.sectionIndex}:{}})?{ok:true,changed:false}:{ok:false,code:"unsupported",reason:"that header or footer could not be opened"}}let i=ZO(e,t.head.paragraphId);return i?(t.anchor.paragraphId===t.head.paragraphId?i:ZO(e,t.anchor.paragraphId))!==i?{ok:false,code:"unsupported",reason:"a selection cannot span two stories"}:o.kind==="note"&&o.id===i?{ok:true,changed:false}:(e.exitHeaderFooter?.(),e.enterNote?.(i)?{ok:true,changed:false}:{ok:false,code:"unsupported",reason:"that note could not be opened"}):{ok:false,code:"notFound",reason:"that note is not laid out"}}var q6=new Set(["toggleMark","setMarkAttr","setAlignment","setParagraphDirection","clearFormatting","setLineSpacing","setParagraphSpacing","setParagraphStyle","setParagraphFormat"]),Vc=class{constructor(t,n,r){this.owner=t;this.diagnose=n;this.target=r;}owner;diagnose;target;records=new WeakMap;undoEpoch=0;burst;diagnoseWrites(t,n,r=false){if(t.type!=="setMarkAttr"||!n.ok||!n.changed)return;let o=`${r}:${t.mark}:${t.attr}:${this.target()}`,i=Date.now(),a=this.burst,s=a?.key===o&&i-a.time<=250?a.count+1:1;this.burst={key:o,time:i,count:s},s===3&&this.diagnose({kind:r?"possible-fragmented-gesture":"possible-ungrouped-gesture",reason:"Three rapid formatting writes started separate groups at the same selection. For a continuous control, retain one handle with bindHistoryGroup; separate clicks may be intentional."});}begin(){let t=this.owner(),n={token:Symbol("gesture"),owner:t?new WeakRef(t):void 0,closed:false,committed:false,undoEpoch:this.undoEpoch},r=K6(n,new WeakRef(this));return this.records.set(r,n),r}owns(t){return t!==void 0&&t===this.owner()}gate(t,n){let r=n?.historyGroup;return r===void 0?null:!this.records.get(r)||r.state!=="open"?{ok:false,code:"unsupported",reason:"historyGroup must be an open handle from this editor and document"}:q6.has(t.type)?null:{ok:false,code:"unsupported",reason:`${t.type} does not support history grouping`}}note(t){(t.type==="undo"||t.type==="redo")&&this.undoEpoch++;}run(t,n,r,o){let i=r?.historyGroup,a=i&&this.records.get(i);if(!a){let m=qs(t,void 0,o);return this.diagnoseWrites(n,m),m}let s=a.committed,l,d,c=chunkOSFOJTHU_cjs.hl(a.token,(m,g)=>{l=m,d=g;},()=>qs(t,a.token,o));if(!c.ok)return c;let p=l===void 0?{kind:"none",reason:"no-history"}:l==="split"||l==="started"&&s?{kind:"split",reason:d??(a.undoEpoch!==this.undoEpoch?"undo-redo":"history-boundary")}:{kind:l};return l&&(a.committed=true,a.undoEpoch=this.undoEpoch),p.kind==="started"?this.diagnoseWrites(n,c,true):this.burst=void 0,p.kind==="split"&&this.diagnose({kind:"split",reason:p.reason??"history-boundary"}),{...c,history:p}}};function K6(e,t){return Object.freeze({get state(){return !e.closed&&t.deref()?.owns(e.owner?.deref())?"open":"closed"},end(){e.closed=true,e.owner=void 0;}})}var UO={selection:null,pendingFormat:null,headerFooter:null,drawingIntent:"none",formatPainter:"off/none"};function GO(e,t){let n=t.headerFooterState?.();return {selection:e.selection,pendingFormat:e.pendingFormat,headerFooter:n?.editing&&n.rId?`${n.editing}:${n.rId}`:null,drawingIntent:iI(t.drawingSelectionIntent()),formatPainter:`${e.formatPainter.mode}/${e.formatPainter.level}`}}function XO(){let e={...UO};return {moved(t,n){let r=GO(t,n),o=Pd(r.selection,e.selection)&&r.pendingFormat===e.pendingFormat&&r.headerFooter===e.headerFooter&&r.drawingIntent===e.drawingIntent&&r.formatPainter===e.formatPainter;return e=r,!o},adopt(t){e=GO(t.state(),t);},reset(){e={...UO};}}}function V6(e,t){let n=e.byteLength;if(n<22)return false;let r=new DataView(e.buffer,e.byteOffset,n),o=Math.max(0,n-(64*1024+22)),i=-1;for(let d=n-22;d>=o;d-=1)if(r.getUint32(d,true)===101010256){i=d;break}if(i<0)return false;let a=r.getUint16(i+10,true),s=r.getUint32(i+16,true),l=0;for(let d=0;d<a;d+=1){if(s+46>n||r.getUint32(s,true)!==33639248)return false;if(l+=r.getUint32(s+24,true),l>=t)return true;s+=46+r.getUint16(s+28,true)+r.getUint16(s+30,true)+r.getUint16(s+32,true);}return false}var j6=2e3,W6=40;function lh(e){if(typeof MessageChannel!="function"){setTimeout(e,0);return}let t=new MessageChannel;t.port1.onmessage=()=>{t.port1.close(),e();},t.port2.postMessage(null);}function YO(e){let t=null,n=()=>{if(!t)return null;let{bytes:r}=t;return t.cancel(),t=null,r};return {shouldYield:r=>typeof requestAnimationFrame=="function"&&typeof cancelAnimationFrame=="function"&&(r.byteLength>=524288||V6(r,524288)),schedule(r){let o=null,i=null,a=e.prepare?()=>e.prepare(r):null,s=false,l=false,d=()=>{if(s)return;if(a){let m=a;a=null;let g;try{g=m();}catch{}if(typeof g=="function"){a=g,lh(d);return}if(!g){o=setTimeout(d,0);return}let b=true,h=()=>{b&&(b=false,o!==null&&clearTimeout(o),o=setTimeout(d,0));};o=setTimeout(h,j6),g.then(h,h);return}l=true,e.mount(r);let p=()=>{if(!(s||t!==u)){if(e.continueOpen&&!e.continueOpen(W6)){lh(p);return}t=null,e.continueOpen&&e.scheduled();}};e.continueOpen?lh(p):t=null;},c=requestAnimationFrame(()=>{i!==null&&clearTimeout(i),i=null,o=setTimeout(d,0);});i=setTimeout(()=>{cancelAnimationFrame(c),d();},250);let u={bytes:r,mounted:()=>l,cancel:()=>{s=true,cancelAnimationFrame(c),o!==null&&clearTimeout(o),i!==null&&clearTimeout(i);}};t=u,e.scheduled();},cancel:n,flush(){let r=t;if(!r)return;let o=r.mounted();if(n(),o||e.mount(r.bytes),e.continueOpen)for(;!e.continueOpen(Number.POSITIVE_INFINITY););o&&e.scheduled();},isScheduled:()=>t!==null}}var ch=40,dh=16,QO=32,uh=new WeakMap;function Z6(e,t,n){let r=chunkOSFOJTHU_cjs.De(e),o=()=>{let i=performance.now()+ch;for(;;){let a=r.next();if(a.done){let s=chunk6JPL6ZAS_cjs.k(a.value,t.reviewModel?{reviewModel:t.reviewModel}:{});return uh.set(e,s),n(s)}if(performance.now()>=i)return o}};return o}function JO(e){let t=uh.get(e);return t===void 0?{}:(uh.delete(e),{openedSession:t,progressiveOpen:true})}function eM(e,t,n){return r=>Z6(r,e(),o=>{let i=o.ok?t(r,o.session):null;return o.ok&&i?z6(o.session,i,n):void 0})}function tM(e){let t=null;return {set(n){t=n;let r=e();r&&Em(r,n);},adopt:n=>Em(n,t)}}function z6(e,t,n){let r=e.part().root.children.find(g=>g.kind==="body"),o=r?.kind==="body"?r.children:[],i=[];for(let g of o){if(g.kind==="table")for(let b of g.children)i.push(b);i.push(g);}let a=[];for(let g=0;g<o.length;){let b=o[g];if(b.kind==="table"){for(let S=0;S<b.children.length;S+=QO){let x=S;a.push(()=>{NE(e,b,x,x+QO);});}a.push(()=>zg(e,[b])),g+=1;continue}let h=g;for(;h<o.length&&h-g<dh&&o[h].kind!=="table";)h+=1;let y=o.slice(g,h);a.push(()=>zg(e,y)),g=h;}let s=0,l=0,d=false,c,u=chunkOSFOJTHU_cjs.Pa(e.part().root),p=[()=>{let g=performance.now()+ch;return u(()=>performance.now()>=g)},()=>(e.reviewItems(),true)],m=()=>{if(!t())return;let g=performance.now()+ch;if(!d){for(;s<a.length&&performance.now()<g;)a[s++]();return s<a.length||(d=true,c=n()),m}if(l<i.length){for(;l<i.length&&performance.now()<g;)chunkDOHF6FA7_cjs.Ee(i.slice(l,l+dh)),l+=dh;return m}let b=p[0];return b?(b()&&p.shift(),m):c};return m}function nM(e){let t=[];return Object.assign(r=>{for(let o of [...e.customNodeDiagnostics,...t])try{o(r);}catch{}},{observe(r){t.push(r);}})}function rM(e,t){t.customNodePayloadNamespaces.length!==0&&e.session.sweepCustomNodePayloads(t.customNodePayloadNamespaces);}function oM(e){return e.kind==="comment"}function iM(e){let{surface:t}=e,n=t?.retainedSelection()??t?.state().selection??null;if(!n)return null;let{anchor:r,head:o}=n;if(r.paragraphId===o.paragraphId&&r.offset===o.offset||!t?.publishedLayout())return null;let i=e.bodyOrder(),a=i.get(r.paragraphId)??-1,s=i.get(o.paragraphId)??-1;if(a===-1||s===-1){let d=e.openStoryOrder();a=d.get(r.paragraphId)??-1,s=d.get(o.paragraphId)??-1;}return a===-1||s===-1?null:a<s||a===s&&r.offset<=o.offset?{from:r,to:o}:{from:o,to:r}}function G6(e){let t=new Map;for(let n of e){let r=n.item;if(!oM(r))continue;let o=t.get(r.id);if(o===void 0){t.set(r.id,r);continue}if(o.comment!==r.comment)return "ambiguous"}return t}function X6(e,t){let n=e.filter(i=>i.key===t);if(n.length===0)return {ok:false,code:"notFound",reason:"no review item with that key"};let r=n.map(i=>i.item).filter(oM);if(r.length===0)return {ok:false,code:"kindMismatch",reason:"the review item is not a comment"};let o=r[0];for(let i of r)if(i.comment!==o.comment)return {ok:false,code:"ambiguous",reason:"duplicate comment records share that key"};return o}function aM(e,t,n){if(!e.reviewEnabled)return {ok:false,code:"unsupported",reason:e.proReviewReason};if(e.editingMode==="viewing")return {ok:false,code:"locked",reason:"the document is open for viewing"};let r=e.placements(),o=X6(r,t);if(!("kind"in o))return o;if(!e.surface)return {ok:false,code:"notFound",reason:"no review item with that key"};let i=G6(r);if(i==="ambiguous")return {ok:false,code:"ambiguous",reason:"duplicate comment records share an id"};let a=o,s=new Set;for(;a.parentId!==void 0&&!s.has(a.id);){s.add(a.id);let c=i.get(a.parentId);if(!c)break;a=c;}let l=false,d=false;return e.surface.commitReviewOps(()=>{let c=e.surface.session.packageRevision();return l=e.surface.session.setCommentResolved(a.id,n),d=l&&e.surface.session.packageRevision()!==c,{committed:d}},"comment-resolve"),l?(d&&e.bump(),{ok:true,changed:d}):{ok:false,code:"notFound",reason:"the comment could not be resolved"}}function sM(e,t,n){return e.kind==="comment"&&e.resolved?{ok:false,code:"unsupported",reason:"a resolved comment takes no replies"}:n.length===0||t.trim().length===0?{ok:false,code:"invalidArgs",reason:"a reply needs both an author and text"}:e.kind==="custom"?{ok:false,code:"unsupported",reason:"a custom node card takes no replies"}:null}var Y6=Object.freeze(["Arial","Calibri","Cambria","Consolas","Courier New","Garamond","Georgia","Helvetica","Open Sans","Roboto","Times New Roman","Verdana"]),Q6=/^[\p{L}\p{N}\p{M} \-.+_,;]{1,64}$/u;function lM(e,t){let n=new Map,r=s=>{if(s===void 0||!Q6.test(s))return;let l=s.toLowerCase();n.has(l)||n.set(l,s);};r(chunkJLVBDYVQ_cjs.g(e));let o=e?.substitutions??[],i=new Set(o.map(s=>s.to.family.toLowerCase()));for(let s of o)r(s.from.family);for(let s of e?.sources??[])i.has(s.request.family.toLowerCase())||r(s.request.family);for(let s of chunkJLVBDYVQ_cjs.a([e?.supportedFamilies]))r(s);for(let s of Y6)r(s);for(let s of t)r(s);let a=[...n.values()];return a.sort((s,l)=>s<l?-1:s>l?1:0),a}var dM=e=>new chunkUKVVUHZL_cjs.a("overLimit",`font source ${e.id} exceeds the font byte budget`,{request:e.request}),cM=e=>new chunkUKVVUHZL_cjs.a(e.reason,e.reason==="overLimit"?"an embedded font exceeds the font byte budget":"an embedded font part declares an invalid family name",{request:e.request});function uM(e,t){return chunkJLVBDYVQ_cjs.A(e,t)}function fh(e,t,n){return chunkJLVBDYVQ_cjs.B(e,t,n)}var fM=Object.freeze({installed:0,alias:()=>{},dispose(){}});function J6(e){let t=0;for(let n of e)for(let r=0;r<n.length;r+=1)t=t*31+n.charCodeAt(r)>>>0;return `docx-embedded-${t.toString(36)}`}var jc=e=>e.trim().toLowerCase();function e_(){let t=(typeof document<"u"?document:void 0)?.fonts;return !t||typeof FontFace>"u"?{}:{fontSet:t,createFontFace:(n,r,o)=>new FontFace(n,r.slice().buffer,o)}}async function pM(e,t=e_(),n=[]){let{fontSet:r,createFontFace:o}=t;if(!r||!o||e.length===0)return fM;let i=new Map;for(let d of e){let c=jc(d.request.family),u=i.get(c);u?u.push(d):i.set(c,[d]);}let a=new Map,s=[];if(await Promise.all([...i].map(async([d,c])=>{let u=J6(c.map(m=>m.hash)),p=false;await Promise.all(c.map(async m=>{try{let g=o(u,m.bytes,{weight:String(m.request.weight),style:m.request.style});await g.load(),r.add(g),s.push(g),p=!0;}catch{}})),p&&a.set(d,u);})),s.length===0)return fM;for(let d of n){let c=jc(d.from.family);if(a.has(c))continue;let u=a.get(jc(d.to.family));u!==void 0&&a.set(c,u);}let l=false;return {installed:s.length,alias:d=>l?void 0:a.get(jc(d)),dispose(){if(!l){l=true;for(let d of s)try{r.delete(d);}catch{}}}}}var mh=44,Zs=.1,zs=5;var ia={type:"fit",fit:"pageWidth",minZoom:.5,maxZoom:1},t_={type:"fit",fit:"pageWidth"},Wc={type:"fixed"};function Zc(e){return e==="auto"?ia:!e||typeof e!="object"?null:e.type==="fixed"?Wc:e.type==="fit"&&e.fit==="pageWidth"?zc(e,ia)?ia:e:null}function zc(e,t){return e===t?true:e.type!==t.type?false:e.type!=="fit"||t.type!=="fit"?true:e.fit===t.fit&&Object.is(e.minZoom,t.minZoom)&&Object.is(e.maxZoom,t.maxZoom)}function gh(e,t,n="float"){return e?.type!=="fit"?t:n==="shrinkPage"?e.minZoom!==void 0&&Number.isFinite(e.minZoom)?ph(e.minZoom):.1:e.maxZoom!==void 0&&e.maxZoom<5?e.maxZoom:null}function aa(e){return e.type==="fit"}function mM({availableWidthPx:e,pageWidthPx:t,gutterPx:n=24,minZoom:r=.1,maxZoom:o=5}){if(!Number.isFinite(e)||e<=0||!Number.isFinite(t)||t<=0)return null;let i=Number.isFinite(n)&&n>0?n:0,a=Math.max(e-2*i,e*.5),s=Number.isFinite(r)?ph(r):.1,l=Number.isFinite(o)?ph(o):5,d=Math.floor(a/t*100)/100;return Math.min(Math.max(d,s),Math.max(l,s))}function ph(e){return Math.min(Math.max(e,.1),5)}var n_=88;function r_(e,t=false){let n=Vt(e);if(!n)return null;let r=n.clientWidth;if(!Number.isFinite(r)||r<=0)return null;let o=n.ownerDocument.defaultView?.getComputedStyle(n);if(t&&n.hasAttribute("data-review-pane")){let s=Number.parseFloat(o?.getPropertyValue("--docx-review-strip")??""),l=Number.isFinite(s)?s:n_,d=l/2,c=Number.parseFloat(o?.getPropertyValue("--docx-nav-shift")??""),u=Number.parseFloat(o?.getPropertyValue("--docx-review-gutter-start")??""),p=(Number.isFinite(c)?c:0)+(Number.isFinite(u)?u:d)-d;return Math.max(r-l-Math.max(p,0),0)}if(!o)return r;let i=Number.parseFloat(o.paddingLeft)||0,a=Number.parseFloat(o.paddingRight)||0;return Math.max(r-i-a,0)}function gM(e){let t=null,n=null,r=null,o=null;function i(){if(r===null)return;n?.ownerDocument.defaultView?.cancelAnimationFrame(r),r=null;}function a(){let l=e.mode();if(!aa(l))return;let d=e.container();if(!d)return;let c=e.reviewPaneScrolls?.()===true&&gh(l,e.zoom())!==null,u=r_(d,c);if(u===null)return;let p=e.pageWidthPx();if(p===null)return;o=e.pageWidthTwips();let m=mM({availableWidthPx:u,pageWidthPx:p,...l.minZoom!==void 0?{minZoom:l.minZoom}:{},...l.maxZoom!==void 0?{maxZoom:l.maxZoom}:{}});if(m===null||m===e.zoom())return;let g=Vt(d),b=g!==null&&g.scrollLeft===0;e.applyZoom(m),b&&g&&g.scrollLeft!==0&&(g.scrollLeft=0);}function s(){let l=n?.ownerDocument.defaultView;if(!l?.requestAnimationFrame){a();return}r===null&&(r=l.requestAnimationFrame(()=>{r=null,a();}));}return {refitIfPageResized(){let l=e.pageWidthTwips();l===null||l===o||a();},attach(){this.detach();let l=e.container();if(!l)return;let d=Vt(l);d&&(n=d,typeof ResizeObserver<"u"&&(t=new ResizeObserver(s),t.observe(d)),a());},refit:a,detach(){i(),t?.disconnect(),t=null,n=null,o=null;}}}function yM(e,t){let n=e.zoom!==void 0&&Number.isFinite(e.zoom)&&e.zoom>=.1&&e.zoom<=5?e.zoom:null,r=n??1,o=Zc(e.zoomMode??(n!==null?Wc:"auto"))??ia;function i(l,d){if(l===r)return d?.(),true;let c=t.surface();return c&&!Tm(c,l*(96/72))?false:(r=l,d?.(),t.bump(),t.emitSelectionChange(),true)}function a(){o=Wc,s.detach();}let s=gM({container:t.container,mode:()=>o,pageWidthPx:()=>{let l=t.surface()?.layout().pages[0]?.box;return l?l.width*(96/72):null},pageWidthTwips:()=>t.surface()?.sectionProperties().pageSize.widthTwips??null,zoom:()=>r,applyZoom:l=>{i(l);},reviewPaneScrolls:()=>t.reviewPaneScrolls?.()===true});return {zoom:()=>r,mode:()=>o,scale:()=>r*(96/72),attach:()=>{aa(o)&&s.attach();},detach:()=>s.detach(),refit:()=>s.refit(),refitIfPageResized:()=>s.refitIfPageResized(),setZoom(l){if(!Number.isFinite(l)||l<.1||l>5)return {ok:false,code:"invalidArgs",reason:`zoom must be between ${.1} and ${5}, got ${l}`};let d=aa(o);return l===r?d?(a(),t.bump(),t.emitSelectionChange(),{ok:true,changed:true}):{ok:true,changed:false}:i(l,d?a:void 0)?{ok:true,changed:true}:{ok:false,code:"unsupported",reason:`the mounted surface could not apply zoom ${l}`}},setZoomMode(l){let d=Zc(l);return d?zc(d,o)?{ok:true,changed:false}:(o=d,aa(d)?s.attach():s.detach(),t.bump(),t.emitSelectionChange(),{ok:true,changed:true}):{ok:false,code:"invalidArgs",reason:`unknown zoom mode ${JSON.stringify(l)}`}}}}function hM(e){let t=1.3333333333333333;return {x:e.x*t,y:e.y*t,width:e.width*t,height:e.height*t}}function bM(e,t){return {getZoom:()=>e.zoom(),setZoom:n=>e.setZoom(n),getZoomMode:()=>e.mode(),setZoomMode:n=>e.setZoomMode(n),getRenderScale:()=>e.scale(),getPageGeometry:()=>{let n=t();return n?n.layout().pages.map(r=>({index:r.index,box:hM(r.box),contentBox:hM(r.contentBox)})):[]}}}var vM=new Map;function xM(e){let t=e,n=null,r=null;return {current:()=>t,set:o=>{t=o;},authorsFor:o=>{if(n&&n.slots===o&&n.colors===t)return n.value;let i=chunkCAJEXXVG_cjs.c(o,t);return n={slots:o,colors:t,value:i},i},styleFor:o=>((!r||r.colors!==t)&&(r={colors:t,value:chunkCAJEXXVG_cjs.b(t)}),r.value.get(o))}}function hh(e){let t=[];return {current:()=>t[t.length-1]??e,push:n=>(t.push(n),()=>{let r=t.lastIndexOf(n);r>=0&&t.splice(r,1);})}}function wM(e){let t=chunkOSFOJTHU_cjs.Ni(e),n=new Intl.Locale(t).baseName;for(;n&&!Object.hasOwn(i18n.locales,n);){let s=n.lastIndexOf("-");n=s<0?"":n.slice(0,s);}let r=new Intl.Locale(t).maximize(),o=n?void 0:Object.keys(i18n.locales).find(s=>{let l=new Intl.Locale(s).maximize();return l.language===r.language&&l.script===r.script}),i=n||o||"en",a=i18n.createT(i18n.deepMerge(i18n.en,i==="en"?void 0:i18n.locales[i]),i);return {locale:t,labels:{title:a("toolbar.tableOfContents")}}}function SM(e){let t=e.mode,n=e.translate,r=n?chunkCAJEXXVG_cjs.l(n):chunkCAJEXXVG_cjs.k,o=wM(e.locale);return {mode:()=>t,modeForGate:()=>t??"edit",openingModeDecision:i=>jp(t,i),setMode(i){return t===i?false:(t=i,true)},translate:()=>n,drawingStrings:()=>r,setTranslate(i){if(n===i)return null;n=i;let a=i?chunkCAJEXXVG_cjs.l(i):chunkCAJEXXVG_cjs.k;return chunkCAJEXXVG_cjs.j(r)===chunkCAJEXXVG_cjs.j(a)?(r=a,null):(r=a,r)},locale:()=>o.locale,tocLabels:()=>o.labels,setLocale(i){let a=wM(i);return o.locale===a.locale?null:(o=a,o.labels)}}}function IM(e,t){return {setTranslate(n){let r=e.setTranslate(n);t.surface()?.setTranslate(e.translate()),r!==null&&(t.surface()?.setDrawingStrings(r),t.bump(),t.emitSelectionChange());},setLocale(n){let r=e.setLocale(n);r!==null&&(t.surface()?.setLocale(e.locale()),t.surface()?.setTocLabels(r),t.bump(),t.emitSelectionChange());}}}var s_=Object.freeze({kind:"body"}),l_=Object.freeze([]);function d_(e){let t,n=null,r=null,o=-1,i=()=>r!==null||!!E&&Cs(E),a=SM(e),s=Km(e.author),l=e.container??null,d=chunkV3N4SOAK_cjs.a(e.modules),c=nM(d),u=d.review!==null,p=kO(d.review?.pane,{enabled:u,changed:(M,Q)=>{_e&&M.revisionsIn!==Q.revisionsIn&&!p.shows(E?.session.reviewItems()??[])&&(_e=false),Oe(),We(),Zt.refit();}}),m=null,g=new WeakMap,b=YO({mount:M=>ai(M),continueOpen:M=>{if(!E)return true;let Q=nt.continueOpen(()=>Om(E,M));return Q&&nt.openSettled(E),Q},prepare:eM(()=>Yg(d,c),(M,Q)=>n===M?null:(r=Q,()=>r===Q),()=>se.schedule(true)),scheduled:()=>{Oe(),We();}}),h=a.mode()==="view"?"viewing":"editing",y=null,S,x=false,I=ac(),R=xM(e.revisionStyles),T=chunkCAJEXXVG_cjs.e(),P=false,O=false,v=null,C=()=>({reviewEnabled:u,hasAuthor:!!s}),L=false,A=null,q=jS({stillMissing:()=>!N&&s===void 0&&pr(null)===ir,emit:M=>po(M)}),K=a.openingModeDecision(C());K.mode!==null&&(h=K.mode),K.rejection!==null&&(v=K.rejection),q.report(K.rejection);let E=null,_=null,X=tM(()=>E),z=null,oe=null,j=XO(),me=aE(),U=hh({}),F=hh({}),N=false,B,$,G=null,H=()=>{},W=0;function Z(){G?.dispose(),G=null;}let re=0,ne,ee=()=>typeof e.fonts=="function"?ne:e.fonts,se=_E(()=>{let M=r??E?.session;if(N||!M)return null;let Q=r?void 0:Gn().formatting?.fontFamily;return {generation:re,dynamic:typeof e.fonts=="function",families:()=>HE(M,Q,chunkJLVBDYVQ_cjs.g(ee()))}},async M=>{let Q=r?{session:r}:E;Q&&await sa(re,Q,M);}),fe=false,Ce=null,Ee=M=>(Ce||(Ce=CE(l?Ui(l.ownerDocument):null)),Ce(M)),at=new Set,ot=new Set,Ne=M=>at.has(M.toLowerCase())||G?.alias(M)!==void 0,Te=()=>!E||fe?l_:OE(E.session.renderedFontFamilies(),Ne,Ee,ot),Pt=0,st=null,Ye,He=null,Ae=-1,ye=0,Fe=-1,_e=false,Se=e.reviewDisplayMode??(u?"all-markup":"proposed");if(!["all-markup","simple-markup","proposed","original"].includes(Se))throw new TypeError("Invalid reviewDisplayMode");if(e.reviewDisplayMode&&e.reviewDisplayMode!=="proposed"&&!u)throw new TypeError("reviewDisplayMode requires a review module");let fo=sc({fieldResults:e.fieldResults,collaborationModel:d.collaboration??void 0}),cr=WE(M=>{E?.setShowParagraphMarks(M),Oe(),We();}),ze=SO({surface:()=>E,destroyed:()=>N,editingMode:()=>h,hostViewOnly:()=>a.mode()==="view",publish:()=>{Oe(),We();},decision:()=>Yn(),tracking:fr,adopt:M=>{v=M.rejection??pr(null),M.mode!==null&&(O=M.mode==="viewing",Mn(M.mode)),Oe(),We();}});function Oe(){Pt+=1;}let Jt=ZC(Gn),{emitError:po,emitDocumentChange:ct,emitSelectionChange:We}=Jt,nt=oE({modules:d,events:Jt,customNodes:c}),mo=()=>h==="suggesting",Cn=sE(e.revisionMarkup,{container:()=>l,destroyed:()=>N,contribution:()=>d.review,translate:()=>a.translate(),apply:M=>{E?.setRevisionMarkup(M),Oe();},changed:M=>{We(),Jt.emitRevisionMarkupChange(M);}});function $r(){Cn.destroyDialog(),oe?.(),oe=null,E?.destroy(),E=null,j.reset(),ye+=1;}let Zt=yM(e,{container:()=>l,surface:()=>E,bump:Oe,emitSelectionChange:We,reviewPaneScrolls:()=>p.current().overflow==="scroll"}),pn=()=>Zt.scale(),En=uO({surface:()=>E,container:()=>l,flushOpen:()=>b.flush()});function ai(...M){let Q=t?.source!==void 0;try{if(n===M[0]){n=null,go(M[0],!0);return}Gs(...M),t?.mounted(M[0]);}catch(te){if(nt.openCrashed(te),t?.mounted(M[0],te),!Q)throw te}}function Gs(M,Q,te){if(te??=g.get(M),g.delete(M),r=null,!l){m=M,te&&g.set(M,te),z=null,nt.openDeferred(),Oe();return}nt.openMounting(),$r();let we=I.stateKey,ve=Ag(l,M,{scale:pn(),showParagraphMarks:cr.get(),onToggleParagraphMarks:cr.toggle,defaultFontFamily:chunkJLVBDYVQ_cjs.g(ee()),translate:a.translate(),drawingStrings:a.drawingStrings(),locale:a.locale(),...s?{author:s}:{},...R.current()!==void 0?{revisionStyles:R.current()}:{},reviewAuthorSlots:T,revisionAuthorVisibility:I,initialSelection:Q,initialTextFormInput:te,editingMode:h==="suggesting"?"suggest":h==="viewing"?"view":"edit",revisionDisplayMode:u?Se:"proposed",revisionMarkup:Cn.current(),...Yg(d,c),onRejection:ke=>nt.inputRejected(ke,mo()),onTiming:(ke,Ze)=>nt.timing(ke,Ze,E??void 0),...JO(M),...B?{measurer:B,...$?{producer:$}:{}}:{},...G?{fontAlias:G.alias}:{},...e.tableInteractionLabel?{tableInteractionLabel:e.tableInteractionLabel}:{},...e.imageDecodePort?{imageDecodePort:e.imageDecodePort}:{},...d.collaboration?{collaborationModel:d.collaboration}:{},...fo.mode==="editable"?{fieldResults:fo.mode}:{},onHyperlinkPopover:ke=>U.current().onPopover?.(ke),...me.surfaceOptions,onRequestHyperlink:()=>U.current().onRequest?.(),onEquationPopover:ke=>F.current().onPopover?.(ke),onTrackedChange:()=>{_e||!p.opensOnTrackedChange()||(_e=true,Oe(),We());},tocLabels:a.tocLabels(),onChange:ke=>{if(!E)return;Oe(),ze.sync(),se.schedule();let Ze=u&&Se!==E.revisionDisplayMode();Ze&&(Se=E.revisionDisplayMode());let ae=we!==I.stateKey||Ze;we=I.stateKey,!(!ae&&!j.moved(ke,E))&&We();}});if(!ve.ok){z=ve.detail?`${ve.reason}: ${ve.detail}`:ve.reason,Oe(),po(fn(ve.reason,`failed to open document: ${ve.reason}`)),nt.openRejected(ve.reason,ve.limit,ve.detail);return}z=null,E=ve.surface,o=re,En.attach(E,t?.source!==void 0),ze.prime(),_e=u&&p.opensOnLoad(E.session.reviewItems()),j.adopt(E),A!==null?mr(A,false):ci(),rM(E,d),Cs(E)||nt.openSettled(E),ye+=1,E.setEditable(h!=="viewing"),_!==null&&E.setRemoteCaretLabelHost(_),X.adopt(E),y!==null&&E.setReviewActivationExclusions(y,{formattingKinds:S}),oe=ve.surface.session.subscribe(ke=>{let Ze={revision:ve.surface.session.packageRevision(),created:ke.created,deleted:ke.deleted,dirty:ke.dirty};Zt.refitIfPageResized(),Oe(),ct(Ze);}),t?.contentMounted(M),Zt.attach(),Oe(),ct({revision:E.session.packageRevision(),source:t?.source??"load"}),We(),se.schedule(true);}function go(M,Q=false){if(b.cancel(),r=null,n=null,t?.source&&!Q&&l&&b.shouldYield(M)){n=M,b.schedule(M);return}if(g=new WeakMap,nt.openStarted(M),_e=false,re+=1,T=chunkCAJEXXVG_cjs.e(),I.showAll(),B=void 0,$=void 0,ne=void 0,at=new Set,ot=new Set,Z(),H(),H=()=>{},fe=false,l&&!t?.source){let te=Vt(l);te&&(te.scrollTop=0,te.scrollLeft=0);}!Q&&l&&b.shouldYield(M)?($r(),b.schedule(M)):ai(M);}function ur(M){iE(M,{config:e,events:Jt,diagnostics:nt});}async function sa(M,Q,te){let we=e.fonts,ve=Q.session.embeddedFonts();if(!(!we&&ve.length===0)){fe=true,Oe();try{let{plan:ke,request:Ze}=chunkJLVBDYVQ_cjs.y(Q.session,te,ee()),ae=typeof we!="function"?we:ne?await chunkJLVBDYVQ_cjs.n([ne,chunkJLVBDYVQ_cjs.j(Qe=>we(Qe))],Ze,{onOriginFailure:({cause:Qe})=>ur(Mi(Qe))}):await we(Ze),Re=typeof we=="function"?chunkJLVBDYVQ_cjs.b(ae):ae;if(N||M!==re){M===re&&(fe=!1);return}if(ne=ae,ve.length===0&&(!Re||ae?.supportedFamilies?.length&&!chunkJLVBDYVQ_cjs.b(ae))){fe=!1,Oe(),We();return}let je=(Re&&"maxFontBytes"in Re?Re.maxFontBytes:void 0)??chunkDOHF6FA7_cjs.a,rt=uM(Re?.sources??[],je),an=rt.sources;for(let Qe of rt.dropped)ur(dM(Qe));let At=fh(ve,an,je),gr=!1,hr=()=>{if(!gr){gr=!0;for(let Qe of At.dropped)ur(cM(Qe));}},Tt=chunkJLVBDYVQ_cjs.z(chunkJLVBDYVQ_cjs.f({epoch:M,...Re,sources:an},At),ke);if(Tt.sources.length===0){hr(),fe=!1,Oe(),Re&&ur(new chunkUKVVUHZL_cjs.a("missing","the supplied font configuration contains no usable sources; the fixed measurer stays in effect"));return}let Dt=await as(Tt),zt=()=>!N&&M===re?!1:(chunkD7ZMDMPX_cjs.s(Dt),M===re&&(fe=!1),!0);if(zt())return;let yo=Qe=>{hr(),Qe&&chunkD7ZMDMPX_cjs.s(Qe),fe=!1,Oe();},yr=(Qe,mt)=>{let An=new Set;for(let mn of mt.sources??[]){let bt=Qe.fonts.resolve(mn.request);bt instanceof chunkDOHF6FA7_cjs.d&&(ur(Mi(bt)),An.add(chunkDOHF6FA7_cjs.h(mn.request)));}return An},Kr=yr(Dt,Tt);try{if(Kr.size>0){let Qe=an.filter(vo=>!Kr.has(chunkDOHF6FA7_cjs.h(vo.request))),mt=Qe.length!==an.length;mt&&(At=fh(ve,Qe,je));let An=At.sources.filter(vo=>mt||!Kr.has(chunkDOHF6FA7_cjs.h(vo.request))),mn=Dt;if(Tt=chunkJLVBDYVQ_cjs.z(chunkJLVBDYVQ_cjs.f({epoch:M,...Re,sources:Qe},{sources:An}),ke),Tt.sources.length===0)return yo(mn);if(Dt=await as(Tt),chunkD7ZMDMPX_cjs.s(mn),zt())return;let bt=yr(Dt,Tt);if(bt.size>0){let vo=Qe.filter(ui=>!bt.has(chunkDOHF6FA7_cjs.h(ui.request))),Uc=At.sources.filter(ui=>!bt.has(chunkDOHF6FA7_cjs.h(ui.request))),lt=Dt;if(Tt=chunkJLVBDYVQ_cjs.z(chunkJLVBDYVQ_cjs.f({epoch:M,...Re,sources:vo},{sources:Uc}),ke),Tt.sources.length===0)return yo(lt);if(Dt=await as(Tt),chunkD7ZMDMPX_cjs.s(lt),zt())return}}}finally{hr();}let ca=Tt.sources.map(Qe=>{let mt=Dt.fonts.resolve(Qe.request);return mt instanceof chunkDOHF6FA7_cjs.d||mt.id!==Qe.id?null:{request:Qe.request,id:mt.id,bytes:mt.bytes,hash:mt.hash,faceIndex:mt.faceIndex}}).filter(Qe=>Qe!==null),br=await pM(ca,void 0,Tt.substitutions??[]);if(N||M!==re){br.dispose(),zt();return}let bo={embeddedFaces:G,coveredFontFamilies:at,documentSubstitutedFamilies:ot,shapedMeasurer:B,shapedProducer:$,disposeShapedFonts:H};try{G=br,at=ME(ca,Tt.substitutions??[]),ot=chunkJLVBDYVQ_cjs.w(Tt,ke,Dt.fonts);let Qe=chunkD7ZMDMPX_cjs.S(pn(),{context:l?Ui(l.ownerDocument):null,...G?{fontAlias:G.alias}:{}}),mt=PE(Dt,Tt,Qe,pn(),++W);if(B=mt.measurer,$=mt.producer,fe=!1,E&&o===M&&oR(E,{measurer:B,producer:$,fontAlias:G?.alias,defaultFontFamily:chunkJLVBDYVQ_cjs.g(ee())}),N||M!==re){br.dispose(),chunkD7ZMDMPX_cjs.s(Dt);return}}catch(Qe){throw !N&&M===re&&({embeddedFaces:G,coveredFontFamilies:at,documentSubstitutedFamilies:ot,shapedMeasurer:B,shapedProducer:$,disposeShapedFonts:H}=bo),br.dispose(),chunkD7ZMDMPX_cjs.s(Dt),Qe}H=()=>chunkD7ZMDMPX_cjs.s(Dt),bo.disposeShapedFonts(),bo.embeddedFaces?.dispose(),Oe(),We();}catch(ke){if(N||M!==re)return;fe=false,Oe(),ur(Mi(ke));}}}let en=Lp();function si(){let M=E?.state()??null;return {scope:E?.activeScope?.()??s_,isLoading:z===null&&E===null&&m===null&&!b.isScheduled(),isOpening:b.isScheduled()&&!t?.source,parseError:z,editable:E!==null&&E.session.editable&&a.mode()!=="view"&&h!=="viewing"&&!(l&&Wn(l)),zoom:Zt.zoom(),zoomMode:Zt.mode(),selection:Md(E),selectionCollapsed:M===null||M.selection.anchor.paragraphId===M.selection.head.paragraphId&&M.selection.anchor.offset===M.selection.head.offset,formatting:hI(E),table:Fd(E),tocContext:en(M?.contextTocId??null),image:ar(E),page:{current:lm(E),total:qi(E)},canUndo:M?.canUndo??false,canRedo:M?.canRedo??false,pageSetup:yI(b,E),reviewPaneOpen:_e,reviewPane:p.current(),showParagraphMarks:cr.get(),documentProtection:ze.state(),revisionMarkup:Cn.current(),reviewDisplayMode:E&&u?E.revisionDisplayMode():Se,hasReviewContent:E?.session.hasReviewContent()??false,hiddenReviewAuthors:I.hiddenAuthorList,collaborationStatus:M?.collaborationStatus??"inactive",editingMode:h,lastRejection:v??M?.lastRejection??null,fontSubstitutions:Te(),formatPainter:M?.formatPainter??wd}}let li;function Gn(){if(st&&Fe===Pt)return st;let M=st,Q=ee()===li;li=ee();let te=s===Ye;Ye=s;let we=E?.state().selection??null,ve=Pd(we,He);He=we;let ke=E?.session.packageRevision()??-1,Ze=ke===Ae;Ae=ke;let ae=si(),Re=ae;if(M){let je=Op(ae.formatting,M.formatting)?M.formatting:ae.formatting,rt=Mp(ae.page,M.page)?M.page:ae.page,an=Ap(ae.pageSetup??null,M.pageSetup??null)?M.pageSetup:ae.pageSetup,At=Fp(ae.selection,M.selection)?M.selection:ae.selection,gr=cI(ae.image,M.image)?M.image:ae.image,hr=M.fontSubstitutions!==void 0&&ae.fontSubstitutions!==void 0&&M.fontSubstitutions.length===ae.fontSubstitutions.length&&ae.fontSubstitutions.every((Tt,Dt)=>M.fontSubstitutions[Dt]===Tt)?M.fontSubstitutions:ae.fontSubstitutions;Re={...ae,formatting:je,page:rt,pageSetup:an,selection:At,image:gr,fontSubstitutions:hr},Np(Re,M)&&ve&&Ze&&te&&Q&&(Re=M);}return st=Rd(Re),Fe=Pt,st}if(e.document){let M=Bp(e.document);M?go(M):(z=$p(e.document),po(fn("unsupported",z)),nt.openRejected("unsupported"));}let Xs=UR({surface:()=>E,activeKey:rn,paneOpen:()=>_e,selectionAnchor:()=>da()?.anchorY??null,authorFilterKey:()=>I.stateKey});function Ys(M){return chunkOSFOJTHU_cjs.zj(M)===null||M.kind==="custom"&&!M.carded?false:!(M.kind==="revision"&&y!==null&&y.includes(M.revisionKind)&&(M.revisionKind!=="format"||S===void 0||S.includes(M.formattingKind??"")))}let la=PO();function tn(M){let Q=chunkOSFOJTHU_cjs.zj(M)?.partName;if(!Q||!E||Q===E.session.part().name)return null;for(let te of E.session.headerFooterResolutionBySection())for(let we of ["header","footer"]){let ve=we==="header"?te.headers:te.footers;for(let ke of ve.values())if(ke.partName===Q)return {kind:we,rId:ke.rId}}return null}function Xn(M){let Q=chunkOSFOJTHU_cjs.zj(M),te=E?.publishedLayout();return !Q||!te?null:EO(te).get(Q.start.paragraphId)??null}function Qs(M){let Q=chunkOSFOJTHU_cjs.zj(M)?.partName;if(!Q||!E)return null;for(let te of ["footnote","endnote"])if(chunkOSFOJTHU_cjs.ch(E.session.currentPackage(),te)?.name===Q)return {kind:"notesPart",noteKind:te};return null}function Ft(M){let Q=tn(M);return Q!==null?{kind:"headerFooter",rId:Q.rId}:Qs(M)??{kind:"body"}}let Js=()=>`${new Date().toISOString().slice(0,19)}Z`;function On(){return iM({surface:E,bodyOrder:()=>{let M=E?.publishedLayout();return M?OO(M):new Map},openStoryOrder:It})}function Lt(){let M=E?.activeScope();if(M?.kind==="headerFooter")return {kind:"headerFooter",rId:M.rId};if(M?.kind==="note"){let Q=chunkOSFOJTHU_cjs.pc(M.id);if(Q)return {kind:"notesPart",noteKind:Q.noteKind}}return {kind:"body"}}function di(M){if(!E)return {kind:"body"};let Q=M.slice(0,M.indexOf("#"));if(Q.length===0||Q===E.session.part().name)return {kind:"body"};for(let te of E.session.headerFooterResolutionBySection())for(let we of [te.headers,te.footers])for(let ve of we.values())if(ve.partName===Q)return {kind:"headerFooter",rId:ve.rId};for(let te of ["footnote","endnote"])if(chunkOSFOJTHU_cjs.ch(E.session.currentPackage(),te)?.name===Q)return {kind:"notesPart",noteKind:te};return Lt()}function It(){if(!E)return new Map;let M=Lt();if(M.kind==="body")return new Map;let Q=new Map;for(let[te,we]of E.session.paragraphIdsIn(M).entries())Q.set(we,te);return Q}function el(M){if(M.kind==="revision"){let te=M.ranges;if(te.length===0)return null;let ve=M.revisionKind==="replace"||M.revisionKind==="insert"||M.revisionKind==="delete"?te[te.length-1]:te[0];return {start:te[0].start,end:ve.end}}let Q=chunkOSFOJTHU_cjs.zj(M);return Q?{start:Q.start,end:Q.end}:null}function da(){if(E&&E.activatedReviewKey()!==null)return null;let M=On(),Q=E?.publishedLayout();if(!M||!Q)return null;let te=la(Q).get(M.from.paragraphId);return te?{pageIndex:te.pageIndex,anchorY:te.contentY+chunkD7ZMDMPX_cjs.X(te,M.from.paragraphId,M.from.offset)}:null}function rn(){return E?.activeReviewKey()??null}function on(M){if(!u)return [];let Q=qE(jm(E?.session.reviewItems()??[],I),M),te=M?.placement!==false,we=null;if(te&&Q.length>0){let ae=E?.publishedLayout()??null;ae&&(we=la(ae));}let ve=rn(),ke=ae=>{let Re=tn(ae);return Re===null?1:Re.kind==="header"?0:2},Ze=Q.map((ae,Re)=>({item:ae,position:Re,pageIndex:we?chunkD7ZMDMPX_cjs.Z(ae,we)?.pageIndex??null:null,group:ke(ae)}));return Ze.sort((ae,Re)=>{let je=ae.pageIndex??Number.MAX_SAFE_INTEGER,rt=Re.pageIndex??Number.MAX_SAFE_INTEGER;return je!==rt?je-rt:ae.group!==Re.group?ae.group-Re.group:ae.position-Re.position}),Ze.map(({item:ae})=>{let Re=chunkOSFOJTHU_cjs.xj(ae),je=we?chunkD7ZMDMPX_cjs.Z(ae,we):null,rt={key:Re,id:ae.id,...Qg(ae)!==void 0?{date:Qg(ae)}:{},activatable:Nc(ae).every(Ys),anchorY:je?.y??null,pageIndex:je?.pageIndex??null,isActive:Nc(ae).some(an=>chunkOSFOJTHU_cjs.xj(an)===ve)};return ae.kind==="comment"?{...rt,kind:"comment",author:ae.comment.author,initials:chunkOSFOJTHU_cjs.Oj(ae.comment),text:chunkOSFOJTHU_cjs.Mj(ae.comment),resolved:ae.resolved,...ae.parentId!==void 0?{parentId:ae.parentId}:{},...ae.parentRevisionId!==void 0?{parentRevisionId:ae.parentRevisionId}:{},replyIds:ae.replyIds,readOnly:false,item:ae}:ae.kind==="revision"?{...rt,kind:"revision",revisionKind:ae.revisionKind,author:ae.author,initials:KR(ae.author),text:chunkOSFOJTHU_cjs.lb(ae.text),...ae.replacedText?{replacedText:chunkOSFOJTHU_cjs.lb(ae.replacedText)}:{},replyIds:ae.replyIds,readOnly:ae.readOnly||XS(E),item:ae}:{...rt,kind:"custom",author:"",initials:"",text:ae.detail??ae.text,replyIds:[],readOnly:true,item:ae}})}function fr(){return E?.session.trackingSettings()??chunkOSFOJTHU_cjs.gi}function Yn(M=h,Q=P){let te=fr();return Zp({...C(),viewOnly:a.mode()==="view",hostChoseMode:a.mode()!==void 0,readerChoseMode:Q,currentMode:M,trackRevisions:te.trackRevisions,restrictedToTrackedChanges:te.restrictedToTrackedChanges,restrictedToForms:te.restrictedToForms,restrictedToReadOnly:te.restrictedToReadOnly,restrictedToComments:te.restrictedToComments,engineAdoptedViewing:O})}function Mn(M){A=null,h=M,E?.setEditingMode(M==="suggesting"?"suggest":M==="viewing"?"view":"edit"),E?.setEditable(M!=="viewing");}function pr(M){return M!==null?M:h==="suggesting"&&s===void 0?ir:L?ir:P?null:a.openingModeDecision(C()).rejection}function ci(){let M=Yn();v=pr(M.rejection),M.mode!==null&&(O=M.mode==="viewing",Mn(M.mode));}function mr(M="editing",Q=true){if(b.isScheduled()){A=M;return}A=null;let te=ZS(a.mode(),C(),fr(),h,M,O);O=te.mode==="viewing"&&a.mode()!=="view",te.mode!==h&&Mn(te.mode),v=pr(te.rejection),q.report(te.configurationRejection),Q&&(Oe(),We());}function be(M){return a.mode()==="view"&&M!=="viewing"?{ok:false,code:"locked",reason:"this document was opened for viewing"}:(M==="suggesting"?Wp(C()):null)??zp(fr(),M)}let Qn=jE({surface:()=>E,enabled:()=>u,destroyed:()=>N,viewing:()=>h==="viewing",placements:on,visible:()=>jm(E?.session.reviewItems()??[],I),scope:Ft,reveal:M=>Jt.emitReviewItemReveal(Xg(on,M)),activate:(M,Q)=>{x=Q??false;try{return Nt.setActiveReviewItem(M,{announce:!1})}finally{x=false;}},setDisplayMode:M=>{Se=M,E?.setRevisionDisplayMode(M),Oe(),We();},report:{diagnostics:nt,tracked:()=>h==="suggesting"}}),{resolveReviewItem:ho}=Qn,qr=new Vc(()=>E,Jt.emitHistoryDiagnostic,()=>JSON.stringify(E?.state().selection)),Nt={beginHistoryGroup(){return b.flush(),qr.begin()},get mountGeneration(){return ye},get surface(){return E&&Cs(E)?null:E},...me.setters,setHyperlinkChrome:U.push,setEquationChrome:F.push,stateVersion:()=>Pt,fontMeasurement:()=>({measurer:B&&!i()?"shaped":"fixed",resolving:fe||i(),...B&&$&&!i()?{producer:$}:{}}),attach(M){if(l!==M&&t?.invalidate(),N){po(fn("destroyed","this editor was destroyed; create a new instance to remount"));return}if(E&&l===M)return;if(E){E.flushPendingInput(),m=E.session.save();let we=l?Fm(l):void 0;we&&g.set(m,we),$r();}let Q=b.cancel();Q&&(m=Q),Zt.detach(),l=M,Ce=null;let te=m;m=null,te&&b.shouldYield(te)?b.schedule(te):te?ai(te):Oe();},detach(){if(t?.invalidate(),N)return;Zt.detach();let M=b.cancel();if(E){E.flushPendingInput(),m=E.session.save();let Q=l?Fm(l):void 0;Q&&g.set(m,Q),$r();}M&&(m=M),l=null,Ce=null,Oe();},load(M){let Q=Bp(M);if(!Q){po(fn("unsupported",$p(M))),nt.openRejected("unsupported");return}t?.invalidate(),En.reset(),go(Q);},save(){return b.flush(),ER(E,l,()=>E)},getDocumentHandle(){return Object.freeze({revision:E?.session.packageRevision()??0})},exec(M,Q){if(l&&Wn(l))return {ok:false,code:"unsupported",reason:"An external document refresh is in progress."};if(b.flush(),M.type==="openRevisionMarkupDialog")return Cn.open();let te=qr.gate(M,Q);if(te)return te;qr.note(M);let we=Jg(M,N,u,be);if(N&&we&&!we.ok)return we;if(M.type==="setEditingMode"){let rt=be(M.mode);return rt!==null?(rt.reason===ir&&(L=true,v=rt.reason,q.report(rt.reason),Oe(),We()),rt):(P=true,L=false,v=null,Mn(M.mode),Oe(),We(),{ok:true,changed:false})}if(M.type==="toggleParagraphMarks")return cr.toggle(),{ok:true,changed:false};if(M.type==="toggleReviewPane")return u?(_e=!_e,Oe(),We(),{ok:true,changed:false}):{ok:false,code:"unsupported",reason:Qt};let ve=ze.exec(M);if(ve)return ve;let ke=Qn.exec(M);if(ke)return ke;if(Vg(M))return xE(M,E,jg(h),Q);let Ze=Vo(M);if(h==="viewing"&&Ze.supported&&Ze.mutating)return {ok:false,code:"locked",reason:"the document is open for viewing"};let ae=xs(M,E,a.modeForGate(),Q);if(!ae.ok)return ae.refusal;let Re=E,je=Re.session.packageRevision();return qr.run(Re,M,Q,()=>{let rt=zO(Re,M,{...ae.tablePlan?{admittedTablePlan:ae.tablePlan}:{},editor:Nt});return rt||{ok:true,changed:Re.session.packageRevision()!==je}})},can(M,Q){if(l&&Wn(l))return {ok:false,code:"unsupported",reason:"An external document refresh is in progress."};if(M.type==="openRevisionMarkupDialog")return Cn.canOpen();let te=qr.gate(M,Q);if(te)return te;if(M.type==="insertImage"||M.type==="replaceImage"){if(N)return {ok:false,code:"notFound",reason:"the editor was destroyed"};if(Q?.scope){let Re=xs(M,E,a.modeForGate(),Q);if(!Re.ok)return Re.refusal}return gI(M,E)}let we=Jg(M,N,u,be);if(we)return we;let ve=ze.can(M);if(ve)return ve;let ke=Qn.can(M);if(ke)return ke;if(Vg(M))return Wg(M,E,jg(h),Q);let Ze=Vo(M);if(h==="viewing"&&Ze.supported&&Ze.mutating)return {ok:false,code:"locked",reason:"the document is open for viewing"};let ae=xs(M,E,a.modeForGate(),Q);if(!ae.ok)return ae.refusal;if(M.type==="proposeInsertion"||M.type==="proposeDeletion"||M.type==="proposeReplacement"){if(!(M.author??s??"").trim())return {ok:false,code:"invalidArgs",reason:`${M.type} requires a non-empty author`};let je=M.target===void 0?{ok:true,selection:E.state().selection}:qc(E,M.target);if(!je.ok)return je;let{anchor:rt,head:an}=je.selection,At=rt.paragraphId===an.paragraphId&&rt.offset===an.offset,gr=M.type==="proposeReplacement"&&M.target===void 0&&E.state().cellSelection!==null;if(M.type!=="proposeInsertion"&&At&&!gr)return {ok:false,code:"invalidArgs",reason:`${M.type} needs a non-collapsed selection`}}if(bs(M)&&em(M)){let Re=vs(Nt);if(Re){let je=tm(Nt,M,Re);if(je)return je}}return {ok:true}},isActive(M){return M.type==="toggleParagraphMarks"?cr.get():M.type==="toggleDocumentProtection"?ze.isActive():M.type==="setReviewDisplayMode"?Se===M.mode:M.type==="toggleReviewPane"?_e:M.type==="setEditingMode"?h===M.mode:ZE(M,E?Gn().formatting:null,Q=>E?.isListActive(Q)??false)},getDocumentStyles:()=>E?.session.documentStyles()??[],getDocumentFonts:()=>E?.session.documentFonts()??[],getAvailableFonts:()=>lM(ee(),E?.session.documentFonts()??[]),getDocumentThemeColors:()=>E?.session.documentThemeColors()??[],getOutline:()=>E?.session.documentOutline()??[],getComments:()=>[],getSelectionFormatting:()=>SI(E?Gn().formatting:null),findMatches:((M,Q)=>{let te={...Q?.matchCase!==void 0?{matchCase:Q.matchCase}:{},...Q?.wholeWord!==void 0?{wholeWord:Q.wholeWord}:{},...E?{stories:zE(E,h)}:{}};if(typeof M=="string")return ih(E?.session.findText(M,te),En.noteMatches);let we=E?.session.findText(M,te);return M.map((ve,ke)=>ih(we?.[ke],En.noteMatches))}),selectMatch(M){return b.flush(),E?UE(E,M):{ok:false,code:"notFound",reason:"no document is loaded"}},getSelectedImage:()=>Gn().image,getSelectedTable:()=>wI(E),getTableCellSelection:()=>{let M=E?.state().cellSelection;return M?{tableId:M.tableId,rows:M.rows,columns:M.columns,cellIds:M.cellIds}:null},setTableInteractionLabel(M){E?.setTableInteractionLabel(M);},canExecuteImageCommand(M,Q){if(N)return {ok:false,code:"notFound",reason:"the editor was destroyed"};if(Q?.scope){let te=xs(M,E,a.modeForGate(),Q);if(!te.ok)return te.refusal}return rm(M,E)},executeImageCommand(M){return N?Promise.resolve({ok:false,code:"notFound",reason:"the editor was destroyed"}):im(Nt,M)},getPageSetup:()=>sm(E),getWatermark:()=>null,getTrackedChanges:()=>(E?.session.reviewItems()??[]).filter(M=>M.kind==="revision").map(M=>{let Q=tn(M);return {id:M.id,kind:M.kind==="revision"?M.revisionKind:"revision",...M.kind==="revision"&&M.author?{author:M.author}:{},story:Q!==null?Q.kind:Qs(M)?.noteKind??"body"}}),getReviewItems:M=>on(M),getCustomNodeDefinitions:()=>d.customNodes,reportCustomNodeDiagnostic:c,addComment(M,Q){if(!u)return {ok:false,code:"unsupported",reason:Qt};E?.flushPendingInput();let te=On();if(!te||!E)return {ok:false,code:"invalidArgs",reason:"a comment needs a selected range"};let we=(Q??s??"").trim();if(we.length===0||M.trim().length===0)return {ok:false,code:"invalidArgs",reason:"a comment needs both an author and text"};let ve=null;return E.commitReviewOps(()=>(ve=E.session.replyToComment(null,{paragraphId:te.from.paragraphId,start:te.from.offset,end:te.to.offset,...te.to.paragraphId===te.from.paragraphId?{}:{endParagraphId:te.to.paragraphId}},M,we,Js(),di(te.from.paragraphId)),{committed:ve!==null}),"comment-add"),ve===null?{ok:false,code:"unsupported",reason:"the comment could not be committed"}:{ok:true,changed:true}},getSelectionPlacement:()=>da(),isReviewPaneOpen:()=>_e,getEditingMode:()=>h,getReviewAuthors:()=>R.authorsFor(E?.revisionAuthors()??vM),...GR(I,{enabled:u,surface:()=>E,notify:()=>{Oe(),We();}}),setTrackedChangesFilter(M,Q){if(E)return E.setTrackedChangesFilter(M,Q);I.setPredicate(M,Q)&&(Oe(),We());},getConfiguredAuthor:()=>s??null,setAuthor(M){let Q=Km(M);if(s!==Q){if(s=Q,E?.setAuthor(s),s!==void 0&&L){L=false;let te=WS(be("suggesting"));if(te.enter)P=true,Mn("suggesting");else {v=te.rejection,Oe(),We();return}}else if(!P){let te=A??h;mr(a.mode()===void 0?te:"editing");return}v=pr(null),q.report(v),Oe(),We();}},setMode(M){a.setMode(M)&&(P=false,L=false,mr());},...IM(a,{surface:()=>E,bump:Oe,emitSelectionChange:We}),presenceColorFor:M=>E?.remotePresenceColor(M)??"var(--doc-accent)",collaborationSession:()=>E?.collaborationSession()??null,getReviewAuthorStyle:M=>R.styleFor(M),setOpeningIndicatorHost:X.set,setRemoteCaretLabelHost(M){_=M,E?.setRemoteCaretLabelHost(M);},setReviewPaneOptions:p.set,setRevisionMarkup:Cn.set,setRevisionMarkupChrome:Cn.register,setRevisionStyles(M){R.set(M),E?.setRevisionStyles(M),Oe(),We();},setEditingMode:M=>Nt.exec({type:"setEditingMode",mode:M}),getReviewRevision:()=>Xs(),getActivatedReviewItemKey:M=>Gg(on,E?.activatedReviewKey()??null,M),setActiveReviewItem(M,Q){if(M===null)return E?.dismissActiveReview(),Oe(),We(),{ok:true,changed:false};if(!E)return {ok:false,code:"notFound",reason:"no document is open"};E.flushPendingInput();let te=Br(on,M)?.item;if(!te)return {ok:false,code:"notFound",reason:"no review item with that key"};let we=Ug(te),ve=we?chunkOSFOJTHU_cjs.xj(we.deletion):M,ke=chunkOSFOJTHU_cjs.zj(te);if(!ke)return {ok:false,code:"unsupported",reason:"this review item has no resolvable range"};if(!Nc(te).every(Ys)&&!(x&&te.kind==="revision"&&te.revisionKind==="format"))return {ok:false,code:"unsupported",reason:VE(te)};let Ze=te?tn(te):null,ae=Ze===null&&te?Xn(te):null;if(Ze!==null||ae!==null){let Re=Ze!==null?{kind:"headerFooter",rId:Ze.rId,furnitureKind:Ze.kind}:{kind:"note",id:ae},je=Hc(E,Re,ke.start);if(!je.ok)return je}else {E.exitNote?.(),E.exitHeaderFooter?.();let Re=el(te)??ke,je={paragraphId:Re.start.paragraphId,offset:Re.start.offset};E.activateReview(ve,{anchor:je,head:je},{allowExcluded:x});let rt=Q?.reveal??"centerIfNeeded";rt!==false&&E.revealPosition?.(Re.start,{block:rt});}return (Ze!==null||ae!==null)&&E.activateReview(ve,void 0,{allowExcluded:x}),Oe(),We(),Q?.announce===true&&Jt.emitReviewItemReveal(Xg(on,{key:M,source:"host"})),{ok:true,changed:false}},setReviewActivationExclusions(M,Q){y=M===null?null:[...M],S=Q?.formattingKinds?[...Q.formattingKinds]:void 0,E?.setReviewActivationExclusions(y,{formattingKinds:S});},acceptReviewItem:M=>ho(M,"accept"),rejectReviewItem:M=>ho(M,"reject"),setCommentResolved(M,Q){return aM({reviewEnabled:u,editingMode:h,placements:on,surface:E,proReviewReason:Qt,bump:Oe},M,Q)},deleteReviewItem(M){if(!u)return {ok:false,code:"unsupported",reason:Qt};let Q=Br(on,M)?.item;if(!Q||!E)return {ok:false,code:"notFound",reason:"no review item with that key"};if(Q.kind==="revision")return ho(M,"reject");if(Q.kind!=="comment")return {ok:false,code:"unsupported",reason:"a custom node card cannot be deleted"};rn()===M&&E.dismissActiveReview();let te=false;return E.commitReviewOps(()=>{let we=Xn(Q),ve=we===null?null:chunkOSFOJTHU_cjs.pc(we);return te=E.session.deleteComment(Q.id,Ft(Q),ve?.noteId),{committed:te}},"comment-delete"),te?(Oe(),{ok:true,changed:true}):{ok:false,code:"unsupported",reason:"the comment could not be deleted"}},replyToReviewItem(M,Q,te){if(!u)return {ok:false,code:"unsupported",reason:Qt};E?.flushPendingInput();let we=Br(on,M)?.item,ve=Ug(we)?.insertion??we;if(!ve||!E)return {ok:false,code:"notFound",reason:"no review item with that key"};let ke=chunkOSFOJTHU_cjs.zj(ve);if(!ke)return {ok:false,code:"invalidArgs",reason:"the item has no anchorable range"};let Ze=(te??s??"").trim(),ae=sM(ve,Q,Ze);if(ae)return ae;let Re=ve.kind==="comment"?ve.id:null,je=null;return E.commitReviewOps(()=>(je=E.session.replyToComment(Re,{paragraphId:ke.start.paragraphId,start:ke.start.offset,end:ke.end.offset},Q,Ze,Js(),Ft(ve)),{committed:je!==null}),"comment-reply"),je===null?{ok:false,code:"unsupported",reason:"the reply could not be committed"}:{ok:true,changed:true}},getHeaderFooterState:()=>E?.headerFooterState()??null,getNotePropertiesState:()=>E?.notePropertiesState?.()??null,getNotePreviewText:M=>E?.notePreviewText?.(M)??null,setActiveScope(M){E?.setActiveScope(M)&&Oe();},getActiveScope:()=>E?.activeScope()??{kind:"body"},query:M=>SE(E,()=>Gn().formatting,M),snapshot:()=>Gn(),getTotalPages:()=>qi(E),getCurrentPage:M=>lm(E,M),...GE(()=>E,()=>b.flush(),()=>l),...JE(()=>Nt,()=>t,()=>b.flush()),...bM(Zt,()=>E),...En.members,...bO({frame:En.frame,placements:on}),relayout(M){M?.sync,E?.layout();},retainSelection:()=>E?.retainSelection()??null,releaseSelection:M=>E?.releaseSelection(M),focus(M){return b.flush(),E?M&&M.kind==="all"?{ok:false,code:"invalidTarget",reason:"the all scope cannot take focus"}:M&&!E.setActiveScope(M)?{ok:false,code:"invalidTarget",reason:"that scope cannot be opened"}:(E.focus(),{ok:true,value:void 0}):{ok:false,code:"invalidTarget",reason:"no document is loaded"}},destroy(){t?.invalidate(),N=true,q.dispose(),b.cancel(),Zt.detach(),Z(),H(),H=()=>{},$r(),l=null,m=null,g=new WeakMap,ye+=1,Oe(),nt.dispose(),Jt.clear();},on:Jt.on};return t=RE(Nt,{surface:()=>E,container:()=>l,collaboration:()=>d.collaboration!==null,load:go,changed:()=>{Oe(),We();},cancelLoad:()=>{n=null,b.cancel();}}),nt.attach(Nt,mo),fo.methods(Nt)}var kM=Object.freeze({document:true,save:true,events:true,selection:true,scrolling:true,layout:true});function c_(e){if(e.length===0)return;if(e.every(n=>n.kind==="delete"))return "comment-delete";if(e.length!==1)return;let t=e[0];if(t.kind==="resolve")return "comment-resolve";if(t.kind==="create")return "comment-add";if(t.kind==="reply")return "comment-reply"}function u_(e){let t=chunkEKLM7NWB_cjs.m({port:f_(e),capabilities:kM}),n=false;return {...t,save:()=>{try{return t.save()}catch(r){return {ok:false,error:{code:"transaction-refused",message:r instanceof Error?r.message:"Cannot save the document."}}}},dispose:()=>{n=true,t.dispose();},execute:r=>(n||e.surface?.flushPendingInput(),rE(e,()=>t.execute(r)))}}function f_(e){let t=0,n=0,r=null,o=false,i=false,a=()=>{if(i)return null;let d=e.surface?.session??null;return d!==r&&(o&&(t+=n+1),o=true,r=d,n=0),d&&(n=d.packageRevision()),d},s,l=null;return {localChangeTracking:true,suggesting:()=>e.surface?.editingMode()==="suggest",async prepare(d){if(!d.operations.some(p=>p.op==="updateFieldResult"))return;s=void 0,l=null;let c=e.surface;if(!c)return;let u=c.layout();s=chunkEKLM7NWB_cjs.j(u),l=a()?.currentPackage()??null;},fieldPageContext(d,c,u){let p=a()?.currentPackage()??null;if(!p||p!==l)return null;let m=chunkEKLM7NWB_cjs.i(p).story(d);return m?chunkEKLM7NWB_cjs.k(s,m.part,c,u):null},revision(){return a(),t+n},currentPackage:()=>a()?.currentPackage()??null,revisionDisplayMode:()=>e.surface?chunkDOHF6FA7_cjs.Ya(e.surface.revisionDisplayMode()):chunkOSFOJTHU_cjs.th,collaborative:()=>!!e.surface?.collaborationSession(),trackedRangeReplacement:()=>!e.surface?.collaborationSession(),replacementLanding:(d,c,u)=>e.surface?.replacementLanding(d,c,u)??null,apply(d,c,u=[],p=false){a();let m=e.surface;if(!m)return {ok:false,reason:"no-document"};let g=m.applyAutomationOps(d,c,u,p);return g.rejected?{ok:false,reason:Fg(g.reason)}:{ok:true,changed:g.committed}},applyLifecycle(d){a();let c=e.surface;if(!c)return {ok:false,reason:"no-document"};let u=c.applyAutomationOps(()=>[d]);return u.rejected?{ok:false,reason:Fg(u.reason)}:{ok:true,changed:u.committed}},applyCommentWrites(d,c){let u=e.surface,p=a();if(!u||!p)return {ok:false,reason:"no-document"};if(d.length===0)return {ok:true,changed:false};if(c.kind!=="body")return {ok:false,reason:"unsupported-story"};let m=e.can({type:"toggleReviewPane"});if(!m.ok)return {ok:false,reason:m.reason??"review-module-required"};let g={ok:false,reason:"refused"};return u.commitReviewOps(()=>{if(d.every(y=>y.kind==="delete")){let y=d.find(x=>x.kind==="delete"),S=p.deleteComments(d.map(x=>{if(x.kind!=="delete")throw new Error("unreachable mixed comment write");return {commentId:x.commentId,...x.parentCommentId===void 0?{}:{parentCommentId:x.parentCommentId}}}),c,y?.kind==="delete"?y.noteId:void 0);return g=S?{ok:true,changed:true}:{ok:false,reason:"unknown-comment"},{committed:S}}if(d.length!==1)return g={ok:false,reason:"mixed-comment-writes"},{committed:false};let b=d[0];if(b.kind==="resolve"){let y=p.setCommentResolved(b.commentId,b.resolved);return g=y?{ok:true,changed:true}:{ok:false,reason:"unknown-comment"},{committed:y}}if(b.kind!=="create"&&b.kind!=="reply")return g={ok:false,reason:"unsupported-comment-write"},{committed:false};let h=p.replyToComment(b.kind==="reply"?b.parentCommentId:null,b.anchor,b.text,b.author,b.date);return g=h===null?{ok:false,reason:"refused"}:{ok:true,changed:true,commentId:h},{committed:h!==null}},c_(d)),g},applyCustomNodeWrite(d,c){let u=e.surface,p=a();if(!u||!p)return {ok:false,reason:"no-document"};if(c.kind!=="body")return {ok:false,reason:"unsupported-story"};let m={ok:false,reason:"refused"};return u.commitReviewOps(()=>{let g=p.insertCustomNode(d);return m=g.ok?{ok:true,changed:g.change!==null}:{ok:false,reason:g.detail?`${g.reason}: ${g.detail}`:g.reason},{committed:g.ok}},"package-scoped"),m},save:()=>a()?e.surface?.save()??null:null,select(d,c){if(!e.surface)return;let p=c==="end"?d.end:d.start,m=c==="start"?d.start:d.end;e.exec({type:"setSelection",range:{anchor:{paragraphId:p.paragraphId,offset:p.offset},head:{paragraphId:m.paragraphId,offset:m.offset}}});},subscribe:d=>e.on("change",()=>d()),dispose(){i=true,r=null;}}}function bh(e){let t=e?.closest(".docx-editor")??null;for(;t&&!t.querySelector(".docx-pages");)t=t.parentElement?.closest(".docx-editor")??null;return t}function p_(e){let t=e.popup.ownerDocument,n=r=>{if(r.key!=="Escape"||r.isComposing||r.keyCode===229||e.skip?.(r))return;let o=r.composedPath(),i=o[0]??r.target,a=i instanceof Node?i:null,s=a!==null&&e.contains(a);if(!s&&RM(a,e.popup))return;let l=[bh(e.popup),e.chromeRoot?.(),...e.editorElements?.()??[]],d=s||l.some(c=>c!=null&&o.includes(c));e.close(s),d&&(r.preventDefault(),r.stopPropagation());};return t.addEventListener("keydown",n,true),()=>t.removeEventListener("keydown",n,true)}function RM(e,t){let r=(e instanceof Element?e:e?.parentElement??null)?.closest('[aria-modal="true"], [data-docx-modal]');return r?r.hasAttribute("data-docx-dialog")||r.hasAttribute("data-docx-modal")?true:bh(t)?.contains(r)===true:false}var m_='[aria-expanded="true"], [role="menu"], [role="listbox"], [role="dialog"]';function g_(e){return e?.querySelector(m_)!=null}function h_(e){let t=e.popup.ownerDocument,n=r=>{let o=r.composedPath()[0]??r.target;if(!(o instanceof Node)||e.contains(o))return;let i=o instanceof Element?o:o.parentElement;i===null||i===t.body||i===t.documentElement||i.closest(".docx-pages")||RM(i,e.popup)||e.close();};return t.addEventListener("focusin",n,true),()=>t.removeEventListener("focusin",n,true)}function y_(e){return e*(96/72)}function b_(e,t){return e*t}function v_(e,t){return e/t}function x_(e,t,n){let r=e.pages.find(a=>a.index===t.pageIndex)??e.pages[t.pageIndex];if(!r)return {left:0,top:0,width:0,height:0};let o=n.pageOffsetX.get(r.index)??0,i=n.paintScale;return Object.freeze({left:(r.contentBox.x+t.x+o)*i,top:(r.contentBox.y+t.y)*i,width:t.width*i,height:t.height*i})}function w_(e){return Object.freeze(e?{left:e.offsetLeft,top:e.offsetTop}:{left:0,top:0})}function TM(e,t,n,r=false){return t?true:e.length===1?false:r?n:!n}var PM=["e","se","s","sw","w","nw","n","ne"];function S_(e,t){let n=PM.indexOf(e);t.flipHorizontal&&(n=(4-n+8)%8),t.flipVertical&&(n=(8-n)%8);let r=Math.round(t.rotationDegrees/45)%8;return PM[(n-r+8)%8]}function I_(e,t,n){let r=e,o=t,i=-n.rotationDegrees*Math.PI/180,a=Math.cos(i),s=Math.sin(i),l=r*a-o*s,d=r*s+o*a;return r=l,o=d,n.flipHorizontal&&(r=-r),n.flipVertical&&(o=-o),Object.freeze({x:r,y:o})}function ii(e){return e/12700}function CM(e){let t=I_(e.deltaXPt,e.deltaYPt,e.transform),n=ii(e.startWidthEmu),r=ii(e.startHeightEmu),o=n/r,i=S_(e.handle,e.transform),a=i.includes("e")?t.x:i.includes("w")?-t.x:0,s=i.includes("s")?t.y:i.includes("n")?-t.y:0;if(n=Math.max(1,n+a),r=Math.max(1,r+s),e.preserveAspect)if(i.length===2){let x=Math.max(n/ii(e.startWidthEmu),r/ii(e.startHeightEmu));n=Math.max(1,ii(e.startWidthEmu)*x),r=Math.max(1,n/o);}else i==="e"||i==="w"?r=Math.max(1,n/o):n=Math.max(1,r*o);let l=ii(e.startWidthEmu),d=ii(e.startHeightEmu),c=n/l,u=r/d,p=Math.max(1,e.startBounds.width*c),m=Math.max(1,e.startBounds.height*u),g=e.startBounds.x,b=e.startBounds.y,h=e.handle;h.includes("w")&&(g=e.startBounds.x+e.startBounds.width-p),h.includes("n")&&(b=e.startBounds.y+e.startBounds.height-m);let y=null;if(e.kind==="anchored"&&e.startPosition&&(h.includes("w")||h.includes("n")||e.anchorFrameOrigin&&(e.startPosition.horizontalEmu===void 0&&n!==l||e.startPosition.verticalEmu===void 0&&r!==d)))if(e.startPosition.mode==="simple"){let S=h.includes("w")?Ot(g-e.startBounds.x):0,x=h.includes("n")?Ot(b-e.startBounds.y):0;y=Object.freeze({mode:"simple",horizontalEmu:(e.startPosition.horizontalEmu??0)+S,verticalEmu:(e.startPosition.verticalEmu??0)+x});}else if(e.anchorFrameOrigin)y=Object.freeze({mode:"frame",...e.startPosition.relativeToH!==void 0?{relativeToH:e.startPosition.relativeToH}:{},...e.startPosition.relativeToV!==void 0?{relativeToV:e.startPosition.relativeToV}:{},...h.includes("w")||e.startPosition.horizontalEmu===void 0&&n!==l?{horizontalEmu:Ot(g-e.anchorFrameOrigin.x)}:e.startPosition.horizontalEmu!==void 0?{horizontalEmu:e.startPosition.horizontalEmu}:{},...h.includes("n")||e.startPosition.verticalEmu===void 0&&r!==d?{verticalEmu:Ot(b-e.anchorFrameOrigin.y)}:e.startPosition.verticalEmu!==void 0?{verticalEmu:e.startPosition.verticalEmu}:{}});else {let S=h.includes("w")?Ot(g-e.startBounds.x):0,x=h.includes("n")?Ot(b-e.startBounds.y):0;y=Object.freeze({mode:"frame",...e.startPosition.horizontalEmu!==void 0?{horizontalEmu:e.startPosition.horizontalEmu+S}:{},...e.startPosition.verticalEmu!==void 0?{verticalEmu:e.startPosition.verticalEmu+x}:{},...e.startPosition.relativeToH!==void 0?{relativeToH:e.startPosition.relativeToH}:{},...e.startPosition.relativeToV!==void 0?{relativeToV:e.startPosition.relativeToV}:{}});}return Object.freeze({widthEmu:Ot(n),heightEmu:Ot(r),previewBounds:Object.freeze({x:g,y:b,width:p,height:m}),position:y})}function k_(e,t){return Object.freeze({scrollBy(n){if(!Number.isFinite(n)||n===0)return 0;let r=e.scrollTop;return e.scrollTop+=n*t,(e.scrollTop-r)/t}})}function R_(e){if(e.session.mode==="move"){let t=e.session.startBounds.x+e.deltaXPt,n=e.session.startBounds.y+e.deltaYPt+e.accumulatedScrollPt,r=e.session.startPosition&&Ed(e.session.startPosition.mode==="frame"&&e.anchorFrameOrigin?{...e.session.startPosition,horizontalEmu:e.session.startPosition.horizontalEmu??Ot(e.session.startBounds.x-e.anchorFrameOrigin.x),verticalEmu:e.session.startPosition.verticalEmu??Ot(e.session.startBounds.y-e.anchorFrameOrigin.y)}:e.session.startPosition,e.deltaXPt,e.deltaYPt+e.accumulatedScrollPt);return Object.freeze({widthEmu:e.session.startWidthEmu,heightEmu:e.session.startHeightEmu,previewBounds:Object.freeze({x:t,y:n,width:e.session.startBounds.width,height:e.session.startBounds.height}),position:r??null})}return e.session.handle?CM({handle:e.session.handle,startWidthEmu:e.session.startWidthEmu,startHeightEmu:e.session.startHeightEmu,startBounds:e.session.startBounds,startPosition:e.session.startPosition,anchorFrameOrigin:e.anchorFrameOrigin,deltaXPt:e.deltaXPt,deltaYPt:e.deltaYPt,transform:e.session.transform,preserveAspect:TM(e.session.handle,e.aspectLocked,e.shiftKey,e.textbox),kind:e.session.kind}):Object.freeze({widthEmu:e.session.startWidthEmu,heightEmu:e.session.startHeightEmu,previewBounds:e.session.startBounds,position:null})}var EM=e=>Math.round(e/1440*100)/100,P_=e=>EM(e).toLocaleString(void 0,{maximumFractionDigits:2}),T_=e=>Math.round(e*1440),C_={left:"dialogs.paragraph.tabAlignLeft",center:"dialogs.paragraph.tabAlignCenter",right:"dialogs.paragraph.tabAlignRight",decimal:"dialogs.paragraph.tabAlignDecimal",bar:"dialogs.paragraph.tabAlignBar"},OM=e=>e===null||e===0?"none":e<0?"hanging":"firstLine",MM=(e,t)=>e==="none"?0:e==="hanging"?-Math.abs(t):Math.abs(t);function E_(e){let t=e.indentFirstLineTwips;return {alignment:e.alignment??"left",direction:e.direction??"ltr",indentLeft:e.indentLeftTwips??0,indentRight:e.indentRightTwips??0,special:OM(t),specialBy:Math.abs(t??0),spaceBefore:e.spaceBeforePt??0,spaceAfter:e.spaceAfterPt??0,lineRule:e.lineSpacing?.rule??"multiple",lineValue:e.lineSpacing?.value??1.08,contextualSpacing:e.contextualSpacing===true,keepNext:e.keepNext===true,keepLines:e.keepLines===true,widowControl:e.widowControl!==false,pageBreakBefore:e.pageBreakBefore===true,tabStops:e.tabStops??[],clearedAllTabStops:false}}var AM={contextualSpacing:false,keepNext:false,keepLines:false,widowControl:false,pageBreakBefore:false,tabStops:false,alignment:false,direction:false,indentLeft:false,indentRight:false,special:false,spaceBefore:false,spaceAfter:false,lineSpacing:false};function O_(e){return {contextualSpacing:e.contextualSpacing===null,keepNext:e.keepNext===null,keepLines:e.keepLines===null,widowControl:e.widowControl===null,pageBreakBefore:e.pageBreakBefore===null,tabStops:e.disagrees.tabStops,alignment:e.disagrees.alignment,direction:e.disagrees.direction,indentLeft:e.disagrees.indentLeft||e.indentUnknown,indentRight:e.disagrees.indentRight||e.indentUnknown,special:e.disagrees.indentFirstLine||e.indentUnknown,spaceBefore:e.disagrees.spaceBeforePt,spaceAfter:e.disagrees.spaceAfterPt,lineSpacing:e.disagrees.lineSpacing}}function FM(e,t){return e===t?true:e.length!==t.length?false:e.every((n,r)=>{let o=t[r];return o!==void 0&&n.positionTwips===o.positionTwips&&n.alignment===o.alignment&&(n.leader??"none")===(o.leader??"none")})}function M_(e,t,n=AM,r=n){let o={},i=false,a=(d,c)=>{o[d]=c,i=true;},s=d=>n[d]&&!r[d];(e.direction!==t.direction||s("direction"))&&a("direction",t.direction);let l=!n.direction&&!n.alignment&&e.direction!==t.direction&&t.alignment===LM(e.alignment);return (e.alignment!==t.alignment&&!l||s("alignment"))&&a("alignment",t.alignment),(e.indentLeft!==t.indentLeft||s("indentLeft"))&&a("indentLeftTwips",t.indentLeft),(e.indentRight!==t.indentRight||s("indentRight"))&&a("indentRightTwips",t.indentRight),(e.special!==t.special||e.specialBy!==t.specialBy||s("special"))&&a("indentFirstLineTwips",MM(t.special,t.specialBy)),(e.spaceBefore!==t.spaceBefore||s("spaceBefore"))&&a("spaceBeforePt",t.spaceBefore),(e.spaceAfter!==t.spaceAfter||s("spaceAfter"))&&a("spaceAfterPt",t.spaceAfter),!r.lineSpacing&&(e.lineRule!==t.lineRule||e.lineValue!==t.lineValue||s("lineSpacing"))&&a("lineSpacing",{rule:t.lineRule,value:t.lineValue}),(e.contextualSpacing!==t.contextualSpacing||s("contextualSpacing"))&&a("contextualSpacing",t.contextualSpacing),(e.keepNext!==t.keepNext||s("keepNext"))&&a("keepNext",t.keepNext),(e.keepLines!==t.keepLines||s("keepLines"))&&a("keepLines",t.keepLines),(e.widowControl!==t.widowControl||s("widowControl"))&&a("widowControl",t.widowControl),(e.pageBreakBefore!==t.pageBreakBefore||s("pageBreakBefore"))&&a("pageBreakBefore",t.pageBreakBefore),(!FM(e.tabStops,t.tabStops)||s("tabStops")&&t.clearedAllTabStops)&&a("tabStops",t.tabStops),i?o:null}function LM(e){return e==="left"?"right":e==="right"?"left":e}function A_(e,t){return [...e.filter(r=>r.positionTwips!==t.positionTwips),t].sort((r,o)=>r.positionTwips-o.positionTwips)}function F_(e,t){if(t.key!=="Tab")return false;let n=[...e.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])')].filter(a=>!a.hasAttribute("disabled")&&a.tabIndex!==-1);if(n.length===0)return false;let r=n[0],o=n[n.length-1],i=e.ownerDocument.activeElement;return t.shiftKey&&(i===r||i===e)?(o.focus(),true):!t.shiftKey&&i===o?(r.focus(),true):false}function L_(e,t,n){let r,o=false,i,a,s=new Set,l=[],d=()=>{clearTimeout(a),a=void 0,r?.end(),r=void 0,i=void 0,s.clear();},c=()=>{if(o)throw new Error("history group binding was disposed");return (!r||r.state==="closed")&&(r=e.beginHistoryGroup()),r},u=()=>{d(),c();},p=()=>{let b=r;i=void 0,s.clear(),clearTimeout(a),a=setTimeout(()=>{r===b&&d();},0);},m=(b,h,y,S=false)=>{b.addEventListener(h,y,S),l.push(()=>b.removeEventListener(h,y,S));},g=b=>n.kind==="native-color"?b==="Enter"||b===" ":["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End","PageUp","PageDown"," ","Enter"].includes(b);if(m(t,"pointerdown",b=>{let h=b;if(!(h.button!==0||n.kind==="keyboard")&&(u(),i=h.pointerId,n.kind!=="native-color"))try{t.setPointerCapture?.(h.pointerId);}catch{}},true),m(t,"keydown",b=>{let h=b;if(h.key==="Escape"){p();return}!g(h.key)||h.altKey||h.ctrlKey||h.metaKey||(!h.repeat&&s.size===0&&u(),s.add(h.key),c());},true),m(t.ownerDocument,"keyup",b=>{let h=b.key;s.delete(h)&&n.kind!=="native-color"&&s.size===0&&p();},true),n.kind!=="native-color")for(let b of ["pointerup","pointercancel","lostpointercapture"])m(b==="lostpointercapture"?t:t.ownerDocument,b,h=>{i!==void 0&&h.pointerId===i&&p();},true);return m(t,"input",()=>{a!==void 0?u():c();},true),m(t,"change",()=>{(n.kind==="native-color"||i===void 0&&s.size===0)&&p();}),m(t,"blur",p,true),t.ownerDocument.defaultView&&m(t.ownerDocument.defaultView,"blur",p),{options:()=>({historyGroup:c()}),dispose(){if(!o){o=true,d();for(let b of l)b();}}}}var uo=class extends Error{code;constructor(t,n){super(`Document capture failed: ${t}.`,{cause:n}),this.name="DocumentRefreshError",this.code=t;}};function NM(e){return JSON.stringify([e.revisionKind,e.author,e.date,e.text,e.replacedText])}function DM(e){return new Map(e.surface()?.session.reviewItems().filter(t=>t.kind==="revision").map(t=>[t.id,NM(t)]))}function HM(e,t,n,r){let o=e.surface();if(!o)return {located:[],available:false};let i=o.session.part(),a=chunk6JPL6ZAS_cjs.d(i),s=o.session.paragraphAnchors().paraIdByNode,l=new Map,d=new Map;a.forEach((g,b)=>{d.set(g.id,b);let h=s.get(g.id);if(h){let y=h.toUpperCase();l.set(y,l.has(y)?null:g);}});let c=new Set(o.layout().pages.flatMap(g=>chunkDOHF6FA7_cjs.xa(g).map(b=>b.paragraphId))),u=(g,b=JSON.stringify([typeof g.location?.text=="string"?g.location.text:null,g.unavailableReason,g.description]))=>{let h={id:g.id,resultId:t,isNew:r.get(g.id)!==b,...g.description!==void 0?{description:g.description}:{}};if(!g.location)return {fingerprint:b,change:{...h,status:g.unavailableReason??"unavailable",diagnostic:Object.freeze({code:g.unavailableReason==="deleted"?"deleted":"missing-location"})}};let y=g.location,S=T=>({fingerprint:b,change:{...h,status:"invalid",diagnostic:Object.freeze({code:T,location:Object.freeze({...y})})}});if(y.paragraphId===void 0==(y.paragraphIndex===void 0)||y.paragraphIndex!==void 0&&(!Number.isSafeInteger(y.paragraphIndex)||y.paragraphIndex<0))return S("invalid-selector");if(y.paragraphId!==void 0&&(typeof y.paragraphId!="string"||!chunkOSFOJTHU_cjs.vb(y.paragraphId)))return S("invalid-paragraph-id");let x=y.paragraphId!==void 0?l.get(y.paragraphId.toUpperCase()):a[y.paragraphIndex];if(x===null)return S("ambiguous-paragraph-id");if(!x)return S("paragraph-not-found");let I=x?chunkOSFOJTHU_cjs.Vi(i,x.id)??"":"";if(!Number.isSafeInteger(y.start)||!Number.isSafeInteger(y.end)||y.start<0||y.end<=y.start||y.end>I.length)return S("invalid-offsets");if(I.slice(y.start,y.end)!==y.text)return S("text-mismatch");let R=c.has(x.id);return {fingerprint:b,change:{...h,status:R?"available":"unavailable",location:Object.freeze({...y}),...R?{}:{diagnostic:Object.freeze({code:"not-rendered",location:Object.freeze({...y})})}},...R?{paragraphId:x.id,offset:y.start}:{}}};if(n)return {located:n.map(g=>u(g)),available:true};let p=o.session.reviewItems().filter(g=>g.kind==="revision");return {located:p.map(g=>{let b=NM(g),h=g.ranges[0];if(!h||h.partName!==i.name)return {fingerprint:b,change:{id:g.id,resultId:t,isNew:r.get(g.id)!==b,status:h?"unsupported-story":"unavailable",diagnostic:Object.freeze({code:h?"unsupported-story":"missing-location"})}};let y=d.get(h.start.paragraphId)??-1;if(g.revisionKind==="delete"||g.revisionKind==="moveFrom")return {fingerprint:b,change:{id:g.id,resultId:t,isNew:r.get(g.id)!==b,status:"deleted",diagnostic:Object.freeze({code:"deleted"})}};if(h.start.paragraphId!==h.end.paragraphId)return {fingerprint:b,change:{id:g.id,resultId:t,isNew:r.get(g.id)!==b,status:"unavailable",diagnostic:Object.freeze({code:"multiple-paragraphs"})}};let S=chunkOSFOJTHU_cjs.Vi(i,h.start.paragraphId)??"",x={paragraphIndex:y,start:h.start.offset,end:h.end.offset,text:S.slice(h.start.offset,h.end.offset)};return u({id:g.id,location:x},b)}),available:p.length>0}}var _M=new WeakMap,N_=0;function D_(e){let t=_M.get(e);if(t)return t;let n=kE(e),r=`refresh-${++N_}`,o=0,i=null,a=new AbortController,s=false,l=Promise.resolve(),d=null,c=[],u=null,p=new Set,m=new Set,g=Object.freeze({phase:"idle",result:null,changes:[],highlightsVisible:false,recoveryAvailable:false}),b=P=>{g=Object.freeze({...g,...P});for(let O of p)try{O();}catch{}},h=Bc(e,n,{marker:"data-docx-refresh-highlight",defaultColor:"var(--doc-refresh-highlight-color)"},()=>{g.highlightsVisible&&b({highlightsVisible:false});}),y=(P,O)=>{O&&b({phase:O,result:P,recoveryAvailable:d!==null});for(let v of m)try{v(P);}catch{}return P},S=(P,O,v)=>({ok:false,resultId:P,code:O,...v===void 0?{}:{recovered:v}}),x=()=>n.collaboration()?"collaboration":!n.surface()||!n.container()||e.snapshot().isOpening?"unavailable":null,I=()=>{o++,i=null,a.abort(),a=new AbortController,c=[],u=null,h.clear();};n.invalidated.add(()=>{I(),d=null,b({phase:"idle",result:null,changes:[],highlightsVisible:false,recoveryAvailable:false});}),e.on("change",P=>{P.source||u===null||n.revision===u||(c=[],h.clear(),u=null,b({changes:[],highlightsVisible:false}));});let R=async P=>{let O=n.surface(),v=n.container();if(!O||!v)throw new Error("unavailable");Nk(O)&&await new Promise((A,q)=>{let K=()=>{v.removeEventListener("compositionend",E),P.removeEventListener("abort",_);},E=()=>{K(),A();},_=()=>{K(),q(new Error("cancelled"));};v.addEventListener("compositionend",E),P.addEventListener("abort",_,{once:true}),P.aborted&&_();});let C=As(v);if(C&&await C,P.aborted||n.surface()!==O)throw new Error("document-changed");let L=O.save();if(n.surface()!==O)throw new Error("document-changed");return {bytes:L,revision:n.revision}},T={async capture(){let P=x();if(d)throw new uo("recovery-failed");if(P||s)throw new uo(P??"busy");I(),d=null;let O=o,v=n.epoch,C=a.signal;b({phase:"capturing",result:null,changes:[],highlightsVisible:false,recoveryAvailable:false});try{let L=await R(C);if(O!==o||v!==n.epoch)throw new Error("superseded");let A=Object.freeze({id:`${r}-${O}`,bytes:L.bytes.slice().buffer});return i={token:A,epoch:v,revision:L.revision,sequence:-1,seen:DM(n)},b({phase:"processing"}),A}catch(L){throw O===o&&b({phase:"failed"}),new uo(O===o?"input-failed":"superseded",L)}},applyUpdate(P){let O=`${P.submission?.id??"unknown"}:${P.sequence}`,v;try{if(!Number.isSafeInteger(P.sequence)||P.sequence<0||!(P.bytes instanceof Uint8Array||P.bytes instanceof ArrayBuffer)||P.failures!==void 0&&(!Array.isArray(P.failures)||P.failures.length>1e4||Array.from(P.failures).some(A=>typeof A!="string"))||P.changes!==void 0&&(!Array.isArray(P.changes)||P.changes.length>1e4||new Set(P.changes.map(A=>A.id)).size!==P.changes.length||Array.from(P.changes).some(A=>!A||typeof A.id!="string"||!A.id||A.description!==void 0&&(typeof A.description!="string"||A.description.length>1e3)||A.location!==void 0&&(!A.location||typeof A.location!="object"||A.location.paragraphId!==void 0&&typeof A.location.paragraphId!="string"||A.location.paragraphIndex!==void 0&&typeof A.location.paragraphIndex!="number"||typeof A.location.start!="number"||typeof A.location.end!="number"||typeof A.location.text!="string")||A.unavailableReason!==void 0&&!["deleted","unavailable"].includes(A.unavailableReason))))throw new Error("invalid-result");v={...P,bytes:new Uint8Array((P.bytes instanceof Uint8Array,P.bytes)).slice(),changes:P.changes?.map(A=>({id:A.id,description:A.description,unavailableReason:A.unavailableReason,location:A.location?{paragraphId:A.location.paragraphId,paragraphIndex:A.location.paragraphIndex,start:A.location.start,end:A.location.end,text:A.location.text}:void 0})),failures:P.failures?.slice()};}catch{return Promise.resolve(y(S(O,"invalid-result")))}let C=async()=>{let A=i,q=x();if(q)return y(S(O,q));if(!A||A.token!==v.submission)return y(S(O,"superseded"));if(v.sequence<=A.sequence)return y(S(O,"out-of-order"));if(A.epoch!==n.epoch)return y(S(O,"document-changed"));s=true;let K=a.signal,E=()=>i===A&&A.epoch===n.epoch&&!K.aborted;try{let _=await R(K);if(!E())return y(S(O,"cancelled"));if(_.revision!==A.revision)return y(S(O,"local-edits"),"failed");let X=v.bytes;if(!chunkOSFOJTHU_cjs.Ce(X).ok)return y(S(O,"invalid-document"),"failed");if(h.clear(),c=[],u=null,b({phase:"refreshing",changes:[],highlightsVisible:!1}),!E())return y(S(O,"cancelled"));let z=n.surface().save();if(!E())return y(S(O,"cancelled"));if(n.revision!==A.revision)return y(S(O,"local-edits"),"failed");d={bytes:z.slice(),epoch:n.epoch};let oe=await n.replace(X,"refresh");if(A.epoch!==n.epoch)return y(S(O,"document-changed"));if(!oe&&!E())return d=null,y(S(O,"cancelled"));if(!oe){if(b({phase:"recovering"}),A.epoch!==n.epoch)return y(S(O,"document-changed"));let F=d&&await n.replace(d.bytes,"recovery");return A.epoch!==n.epoch?y(S(O,"document-changed")):(F&&(d=null),i=null,y(S(O,F?"load-failed":"recovery-failed",!!F),"failed"))}d=null,h.clear(),A.revision=n.mountedRevision,A.sequence=v.sequence;let j=HM(n,O,v.changes,A.seen);c=n.revision===A.revision?j.located:[];for(let F of c)A.seen.set(F.change.id,F.fingerprint);u=A.revision;let me=Object.freeze(c.map(F=>Object.freeze(F.change))),U=Object.freeze({ok:!0,resultId:O,changes:me,changeInformation:n.revision===A.revision&&j.available?"available":"unavailable",failures:Object.freeze(v.failures??[])});return b({changes:me,result:U,phase:"complete",recoveryAvailable:!1}),y(U)}catch{return y(S(O,E()?"input-failed":"cancelled"),E()?"failed":void 0)}finally{s=false;}},L=l.then(C);return l=L.then(()=>{},()=>{}),L},cancel(){let P=g.phase==="recovering"||!n.surface()&&d!==null;n.cancel(),o++,i=null,a.abort(),a=new AbortController,P||(d=null),b({phase:P?"failed":g.result?.ok?"complete":"idle",result:P||g.result?.ok?g.result:null,recoveryAvailable:d!==null});},finish(P){i?.token===P&&!s&&(i=null,b({phase:g.phase==="processing"?"idle":g.phase}));},snapshot:()=>g,subscribe(P){return p.add(P),()=>{p.delete(P);}},onResult(P){return m.add(P),()=>{m.delete(P);}},highlightChanges(P){if(h.validate(P),u!==n.revision)return 0;let O=P?.changeIds===void 0?null:new Set(P.changeIds),v=c.filter(C=>C.change.status==="available"&&(O?O.has(C.change.id):P?.includePrevious||C.change.isNew));return h.show(v,P),b({highlightsVisible:v.length>0}),v.length},clearHighlights(P){h.hide(P),b({highlightsVisible:false});},navigateToChange(P,O={}){if(O.focus!==void 0&&typeof O.focus!="boolean")throw new TypeError("focus must be a boolean.");let v=oa(O,"center",n.container());if(u!==n.revision)return false;let C=c.find(A=>A.change.id===P);if(!C?.paragraphId||C.offset===void 0)return false;let L=n.surface();if(!L?.revealPosition({paragraphId:C.paragraphId,offset:C.offset},v))return false;if(O?.focus){L.setActiveScope({kind:"body"});let A={paragraphId:C.paragraphId,offset:C.offset};L.setSelection({anchor:A,head:A}),L.focus();}return true},recoveryBytes:()=>d?d.bytes.slice().buffer:null,async recover(){if(!d||d.epoch!==n.epoch||s)return false;s=true;let P=d;b({phase:"recovering"});try{if(P.epoch!==n.epoch)return !1;let O=await n.replace(P.bytes,"recovery");return P.epoch!==n.epoch?!1:(O&&(d=null),b({phase:O?"idle":"failed",recoveryAvailable:!O}),O)}finally{s=false;}}};return _M.set(e,T),T}var H_=150;var __=Object.freeze({applied:0,unavailable:0});function B_(e,t,n,r={}){let{onResult:o,...i}=r,a=n,s=i,l=__,d=false,c,u=0,p=h=>{h.applied===l.applied&&h.unavailable===l.unavailable||(l=h,o?.(h));},m=()=>{if(clearTimeout(c),c=void 0,u=0,d)return;let h=typeof a=="function"?a(e):a;p(e.setHighlights(t,h,s));},g=()=>{let h=Date.now();u===0&&(u=h),clearTimeout(c);let y=Math.min(150,1e3-(h-u));c=setTimeout(m,Math.max(0,y));},b=e.on("change",h=>{typeof a=="function"?h.source?m():g():h.source==="refresh"||h.source==="recovery"?m():h.source==="load"&&p({applied:0,unavailable:a.length});});return m(),{get result(){return l},refresh:m,update(h,y){a=h,y!==void 0&&(s=y),m();},stop(){d||(d=true,clearTimeout(c),b(),e.clearHighlights(t));}}}var xh=150,$M=2e3,qM="search",KM=10,vh=Object.freeze([]),$_=1e3;function q_(e,t){let n=e.activeIndex>=0?e.matches[e.activeIndex]:void 0;if(!n)return -1;let r=-1;for(let[o,i]of t.entries())i.blockId===n.blockId&&(r<0||Math.abs(i.start-n.start)<Math.abs(t[r].start-n.start))&&(r=o);return r}var BM=new WeakMap;function K_(e){let t=BM.get(e);if(t)return t;let n={query:"",matchCase:false,wholeWord:false,matches:vh,truncated:false,activeIndex:-1,activeMatch:null,isPending:false},r="",o={},i,a=new Set,s=new Map,l=false;function d(){let T="none";for(let P of s.values()){if(P==="all")return "all";P==="active"&&(T="active");}return T}function c(){let T=d(),{matches:P,activeIndex:O}=n,v=O>=0?P[O]:void 0,C=T==="all"?P:T==="active"&&v?[v]:[];C.length===0&&!l||(e.setHighlights(qM,C,{activeIndex:T==="all"?O:C.length>0?0:-1,priority:KM}),l=C.length>0);}function u(T){let P={...n,...T};if(P.matches!==n.matches&&T.activeIndex===void 0&&(P.activeIndex=q_(n,P.matches)),P.truncated=xO(P.matches)??P.matches.length>=$M,P.activeMatch=P.matches[P.activeIndex]??null,!!Object.keys(P).some(v=>P[v]!==n[v])){n=P,c();for(let v of [...a])v();}}function p(T=r,P=n){return T.length===0?vh:e.findMatches(T,{matchCase:P.matchCase??false,wholeWord:P.wholeWord??false})}function m(){clearTimeout(i),i=void 0;}function g(){m(),r=n.query,u({matches:p(),isPending:false});}let b,h=0,y=()=>{clearTimeout(b),b=void 0,h=0,r.length>0&&u({matches:p()});},S=()=>{b!==void 0&&y();};e.on("change",T=>{if(r.length===0)return;if(T.source)return y();let P=Date.now();h===0&&(h=P),clearTimeout(b);let O=Math.min(xh,$_-(P-h));b=setTimeout(y,Math.max(0,O));});let x=e.snapshot().editingMode;e.on("selectionChange",T=>{T.editingMode!==x&&(x=T.editingMode,y());});let I=(T,P)=>{S();let O=n.matches.length;if(O===0)return false;let v=n.activeIndex<0?T>0?-1:0:n.activeIndex;return R.goTo((v+T+O)%O,P)},R={getState:()=>n,subscribe(T){return a.add(T),()=>a.delete(T)},find(T,P={}){m(),r=T;let O=P.matchCase??n.matchCase,v=P.wholeWord??n.wholeWord,C=p(T,{matchCase:O,wholeWord:v});return P.highlight===void 0||P.highlight==="none"?s.delete(o):s.set(o,P.highlight),u({query:T,matchCase:O,wholeWord:v,matches:C,activeIndex:-1,isPending:false}),c(),P.selectFirst&&R.goTo(0),n.matches},setQuery(T){T!==n.query&&(m(),T!==r&&(i=setTimeout(g,xh)),u({query:T,isPending:T!==r}));},setMatchCase(T){u({matchCase:T,matches:p(r,{...n,matchCase:T})});},setWholeWord(T){u({wholeWord:T,matches:p(r,{...n,wholeWord:T})});},goTo(T,P){S();let O=n.matches[T];return !O||(P?.focus&&e.focus(),!e.selectMatch(O).ok)?false:(u({activeIndex:T}),true)},next:T=>I(1,T),previous:T=>I(-1,T),clear(){m(),r="",s.delete(o),u({query:"",matches:vh,activeIndex:-1,isPending:false});},showHighlights(T){let P={};return s.set(P,T),c(),()=>{s.delete(P)&&c();}}};return BM.set(e,R),R}var V_=[37,80,68,70,45],Us=class extends Error{constructor(n){super(`Install @docx-editor.dev/docx-to-${n} and configure menu.exporters.${n}.`+(n==="pdf"?" PDF conversion requires a Node.js server.":""));this.format=n;this.name="ChromeExportError";}format;code="missing-exporter"};async function wh(e,t,n={}){if(t==="markdown"){if(!n.markdown)throw new Us(t);let a=await n.markdown(new Uint8Array(await e.save()));if(typeof a?.markdown!="string")throw new TypeError("The Markdown converter returned no Markdown.");return {bytes:new TextEncoder().encode(a.markdown),extension:"md",mimeType:"text/markdown;charset=utf-8"}}if(t!=="pdf")throw new TypeError("Unsupported export format.");if(!n.pdf)throw new Us(t);let r=e.snapshot?.(),o=r?{displayMode:r.reviewDisplayMode??"proposed",revisionMarkup:r.revisionMarkup,...e.getReviewAuthors?{revisionAuthorSlots:Object.freeze(Object.fromEntries(e.getReviewAuthors().map(({author:a,slot:s})=>[a,s])))}:{}}:void 0,i=await n.pdf(new Uint8Array(await e.save()),o);if(!(i?.bytes instanceof Uint8Array)||i.bytes.length===0)throw new TypeError("The PDF converter returned no PDF bytes.");if(!V_.every((a,s)=>i.bytes[s]===a))throw new TypeError("The PDF converter returned a file without a PDF header.");return {bytes:i.bytes,extension:"pdf",mimeType:"application/pdf"}}var W_=15e3,Un=class extends Error{code;constructor(t){super(t==="pdf-viewer-unavailable"?"This browser cannot display PDF files in the page.":t==="pdf-load-failed"?"The PDF did not load for printing.":t==="print-refused"?"The browser refused to print the PDF from the page.":"The print job has ended."),this.code=t,this.name="ChromePrintError";}};function Z_(e){if(e.altKey||e.shiftKey||typeof e.key!="string")return false;let t=e.key.toLowerCase();return t!=="p"&&(e.code!=="KeyP"||/^[a-z]$/.test(t))?false:i18n.isApplePlatform()?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey}async function z_(e,t={},n=document){let{bytes:r,mimeType:o}=await wh(e,"pdf",t);return U_(r,o,n)}function U_(e,t,n){let r=n.nodeType===9?n.body:n;if(!r)throw new TypeError("Printing requires a document body.");let o=r.ownerDocument,i=o.defaultView;if(!i)throw new TypeError("Printing requires a document with a window.");let a=e.buffer instanceof ArrayBuffer?e:e.slice(),s=i.URL.createObjectURL(new i.Blob([a],{type:t})),l=null,d=null,c,u=null,p=false,m=h=>{i.clearTimeout(c),u?.(h),u=null,l?.remove(),l=null,d=null;},g=()=>{if(d)return d;let h=o.createElement("iframe");return l=h,h.setAttribute("aria-hidden","true"),h.setAttribute("tabindex","-1"),h.setAttribute("data-docx-print-frame",""),h.style.cssText="position:fixed;right:0;bottom:0;width:0;height:0;border:0;visibility:hidden;",d=new Promise((y,S)=>{u=S,c=i.setTimeout(()=>m(new Un("pdf-load-failed")),W_),h.addEventListener("load",()=>{if(i.clearTimeout(c),!h.contentWindow){m(new Un("pdf-load-failed"));return}u=null,y(h.contentWindow);},{once:true});}),d.catch(()=>{}),h.src=s,r.append(h),d};return {url:s,async print(h={}){if(p)throw new Un("print-ended");if(i.navigator.pdfViewerEnabled===false)throw new Un("pdf-viewer-unavailable");let y=await g();if(p)throw new Un("print-ended");if(await h.beforePrint?.(),p)throw new Un("print-ended");let S=o.activeElement;try{y.focus(),y.print();}catch{throw new Un("print-refused")}finally{S?.isConnected&&S.focus({preventScroll:true});}},dispose(){p||(p=true,m(new Un("print-ended")),i.URL.revokeObjectURL(s));}}}
|
|
27
|
+
exports.$=Ki;exports.$a=fR;exports.$b=AM;exports.A=kS;exports.Aa=ON;exports.Ab=t_;exports.B=RS;exports.Ba=NI;exports.Bb=Zc;exports.C=kd;exports.Ca=HI;exports.Cb=zc;exports.D=Pp;exports.Da=MN;exports.Db=gh;exports.E=Tp;exports.Ea=AN;exports.Eb=d_;exports.F=uL;exports.Fa=pm;exports.Fb=kM;exports.G=Gp;exports.Ga=FN;exports.Gb=u_;exports.H=qL;exports.Ha=LN;exports.Hb=bh;exports.I=hs;exports.Ia=NN;exports.Ib=p_;exports.J=ys;exports.Ja=DN;exports.Jb=g_;exports.K=Xp;exports.Ka=HN;exports.Kb=h_;exports.L=KL;exports.La=_N;exports.Lb=y_;exports.M=Yp;exports.Ma=BN;exports.Mb=b_;exports.N=Cd;exports.Na=$N;exports.Nb=v_;exports.O=Ot;exports.Oa=qN;exports.Ob=x_;exports.P=zo;exports.Pa=BI;exports.Pb=w_;exports.Q=oI;exports.Qa=jI;exports.Qb=TM;exports.R=Ed;exports.Ra=GN;exports.Rb=CM;exports.S=ar;exports.Sa=gm;exports.Sb=k_;exports.T=vs;exports.Ta=hm;exports.Tb=R_;exports.U=rm;exports.Ua=YN;exports.Ub=EM;exports.V=im;exports.Va=GI;exports.Vb=P_;exports.W=eN;exports.Wa=QN;exports.Wb=T_;exports.X=tN;exports.Xa=XI;exports.Xb=C_;exports.Y=rN;exports.Ya=JN;exports.Yb=OM;exports.Z=oN;exports.Za=eD;exports.Zb=MM;exports._=Ad;exports._a=tD;exports._b=E_;exports.a=Mi;exports.aa=RI;exports.ab=Es;exports.ac=O_;exports.b=as;exports.ba=dm;exports.bb=Os;exports.bc=FM;exports.c=rd;exports.ca=ws;exports.cb=HD;exports.cc=M_;exports.d=od;exports.da=dN;exports.db=Am;exports.dc=LM;exports.e=Ff;exports.ea=PI;exports.eb=Xo;exports.ec=A_;exports.f=MA;exports.fa=TI;exports.fb=Dr;exports.fc=F_;exports.g=Lf;exports.ga=cN;exports.gb=tc;exports.gc=L_;exports.h=q1;exports.ha=Uo;exports.hb=LR;exports.hc=uo;exports.i=K1;exports.ia=cm;exports.ib=NR;exports.ic=D_;exports.j=Me;exports.ja=mN;exports.jb=Lm;exports.jc=H_;exports.k=vp;exports.ka=gN;exports.kb=nc;exports.kc=B_;exports.l=Y1;exports.la=yN;exports.lb=Nm;exports.lc=xh;exports.m=J1;exports.ma=Nd;exports.mb=rc;exports.mc=$M;exports.n=eL;exports.na=MI;exports.nb=Dm;exports.nc=qM;exports.o=sS;exports.oa=Ld;exports.ob=Hm;exports.oc=KM;exports.p=tL;exports.pa=AI;exports.pb=_m;exports.pc=K_;exports.q=nL;exports.qa=FI;exports.qb=LP;exports.qc=Us;exports.r=rL;exports.ra=wN;exports.rb=vc;exports.rc=wh;exports.s=oL;exports.sa=SN;exports.sb=Ag;exports.sc=Un;exports.t=iL;exports.ta=IN;exports.tb=Mc;exports.tc=Z_;exports.u=aL;exports.ua=RN;exports.ub=y8;exports.uc=z_;exports.v=dS;exports.va=PN;exports.vb=b8;exports.w=cS;exports.wa=TN;exports.wb=mh;exports.x=uS;exports.xa=CN;exports.xb=Zs;exports.y=sL;exports.ya=EN;exports.yb=zs;exports.z=kp;exports.za=fm;exports.zb=ia;
|