@eigenpal/docx-editor-core 0.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +204 -0
- package/README.md +54 -0
- package/dist/ImageExtension-BN327PNe.d.mts +38 -0
- package/dist/ImageExtension-BlI5afZD.d.ts +38 -0
- package/dist/Subscribable-DOz6Ohoo.d.mts +33 -0
- package/dist/Subscribable-DOz6Ohoo.d.ts +33 -0
- package/dist/agent/index.d.mts +169 -0
- package/dist/agent/index.d.ts +169 -0
- package/dist/agent/index.js +1 -0
- package/dist/agent/index.mjs +1 -0
- package/dist/borders-BH_GoYU3.d.mts +58 -0
- package/dist/borders-Z9hPno2u.d.ts +58 -0
- package/dist/chunk-23CP3TOP.js +1 -0
- package/dist/chunk-2KHWHVTA.js +1 -0
- package/dist/chunk-36VIYQHD.mjs +9 -0
- package/dist/chunk-3COGZG7O.mjs +1 -0
- package/dist/chunk-3NRMSZX2.mjs +1 -0
- package/dist/chunk-3SXJPJSV.mjs +1 -0
- package/dist/chunk-44RUAQA2.js +1 -0
- package/dist/chunk-4AJYHCPB.js +2 -0
- package/dist/chunk-4BFNWPKW.js +1 -0
- package/dist/chunk-4EHBV73E.mjs +59 -0
- package/dist/chunk-4G6AJ4ZM.js +1 -0
- package/dist/chunk-4GER4JLW.js +1 -0
- package/dist/chunk-4Q2IP5FW.js +1 -0
- package/dist/chunk-5N5DBQJV.mjs +1 -0
- package/dist/chunk-62NPHRTF.js +1 -0
- package/dist/chunk-67LVRQIR.mjs +1 -0
- package/dist/chunk-6ILFFGGS.js +2 -0
- package/dist/chunk-6LOYA7G5.mjs +2 -0
- package/dist/chunk-6LVPRTB6.js +1 -0
- package/dist/chunk-6NQSIC27.mjs +1 -0
- package/dist/chunk-6VUYFDHY.mjs +1 -0
- package/dist/chunk-7E5VBRDL.mjs +1 -0
- package/dist/chunk-7GHQ4YCJ.mjs +1 -0
- package/dist/chunk-7RDCZLTU.js +1 -0
- package/dist/chunk-7VCMJCBY.js +2 -0
- package/dist/chunk-AAPBAMD7.js +1 -0
- package/dist/chunk-AMENZY5F.mjs +1 -0
- package/dist/chunk-ARHPXIBJ.mjs +1 -0
- package/dist/chunk-BGC7QKP5.mjs +1 -0
- package/dist/chunk-BGY3CB37.mjs +1 -0
- package/dist/chunk-BHBOAP6Z.js +3 -0
- package/dist/chunk-BWHUD2XC.mjs +4 -0
- package/dist/chunk-CCWOLPZE.js +3 -0
- package/dist/chunk-CGJ6S3AH.mjs +1 -0
- package/dist/chunk-CKKO4JWE.mjs +1 -0
- package/dist/chunk-CKXAHSJQ.js +10 -0
- package/dist/chunk-CP5OSG5Z.mjs +1 -0
- package/dist/chunk-CUY2THAO.mjs +1 -0
- package/dist/chunk-CWAP26GB.js +4 -0
- package/dist/chunk-D4RPOJC7.js +1 -0
- package/dist/chunk-D6GO7UGD.mjs +1 -0
- package/dist/chunk-DC7S76ZX.js +1 -0
- package/dist/chunk-DFZTUQ7O.js +2 -0
- package/dist/chunk-DROCYKAR.js +1 -0
- package/dist/chunk-DWFWYHM5.mjs +1 -0
- package/dist/chunk-DY2MJCSV.js +1 -0
- package/dist/chunk-ESI4BSBF.js +1 -0
- package/dist/chunk-FC6QL3E6.js +1 -0
- package/dist/chunk-FWTP7BN7.mjs +4 -0
- package/dist/chunk-G6Y4UZMJ.mjs +1 -0
- package/dist/chunk-GGPKPXON.js +1 -0
- package/dist/chunk-GXW7YSFL.mjs +1 -0
- package/dist/chunk-I6PMX4BO.js +1 -0
- package/dist/chunk-IBNUQL57.mjs +2 -0
- package/dist/chunk-ILJUDEZ5.mjs +1 -0
- package/dist/chunk-IP2VXNWG.js +1 -0
- package/dist/chunk-J7ULKGU2.mjs +10 -0
- package/dist/chunk-JFZIXFRC.js +1 -0
- package/dist/chunk-JHZ3HLSR.mjs +1 -0
- package/dist/chunk-JKVXID22.mjs +1 -0
- package/dist/chunk-JY5EFI4D.js +1 -0
- package/dist/chunk-KBU6QQFU.js +9 -0
- package/dist/chunk-KESNGXGO.js +1 -0
- package/dist/chunk-KQTB5Y7P.mjs +1 -0
- package/dist/chunk-LBKMYD3M.mjs +1 -0
- package/dist/chunk-LMF2ELOB.js +1 -0
- package/dist/chunk-LVD6HXRF.mjs +2 -0
- package/dist/chunk-MJ5FQX7Q.js +1 -0
- package/dist/chunk-MOKKS75W.mjs +3 -0
- package/dist/chunk-MVZOTKNL.mjs +1 -0
- package/dist/chunk-MZ7LW5CH.js +1 -0
- package/dist/chunk-MZOVDLYL.js +1 -0
- package/dist/chunk-N27FJQTG.js +1 -0
- package/dist/chunk-N3Y5BUKV.js +1 -0
- package/dist/chunk-NBLJPT54.mjs +1 -0
- package/dist/chunk-NERY274X.js +1 -0
- package/dist/chunk-NNQWQOC5.mjs +1 -0
- package/dist/chunk-NXLJVVVE.js +1 -0
- package/dist/chunk-O5X22KZ6.mjs +1 -0
- package/dist/chunk-OBMN4VSM.mjs +1 -0
- package/dist/chunk-OCAX2KJQ.js +4 -0
- package/dist/chunk-OZMNIX6U.mjs +1 -0
- package/dist/chunk-PRRM64JO.mjs +1 -0
- package/dist/chunk-Q4CKLXWA.js +1 -0
- package/dist/chunk-Q5QOBZWT.mjs +1 -0
- package/dist/chunk-QPFJJPIC.mjs +1 -0
- package/dist/chunk-QYUPLKLP.mjs +1 -0
- package/dist/chunk-RNOXNNSD.mjs +0 -0
- package/dist/chunk-RPIQG46O.mjs +1 -0
- package/dist/chunk-S7IKPRC3.js +9 -0
- package/dist/chunk-SUXJX72X.js +1 -0
- package/dist/chunk-SYJAAHUK.js +1 -0
- package/dist/chunk-T4CPTPRP.js +1 -0
- package/dist/chunk-TE2AF7FM.js +1 -0
- package/dist/chunk-TE2VQJZG.js +1 -0
- package/dist/chunk-TRJWRZZD.js +1 -0
- package/dist/chunk-U4UCHBZ7.js +1 -0
- package/dist/chunk-UDPROEUK.js +1 -0
- package/dist/chunk-UIROUI5I.mjs +1 -0
- package/dist/chunk-UOFQYE2L.mjs +1 -0
- package/dist/chunk-UQ6WNWXX.js +1 -0
- package/dist/chunk-V7BKPX67.mjs +2 -0
- package/dist/chunk-VKTCTMIO.mjs +2 -0
- package/dist/chunk-VQWZHPWI.mjs +1 -0
- package/dist/chunk-VW22RZ6C.mjs +1 -0
- package/dist/chunk-WLKRUBY4.js +1 -0
- package/dist/chunk-WLQEPVDR.js +1 -0
- package/dist/chunk-WNTT4MGC.js +59 -0
- package/dist/chunk-WTFLNYAT.mjs +1 -0
- package/dist/chunk-XXU7YQVV.js +1 -0
- package/dist/chunk-Y5HZAMND.mjs +9 -0
- package/dist/chunk-Y74ANBPV.js +1 -0
- package/dist/chunk-Y7JZPBBW.js +1 -0
- package/dist/chunk-YGHHSCPR.js +2 -0
- package/dist/chunk-YMZ3F2FZ.mjs +1 -0
- package/dist/chunk-YUKBAAB5.mjs +1 -0
- package/dist/chunk-ZRZ2VRQQ.mjs +1 -0
- package/dist/chunk-ZYESB4KC.mjs +3 -0
- package/dist/colorResolver-C3q7MLLD.d.mts +390 -0
- package/dist/colorResolver-CVsPLsw1.d.ts +390 -0
- package/dist/colors-C3vA7HUU.d.mts +70 -0
- package/dist/colors-C3vA7HUU.d.ts +70 -0
- package/dist/core-plugins.d.mts +64 -0
- package/dist/core-plugins.d.ts +64 -0
- package/dist/core-plugins.js +1 -0
- package/dist/core-plugins.mjs +1 -0
- package/dist/core.d.mts +399 -0
- package/dist/core.d.ts +399 -0
- package/dist/core.js +1 -0
- package/dist/core.mjs +1 -0
- package/dist/documentSerializer-C1ueey5d.d.mts +36 -0
- package/dist/documentSerializer-Chn7J1WG.d.ts +36 -0
- package/dist/docx/index.d.mts +1124 -0
- package/dist/docx/index.d.ts +1124 -0
- package/dist/docx/index.js +1 -0
- package/dist/docx/index.mjs +1 -0
- package/dist/docx/parser.d.mts +109 -0
- package/dist/docx/parser.d.ts +109 -0
- package/dist/docx/parser.js +1 -0
- package/dist/docx/parser.mjs +1 -0
- package/dist/docx/rezip.d.mts +313 -0
- package/dist/docx/rezip.d.ts +313 -0
- package/dist/docx/rezip.js +1 -0
- package/dist/docx/rezip.mjs +1 -0
- package/dist/docx/serializer/index.d.mts +126 -0
- package/dist/docx/serializer/index.d.ts +126 -0
- package/dist/docx/serializer/index.js +1 -0
- package/dist/docx/serializer/index.mjs +1 -0
- package/dist/docx/wrapTypes.d.mts +19 -0
- package/dist/docx/wrapTypes.d.ts +19 -0
- package/dist/docx/wrapTypes.js +1 -0
- package/dist/docx/wrapTypes.mjs +1 -0
- package/dist/docxInput-DTbCa48g.d.mts +21 -0
- package/dist/docxInput-DTbCa48g.d.ts +21 -0
- package/dist/executor-DZAMMQ35.js +1 -0
- package/dist/executor-ZCJRLT3Z.mjs +1 -0
- package/dist/findParagraphByParaId-Maw_8M5D.d.mts +28 -0
- package/dist/findParagraphByParaId-Maw_8M5D.d.ts +28 -0
- package/dist/fontLoader-BOt95Jtf.d.mts +223 -0
- package/dist/fontLoader-QPwbcX5j.d.ts +223 -0
- package/dist/footnotes-lCH_P3N3.d.mts +78 -0
- package/dist/footnotes-skVvEHvZ.d.ts +78 -0
- package/dist/formatting-BwpZWdGi.d.ts +410 -0
- package/dist/formatting-D9I-lFS4.d.mts +410 -0
- package/dist/headerFooterLayout-B3QVg556.d.ts +201 -0
- package/dist/headerFooterLayout-DkclHZ0Z.d.mts +201 -0
- package/dist/headless.d.mts +110 -0
- package/dist/headless.d.ts +110 -0
- package/dist/headless.js +1 -0
- package/dist/headless.mjs +1 -0
- package/dist/layout-bridge/clickToPositionDom.d.mts +56 -0
- package/dist/layout-bridge/clickToPositionDom.d.ts +56 -0
- package/dist/layout-bridge/clickToPositionDom.js +1 -0
- package/dist/layout-bridge/clickToPositionDom.mjs +1 -0
- package/dist/layout-bridge/index.d.mts +462 -0
- package/dist/layout-bridge/index.d.ts +462 -0
- package/dist/layout-bridge/index.js +1 -0
- package/dist/layout-bridge/index.mjs +1 -0
- package/dist/layout-bridge/measuring/index.d.mts +320 -0
- package/dist/layout-bridge/measuring/index.d.ts +320 -0
- package/dist/layout-bridge/measuring/index.js +1 -0
- package/dist/layout-bridge/measuring/index.mjs +1 -0
- package/dist/layout-bridge/tableInsertHover.d.mts +45 -0
- package/dist/layout-bridge/tableInsertHover.d.ts +45 -0
- package/dist/layout-bridge/tableInsertHover.js +1 -0
- package/dist/layout-bridge/tableInsertHover.mjs +1 -0
- package/dist/layout-bridge/toFlowBlocks.d.mts +122 -0
- package/dist/layout-bridge/toFlowBlocks.d.ts +122 -0
- package/dist/layout-bridge/toFlowBlocks.js +1 -0
- package/dist/layout-bridge/toFlowBlocks.mjs +1 -0
- package/dist/layout-engine/index.d.mts +322 -0
- package/dist/layout-engine/index.d.ts +322 -0
- package/dist/layout-engine/index.js +1 -0
- package/dist/layout-engine/index.mjs +1 -0
- package/dist/layout-engine/types.d.mts +903 -0
- package/dist/layout-engine/types.d.ts +903 -0
- package/dist/layout-engine/types.js +1 -0
- package/dist/layout-engine/types.mjs +1 -0
- package/dist/layout-painter/index.d.mts +23 -0
- package/dist/layout-painter/index.d.ts +23 -0
- package/dist/layout-painter/index.js +1 -0
- package/dist/layout-painter/index.mjs +1 -0
- package/dist/layout-painter/renderPage.d.mts +674 -0
- package/dist/layout-painter/renderPage.d.ts +674 -0
- package/dist/layout-painter/renderPage.js +1 -0
- package/dist/layout-painter/renderPage.mjs +1 -0
- package/dist/lists-CdiIk_c1.d.ts +142 -0
- package/dist/lists-JDB80qyP.d.mts +142 -0
- package/dist/managers/AutoSaveManager.d.mts +96 -0
- package/dist/managers/AutoSaveManager.d.ts +96 -0
- package/dist/managers/AutoSaveManager.js +1 -0
- package/dist/managers/AutoSaveManager.mjs +1 -0
- package/dist/managers/TableSelectionManager.d.mts +95 -0
- package/dist/managers/TableSelectionManager.d.ts +95 -0
- package/dist/managers/TableSelectionManager.js +1 -0
- package/dist/managers/TableSelectionManager.mjs +1 -0
- package/dist/managers/types.d.mts +122 -0
- package/dist/managers/types.d.ts +122 -0
- package/dist/managers/types.js +1 -0
- package/dist/managers/types.mjs +0 -0
- package/dist/marks-BujVxYP4.d.ts +56 -0
- package/dist/marks-CCPVlQzL.d.mts +56 -0
- package/dist/mcp-cli.mjs +137 -0
- package/dist/mcp.d.mts +184 -0
- package/dist/mcp.d.ts +184 -0
- package/dist/mcp.js +16 -0
- package/dist/mcp.mjs +16 -0
- package/dist/nodes-BXi1Uu3e.d.mts +257 -0
- package/dist/nodes-DfKj9kUA.d.ts +257 -0
- package/dist/plugin-api/RenderedDomContext.d.mts +74 -0
- package/dist/plugin-api/RenderedDomContext.d.ts +74 -0
- package/dist/plugin-api/RenderedDomContext.js +1 -0
- package/dist/plugin-api/RenderedDomContext.mjs +1 -0
- package/dist/plugin-api/index.d.mts +15 -0
- package/dist/plugin-api/index.d.ts +15 -0
- package/dist/plugin-api/index.js +1 -0
- package/dist/plugin-api/index.mjs +0 -0
- package/dist/plugin-api/resolveItemPositions.d.mts +54 -0
- package/dist/plugin-api/resolveItemPositions.d.ts +54 -0
- package/dist/plugin-api/resolveItemPositions.js +1 -0
- package/dist/plugin-api/resolveItemPositions.mjs +1 -0
- package/dist/plugin-api/types.d.mts +190 -0
- package/dist/plugin-api/types.d.ts +190 -0
- package/dist/plugin-api/types.js +1 -0
- package/dist/plugin-api/types.mjs +0 -0
- package/dist/processTemplate-GPFDLQMX.mjs +1 -0
- package/dist/processTemplate-HH2E3HBO.js +1 -0
- package/dist/prosemirror/commands/formatting.d.mts +100 -0
- package/dist/prosemirror/commands/formatting.d.ts +100 -0
- package/dist/prosemirror/commands/formatting.js +1 -0
- package/dist/prosemirror/commands/formatting.mjs +1 -0
- package/dist/prosemirror/commands/index.d.mts +114 -0
- package/dist/prosemirror/commands/index.d.ts +114 -0
- package/dist/prosemirror/commands/index.js +1 -0
- package/dist/prosemirror/commands/index.mjs +1 -0
- package/dist/prosemirror/commands/pageBreak.d.mts +20 -0
- package/dist/prosemirror/commands/pageBreak.d.ts +20 -0
- package/dist/prosemirror/commands/pageBreak.js +1 -0
- package/dist/prosemirror/commands/pageBreak.mjs +1 -0
- package/dist/prosemirror/commands/paragraph.d.mts +70 -0
- package/dist/prosemirror/commands/paragraph.d.ts +70 -0
- package/dist/prosemirror/commands/paragraph.js +1 -0
- package/dist/prosemirror/commands/paragraph.mjs +1 -0
- package/dist/prosemirror/conversion/fromProseDoc.d.mts +66 -0
- package/dist/prosemirror/conversion/fromProseDoc.d.ts +66 -0
- package/dist/prosemirror/conversion/fromProseDoc.js +1 -0
- package/dist/prosemirror/conversion/fromProseDoc.mjs +1 -0
- package/dist/prosemirror/conversion/index.d.mts +78 -0
- package/dist/prosemirror/conversion/index.d.ts +78 -0
- package/dist/prosemirror/conversion/index.js +1 -0
- package/dist/prosemirror/conversion/index.mjs +1 -0
- package/dist/prosemirror/editor.css +763 -0
- package/dist/prosemirror/extensions/index.d.mts +79 -0
- package/dist/prosemirror/extensions/index.d.ts +79 -0
- package/dist/prosemirror/extensions/index.js +1 -0
- package/dist/prosemirror/extensions/index.mjs +1 -0
- package/dist/prosemirror/extensions/nodes/TableExtension.d.mts +30 -0
- package/dist/prosemirror/extensions/nodes/TableExtension.d.ts +30 -0
- package/dist/prosemirror/extensions/nodes/TableExtension.js +1 -0
- package/dist/prosemirror/extensions/nodes/TableExtension.mjs +1 -0
- package/dist/prosemirror/index.d.mts +71 -0
- package/dist/prosemirror/index.d.ts +71 -0
- package/dist/prosemirror/index.js +1 -0
- package/dist/prosemirror/index.mjs +1 -0
- package/dist/prosemirror/plugins/index.d.mts +50 -0
- package/dist/prosemirror/plugins/index.d.ts +50 -0
- package/dist/prosemirror/plugins/index.js +1 -0
- package/dist/prosemirror/plugins/index.mjs +1 -0
- package/dist/prosemirror/plugins/selectionTracker.d.mts +78 -0
- package/dist/prosemirror/plugins/selectionTracker.d.ts +78 -0
- package/dist/prosemirror/plugins/selectionTracker.js +1 -0
- package/dist/prosemirror/plugins/selectionTracker.mjs +1 -0
- package/dist/prosemirror/schema/index.d.mts +30 -0
- package/dist/prosemirror/schema/index.d.ts +30 -0
- package/dist/prosemirror/schema/index.js +1 -0
- package/dist/prosemirror/schema/index.mjs +1 -0
- package/dist/prosemirror/styles/index.d.mts +124 -0
- package/dist/prosemirror/styles/index.d.ts +124 -0
- package/dist/prosemirror/styles/index.js +1 -0
- package/dist/prosemirror/styles/index.mjs +1 -0
- package/dist/prosemirror/template/prosemirror-plugin.d.mts +66 -0
- package/dist/prosemirror/template/prosemirror-plugin.d.ts +66 -0
- package/dist/prosemirror/template/prosemirror-plugin.js +15 -0
- package/dist/prosemirror/template/prosemirror-plugin.mjs +15 -0
- package/dist/prosemirror/utils/ClickPositionResolver.d.mts +109 -0
- package/dist/prosemirror/utils/ClickPositionResolver.d.ts +109 -0
- package/dist/prosemirror/utils/ClickPositionResolver.js +1 -0
- package/dist/prosemirror/utils/ClickPositionResolver.mjs +1 -0
- package/dist/prosemirror/utils/LayoutSelectionGate.d.mts +81 -0
- package/dist/prosemirror/utils/LayoutSelectionGate.d.ts +81 -0
- package/dist/prosemirror/utils/LayoutSelectionGate.js +1 -0
- package/dist/prosemirror/utils/LayoutSelectionGate.mjs +1 -0
- package/dist/prosemirror/utils/PointerEventHandler.d.mts +94 -0
- package/dist/prosemirror/utils/PointerEventHandler.d.ts +94 -0
- package/dist/prosemirror/utils/PointerEventHandler.js +1 -0
- package/dist/prosemirror/utils/PointerEventHandler.mjs +1 -0
- package/dist/prosemirror/utils/extractTrackedChanges.d.mts +63 -0
- package/dist/prosemirror/utils/extractTrackedChanges.d.ts +63 -0
- package/dist/prosemirror/utils/extractTrackedChanges.js +1 -0
- package/dist/prosemirror/utils/extractTrackedChanges.mjs +1 -0
- package/dist/prosemirror/utils/visualLineNavigation.d.mts +45 -0
- package/dist/prosemirror/utils/visualLineNavigation.d.ts +45 -0
- package/dist/prosemirror/utils/visualLineNavigation.js +1 -0
- package/dist/prosemirror/utils/visualLineNavigation.mjs +1 -0
- package/dist/registry-Cpyybgij.d.mts +165 -0
- package/dist/registry-E5pahPKL.d.ts +165 -0
- package/dist/selectionContext-85CE0f7a.d.ts +570 -0
- package/dist/selectionContext-Xq3AY7pn.d.mts +570 -0
- package/dist/selectiveSave-CWaPEv0B.d.ts +31 -0
- package/dist/selectiveSave-jinP_4xa.d.mts +31 -0
- package/dist/selectiveXmlPatch-ypkxlTD_.d.mts +23 -0
- package/dist/selectiveXmlPatch-ypkxlTD_.d.ts +23 -0
- package/dist/styles-BBoqh07F.d.mts +233 -0
- package/dist/styles-jqO45PSq.d.ts +233 -0
- package/dist/table-P8esKWAc.d.ts +82 -0
- package/dist/table-_t_W8oQf.d.mts +82 -0
- package/dist/types/agentApi.d.mts +467 -0
- package/dist/types/agentApi.d.ts +467 -0
- package/dist/types/agentApi.js +1 -0
- package/dist/types/agentApi.mjs +1 -0
- package/dist/types/content.d.mts +1181 -0
- package/dist/types/content.d.ts +1181 -0
- package/dist/types/content.js +1 -0
- package/dist/types/content.mjs +0 -0
- package/dist/types/document.d.mts +106 -0
- package/dist/types/document.d.ts +106 -0
- package/dist/types/document.js +1 -0
- package/dist/types/document.mjs +0 -0
- package/dist/types-DXG7vqe9.d.ts +311 -0
- package/dist/types-RchZmPFN.d.mts +137 -0
- package/dist/types-RchZmPFN.d.ts +137 -0
- package/dist/types-dYdjUZMo.d.mts +311 -0
- package/dist/utils/cardStyles.d.mts +31 -0
- package/dist/utils/cardStyles.d.ts +31 -0
- package/dist/utils/cardStyles.js +1 -0
- package/dist/utils/cardStyles.mjs +1 -0
- package/dist/utils/comments.d.mts +48 -0
- package/dist/utils/comments.d.ts +48 -0
- package/dist/utils/comments.js +1 -0
- package/dist/utils/comments.mjs +1 -0
- package/dist/utils/findReplace.d.mts +114 -0
- package/dist/utils/findReplace.d.ts +114 -0
- package/dist/utils/findReplace.js +2 -0
- package/dist/utils/findReplace.mjs +2 -0
- package/dist/utils/findVerticalScrollParent.d.mts +25 -0
- package/dist/utils/findVerticalScrollParent.d.ts +25 -0
- package/dist/utils/findVerticalScrollParent.js +1 -0
- package/dist/utils/findVerticalScrollParent.mjs +1 -0
- package/dist/utils/fontOptions.d.mts +21 -0
- package/dist/utils/fontOptions.d.ts +21 -0
- package/dist/utils/fontOptions.js +1 -0
- package/dist/utils/fontOptions.mjs +1 -0
- package/dist/utils/headingCollector.d.mts +32 -0
- package/dist/utils/headingCollector.d.ts +32 -0
- package/dist/utils/headingCollector.js +1 -0
- package/dist/utils/headingCollector.mjs +1 -0
- package/dist/utils/highlightColors.d.mts +14 -0
- package/dist/utils/highlightColors.d.ts +14 -0
- package/dist/utils/highlightColors.js +1 -0
- package/dist/utils/highlightColors.mjs +1 -0
- package/dist/utils/index.d.mts +711 -0
- package/dist/utils/index.d.ts +711 -0
- package/dist/utils/index.js +82 -0
- package/dist/utils/index.mjs +82 -0
- package/dist/utils/listState.d.mts +27 -0
- package/dist/utils/listState.d.ts +27 -0
- package/dist/utils/listState.js +1 -0
- package/dist/utils/listState.mjs +1 -0
- package/dist/utils/reportIssue.d.mts +23 -0
- package/dist/utils/reportIssue.d.ts +23 -0
- package/dist/utils/reportIssue.js +2 -0
- package/dist/utils/reportIssue.mjs +2 -0
- package/dist/utils/sidebarConstants.d.mts +10 -0
- package/dist/utils/sidebarConstants.d.ts +10 -0
- package/dist/utils/sidebarConstants.js +1 -0
- package/dist/utils/sidebarConstants.mjs +1 -0
- package/dist/utils/textSelection.d.mts +92 -0
- package/dist/utils/textSelection.d.ts +92 -0
- package/dist/utils/textSelection.js +1 -0
- package/dist/utils/textSelection.mjs +1 -0
- package/dist/utils/units.d.mts +91 -0
- package/dist/utils/units.d.ts +91 -0
- package/dist/utils/units.js +1 -0
- package/dist/utils/units.mjs +1 -0
- package/dist/variableDetector-CAdt8yOr.d.mts +115 -0
- package/dist/variableDetector-W4XEN9YC.d.ts +115 -0
- package/package.json +565 -0
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Document Agent
|
|
3
|
+
*
|
|
4
|
+
* Headless, framework-agnostic API for inspecting and editing the
|
|
5
|
+
* Document model. Used by `@eigenpal/docx-editor-agents` and any
|
|
6
|
+
* adapter that wants agent capabilities without UI.
|
|
7
|
+
* @packageDocumentation
|
|
8
|
+
* @public
|
|
9
|
+
*/
|
|
10
|
+
export { A as AgentContextOptions, S as ContextSelectionOptions, D as DocumentAgent, E as ExtendedSelectionContext, F as FormattedTextSegment, a as FormattingSummary, I as InsertHyperlinkOptions, b as InsertImageOptions, c as InsertTableOptions, d as InsertTextOptions, e as SelectionContextOptions, f as buildExtendedSelectionContext, g as buildSelectionContext, h as buildSelectionContextFromContext, i as createAgent, j as createAgentFromDocument, k as executeCommand, l as executeCommands, m as getAgentContext, n as getDocumentSummary, o as getSelectionFormattingSummary } from '../selectionContext-85CE0f7a.js';
|
|
11
|
+
import { T as TextFormatting } from '../formatting-BwpZWdGi.js';
|
|
12
|
+
import { DocumentBody, Paragraph, Hyperlink, Run, Table } from '../types/content.js';
|
|
13
|
+
import { Position } from '../types/agentApi.js';
|
|
14
|
+
export { AIAction, AIActionRequest, AgentCommand, AgentContext, AgentResponse, SelectionContext as AgentSelectionContext, ApplyStyleCommand, ApplyVariablesCommand, DEFAULT_AI_ACTIONS, DeleteTextCommand, FormatParagraphCommand, FormatTextCommand, InsertHyperlinkCommand, InsertImageCommand, InsertParagraphBreakCommand, InsertTableCommand, InsertTextCommand, MergeParagraphsCommand, ParagraphContext, ParagraphOutline, Range, RemoveHyperlinkCommand, ReplaceTextCommand, SectionInfo, SetVariableCommand, SplitParagraphCommand, StyleInfo, SuggestedAction, comparePositions, createCollapsedRange, createCommand, createRange, getActionDescription, getActionLabel, isPositionInRange } from '../types/agentApi.js';
|
|
15
|
+
import '../types/document.js';
|
|
16
|
+
import '../colors-C3vA7HUU.js';
|
|
17
|
+
import '../lists-CdiIk_c1.js';
|
|
18
|
+
import '../styles-jqO45PSq.js';
|
|
19
|
+
import '../docx/wrapTypes.js';
|
|
20
|
+
import '../selectiveSave-CWaPEv0B.js';
|
|
21
|
+
import '../docxInput-DTbCa48g.js';
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Shared Text Utilities for Agent Module
|
|
25
|
+
*
|
|
26
|
+
* Common text extraction and manipulation utilities used by
|
|
27
|
+
* context.ts, selectionContext.ts, and other agent-related code.
|
|
28
|
+
*
|
|
29
|
+
* Consolidates duplicated helper functions into a single location.
|
|
30
|
+
*/
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Get plain text from a paragraph
|
|
34
|
+
*/
|
|
35
|
+
declare function getParagraphText(paragraph: Paragraph): string;
|
|
36
|
+
/**
|
|
37
|
+
* Get plain text from a run
|
|
38
|
+
*/
|
|
39
|
+
declare function getRunText(run: Run): string;
|
|
40
|
+
/**
|
|
41
|
+
* Get plain text from a hyperlink
|
|
42
|
+
*/
|
|
43
|
+
declare function getHyperlinkText(hyperlink: Hyperlink): string;
|
|
44
|
+
/**
|
|
45
|
+
* Get plain text from a table
|
|
46
|
+
*/
|
|
47
|
+
declare function getTableText(table: Table): string;
|
|
48
|
+
/**
|
|
49
|
+
* Get plain text from document body
|
|
50
|
+
*/
|
|
51
|
+
declare function getBodyText(body: DocumentBody): string;
|
|
52
|
+
/**
|
|
53
|
+
* Count words in text
|
|
54
|
+
*/
|
|
55
|
+
declare function countWords(text: string): number;
|
|
56
|
+
/**
|
|
57
|
+
* Count characters in text
|
|
58
|
+
*/
|
|
59
|
+
declare function countCharacters(text: string, includeSpaces?: boolean): number;
|
|
60
|
+
/**
|
|
61
|
+
* Get word count from document body
|
|
62
|
+
*/
|
|
63
|
+
declare function getBodyWordCount(body: DocumentBody): number;
|
|
64
|
+
/**
|
|
65
|
+
* Get character count from document body
|
|
66
|
+
*/
|
|
67
|
+
declare function getBodyCharacterCount(body: DocumentBody): number;
|
|
68
|
+
/**
|
|
69
|
+
* Get text before a position
|
|
70
|
+
*
|
|
71
|
+
* @param paragraphs - Array of paragraphs
|
|
72
|
+
* @param position - Position to get text before
|
|
73
|
+
* @param maxChars - Maximum characters to return
|
|
74
|
+
* @returns Text before the position
|
|
75
|
+
*/
|
|
76
|
+
declare function getTextBefore(paragraphs: Paragraph[], position: Position, maxChars: number): string;
|
|
77
|
+
/**
|
|
78
|
+
* Get text after a position
|
|
79
|
+
*
|
|
80
|
+
* @param paragraphs - Array of paragraphs
|
|
81
|
+
* @param position - Position to get text after
|
|
82
|
+
* @param maxChars - Maximum characters to return
|
|
83
|
+
* @returns Text after the position
|
|
84
|
+
*/
|
|
85
|
+
declare function getTextAfter(paragraphs: Paragraph[], position: Position, maxChars: number): string;
|
|
86
|
+
/**
|
|
87
|
+
* Get formatting at a specific position in a paragraph
|
|
88
|
+
*
|
|
89
|
+
* @param paragraph - The paragraph to check
|
|
90
|
+
* @param offset - Character offset in the paragraph
|
|
91
|
+
* @returns Formatting at that position
|
|
92
|
+
*/
|
|
93
|
+
declare function getFormattingAtPosition(paragraph: Paragraph, offset: number): Partial<TextFormatting>;
|
|
94
|
+
/**
|
|
95
|
+
* Check if position is within a hyperlink
|
|
96
|
+
*
|
|
97
|
+
* @param paragraph - The paragraph to check
|
|
98
|
+
* @param offset - Character offset in the paragraph
|
|
99
|
+
* @returns True if position is in a hyperlink
|
|
100
|
+
*/
|
|
101
|
+
declare function isPositionInHyperlink(paragraph: Paragraph, offset: number): boolean;
|
|
102
|
+
/**
|
|
103
|
+
* Get hyperlink at position
|
|
104
|
+
*
|
|
105
|
+
* @param paragraph - The paragraph to check
|
|
106
|
+
* @param offset - Character offset in the paragraph
|
|
107
|
+
* @returns The hyperlink at that position, or undefined
|
|
108
|
+
*/
|
|
109
|
+
declare function getHyperlinkAtPosition(paragraph: Paragraph, offset: number): Hyperlink | undefined;
|
|
110
|
+
/**
|
|
111
|
+
* Check if style ID represents a heading
|
|
112
|
+
*
|
|
113
|
+
* @param styleId - Style ID to check
|
|
114
|
+
* @returns True if it's a heading style
|
|
115
|
+
*/
|
|
116
|
+
declare function isHeadingStyle(styleId?: string): boolean;
|
|
117
|
+
/**
|
|
118
|
+
* Parse heading level from style ID
|
|
119
|
+
*
|
|
120
|
+
* @param styleId - Style ID to parse
|
|
121
|
+
* @returns Heading level (1-9) or undefined
|
|
122
|
+
*/
|
|
123
|
+
declare function parseHeadingLevel(styleId?: string): number | undefined;
|
|
124
|
+
/**
|
|
125
|
+
* Check if document body has images
|
|
126
|
+
*
|
|
127
|
+
* @param body - Document body to check
|
|
128
|
+
* @returns True if contains images
|
|
129
|
+
*/
|
|
130
|
+
declare function hasImages(body: DocumentBody): boolean;
|
|
131
|
+
/**
|
|
132
|
+
* Check if document body has hyperlinks
|
|
133
|
+
*
|
|
134
|
+
* @param body - Document body to check
|
|
135
|
+
* @returns True if contains hyperlinks
|
|
136
|
+
*/
|
|
137
|
+
declare function hasHyperlinks(body: DocumentBody): boolean;
|
|
138
|
+
/**
|
|
139
|
+
* Check if document body has tables
|
|
140
|
+
*
|
|
141
|
+
* @param body - Document body to check
|
|
142
|
+
* @returns True if contains tables
|
|
143
|
+
*/
|
|
144
|
+
declare function hasTables(body: DocumentBody): boolean;
|
|
145
|
+
/**
|
|
146
|
+
* Get all paragraphs from document body
|
|
147
|
+
*
|
|
148
|
+
* @param body - Document body
|
|
149
|
+
* @returns Array of paragraphs
|
|
150
|
+
*/
|
|
151
|
+
declare function getParagraphs(body: DocumentBody): Paragraph[];
|
|
152
|
+
/**
|
|
153
|
+
* Get paragraph at index from document body
|
|
154
|
+
*
|
|
155
|
+
* @param body - Document body
|
|
156
|
+
* @param index - Paragraph index (0-indexed)
|
|
157
|
+
* @returns Paragraph or undefined
|
|
158
|
+
*/
|
|
159
|
+
declare function getParagraphAtIndex(body: DocumentBody, index: number): Paragraph | undefined;
|
|
160
|
+
/**
|
|
161
|
+
* Get block index for a paragraph index
|
|
162
|
+
*
|
|
163
|
+
* @param body - Document body
|
|
164
|
+
* @param paragraphIndex - Paragraph index
|
|
165
|
+
* @returns Block index or -1 if not found
|
|
166
|
+
*/
|
|
167
|
+
declare function getBlockIndexForParagraph(body: DocumentBody, paragraphIndex: number): number;
|
|
168
|
+
|
|
169
|
+
export { Position, countCharacters, countWords, getBlockIndexForParagraph, getBodyCharacterCount, getBodyText, getBodyWordCount, getFormattingAtPosition, getHyperlinkAtPosition, getHyperlinkText, getParagraphAtIndex, getParagraphText, getParagraphs, getRunText, getTableText, getTextAfter, getTextBefore, hasHyperlinks, hasImages, hasTables, isHeadingStyle, isPositionInHyperlink, parseHeadingLevel };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var chunkOCAX2KJQ_js=require('../chunk-OCAX2KJQ.js'),chunkXXU7YQVV_js=require('../chunk-XXU7YQVV.js'),chunkS7IKPRC3_js=require('../chunk-S7IKPRC3.js');require('../chunk-WLQEPVDR.js'),require('../chunk-U4UCHBZ7.js');var chunkTE2AF7FM_js=require('../chunk-TE2AF7FM.js');require('../chunk-WNTT4MGC.js'),require('../chunk-CCWOLPZE.js'),require('../chunk-4BFNWPKW.js'),require('../chunk-6ILFFGGS.js'),require('../chunk-CWAP26GB.js'),require('../chunk-KBU6QQFU.js'),require('../chunk-MZOVDLYL.js'),require('../chunk-YGHHSCPR.js'),require('../chunk-7VCMJCBY.js'),require('../chunk-T4CPTPRP.js'),require('../chunk-Q4CKLXWA.js'),require('../chunk-4Q2IP5FW.js'),require('../chunk-DC7S76ZX.js');Object.defineProperty(exports,"countCharacters",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.g}});Object.defineProperty(exports,"countWords",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.f}});Object.defineProperty(exports,"getBlockIndexForParagraph",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.v}});Object.defineProperty(exports,"getBodyCharacterCount",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.i}});Object.defineProperty(exports,"getBodyText",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.e}});Object.defineProperty(exports,"getBodyWordCount",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.h}});Object.defineProperty(exports,"getFormattingAtPosition",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.l}});Object.defineProperty(exports,"getHyperlinkAtPosition",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.n}});Object.defineProperty(exports,"getHyperlinkText",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.c}});Object.defineProperty(exports,"getParagraphAtIndex",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.u}});Object.defineProperty(exports,"getParagraphText",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.a}});Object.defineProperty(exports,"getParagraphs",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.t}});Object.defineProperty(exports,"getRunText",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.b}});Object.defineProperty(exports,"getTableText",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.d}});Object.defineProperty(exports,"getTextAfter",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.k}});Object.defineProperty(exports,"getTextBefore",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.j}});Object.defineProperty(exports,"hasHyperlinks",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.r}});Object.defineProperty(exports,"hasImages",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.q}});Object.defineProperty(exports,"hasTables",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.s}});Object.defineProperty(exports,"isHeadingStyle",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.o}});Object.defineProperty(exports,"isPositionInHyperlink",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.m}});Object.defineProperty(exports,"parseHeadingLevel",{enumerable:true,get:function(){return chunkOCAX2KJQ_js.p}});Object.defineProperty(exports,"DEFAULT_AI_ACTIONS",{enumerable:true,get:function(){return chunkXXU7YQVV_js.g}});Object.defineProperty(exports,"comparePositions",{enumerable:true,get:function(){return chunkXXU7YQVV_js.d}});Object.defineProperty(exports,"createCollapsedRange",{enumerable:true,get:function(){return chunkXXU7YQVV_js.a}});Object.defineProperty(exports,"createCommand",{enumerable:true,get:function(){return chunkXXU7YQVV_js.h}});Object.defineProperty(exports,"createRange",{enumerable:true,get:function(){return chunkXXU7YQVV_js.b}});Object.defineProperty(exports,"getActionDescription",{enumerable:true,get:function(){return chunkXXU7YQVV_js.f}});Object.defineProperty(exports,"getActionLabel",{enumerable:true,get:function(){return chunkXXU7YQVV_js.e}});Object.defineProperty(exports,"isPositionInRange",{enumerable:true,get:function(){return chunkXXU7YQVV_js.c}});Object.defineProperty(exports,"DocumentAgent",{enumerable:true,get:function(){return chunkS7IKPRC3_js.a}});Object.defineProperty(exports,"buildExtendedSelectionContext",{enumerable:true,get:function(){return chunkS7IKPRC3_js.h}});Object.defineProperty(exports,"buildSelectionContext",{enumerable:true,get:function(){return chunkS7IKPRC3_js.g}});Object.defineProperty(exports,"buildSelectionContextFromContext",{enumerable:true,get:function(){return chunkS7IKPRC3_js.e}});Object.defineProperty(exports,"createAgent",{enumerable:true,get:function(){return chunkS7IKPRC3_js.b}});Object.defineProperty(exports,"createAgentFromDocument",{enumerable:true,get:function(){return chunkS7IKPRC3_js.c}});Object.defineProperty(exports,"getAgentContext",{enumerable:true,get:function(){return chunkS7IKPRC3_js.d}});Object.defineProperty(exports,"getDocumentSummary",{enumerable:true,get:function(){return chunkS7IKPRC3_js.f}});Object.defineProperty(exports,"getSelectionFormattingSummary",{enumerable:true,get:function(){return chunkS7IKPRC3_js.i}});Object.defineProperty(exports,"executeCommand",{enumerable:true,get:function(){return chunkTE2AF7FM_js.a}});Object.defineProperty(exports,"executeCommands",{enumerable:true,get:function(){return chunkTE2AF7FM_js.b}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{g as countCharacters,f as countWords,v as getBlockIndexForParagraph,i as getBodyCharacterCount,e as getBodyText,h as getBodyWordCount,l as getFormattingAtPosition,n as getHyperlinkAtPosition,c as getHyperlinkText,u as getParagraphAtIndex,a as getParagraphText,t as getParagraphs,b as getRunText,d as getTableText,k as getTextAfter,j as getTextBefore,r as hasHyperlinks,q as hasImages,s as hasTables,o as isHeadingStyle,m as isPositionInHyperlink,p as parseHeadingLevel}from'../chunk-FWTP7BN7.mjs';export{g as DEFAULT_AI_ACTIONS,d as comparePositions,a as createCollapsedRange,h as createCommand,b as createRange,f as getActionDescription,e as getActionLabel,c as isPositionInRange}from'../chunk-MVZOTKNL.mjs';export{a as DocumentAgent,h as buildExtendedSelectionContext,g as buildSelectionContext,e as buildSelectionContextFromContext,b as createAgent,c as createAgentFromDocument,d as getAgentContext,f as getDocumentSummary,i as getSelectionFormattingSummary}from'../chunk-36VIYQHD.mjs';import'../chunk-O5X22KZ6.mjs';import'../chunk-ARHPXIBJ.mjs';export{a as executeCommand,b as executeCommands}from'../chunk-CUY2THAO.mjs';import'../chunk-4EHBV73E.mjs';import'../chunk-ZYESB4KC.mjs';import'../chunk-3NRMSZX2.mjs';import'../chunk-VKTCTMIO.mjs';import'../chunk-BWHUD2XC.mjs';import'../chunk-Y5HZAMND.mjs';import'../chunk-ILJUDEZ5.mjs';import'../chunk-IBNUQL57.mjs';import'../chunk-6LOYA7G5.mjs';import'../chunk-6VUYFDHY.mjs';import'../chunk-VQWZHPWI.mjs';import'../chunk-VW22RZ6C.mjs';import'../chunk-QYUPLKLP.mjs';
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { Node } from 'prosemirror-model';
|
|
2
|
+
import { EditorState, Command } from 'prosemirror-state';
|
|
3
|
+
import { C as ColorValue } from './colors-C3vA7HUU.mjs';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Table selection context + navigation helpers.
|
|
7
|
+
*
|
|
8
|
+
* `getTableContext` walks the selection up from `$from` and reports which
|
|
9
|
+
* table / row / cell the cursor is in, plus the table's row/column counts,
|
|
10
|
+
* whether a multi-cell selection is active, and the current cell's border
|
|
11
|
+
* + fill colors (so the toolbar's color pickers can show the live values).
|
|
12
|
+
*
|
|
13
|
+
* `goToNextCell` / `goToPrevCell` are tab-stop-style cell navigation commands
|
|
14
|
+
* registered by the plugin extension.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
interface TableContextInfo {
|
|
18
|
+
isInTable: boolean;
|
|
19
|
+
table?: Node;
|
|
20
|
+
tablePos?: number;
|
|
21
|
+
rowIndex?: number;
|
|
22
|
+
columnIndex?: number;
|
|
23
|
+
rowCount?: number;
|
|
24
|
+
columnCount?: number;
|
|
25
|
+
hasMultiCellSelection?: boolean;
|
|
26
|
+
canSplitCell?: boolean;
|
|
27
|
+
/** Current cell's dominant border color, if any */
|
|
28
|
+
cellBorderColor?: ColorValue;
|
|
29
|
+
/** Current cell's background/fill color (RGB hex without #), if any */
|
|
30
|
+
cellBackgroundColor?: string;
|
|
31
|
+
}
|
|
32
|
+
declare function getTableContext(state: EditorState): TableContextInfo;
|
|
33
|
+
declare function isInTableCell(state: EditorState): boolean;
|
|
34
|
+
declare function goToNextCell(): Command;
|
|
35
|
+
declare function goToPrevCell(): Command;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Cell-border commands. Each command applies a preset / individual side /
|
|
39
|
+
* color / width to the cells targeted by the current selection (single
|
|
40
|
+
* cursor cell or active `CellSelection`).
|
|
41
|
+
*
|
|
42
|
+
* All four commands use the shared `buildTableGrid` lookup to find each
|
|
43
|
+
* cell's neighbours in the grid, then sync the matching edge on the
|
|
44
|
+
* adjacent cell — Google-Docs style edge-symmetric border editing.
|
|
45
|
+
*
|
|
46
|
+
* Schema-free: only attribute updates via `tr.setNodeMarkup`.
|
|
47
|
+
*/
|
|
48
|
+
|
|
49
|
+
type BorderPreset = 'all' | 'outside' | 'inside' | 'none';
|
|
50
|
+
type BorderSpec = {
|
|
51
|
+
style: string;
|
|
52
|
+
size: number;
|
|
53
|
+
color: {
|
|
54
|
+
rgb: string;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
export { type BorderPreset as B, type TableContextInfo as T, type BorderSpec as a, goToNextCell as b, goToPrevCell as c, getTableContext as g, isInTableCell as i };
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { Node } from 'prosemirror-model';
|
|
2
|
+
import { EditorState, Command } from 'prosemirror-state';
|
|
3
|
+
import { C as ColorValue } from './colors-C3vA7HUU.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Table selection context + navigation helpers.
|
|
7
|
+
*
|
|
8
|
+
* `getTableContext` walks the selection up from `$from` and reports which
|
|
9
|
+
* table / row / cell the cursor is in, plus the table's row/column counts,
|
|
10
|
+
* whether a multi-cell selection is active, and the current cell's border
|
|
11
|
+
* + fill colors (so the toolbar's color pickers can show the live values).
|
|
12
|
+
*
|
|
13
|
+
* `goToNextCell` / `goToPrevCell` are tab-stop-style cell navigation commands
|
|
14
|
+
* registered by the plugin extension.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
interface TableContextInfo {
|
|
18
|
+
isInTable: boolean;
|
|
19
|
+
table?: Node;
|
|
20
|
+
tablePos?: number;
|
|
21
|
+
rowIndex?: number;
|
|
22
|
+
columnIndex?: number;
|
|
23
|
+
rowCount?: number;
|
|
24
|
+
columnCount?: number;
|
|
25
|
+
hasMultiCellSelection?: boolean;
|
|
26
|
+
canSplitCell?: boolean;
|
|
27
|
+
/** Current cell's dominant border color, if any */
|
|
28
|
+
cellBorderColor?: ColorValue;
|
|
29
|
+
/** Current cell's background/fill color (RGB hex without #), if any */
|
|
30
|
+
cellBackgroundColor?: string;
|
|
31
|
+
}
|
|
32
|
+
declare function getTableContext(state: EditorState): TableContextInfo;
|
|
33
|
+
declare function isInTableCell(state: EditorState): boolean;
|
|
34
|
+
declare function goToNextCell(): Command;
|
|
35
|
+
declare function goToPrevCell(): Command;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Cell-border commands. Each command applies a preset / individual side /
|
|
39
|
+
* color / width to the cells targeted by the current selection (single
|
|
40
|
+
* cursor cell or active `CellSelection`).
|
|
41
|
+
*
|
|
42
|
+
* All four commands use the shared `buildTableGrid` lookup to find each
|
|
43
|
+
* cell's neighbours in the grid, then sync the matching edge on the
|
|
44
|
+
* adjacent cell — Google-Docs style edge-symmetric border editing.
|
|
45
|
+
*
|
|
46
|
+
* Schema-free: only attribute updates via `tr.setNodeMarkup`.
|
|
47
|
+
*/
|
|
48
|
+
|
|
49
|
+
type BorderPreset = 'all' | 'outside' | 'inside' | 'none';
|
|
50
|
+
type BorderSpec = {
|
|
51
|
+
style: string;
|
|
52
|
+
size: number;
|
|
53
|
+
color: {
|
|
54
|
+
rgb: string;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
export { type BorderPreset as B, type TableContextInfo as T, type BorderSpec as a, goToNextCell as b, goToPrevCell as c, getTableContext as g, isInTableCell as i };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var chunk4AJYHCPB_js=require('./chunk-4AJYHCPB.js');var O=30,F=200,y=24,R=10,B=10,C=24;function N(_){let{mouseX:n,mouseY:l,pagesContainer:d,target:L,hfEditMode:m,edgeProximity:r=O}=_,T=`.${chunk4AJYHCPB_js.x.table}`,H=`.${chunk4AJYHCPB_js.x.row}`,p=`.${chunk4AJYHCPB_js.x.cell}`,h=`.${chunk4AJYHCPB_js.D.header}`,M=`.${chunk4AJYHCPB_js.D.footer}`,E=t=>{let o=!!t.closest(h),e=!!t.closest(M);return !o&&!e?!m:o?m==="header":m==="footer"},c=L.closest(T);if(c&&!E(c)&&(c=null),!c){let t=d.querySelectorAll(T);for(let o of Array.from(t)){if(!E(o))continue;let e=o.getBoundingClientRect(),s=n>=e.left-r&&n<e.left,A=l>=e.top-r&&l<e.top,P=n>=e.left-r&&n<=e.right,I=l>=e.top-r&&l<=e.bottom;if(s&&I||A&&P){c=o;break}}}if(!c)return null;let i=c.getBoundingClientRect(),b=n<i.left+r&&n>=i.left-r,g=l<i.top+r&&l>=i.top-r;if(!b&&!g)return null;let u=c.querySelectorAll(`:scope > ${H}`);if(u.length===0)return null;let S=t=>t&&Number(t.dataset.pmStart)||0;if(b)for(let t=0;t<u.length;t++){let o=u[t].getBoundingClientRect();if(l>=o.top&&l<=o.bottom){let e=u[t].querySelector(p),s=S(e);if(!s)break;return {type:"row",clientX:i.left-y,clientY:o.top+o.height/2-R,cellPmPos:s}}}if(g){let t=u[0].querySelectorAll(`:scope > ${p}`);for(let o=0;o<t.length;o++){let e=t[o].getBoundingClientRect();if(n>=e.left&&n<=e.right){let s=S(t[o]);if(!s)break;return {type:"column",clientX:e.left+e.width/2-B,clientY:i.top-C,cellPmPos:s}}}}return null}exports.a=O;exports.b=F;exports.c=N;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';function d(e,o,t){let r=0;for(let l=o;l<o+t&&l<e.length;l++)r+=e[l];return r}function C(e,o,t,r){let l=d(e,o,t),c=Math.floor(l/Math.max(r,1)),s=l-c*r,a=Array.from({length:r},(b,i)=>c+(i<s?1:0));return [...e.slice(0,o),...a,...e.slice(o+t)]}function T(e,o,t,r,l,c){let s=t-o.rowspan,a=r-o.colspan,b=l+s,i=o.row+o.rowspan,p=o.col+o.colspan,m=[];for(let n of e){if(n===o)continue;let u=n.row+n.rowspan,w=n.col+n.colspan,f=n.row<i&&u>o.row,h=n.col<p&&w>o.col;m.push({data:n.data,row:n.row>=i?n.row+s:n.row,col:n.col>=p?n.col+a:n.col,rowspan:n.rowspan+(s>0&&f&&!h?s:0),colspan:n.colspan+(a>0&&h&&!f?a:0)});}for(let n=0;n<t;n++)for(let u=0;u<r;u++){let w=n===0&&u===0;m.push({data:c(w,n,u),row:o.row+n,col:o.col+u,rowspan:1,colspan:1});}return {anchors:m,deltaRows:s,deltaCols:a,newRowCount:b}}function A(e){let o=new Map,t=new Map;for(let r of e){o.set(`${r.row}-${r.col}`,r);for(let l=r.row;l<r.row+r.rowspan;l++)for(let c=r.col;c<r.col+r.colspan;c++)t.set(`${l}-${c}`,r);}return {byStart:o,byCoveredSlot:t}}function R(e,o){let t=e>1||o>1;return {minRows:e,minCols:o,initialRows:e,initialCols:t?o:o+1}}exports.a=d;exports.b=C;exports.c=T;exports.d=A;exports.e=R;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import {c}from'./chunk-O5X22KZ6.mjs';import {a as a$1}from'./chunk-ARHPXIBJ.mjs';import {b,a as a$2}from'./chunk-CUY2THAO.mjs';import {h as h$1,s}from'./chunk-4EHBV73E.mjs';import {f}from'./chunk-VKTCTMIO.mjs';import {a}from'./chunk-QYUPLKLP.mjs';var P=class o{constructor(t){a(this,"_document");a(this,"_pendingVariables");t instanceof ArrayBuffer||ArrayBuffer.isView(t)?this._document={package:{document:{content:[]}},originalBuffer:t instanceof ArrayBuffer?t:t.buffer}:this._document=t,this._pendingVariables={};}static async fromBuffer(t){let e=await f(t);return new o(e)}static fromDocument(t){return new o(t)}getDocument(){return this._document}getText(){let t=this._document.package.document;return this._getBodyText(t)}getFormattedText(){let t=[],e=this._document.package.document;for(let n of e.content)n.type==="paragraph"&&this._extractParagraphSegments(n,t);return t}getVariables(){return a$1(this._document)}getStyles(){let t=this._document.package.styles;if(!t?.styles)return [];let e=[];for(let[n,r]of Object.entries(t.styles))if(typeof r=="object"&&r!==null){let a=r;e.push({id:n,name:a.name||n,type:a.type==="numbering"?"paragraph":a.type||"paragraph",builtIn:a.default});}return e}getPageCount(){let t=this.getWordCount();return Math.max(1,Math.ceil(t/500))}getWordCount(){return this.getText().split(/\s+/).filter(n=>n.length>0).length}getCharacterCount(t=true){let e=this.getText();return t?e.length:e.replace(/\s/g,"").length}getParagraphCount(){return this._document.package.document.content.filter(t=>t.type==="paragraph").length}getTableCount(){return this._document.package.document.content.filter(t=>t.type==="table").length}getAgentContext(t=100){let e=this._document.package.document,n=e.content.filter(i=>i.type==="paragraph"),r=n.map((i,s)=>{let c=this._getParagraphText(i),p=i.formatting?.styleId;return {index:s,preview:c.slice(0,t),style:p,isHeading:p?.toLowerCase().includes("heading")||false,headingLevel:this._parseHeadingLevel(p),isListItem:!!i.listRendering,isEmpty:c.trim().length===0}}),a=(e.sections||[]).map((i,s)=>({index:s,paragraphCount:i.content?.length||0,pageSize:i.properties?.pageWidth&&i.properties?.pageHeight?{width:i.properties.pageWidth,height:i.properties.pageHeight}:void 0,isLandscape:i.properties?.orientation==="landscape",hasHeader:!!i.properties?.headerReferences?.length,hasFooter:!!i.properties?.footerReferences?.length}));return {paragraphCount:n.length,wordCount:this.getWordCount(),characterCount:this.getCharacterCount(),variables:this.getVariables(),variableCount:this.getVariables().length,availableStyles:this.getStyles(),outline:r,sections:a,hasTables:this.getTableCount()>0,hasImages:this._hasImages(),hasHyperlinks:this._hasHyperlinks()}}insertText(t,e,n={}){let r={type:"insertText",position:t,text:e,formatting:n.formatting};return this._executeCommand(r)}replaceRange(t,e,n={}){let r={type:"replaceText",range:t,text:e,formatting:n.formatting};return this._executeCommand(r)}deleteRange(t){let e={type:"deleteText",range:t};return this._executeCommand(e)}applyFormatting(t,e){let n={type:"formatText",range:t,formatting:e};return this._executeCommand(n)}applyStyle(t,e){let n={type:"applyStyle",paragraphIndex:t,styleId:e};return this._executeCommand(n)}applyParagraphFormatting(t,e){let n={type:"formatParagraph",paragraphIndex:t,formatting:e};return this._executeCommand(n)}insertTable(t,e,n,r={}){let a={type:"insertTable",position:t,rows:e,columns:n,data:r.data,hasHeader:r.hasHeader};return this._executeCommand(a)}insertImage(t,e,n={}){let r={type:"insertImage",position:t,src:e,width:n.width,height:n.height,alt:n.alt};return this._executeCommand(r)}insertHyperlink(t,e,n={}){let r={type:"insertHyperlink",range:t,url:e,displayText:n.displayText,tooltip:n.tooltip};return this._executeCommand(r)}removeHyperlink(t){let e={type:"removeHyperlink",range:t};return this._executeCommand(e)}insertParagraphBreak(t){let e={type:"insertParagraphBreak",position:t};return this._executeCommand(e)}mergeParagraphs(t,e){let n={type:"mergeParagraphs",paragraphIndex:t,count:e};return this._executeCommand(n)}setVariable(t,e){return this._pendingVariables[t]=e,this}setVariables(t){for(let[e,n]of Object.entries(t))this._pendingVariables[e]=n;return this}getPendingVariables(){return {...this._pendingVariables}}clearPendingVariables(){return this._pendingVariables={},this}async applyVariables(t){let e={...this._pendingVariables,...t};if(Object.keys(e).length===0)return this;let n=this._document.originalBuffer;if(!n)throw new Error("Cannot apply variables: no original buffer for processing");let{processTemplate:r}=await import('./processTemplate-GPFDLQMX.mjs'),a=r(n,e),i=await f(a),s=new o(i);return s._pendingVariables={},s}async toBuffer(t){if(this._document.originalBuffer){if(t?.selective){let n=await c(this._document,this._document.originalBuffer,t.selective);if(n)return this._document.originalBuffer=n,n}let e=await h$1(this._document);return this._document.originalBuffer=e,e}return s(this._document)}async toBlob(t="application/vnd.openxmlformats-officedocument.wordprocessingml.document"){let e=await this.toBuffer();return new Blob([e],{type:t})}executeCommands(t){return new o(b(this._document,t))}_executeCommand(t){let e=new o(a$2(this._document,t));return e._pendingVariables={...this._pendingVariables},e}_getBodyText(t){let e=[];for(let n of t.content)n.type==="paragraph"?e.push(this._getParagraphText(n)):n.type==="table"&&e.push(this._getTableText(n));return e.join(`
|
|
2
|
+
`)}_getParagraphText(t){let e=[];for(let n of t.content)n.type==="run"?e.push(this._getRunText(n)):n.type==="hyperlink"&&e.push(this._getHyperlinkText(n));return e.join("")}_getRunText(t){return t.content.filter(e=>e.type==="text").map(e=>e.text).join("")}_getHyperlinkText(t){let e=[];for(let n of t.children)n.type==="run"&&e.push(this._getRunText(n));return e.join("")}_getTableText(t){let e=[];for(let n of t.rows)for(let r of n.cells)for(let a of r.content)a.type==="paragraph"&&e.push(this._getParagraphText(a));return e.join(" ")}_extractParagraphSegments(t,e){for(let n of t.content)if(n.type==="run"){let r=this._getRunText(n);r&&e.push({text:r,formatting:n.formatting});}else if(n.type==="hyperlink"){let r=n.href||"";for(let a of n.children)if(a.type==="run"){let i=this._getRunText(a);i&&e.push({text:i,formatting:a.formatting,isHyperlink:true,hyperlinkUrl:r});}}}_parseHeadingLevel(t){if(!t)return;let e=t.match(/heading\s*(\d)/i);if(e)return parseInt(e[1],10)}_hasImages(){let t=this._document.package.document;for(let e of t.content)if(e.type==="paragraph"){for(let n of e.content)if(n.type==="run"){for(let r of n.content)if(r.type==="drawing")return true}}return false}_hasHyperlinks(){let t=this._document.package.document;for(let e of t.content)if(e.type==="paragraph"){for(let n of e.content)if(n.type==="hyperlink")return true}return false}};async function Ct(o){return P.fromBuffer(o)}function kt(o){return P.fromDocument(o)}function M(o,t={}){let{outlineMaxChars:e=100,maxOutlineParagraphs:n=50}=t,r=o.package.document,a=r.content.filter(y=>y.type==="paragraph"),i=z(a,e,n),s=a$1(o),c=W(o),p=$(r),u=U(r),d=G(r),f=r.content.some(y=>y.type==="table"),x=K(r),l=N(r);return {paragraphCount:a.length,wordCount:u,characterCount:d,variables:s,variableCount:s.length,availableStyles:c,outline:i,sections:p,hasTables:f,hasImages:x,hasHyperlinks:l}}function At(o,t,e={}){let{contextChars:n=200,includeSuggestions:r=true}=e,i=o.package.document.content.filter(m=>m.type==="paragraph"),s=i[t.start.paragraphIndex];if(!s)throw new Error(`Paragraph not found at index ${t.start.paragraphIndex}`);let c=g(s),p="";if(t.start.paragraphIndex===t.end.paragraphIndex)p=c.slice(t.start.offset,t.end.offset);else {let m=[];for(let b=t.start.paragraphIndex;b<=t.end.paragraphIndex;b++){let H=i[b];if(!H)continue;let _=g(H);b===t.start.paragraphIndex?m.push(_.slice(t.start.offset)):b===t.end.paragraphIndex?m.push(_.slice(0,t.end.offset)):m.push(_);}p=m.join(`
|
|
3
|
+
`);}let u=Y(i,t.start.paragraphIndex,t.start.offset,n),d=Z(i,t.end.paragraphIndex,t.end.offset,n),f=tt(s,t.start.offset),x=s.formatting||{},l={index:t.start.paragraphIndex,fullText:c,style:s.formatting?.styleId,wordCount:v(c)},y=false,A=et(s,t.start.offset),S=r?nt(p):[];return {selectedText:p,range:t,formatting:f,paragraphFormatting:x,textBefore:u,textAfter:d,paragraph:l,inTable:y,inHyperlink:A,suggestedActions:S}}function L(o){let t=M(o,{outlineMaxChars:50,maxOutlineParagraphs:10}),e=[`Document with ${t.paragraphCount} paragraphs, ${t.wordCount} words.`];t.hasTables&&e.push("Contains tables."),t.hasImages&&e.push("Contains images."),t.hasHyperlinks&&e.push("Contains hyperlinks."),t.variableCount>0&&e.push(`Has ${t.variableCount} template variables: ${t.variables.join(", ")}`);let n=t.outline.filter(r=>r.isHeading);if(n.length>0){e.push(`
|
|
4
|
+
Headings:`);for(let r of n.slice(0,5)){let a=r.headingLevel||1;e.push(`${" ".repeat(a-1)}- ${r.preview}`);}n.length>5&&e.push(` ... and ${n.length-5} more headings`);}return e.join(" ")}function z(o,t,e){let n=[];for(let r=0;r<Math.min(o.length,e);r++){let a=o[r],i=g(a),s=a.formatting?.styleId;n.push({index:r,preview:i.slice(0,t),style:s,isHeading:Q(s),headingLevel:X(s),isListItem:!!a.listRendering,isEmpty:i.trim().length===0});}return n}function W(o){let t=o.package.styles;if(!t?.styles)return [];let e=[];for(let[n,r]of Object.entries(t.styles))if(typeof r=="object"&&r!==null){let a=r;e.push({id:n,name:a.name||n,type:a.type==="numbering"?"paragraph":a.type||"paragraph",builtIn:a.default});}return e}function $(o){return o.sections?o.sections.map((t,e)=>({index:e,paragraphCount:t.content?.length||0,pageSize:t.properties?.pageWidth&&t.properties?.pageHeight?{width:t.properties.pageWidth,height:t.properties.pageHeight}:void 0,isLandscape:t.properties?.orientation==="landscape",hasHeader:!!t.properties?.headerReferences?.length,hasFooter:!!t.properties?.footerReferences?.length})):[]}function U(o){let t=0;for(let e of o.content)if(e.type==="paragraph"){let n=g(e);t+=v(n);}else e.type==="table"&&(t+=q(e));return t}function v(o){return o.split(/\s+/).filter(e=>e.length>0).length}function G(o){let t=0;for(let e of o.content)if(e.type==="paragraph"){let n=g(e);t+=n.length;}else e.type==="table"&&(t+=J(e));return t}function q(o){let t=0;for(let e of o.rows)for(let n of e.cells)for(let r of n.content)if(r.type==="paragraph"){let a=g(r);t+=v(a);}return t}function J(o){let t=0;for(let e of o.rows)for(let n of e.cells)for(let r of n.content)if(r.type==="paragraph"){let a=g(r);t+=a.length;}return t}function g(o){let t=[];for(let e of o.content)e.type==="run"?t.push(T(e)):e.type==="hyperlink"&&t.push(F(e));return t.join("")}function T(o){return o.content.filter(t=>t.type==="text").map(t=>t.text).join("")}function F(o){let t=[];for(let e of o.children)e.type==="run"&&t.push(T(e));return t.join("")}function K(o){for(let t of o.content)if(t.type==="paragraph"){for(let e of t.content)if(e.type==="run"){for(let n of e.content)if(n.type==="drawing")return true}}return false}function N(o){for(let t of o.content)if(t.type==="paragraph"){for(let e of t.content)if(e.type==="hyperlink")return true}return false}function Q(o){return o?o.toLowerCase().includes("heading"):false}function X(o){if(!o)return;let t=o.match(/heading\s*(\d)/i);if(t)return parseInt(t[1],10)}function Y(o,t,e,n){let r=[],a=0,i=o[t];if(i){let p=g(i).slice(0,e);r.unshift(p),a+=p.length;}for(let c=t-1;c>=0&&a<n;c--){let p=o[c];if(!p)continue;let u=g(p);r.unshift(u),a+=u.length;}let s=r.join(`
|
|
5
|
+
`);return s.length>n?"..."+s.slice(-n):s}function Z(o,t,e,n){let r=[],a=0,i=o[t];if(i){let p=g(i).slice(e);r.push(p),a+=p.length;}for(let c=t+1;c<o.length&&a<n;c++){let p=o[c];if(!p)continue;let u=g(p);r.push(u),a+=u.length;}let s=r.join(`
|
|
6
|
+
`);return s.length>n?s.slice(0,n)+"...":s}function tt(o,t){let e=0;for(let n of o.content)if(n.type==="run"){let r=T(n),a=e,i=e+r.length;if(t>=a&&t<i)return n.formatting||{};e=i;}else if(n.type==="hyperlink"){let r=F(n),a=e,i=e+r.length;if(t>=a&&t<i){for(let s of n.children)if(s.type==="run")return s.formatting||{}}e=i;}return {}}function et(o,t){let e=0;for(let n of o.content)if(n.type==="run"){let r=T(n);e+=r.length;}else if(n.type==="hyperlink"){let r=F(n),a=e,i=e+r.length;if(t>=a&&t<i)return true;e=i;}return false}function nt(o,t,e){let n=[];return o.length>0&&(n.push({id:"rewrite",label:"Rewrite",description:"Rewrite this text",priority:10},{id:"summarize",label:"Summarize",description:"Summarize this text",priority:9}),o.length>200&&n.push({id:"summarize",label:"Summarize",description:"Create a shorter version",priority:8}),o.length<50&&o.split(/\s+/).length<10&&n.push({id:"expand",label:"Expand",description:"Add more details",priority:8}),n.push({id:"fixGrammar",label:"Fix Grammar",description:"Fix grammar and spelling",priority:7}),n.push({id:"translate",label:"Translate",description:"Translate to another language",priority:6}),n.push({id:"makeFormal",label:"Make Formal",description:"Use formal tone",priority:5},{id:"makeCasual",label:"Make Casual",description:"Use casual tone",priority:4})),n.sort((r,a)=>(a.priority||0)-(r.priority||0)),n}function rt(o,t,e={}){let{contextCharsBefore:n=200,contextCharsAfter:r=200,includeSuggestions:a=true}=e,i=o.package.document,s=i.content.filter(m=>m.type==="paragraph");if(t.start.paragraphIndex>=s.length)throw new Error(`Invalid start paragraph index: ${t.start.paragraphIndex}`);let c=s[t.start.paragraphIndex],p=ot(s,t),u=at(s,t.start,n),d=it(s,t.end,r),f=st(c,t.start.offset),x=c.formatting||{},l={index:t.start.paragraphIndex,fullText:h(c),style:c.formatting?.styleId,wordCount:R(h(c))},y=pt(i,t.start),A=ut(c,t.start.offset),S=a?lt(p):[];return {selectedText:p,range:t,formatting:f,paragraphFormatting:x,textBefore:u,textAfter:d,paragraph:l,inTable:y,inHyperlink:A,suggestedActions:S}}function wt(o,t,e={}){let n=rt(o,t,e),{includeDocumentSummary:r=true}=e,i=o.package.document.content.filter(l=>l.type==="paragraph"),s=R(n.selectedText),c=n.selectedText.length,p=t.start.paragraphIndex!==t.end.paragraphIndex,u=[];for(let l=t.start.paragraphIndex;l<=t.end.paragraphIndex;l++)u.push(l);let d=gt(i,t),f=r?L(o):void 0,x=ft(n.selectedText);return {...n,documentSummary:f,wordCount:s,characterCount:c,isMultiParagraph:p,paragraphIndices:u,detectedLanguage:x,contentType:d}}function Dt(o,t){let n=o.package.document.content.filter(s=>s.type==="paragraph"),r=[];for(let s=t.start.paragraphIndex;s<=t.end.paragraphIndex;s++){let c=n[s];if(!c)continue;let p=s===t.start.paragraphIndex?t.start.offset:0,u=s===t.end.paragraphIndex?t.end.offset:1/0;ct(c,p,u,r);}let a=r.length<=1||r.every(s=>mt(s,r[0]));return {predominant:r.length>0?r[0]:{},isConsistent:a,allFormatting:r}}function ot(o,t){if(t.start.paragraphIndex===t.end.paragraphIndex){let n=o[t.start.paragraphIndex];return n?h(n).slice(t.start.offset,t.end.offset):""}let e=[];for(let n=t.start.paragraphIndex;n<=t.end.paragraphIndex;n++){let r=o[n];if(!r)continue;let a=h(r);n===t.start.paragraphIndex?e.push(a.slice(t.start.offset)):n===t.end.paragraphIndex?e.push(a.slice(0,t.end.offset)):e.push(a);}return e.join(`
|
|
7
|
+
`)}function at(o,t,e){let n=[],r=0,a=o[t.paragraphIndex];if(a){let c=h(a).slice(0,t.offset);n.unshift(c),r+=c.length;}for(let s=t.paragraphIndex-1;s>=0&&r<e;s--){let c=o[s];if(!c)continue;let p=h(c);n.unshift(p),r+=p.length;}let i=n.join(`
|
|
8
|
+
`);return i.length>e?"..."+i.slice(-e):i}function it(o,t,e){let n=[],r=0,a=o[t.paragraphIndex];if(a){let c=h(a).slice(t.offset);n.push(c),r+=c.length;}for(let s=t.paragraphIndex+1;s<o.length&&r<e;s++){let c=o[s];if(!c)continue;let p=h(c);n.push(p),r+=p.length;}let i=n.join(`
|
|
9
|
+
`);return i.length>e?i.slice(0,e)+"...":i}function st(o,t){let e=0;for(let n of o.content)if(n.type==="run"){let r=C(n),a=e+r.length;if(t>=e&&t<a)return n.formatting||{};e=a;}else if(n.type==="hyperlink"){let r=I(n),a=e+r.length;if(t>=e&&t<a){for(let i of n.children)if(i.type==="run")return i.formatting||{}}e=a;}return {}}function ct(o,t,e,n){let r=0;for(let a of o.content)if(a.type==="run"){let i=C(a),s=r,c=r+i.length;c>t&&s<e&&a.formatting&&n.push({...a.formatting}),r=c;}else if(a.type==="hyperlink"){let i=I(a),s=r,c=r+i.length;if(c>t&&s<e)for(let p of a.children)p.type==="run"&&p.formatting&&n.push({...p.formatting});r=c;}}function pt(o,t){return false}function ut(o,t){let e=0;for(let n of o.content)if(n.type==="run"){let r=C(n);e+=r.length;}else if(n.type==="hyperlink"){let r=I(n),a=e,i=e+r.length;if(t>=a&&t<i)return true;e=i;}return false}function lt(o,t,e){let n=[];if(!o||o.trim().length===0)return n;n.push({id:"askAI",label:"Ask AI",description:"Ask AI about this text",priority:11},{id:"rewrite",label:"Rewrite",description:"Rewrite this text differently",priority:10});let r=R(o);return r>50&&n.push({id:"summarize",label:"Summarize",description:"Create a shorter version",priority:9}),r<20&&n.push({id:"expand",label:"Expand",description:"Add more details",priority:9}),n.push({id:"fixGrammar",label:"Fix Grammar",description:"Fix grammar and spelling",priority:7},{id:"translate",label:"Translate",description:"Translate to another language",priority:6},{id:"explain",label:"Explain",description:"Explain what this means",priority:5}),n.push({id:"makeFormal",label:"Make Formal",description:"Use formal tone",priority:4},{id:"makeCasual",label:"Make Casual",description:"Use casual tone",priority:3}),n.sort((a,i)=>(i.priority||0)-(a.priority||0)),n}function gt(o,t){let e=new Set;for(let n=t.start.paragraphIndex;n<=t.end.paragraphIndex;n++){let r=o[n];r&&(r.listRendering?e.add("list"):r.formatting?.styleId?.toLowerCase().includes("heading")?e.add("heading"):e.add("prose"));}return e.size>1?"mixed":e.has("list")?"list":e.has("heading")?"heading":"prose"}function ft(o){return /[а-яА-ЯёЁ]/.test(o)?"ru":/[一-龯]/.test(o)?"zh":/[ひらがなカタカナ]/.test(o)||/[\u3040-\u309F\u30A0-\u30FF]/.test(o)?"ja":/[가-힣]/.test(o)?"ko":/[àâäéèêëïîôùûüç]/i.test(o)?"fr":/[äöüß]/i.test(o)?"de":/[áéíóúñ]/i.test(o)?"es":"en"}function h(o){let t=[];for(let e of o.content)e.type==="run"?t.push(C(e)):e.type==="hyperlink"&&t.push(I(e));return t.join("")}function C(o){return o.content.filter(t=>t.type==="text").map(t=>t.text).join("")}function I(o){let t=[];for(let e of o.children)e.type==="run"&&t.push(C(e));return t.join("")}function R(o){return o.split(/\s+/).filter(t=>t.length>0).length}function mt(o,t){let e=Object.keys(o),n=Object.keys(t);return e.length!==n.length?false:e.every(r=>{let a=o[r],i=t[r];return a===i})}export{P as a,Ct as b,kt as c,M as d,At as e,L as f,rt as g,wt as h,Dt as i};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {TextSelection}from'prosemirror-state';import {Fragment}from'prosemirror-model';var b=(p,i)=>{let{schema:f}=p,m=f.nodes.pageBreak,s=f.nodes.paragraph;if(!m||!s)return false;if(i){let{$from:e}=p.selection,t=p.tr,o=m.create(),a=o.nodeSize,n;if(e.parent.isTextblock)if(e.parentOffset>0&&e.parentOffset<e.parent.content.size){t.split(e.pos);let r=t.mapping.map(e.pos);t.insert(r,Fragment.from([o,s.create()])),n=r+a+1;}else if(e.parentOffset===e.parent.content.size){let r=e.after();t.insert(r,Fragment.from([o,s.create()])),n=r+a+1;}else {let r=e.before();t.insert(r,o),n=r+a+1;}else {let r=e.pos;t.insert(r,Fragment.from([o,s.create()])),n=r+a+1;}t.setSelection(TextSelection.create(t.doc,n)),i(t.scrollIntoView());}return true};export{b as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {a as a$1}from'./chunk-QYUPLKLP.mjs';var a=class{constructor(){a$1(this,"plugins",new Map);a$1(this,"commandHandlers",new Map);a$1(this,"eventListeners",new Set);a$1(this,"initialized",new Set);}register(e,r){let t=[];if(!e.id)return {success:false,error:"Plugin must have an id"};if(this.plugins.has(e.id))return {success:false,error:`Plugin '${e.id}' is already registered`};if(e.dependencies){for(let i of e.dependencies)if(!this.plugins.has(i))return {success:false,error:`Plugin '${e.id}' requires '${i}' which is not registered`}}if(e.commandHandlers)for(let[i,o]of Object.entries(e.commandHandlers)){if(this.commandHandlers.has(i)){let d=this.commandHandlers.get(i);t.push(`Command '${i}' from '${e.id}' overrides handler from '${d.pluginId}'`);}this.commandHandlers.set(i,{pluginId:e.id,handler:o});}if(this.plugins.set(e.id,e),e.initialize&&!this.initialized.has(e.id))try{let i=e.initialize();i instanceof Promise?i.then(()=>{this.initialized.add(e.id);}).catch(o=>{this.emit({type:"error",pluginId:e.id,error:o});}):this.initialized.add(e.id);}catch(i){this.emit({type:"error",pluginId:e.id,error:i});}return r?.debug&&console.log(`[PluginRegistry] Registered plugin: ${e.id}`),this.emit({type:"registered",plugin:e}),{success:true,plugin:e,warnings:t.length>0?t:void 0}}unregister(e){let r=this.plugins.get(e);if(!r)return false;for(let[t,i]of this.plugins)if(i.dependencies?.includes(e))return console.warn(`Cannot unregister '${e}': '${t}' depends on it`),false;for(let[t,{pluginId:i}]of this.commandHandlers)i===e&&this.commandHandlers.delete(t);if(r.destroy)try{let t=r.destroy();t instanceof Promise&&t.catch(i=>{this.emit({type:"error",pluginId:e,error:i});});}catch(t){this.emit({type:"error",pluginId:e,error:t});}return this.plugins.delete(e),this.initialized.delete(e),this.emit({type:"unregistered",pluginId:e}),true}get(e){return this.plugins.get(e)}getAll(){return Array.from(this.plugins.values())}has(e){return this.plugins.has(e)}get size(){return this.plugins.size}getCommandHandler(e){return this.commandHandlers.get(e)?.handler}getCommandTypes(){return Array.from(this.commandHandlers.keys())}hasCommandHandler(e){return this.commandHandlers.has(e)}getMcpTools(){let e=[];for(let r of this.plugins.values())r.mcpTools&&e.push(...r.mcpTools);return e}getMcpToolsForPlugin(e){return this.plugins.get(e)?.mcpTools||[]}getMcpTool(e){for(let r of this.plugins.values())if(r.mcpTools){let t=r.mcpTools.find(i=>i.name===e);if(t)return t}}addEventListener(e){this.eventListeners.add(e);}removeEventListener(e){this.eventListeners.delete(e);}emit(e){for(let r of this.eventListeners)try{r(e);}catch(t){console.error("[PluginRegistry] Event listener error:",t);}}clear(){for(let e of this.plugins.values())if(e.destroy)try{e.destroy();}catch{}this.plugins.clear(),this.commandHandlers.clear(),this.initialized.clear();}getDebugInfo(){return {plugins:Array.from(this.plugins.keys()),commandTypes:Array.from(this.commandHandlers.keys()),mcpTools:this.getMcpTools().map(e=>e.name),initialized:Array.from(this.initialized)}}},l=new a;function c(s,e){return s.map(r=>l.register(r,e))}function g(s){return e=>l.register(e,s)}export{a,l as b,c,g as d};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function l(u,r){if(!r||!r.trim())return null;let e=null;return u.descendants((t,n)=>e!==null?false:t.attrs?.paraId===r&&t.isTextblock?(e=n,false):true),e}function i(u,r){if(!r||!r.trim())return null;let e=null;return u.descendants((t,n)=>e!==null?false:t.isTextblock&&t.attrs?.paraId===r?(e={node:t,from:n,to:n+t.nodeSize},false):true),e}export{l as a,i as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var chunkDROCYKAR_js=require('./chunk-DROCYKAR.js'),chunkJFZIXFRC_js=require('./chunk-JFZIXFRC.js');function R(e,t,n,a){let i=e-t-n,r=(a.count-1)*a.gap;return (i-r)/a.count}function N(e){let t={...e.pageSize},n={...e.margins},a=e.columns??{count:1,gap:0},i=false,r,o,g=[],s=[];function d(){return t.h-n.bottom}function u(){return d()-n.top}function f(){return t.w-n.left-n.right}if(u()<=0)throw new Error("Paginator: page size and margins yield no content area");let B=R(t.w,n.left,n.right,a),h=n.top;function y(c){return n.left+c*(B+a.gap)}function l(){(r||o)&&(r&&(t=r),o&&(n=o),r=void 0,o=void 0,B=R(t.w,n.left,n.right,a));let c=g.length+1,p=n.top,C=d(),k=e.footnoteReservedHeights?.get(c)??0,F=C-k,H={number:c,fragments:[],margins:{...n},size:{...t},footnoteReservedHeight:k>0?k:void 0,columns:a.count>1?{...a}:void 0},w={page:H,cursorY:p,columnIndex:0,topMargin:p,contentBottom:F,trailingSpacing:0};return g.push(H),s.push(w),h=p,e.onNewPage&&e.onNewPage(w),w}function S(){return s.length===0?l():s[s.length-1]}function b(c){return c.contentBottom-c.cursorY}function P(c,p){let C=p||S();return b(C)>=c}function m(c){return c.columnIndex<a.count-1?(c.columnIndex+=1,c.cursorY=h,c.trailingSpacing=0,c):l()}function x(c){let p=S(),C=Number.isFinite(c)&&c>0?c:0;for(;!P(C,p);){let k=p.contentBottom-p.topMargin;if(C>k)return i||(i=true,console.warn(`Paginator: fragment height ${C.toFixed(0)}px exceeds page content height ${k.toFixed(0)}px; placing with overflow.`)),p.cursorY!==p.topMargin&&(p=m(p)),p;p=m(p);}return p}function M(c,p,C=0,k=0){let F=Math.max(C,S().trailingSpacing),H=F+p,w=x(H),J=F,K=y(w.columnIndex),A=w.cursorY+J;return c.x=K,c.y=A,w.page.fragments.push(c),w.cursorY=A+p,w.trailingSpacing=k,{state:w,x:K,y:A}}function I(){if(s.length>0){let c=s[s.length-1];if(c.page.fragments.length===0&&c.cursorY===c.topMargin)return c}return l()}function v(){let c=S();return m(c)}function L(c){a=c,B=R(t.w,n.left,n.right,a);let p=S();p.page.columns=a.count>1?{...a}:void 0,h=p.cursorY,p.columnIndex=0;}function z(c,p,C=true){if(!C){r=c?{...c}:r,o=p?{...p}:o;return}if(c&&(t={...c}),p&&(n={...p}),u()<=0)throw new Error("Paginator: section page size and margins yield no content area");B=R(t.w,n.left,n.right,a),r=void 0,o=void 0;}return {pages:g,states:s,get columnWidth(){return B},get columns(){return {...a}},getCurrentState:S,getAvailableHeight:()=>b(S()),getContentWidth:f,fits:c=>P(c),ensureFits:x,addFragment:M,forcePageBreak:I,forceColumnBreak:v,getColumnX:y,updateColumns:L,updatePageLayout:z}}function O(e){let t=new Map,n=new Set;for(let a=0;a<e.length;a++){if(n.has(a))continue;let i=e[a];if(i.kind!=="paragraph"||!i.attrs?.keepNext)continue;let o=[a],g=a;for(let u=a+1;u<e.length;u++){let f=e[u];if(f.kind==="sectionBreak"||f.kind==="pageBreak"||f.kind==="columnBreak"||f.kind!=="paragraph")break;if(f.attrs?.keepNext)o.push(u),g=u,n.add(u);else break}let s=g+1,d=-1;if(s<e.length){let u=e[s];u.kind!=="sectionBreak"&&u.kind!=="pageBreak"&&u.kind!=="columnBreak"&&(d=s);}t.set(a,{startIndex:a,endIndex:g,memberIndices:o,anchorIndex:d});}return t}function Y(e,t,n){let a=0;for(let i of e.memberIndices){let r=t[i],o=n[i];if(r.kind!=="paragraph"||o.kind!=="paragraph")continue;let g=r,s=o,d=g.attrs?.spacing?.before??0;a+=d,a+=s.totalHeight;let u=g.attrs?.spacing?.after??0;a+=u;}if(e.anchorIndex!==-1){let i=n[e.anchorIndex];if(i?.kind==="paragraph"){let r=i;r.lines.length>0&&(a+=r.lines[0].lineHeight);}}return a}function W(e){let t=new Set;for(let n of e.values())for(let a=1;a<n.memberIndices.length;a++)t.add(n.memberIndices[a]);return t}function Q(e){return e.kind!=="paragraph"?false:e.attrs?.keepLines===true}function X(e){return e.kind!=="paragraph"?false:e.attrs?.pageBreakBefore===true}function D(e){return e.displayMode==="float"||chunkJFZIXFRC_js.a(e.wrapType)}function Me(e){return D(e)&&!chunkJFZIXFRC_js.b(e.wrapType)&&e.wrapType!=="topAndBottom"}var G={count:1,gap:0};function ee(e,t,n){return {activeTopMargin:e.top,activeBottomMargin:e.bottom,activeLeftMargin:e.left,activeRightMargin:e.right,pendingTopMargin:null,pendingBottomMargin:null,pendingLeftMargin:null,pendingRightMargin:null,activePageSize:{...t},pendingPageSize:null,activeColumns:n?{...n}:{...G},pendingColumns:null,activeOrientation:null,pendingOrientation:null,hasAnyPages:false}}function te(e,t){return t.count>1}function E(e){return e?{count:e.count,gap:e.gap}:{...G}}function ne(e,t,n){let a={...t},i=e.type??"continuous",r=e.margins,o=e.pageSize,g=e.orientation;r&&(typeof r.top=="number"&&(a.pendingTopMargin=Math.max(0,r.top)),typeof r.bottom=="number"&&(a.pendingBottomMargin=Math.max(0,r.bottom)),typeof r.left=="number"&&(a.pendingLeftMargin=Math.max(0,r.left)),typeof r.right=="number"&&(a.pendingRightMargin=Math.max(0,r.right))),o&&(a.pendingPageSize={w:o.w,h:o.h}),g&&(a.pendingOrientation=g);let s=te((e.margins,void 0),a.activeColumns);switch(i){case "nextPage":return a.pendingColumns=E(void 0),{decision:{forcePageBreak:true,forceMidPageRegion:false},state:a};case "evenPage":return a.pendingColumns=E(void 0),{decision:{forcePageBreak:true,forceMidPageRegion:false,requiredParity:"even"},state:a};case "oddPage":return a.pendingColumns=E(void 0),{decision:{forcePageBreak:true,forceMidPageRegion:false,requiredParity:"odd"},state:a};default:return s?(a.pendingColumns=E(void 0),{decision:{forcePageBreak:false,forceMidPageRegion:true},state:a}):{decision:{forcePageBreak:false,forceMidPageRegion:false},state:a}}}function ae(e){let t={...e};return t.pendingTopMargin!==null&&(t.activeTopMargin=t.pendingTopMargin,t.pendingTopMargin=null),t.pendingBottomMargin!==null&&(t.activeBottomMargin=t.pendingBottomMargin,t.pendingBottomMargin=null),t.pendingLeftMargin!==null&&(t.activeLeftMargin=t.pendingLeftMargin,t.pendingLeftMargin=null),t.pendingRightMargin!==null&&(t.activeRightMargin=t.pendingRightMargin,t.pendingRightMargin=null),t.pendingPageSize!==null&&(t.activePageSize=t.pendingPageSize,t.pendingPageSize=null),t.pendingColumns!==null&&(t.activeColumns=t.pendingColumns,t.pendingColumns=null),t.pendingOrientation!==null&&(t.activeOrientation=t.pendingOrientation,t.pendingOrientation=null),t}function re(e){return {top:e.pendingTopMargin??e.activeTopMargin,bottom:e.pendingBottomMargin??e.activeBottomMargin,left:e.pendingLeftMargin??e.activeLeftMargin,right:e.pendingRightMargin??e.activeRightMargin}}function ie(e){return e.pendingPageSize??e.activePageSize}function oe(e){return e.pendingColumns??e.activeColumns}function ge(e,t){for(let n=0;n<e.pages.length;n++)for(let a of e.pages[n].fragments){if(a.pmStart==null)continue;let i=a.pmStart,r=a.pmEnd??i+1;if(t>=i&&t<r)return n}return null}var ce={w:816,h:1056},T={top:96,right:96,bottom:96,left:96},V={count:1,gap:0};function se(e,t,n){let a=[],i=[],r=t;for(let o=0;o<e.length;o++){if(e[o].kind!=="sectionBreak")continue;let g=e[o],s={pageSize:g.pageSize??r.pageSize,margins:g.margins??r.margins,columns:g.columns};a.push(s),i.push(o),r=s;}return a.push(n),{configs:a,breakIndices:i}}function Z(e){if(e.runs.length===0)return true;if(e.runs.length!==1)return false;let t=e.runs[0];return t.kind==="text"&&(t.text??"")===""}function $(e){let t=e.attrs?.spacing?.before??0;return Z(e)&&!e.attrs?.spacingExplicit?.before?0:t}function q(e){let t=e.attrs?.spacing?.after??0;return Z(e)&&!e.attrs?.spacingExplicit?.after?0:t}function ue(e){for(let t=0;t<e.length-1;t++){let n=e[t],a=e[t+1];if(n.kind!=="paragraph"||a.kind!=="paragraph")continue;let i=n.attrs,r=a.attrs;i?.contextualSpacing&&r?.contextualSpacing&&i.styleId&&i.styleId===r.styleId&&(i.spacing&&(i.spacing={...i.spacing,after:0}),r.spacing&&(r.spacing={...r.spacing,before:0}));}}function Fe(e,t,n={}){if(e.length!==t.length)throw new Error(`layoutDocument: expected one measure per block (blocks=${e.length}, measures=${t.length})`);let a=n.pageSize??ce,i={top:n.margins?.top??T.top,right:n.margins?.right??T.right,bottom:n.margins?.bottom??T.bottom,left:n.margins?.left??T.left,header:n.margins?.header??n.margins?.top??T.top,footer:n.margins?.footer??n.margins?.bottom??T.bottom};n.headerContentHeights,n.footerContentHeights,n.titlePage,n.evenAndOddHeaders;let r={...i},o=n.finalPageSize??a,g=n.finalMargins??r;if(a.w-r.left-r.right<=0)throw new Error("layoutDocument: page size and margins yield no content area");let d={pageSize:a,margins:r,columns:n.columns},u={pageSize:o,margins:g,columns:n.columns},{configs:f,breakIndices:B}=se(e,d,u),h=[...B.map(m=>e[m].type),n.bodyBreakType],y=f[0]??d,l=N({pageSize:y.pageSize,margins:y.margins,columns:y.columns??V,footnoteReservedHeights:n.footnoteReservedHeights});ue(e);let S=O(e),b=W(S),P=0;for(let m=0;m<e.length;m++){let x=e[m],M=t[m];X(x)&&l.forcePageBreak();let I=S.get(m);if(I&&!b.has(m)){let v=Y(I,e,t),L=l.getCurrentState(),z=l.getAvailableHeight(),c=L.contentBottom-L.topMargin;v<=c&&v>z&&L.page.fragments.length>0&&l.forcePageBreak();}switch(x.kind){case "paragraph":le(x,M,l,l.getContentWidth());break;case "table":x.floating?de(x,M,l,l.getContentWidth()):me(x,M,l);break;case "image":he(x,M,l);break;case "textBox":ye(x,M,l);break;case "pageBreak":l.forcePageBreak();break;case "columnBreak":l.forceColumnBreak();break;case "sectionBreak":{let v=h[P+1]??h[P];Be(x,l,f[P+1]??y,v),P++;break}default:chunkDROCYKAR_js.c(x,"runLayoutPipeline");}}return l.pages.length===0&&l.getCurrentState(),{pageSize:a,pages:l.pages,columns:n.columns,pageGap:n.pageGap}}function le(e,t,n,a){if(t.kind!=="paragraph")throw new Error("layoutParagraph: expected paragraph measure");let i=t.lines;if(i.length===0){let s=$(e),d=q(e),u=n.getCurrentState(),f={kind:"paragraph",blockId:e.id,x:n.getColumnX(u.columnIndex),y:u.cursorY+s,width:a,height:0,fromLine:0,toLine:0,pmStart:e.pmStart,pmEnd:e.pmEnd};n.addFragment(f,0,s,d);return}let r=$(e),o=q(e),g=0;for(;g<i.length;){let s=n.getCurrentState(),d=n.getAvailableHeight(),u=0,f=0;for(let P=g;P<i.length;P++){let m=i[P].lineHeight,x=u+m;if((g===0&&P===g?x+r:x)<=d||f===0)u=x,f++;else break}let B=g===0,h=g+f>=i.length,y=B?r:0,l=h?o:0,S={kind:"paragraph",blockId:e.id,x:n.getColumnX(s.columnIndex),y:0,width:a,height:u,fromLine:g,toLine:g+f,pmStart:e.pmStart,pmEnd:e.pmEnd,continuesFromPrev:!B,continuesOnNext:!h},b=n.addFragment(S,u,y,l);S.y=b.y,g+=f,g<i.length&&n.ensureFits(i[g].lineHeight);}}function pe(e){let t=0;for(let n of e.rows)if(n.isHeader)t++;else break;return t}function fe(e,t){let n=0;for(let a=0;a<t&&a<e.rows.length;a++)n+=e.rows[a].height;return n}function me(e,t,n){if(t.kind!=="table")throw new Error("layoutTable: expected table measure");let a=t.rows;if(a.length===0)return;let i=pe(e),r=fe(t,i),o=0;for(;o<a.length;){let g=n.getCurrentState(),s=n.getAvailableHeight(),d=o===0,u=d?g.trailingSpacing:0,f=s-u,B=!d&&i>0?r:0,h=0,y=0;for(let x=o;x<a.length;x++){let M=a[x].height;if(h+M+B<=f||y===0)h+=M,y++;else break}let l=h+B,S=o+y>=a.length,b=n.getColumnX(g.columnIndex);e.justification==="center"?b=b+(n.columnWidth-t.totalWidth)/2:e.justification==="right"?b=b+n.columnWidth-t.totalWidth:e.indent&&(b+=e.indent);let P={kind:"table",blockId:e.id,x:b,y:0,width:t.totalWidth,height:l,fromRow:o,toRow:o+y,pmStart:e.pmStart,pmEnd:e.pmEnd,continuesFromPrev:!d,continuesOnNext:!S,headerRowCount:!d&&i>0?i:void 0},m=n.addFragment(P,l,0,0);if(P.y=m.y,P.x=b,o+=y,o<a.length){let x=a[o].height+(i>0?r:0);n.ensureFits(x);}}}function de(e,t,n,a){if(t.kind!=="table")throw new Error("layoutFloatingTable: expected table measure");let i=n.getCurrentState(),r=e.floating,o=i.page,g=o.margins,s=t.totalWidth,d=t.totalHeight,u=o.size.h-g.top-g.bottom,f=g.left,B=g.top;r?.horzAnchor==="page"&&(f=0),r?.vertAnchor==="page"&&(B=0);let h=n.getColumnX(i.columnIndex);if(r?.tblpX!==void 0)h=f+r.tblpX;else if(r?.tblpXSpec){let m=r.tblpXSpec;m==="left"||m==="inside"?h=f:m==="right"||m==="outside"?h=f+a-s:m==="center"&&(h=f+(a-s)/2);}else e.justification==="center"?h=f+(a-s)/2:e.justification==="right"&&(h=f+a-s);let y=i.cursorY,l=false;if(r?.tblpY!==void 0)y=B+r.tblpY,l=true;else if(r?.tblpYSpec){l=true;let m=r.tblpYSpec;m==="top"?y=B:m==="bottom"?y=B+u-d:m==="center"&&(y=B+(u-d)/2);}l||(y=n.ensureFits(d).cursorY);let S=g.left,b=g.left+a-s;Number.isFinite(b)&&(h=Math.max(S,Math.min(h,b)));let P={kind:"table",blockId:e.id,x:h,y,width:s,height:d,fromRow:0,toRow:e.rows.length,pmStart:e.pmStart,pmEnd:e.pmEnd,isFloating:true};i.page.fragments.push(P);}function he(e,t,n){if(t.kind!=="image")throw new Error("layoutImage: expected image measure");if(e.anchor?.isAnchored){xe(e,t,n);return}let a=n.ensureFits(t.height),i={kind:"image",blockId:e.id,x:n.getColumnX(a.columnIndex),y:0,width:t.width,height:t.height,pmStart:e.pmStart,pmEnd:e.pmEnd},r=n.addFragment(i,t.height,0,0);i.y=r.y;}function xe(e,t,n){let a=n.getCurrentState(),i=e.anchor,r=i.offsetH??n.getColumnX(a.columnIndex),o=i.offsetV??a.cursorY,g={kind:"image",blockId:e.id,x:r,y:o,width:t.width,height:t.height,pmStart:e.pmStart,pmEnd:e.pmEnd,isAnchored:true,zIndex:i.behindDoc?-1:1};a.page.fragments.push(g);}function ye(e,t,n){if(t.kind!=="textBox")throw new Error("layoutTextBox: expected textBox measure");if(D(e)){let o=n.getCurrentState(),g={kind:"textBox",blockId:e.id,x:n.getColumnX(o.columnIndex),y:o.cursorY,width:t.width,height:t.height,pmStart:e.pmStart,pmEnd:e.pmEnd,isFloating:true,zIndex:e.wrapType==="behind"?-1:1};o.page.fragments.push(g);return}let a=n.ensureFits(t.height),i={kind:"textBox",blockId:e.id,x:n.getColumnX(a.columnIndex),y:0,width:t.width,height:t.height,pmStart:e.pmStart,pmEnd:e.pmEnd},r=n.addFragment(i,t.height,0,0);i.y=r.y;}function Be(e,t,n,a){switch(a??"nextPage"){case "nextPage":t.updatePageLayout(n.pageSize,n.margins),t.forcePageBreak();break;case "evenPage":{t.updatePageLayout(n.pageSize,n.margins),t.forcePageBreak().page.number%2!==0&&t.forcePageBreak();break}case "oddPage":{t.updatePageLayout(n.pageSize,n.margins),t.forcePageBreak().page.number%2===0&&t.forcePageBreak();break}case "continuous":t.updatePageLayout(n.pageSize,n.margins,false);break}t.updateColumns(n.columns??V);}exports.a=N;exports.b=O;exports.c=Y;exports.d=W;exports.e=Q;exports.f=X;exports.g=D;exports.h=Me;exports.i=ee;exports.j=ne;exports.k=ae;exports.l=re;exports.m=ie;exports.n=oe;exports.o=ge;exports.p=se;exports.q=Fe;exports.r=fe;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use strict';var chunkN27FJQTG_js=require('./chunk-N27FJQTG.js'),chunk44RUAQA2_js=require('./chunk-44RUAQA2.js'),chunkDROCYKAR_js=require('./chunk-DROCYKAR.js'),chunkDY2MJCSV_js=require('./chunk-DY2MJCSV.js'),chunkCWAP26GB_js=require('./chunk-CWAP26GB.js'),chunkY7JZPBBW_js=require('./chunk-Y7JZPBBW.js'),chunkJFZIXFRC_js=require('./chunk-JFZIXFRC.js'),chunkBHBOAP6Z_js=require('./chunk-BHBOAP6Z.js'),chunkN3Y5BUKV_js=require('./chunk-N3Y5BUKV.js'),chunk4Q2IP5FW_js=require('./chunk-4Q2IP5FW.js');var _={fragment:"layout-fragment",paragraph:"layout-fragment-paragraph",table:"layout-fragment-table",image:"layout-fragment-image",line:"layout-line",run:"layout-run"};function st(e){return e.kind==="paragraph"}function lt(e){return e.kind==="table"}function dt(e){return e.kind==="image"}function ne(e){e.style.position="absolute",e.style.overflow="hidden";}function pt(e,t,n){let o=n.createElement("div");return o.className=`${_.fragment} ${_.paragraph}`,ne(o),o.dataset.blockId=String(e.blockId),o.dataset.fromLine=String(e.fromLine),o.dataset.toLine=String(e.toLine),e.pmStart!==void 0&&(o.dataset.pmStart=String(e.pmStart)),e.pmEnd!==void 0&&(o.dataset.pmEnd=String(e.pmEnd)),e.continuesFromPrev&&(o.dataset.continuesFromPrev="true"),e.continuesOnNext&&(o.dataset.continuesOnNext="true"),o}function ct(e,t,n){let o=n.createElement("div");return o.className=`${_.fragment} ${_.table}`,ne(o),o.dataset.blockId=String(e.blockId),o.dataset.fromRow=String(e.fromRow),o.dataset.toRow=String(e.toRow),e.pmStart!==void 0&&(o.dataset.pmStart=String(e.pmStart)),e.pmEnd!==void 0&&(o.dataset.pmEnd=String(e.pmEnd)),o}function gt(e,t,n){let o=n.createElement("div");return o.className=`${_.fragment} ${_.image}`,ne(o),o.dataset.blockId=String(e.blockId),e.pmStart!==void 0&&(o.dataset.pmStart=String(e.pmStart)),e.pmEnd!==void 0&&(o.dataset.pmEnd=String(e.pmEnd)),e.isAnchored&&(o.dataset.anchored="true"),e.zIndex!==void 0&&(o.style.zIndex=String(e.zIndex)),o}function xe(e,t,n={}){let o=n.document??document;if(st(e))return pt(e,t,o);if(lt(e))return ct(e,t,o);if(dt(e))return gt(e,t,o);let r=o.createElement("div");r.className=_.fragment,ne(r);let i=e;return i.blockId!==void 0&&(r.dataset.blockId=String(i.blockId)),i.kind&&(r.dataset.kind=i.kind),r}var E={fragment:"layout-paragraph",line:"layout-line",run:"layout-run",text:"layout-run-text",tab:"layout-run-tab",image:"layout-run-image",lineBreak:"layout-run-linebreak"};function W(e){return e.kind==="text"}function j(e){return e.kind==="tab"}function K(e){return e.kind==="image"}function U(e){return e.kind==="lineBreak"}function X(e){return e.kind==="field"}function Z(e){return !chunkJFZIXFRC_js.b(e.wrapType)&&e.wrapType!=="topAndBottom"}function G(e){return e.wrapType==="behind"}function H(e){return chunkJFZIXFRC_js.a(e.wrapType)?true:e.displayMode==="float"}function ft(e){return chunkJFZIXFRC_js.b(e.wrapType)||e.wrapType==="topAndBottom"?false:chunkJFZIXFRC_js.c(e.wrapType)?true:e.displayMode==="float"&&e.cssFloat!=="none"}function oe(e){return e==="left"?"right":e==="right"?"left":"bothSides"}var je={image:"layout-image",imageAnchored:"layout-image-anchored"};function q(e){return !!(e.cropTop||e.cropRight||e.cropBottom||e.cropLeft||e.opacity!=null&&e.opacity<1)}function J(e,t){let n=t.cropTop??0,o=t.cropRight??0,r=t.cropBottom??0,i=t.cropLeft??0;(n||o||r||i)&&(e.style.clipPath=`inset(${n*100}% ${o*100}% ${r*100}% ${i*100}%)`),t.opacity!=null&&t.opacity<1&&(e.style.opacity=String(Math.max(0,t.opacity)));}function re(e,t,n,o,r={}){let i=r.document??document,a=i.createElement("div");a.className=je.image,e.isAnchored&&a.classList.add(je.imageAnchored),a.style.position="absolute",a.style.width=`${e.width}px`,a.style.height=`${e.height}px`,a.style.overflow="hidden",e.zIndex!==void 0&&(a.style.zIndex=String(e.zIndex)),t.anchor?.behindDoc&&(a.style.zIndex="-1"),a.dataset.blockId=String(e.blockId),e.pmStart!==void 0&&(a.dataset.pmStart=String(e.pmStart)),e.pmEnd!==void 0&&(a.dataset.pmEnd=String(e.pmEnd));let l=i.createElement("img");if(l.src=t.src,l.alt=t.alt??"",l.style.width="100%",l.style.height="100%",l.style.objectFit="contain",l.style.display="block",t.transform&&(l.style.transform=t.transform),l.draggable=false,t.hlinkHref){let d=i.createElement("a");d.href=t.hlinkHref,d.target="_blank",d.rel="noopener noreferrer",d.style.display="block",d.style.width="100%",d.style.height="100%",d.appendChild(l),a.appendChild(d);}else a.appendChild(l);return a}function mt(e,t,n){if(t.fontFamily&&(e.style.fontFamily=chunkN3Y5BUKV_js.a(t.fontFamily).cssFallback),t.fontSize){let r=t.fontSize*96/72;e.style.fontSize=`${r}px`;}if(t.bold&&(e.style.fontWeight="bold"),t.italic&&(e.style.fontStyle="italic"),t.color&&(e.style.color=t.color),t.letterSpacing&&(e.style.letterSpacing=`${t.letterSpacing}px`),t.allCaps&&(e.style.textTransform="uppercase"),t.smallCaps&&(e.style.fontVariant="small-caps"),t.positionPx&&(e.style.verticalAlign=`${t.positionPx}px`),t.horizontalScale&&t.horizontalScale!==100&&(e.style.display="inline-block",e.style.transform=`scaleX(${t.horizontalScale/100})`,e.style.transformOrigin="left center"),t.kerningMinPt&&t.kerningMinPt>0&&(t.fontSize??11)>=t.kerningMinPt&&(e.style.fontKerning="normal"),t.emboss&&(e.style.textShadow="1px 1px 1px rgba(255,255,255,0.5), -1px -1px 1px rgba(0,0,0,0.3)"),t.imprint&&(e.style.textShadow="-1px -1px 1px rgba(255,255,255,0.5), 1px 1px 1px rgba(0,0,0,0.3)"),t.textShadow&&!t.emboss&&!t.imprint&&(e.style.textShadow="1px 1px 2px rgba(0,0,0,0.3)"),t.textOutline&&(e.style.webkitTextStroke="1px currentColor",e.style.webkitTextFillColor="transparent"),t.emphasisMark){let r=t.emphasisMark==="comma"?"filled sesame":t.emphasisMark==="circle"?"filled circle":"filled dot",i=t.emphasisMark==="underDot"?"under right":"over right";e.style.textEmphasis=`${r}`,e.style.textEmphasisPosition=i,e.style.webkitTextEmphasis=r,e.style.webkitTextEmphasisPosition=i;}t.highlight&&(e.style.backgroundColor=t.highlight);let o=[];if(t.underline&&(o.push("underline"),typeof t.underline=="object"&&(t.underline.style&&(e.style.textDecorationStyle=t.underline.style),t.underline.color&&(e.style.textDecorationColor=t.underline.color))),t.strike&&o.push("line-through"),t.commentIds&&t.commentIds.length>0){let r=t.commentIds.find(i=>!n||!n.has(i));r!=null&&(e.style.backgroundColor="rgba(255, 212, 0, 0.15)",e.style.borderBottom="1px solid rgba(255, 212, 0, 0.4)",e.dataset.commentId=String(r));}t.isInsertion&&(e.style.backgroundColor="rgba(52, 168, 83, 0.08)",e.style.borderBottom="2px dashed #2e7d32",e.style.paddingBottom="1px",e.classList.add("docx-insertion"),t.changeAuthor&&(e.dataset.changeAuthor=t.changeAuthor),t.changeDate&&(e.dataset.changeDate=t.changeDate),t.changeRevisionId!=null&&(e.dataset.revisionId=String(t.changeRevisionId))),t.isDeletion&&(e.style.backgroundColor="rgba(211, 47, 47, 0.08)",e.style.color="#c62828",o.includes("line-through")||o.push("line-through"),e.style.textDecorationColor="#c62828",e.classList.add("docx-deletion"),t.changeAuthor&&(e.dataset.changeAuthor=t.changeAuthor),t.changeDate&&(e.dataset.changeDate=t.changeDate),t.changeRevisionId!=null&&(e.dataset.revisionId=String(t.changeRevisionId))),o.length>0&&(e.style.textDecorationLine=o.join(" ")),t.superscript&&(e.style.verticalAlign="super",e.style.fontSize="0.75em"),t.subscript&&(e.style.verticalAlign="sub",e.style.fontSize="0.75em"),t.hidden&&(e.classList.add("docx-hidden"),e.style.opacity="0.4",e.style.textDecoration="underline dotted"),t.rtl&&e.setAttribute("dir","rtl"),t.textEffect&&(e.classList.add("docx-text-effect",`docx-text-effect-${t.textEffect}`),e.dataset.effect=t.textEffect);}function D(e,t,n){t!==void 0&&(e.dataset.pmStart=String(t)),n!==void 0&&(e.dataset.pmEnd=String(n));}function ie(e,t,n){let o=t.createElement("span");if(o.className=`${E.run} ${E.text}`,mt(o,e,n),D(o,e.pmStart,e.pmEnd),e.hyperlink){let r=t.createElement("a");r.href=e.hyperlink.href,e.hyperlink.href.startsWith("#")||(r.target="_blank",r.rel="noopener noreferrer"),e.hyperlink.tooltip&&(r.title=e.hyperlink.tooltip),r.textContent=e.text;let i=e.color||"#0563c1";r.style.color=i,r.style.textDecoration="underline",o.style.color=i,o.appendChild(r);}else o.textContent=e.text;return o}function Te(e,t,n,o){let r=t.createElement("span");if(r.className=`${E.run} ${E.tab}`,r.style.display="inline-block",r.style.width=`${n}px`,r.style.overflow="hidden",D(r,e.pmStart,e.pmEnd),o&&o!=="none"){let i=ht(o);i&&(r.style.backgroundImage=`url("data:image/svg+xml,${encodeURIComponent(`<svg xmlns='http://www.w3.org/2000/svg' width='4' height='16'><text x='0' y='12' font-size='12' fill='%23000'>${i}</text></svg>`)}")`,r.style.backgroundRepeat="repeat-x",r.style.backgroundPosition="bottom");}return r.textContent="\xA0",r}function ht(e){switch(e){case "dot":return ".";case "hyphen":return "-";case "underscore":return "_";case "middleDot":return "\xB7";case "heavy":return "_";default:return null}}function Ke(e){if(!e)return 0;let t=e.match(/rotate\(([-\d.]+)deg\)/);return t?(parseFloat(t[1])%360+360)%360:0}function Ue(e,t,n){if(n===0||n===180)return {w:e,h:t};if(n===90||n===270)return {w:t,h:e};let o=n*Math.PI/180,r=Math.abs(Math.sin(o)),i=Math.abs(Math.cos(o));return {w:e*i+t*r,h:e*r+t*i}}function ut(e,t){let n=t.createElement("img");n.className=`${E.run} ${E.image}`,n.src=e.src,n.width=e.width,n.height=e.height,n.style.width=`${e.width}px`,n.style.height=`${e.height}px`,e.alt&&(n.alt=e.alt),e.transform&&(n.style.transform=e.transform,n.style.transformOrigin="center center"),q(e)&&J(n,e);let o=Ke(e.transform);if(o!==0){let r=Ue(e.width,e.height,o),i=t.createElement("span");return i.style.display="inline-block",i.style.position="relative",i.style.width=`${r.w}px`,i.style.height=`${r.h}px`,i.style.verticalAlign="middle",n.style.position="absolute",n.style.left=`${(r.w-e.width)/2}px`,n.style.top=`${(r.h-e.height)/2}px`,D(i,e.pmStart,e.pmEnd),i.appendChild(n),i}return n.style.display="inline-block",n.style.verticalAlign="middle",D(n,e.pmStart,e.pmEnd),n}function Ye(e,t){let n=t.createElement("div");n.className="layout-block-image",n.style.display="block",n.style.textAlign="center",n.style.marginTop=`${e.distTop??6}px`,n.style.marginBottom=`${e.distBottom??6}px`;let o=t.createElement("img");o.src=e.src,o.width=e.width,o.height=e.height,o.style.marginLeft="auto",o.style.marginRight="auto",e.alt&&(o.alt=e.alt),e.transform&&(o.style.transform=e.transform,o.style.transformOrigin="center center"),q(e)&&J(o,e);let r=Ke(e.transform);if(r!==0){let i=Ue(e.width,e.height,r);n.style.height=`${i.h}px`,n.style.position="relative",o.style.position="absolute",o.style.left="50%",o.style.top="50%",o.style.marginLeft=`${-e.width/2}px`,o.style.marginRight="0",o.style.marginTop=`${-e.height/2}px`;}return D(n,e.pmStart,e.pmEnd),n.appendChild(o),n}function Se(e,t){return H(e)||e.displayMode==="block"||e.wrapType==="topAndBottom"?Ye(e,t):ut(e,t)}function we(e,t){let n=t.createElement("br");return n.className=`${E.run} ${E.lineBreak}`,D(n,e.pmStart,e.pmEnd),n}function Fe(e,t,n){let o=e.fallback??"";switch(e.fieldType){case "PAGE":o=String(n.pageNumber);break;case "NUMPAGES":o=String(n.totalPages);break;case "DATE":o=new Date().toLocaleDateString();break;case "TIME":o=new Date().toLocaleTimeString();break}let r={text:o,bold:e.bold,italic:e.italic,underline:e.underline,strike:e.strike,color:e.color,highlight:e.highlight,fontFamily:e.fontFamily,fontSize:e.fontSize,pmStart:e.pmStart,pmEnd:e.pmEnd};return ie(r,t,n?.resolvedCommentIds)}function Xe(e,t,n){if(W(e))return ie(e,t,n?.resolvedCommentIds);if(j(e))return Te(e,t,48,void 0);if(K(e))return Se(e,t);if(U(e))return we(e,t);if(X(e)&&n)return Fe(e,t,n);let o=t.createElement("span");return o.className=E.run,o}function ke(e){return e/1440*96}function yt(e){return e/96*1440}function bt(e){let{explicitStops:t=[],defaultTabInterval:n=720,leftIndent:o=0}=e,r=t.filter(c=>c.val!=="clear").filter(c=>c.pos>=o),i=t.filter(c=>c.val==="clear").map(c=>c.pos),a=r.reduce((c,x)=>Math.max(c,x.pos),0),l=[...r];o>0&&!r.some(c=>c.pos<=o)&&(i.some(x=>Math.abs(x-o)<20)||l.push({val:"start",pos:o,leader:"none"}));let g=a>0?Math.max(a,o):o,s=o+14400;for(;g<s;){g+=n;let c=r.some(f=>Math.abs(f.pos-g)<20),x=i.some(f=>Math.abs(f-g)<20),b=o>0&&Math.abs(g-o)<20;!c&&!x&&!b&&l.push({val:"start",pos:g,leader:"none"});}return l.sort((c,x)=>c.pos-x.pos)}function Ze(e,t,n="",o,r="."){let{defaultTabInterval:i=720}=t,a=yt(e),d=bt(t).find(c=>c.pos>a);if(!d){let c=ke(i),x=c-e%c;return x<=0&&(x=c),{width:x,alignment:"default"}}let s=ke(d.pos)-e;if(d.val==="center"||d.val==="end"){let c=o?o(n):0;d.val==="center"?s-=c/2:s-=c;}else if(d.val==="decimal"){let c=n.indexOf(r);if(c>=0&&o){let x=n.slice(0,c),b=o(x);s-=b;}}else if(d.val==="bar")return {width:0,leader:d.leader,alignment:"bar"};if(s<1){let c=ke(i),x=c-e%c;return x<=0&&(x=c),{width:x,alignment:"default"}}return {width:s,leader:d.leader,alignment:d.val}}function qe(e,t){let n=[],o=e.runs;for(let r=t.fromRun;r<=t.toRun;r++){let i=o[r];if(i)if(W(i)){let a=r===t.fromRun?t.fromChar:0,l=r===t.toRun?t.toChar:i.text.length;if(a>0||l<i.text.length){let d=i.text.slice(a,l);n.push({...i,text:d,pmStart:i.pmStart!==void 0?i.pmStart+a:void 0,pmEnd:i.pmStart!==void 0?i.pmStart+l:void 0});}else n.push(i);}else n.push(i);}return n}function xt(e){return [e.pmStart??"no-start",e.pmEnd??"no-end",e.src,e.width,e.height,e.displayMode??"inline",e.wrapType??"none"].join("|")}function Tt(e){return {val:e.val,pos:e.pos,leader:e.leader}}function St(e,t,n){let o="";for(let r=t+1;r<e.length;r++){let i=e[r];if(W(i))o+=i.text;else if(X(i))i.fieldType==="PAGE"&&n?o+=String(n.pageNumber):i.fieldType==="NUMPAGES"&&n?o+=String(n.totalPages):o+=i.fallback??"";else if(j(i)||U(i))break}return o}function wt(e){let n=e.createElement("canvas").getContext("2d");return (o,r=11,i="Calibri")=>{if(!n)return o.length*7;let a=chunkN3Y5BUKV_js.a(i).cssFallback,l=r*96/72;return n.font=`${l}px ${a}`,n.measureText(o).width}}function ae(e,t,n,o,r){let i=o.createElement("div");i.className=E.line,i.style.height=`${t.lineHeight}px`,i.style.lineHeight=`${t.lineHeight}px`;let a=qe(e,t);if(a.length===1&&K(a[0])){let p=a[0].position?.horizontal?.align??n;i.style.display="flex",i.style.alignItems="center",i.style.justifyContent=p==="center"?"center":p==="right"?"flex-end":"flex-start";}if(a.length===0){let h=o.createElement("span");return h.className=`${E.run} layout-empty-run`,h.innerHTML=" ",i.appendChild(h),i}let l=n==="justify",d=false;l&&r&&(d=!r.isLastLine||r.paragraphEndsWithLineBreak,d&&(i.style.textAlign="justify",i.style.textAlignLast="justify",i.style.width=`${r.availableWidth}px`)),i.style.whiteSpace="pre";let g=a.some(h=>W(h)&&h.highlight);i.style.overflow=g?"hidden":"visible";let s=a.some(j),c,x=wt(o);if(s){let h=r?.tabStops?.map(Tt),m=r?.leftIndentPx?Math.round(r.leftIndentPx*15):0;c={explicitStops:h,leftIndent:m};}let b=0,f=r?.leftIndentPx??0;if(r?.isFirstLine){let h=r?.firstLineIndentPx??0;b=f+h;}else b=f;for(let h=0;h<a.length;h++){let m=a[h];if(j(m)&&c){let p=St(a,h,r?.context),y=Ze(b,c,p,x),u=Te(m,o,y.width,y.leader);i.appendChild(u),b+=y.width;}else if(W(m)){let p=ie(m,o,r?.context?.resolvedCommentIds);if(m.highlight){let F=(m.fontSize?m.fontSize*96/72:14.67)*1.2,S=Math.max(0,t.lineHeight-F);if(S>0){let I=S/2;p.style.paddingTop=`${I}px`,p.style.paddingBottom=`${I}px`;}}i.appendChild(p);let y=m.fontSize||11,u=m.fontFamily||"Calibri";b+=x(m.text,y,u);}else if(K(m)){if(H(m))continue;let p=xt(m);if(r?.renderedInlineImageKeys?.has(p))continue;r?.renderedInlineImageKeys?.add(p);let y=Se(m,o);i.appendChild(y),m.displayMode!=="block"&&m.wrapType!=="topAndBottom"&&(b+=m.width);}else if(U(m)){let p=we(m,o);i.appendChild(p);}else if(X(m)&&r?.context){let p=Fe(m,o,r.context);i.appendChild(p);let y=m.fallback??"";m.fieldType==="PAGE"?y=String(r.context.pageNumber):m.fieldType==="NUMPAGES"&&(y=String(r.context.totalPages));let u=m.fontSize||11,w=m.fontFamily||"Calibri";b+=x(y,u,w);}else {let p=Xe(m,o,r?.context);i.appendChild(p);}}return i}function Q(e,t){return !e&&!t?true:!e||!t?false:e.style===t.style&&e.width===t.width&&e.color===t.color}function Je(e,t){return !e&&!t||!e||!t?false:Q(e.top,t.top)&&Q(e.bottom,t.bottom)&&Q(e.left,t.left)&&Q(e.right,t.right)&&Q(e.between,t.between)}function v(e,t,n,o,r={}){let i=r.document??document,a=i.createElement("div");a.className=E.fragment,a.style.position=o.positioning==="absolute"?"absolute":"relative",a.dataset.blockId=String(e.blockId),a.dataset.fromLine=String(e.fromLine),a.dataset.toLine=String(e.toLine),D(a,e.pmStart,e.pmEnd),e.continuesFromPrev&&(a.dataset.continuesFromPrev="true"),e.continuesOnNext&&(a.dataset.continuesOnNext="true");let l=n.lines.slice(e.fromLine,e.toLine),d=t.attrs?.alignment;t.attrs?.styleId&&(a.dataset.styleId=t.attrs.styleId);let g=t.attrs?.bidi;g&&(a.dir="rtl"),d?d==="center"?a.style.textAlign="center":d==="right"?a.style.textAlign="right":d==="left"?a.style.textAlign="left":a.style.textAlign=g?"right":"left":g&&(a.style.textAlign="right");let s=t.attrs?.indent,c=0,x=0;s&&(g?(s.left&&s.left>0&&(x=s.left),s.right&&s.right>0&&(c=s.right)):(s.left&&s.left>0&&(c=s.left),s.right&&s.right>0&&(x=s.right)));let b=t.attrs?.borders;if(b){let w=R=>{switch(R){case "single":return "solid";case "double":return "double";case "dotted":return "dotted";case "dashed":return "dashed";case "thick":return "solid";case "wave":return "wavy";case "dashSmallGap":return "dashed";case "nil":case "none":return "none";default:return "solid"}};a.style.boxSizing="border-box";let F=R=>`${R.width}px ${w(R.style)} ${R.color}`,S=Je(r.prevBorders,b),I=Je(b,r.nextBorders),C=S?b.between:b.top,T=I?void 0:b.bottom,k=i.createElement("div");if(k.className="layout-paragraph-border",k.style.position="absolute",k.style.pointerEvents="none",k.style.boxSizing="border-box",k.style.left=`${c-(b.left?.space??0)}px`,k.style.right=`${x-(b.right?.space??0)}px`,k.style.top=`${-(C?.space??0)}px`,k.style.bottom=`${-(T?.space??0)}px`,C&&(k.style.borderTop=F(C)),T&&(k.style.borderBottom=F(T)),b.left&&(k.style.borderLeft=F(b.left)),b.right&&(k.style.borderRight=F(b.right)),(C||T||b.left||b.right)&&a.appendChild(k),b.bar){let R=i.createElement("div");R.style.position="absolute",R.style.left="-8px",R.style.top="0",R.style.bottom="0",R.style.borderLeft=F(b.bar),a.style.position="relative",a.appendChild(R);}}t.attrs?.shading&&(a.style.backgroundColor=t.attrs.shading);let f=e.width-c-x,m=t.runs[t.runs.length-1]?.kind==="lineBreak",p=n.lines.length,y=0;s?.hanging&&s.hanging>0?y=-s.hanging:s?.firstLine&&s.firstLine>0&&(y=s.firstLine);let u=r.renderedInlineImageKeys??new Set;for(let w=0;w<l.length;w++){let F=l[w],S=e.fromLine+w,I=S===p-1,C=S===0&&!e.continuesFromPrev,T=F.leftOffset??0,k=F.rightOffset??0,P=f;if(C){let B=s?.hanging&&s.hanging>0,L=s?.firstLine&&s.firstLine>0;B&&s?.hanging?P=f+s.hanging:L&&s?.firstLine&&(P=f-s.firstLine);}if(Ft(F,t)){let B=i.createElement("div");B.className=`${E.line} layout-line-split`,B.style.position="relative",B.style.height=`${F.lineHeight}px`,B.style.lineHeight=`${F.lineHeight}px`;for(let L of F.segments){let he={fromRun:L.fromRun,fromChar:L.fromChar,toRun:L.toRun,toChar:L.toChar,width:L.width,ascent:F.ascent,descent:F.descent,lineHeight:F.lineHeight},O=ae(t,he,d,i,{availableWidth:L.availableWidth,isLastLine:I,isFirstLine:C,paragraphEndsWithLineBreak:m,tabStops:t.attrs?.tabs,leftIndentPx:c,firstLineIndentPx:C?y:0,context:o,renderedInlineImageKeys:u});O.className+=" layout-line-segment",O.style.position="absolute",O.style.left=`${L.leftOffset}px`,O.style.top="0",O.style.width=`${L.availableWidth}px`,B.appendChild(O);}a.appendChild(B);continue}let R=ae(t,F,d,i,{availableWidth:P-T-k,isLastLine:I,isFirstLine:C,paragraphEndsWithLineBreak:m,tabStops:t.attrs?.tabs,leftIndentPx:c,firstLineIndentPx:C?y:0,context:o,renderedInlineImageKeys:u});if(T>0||k>0){T>0&&(R.style.marginLeft=`${T}px`),k>0&&(R.style.marginRight=`${k}px`);let B=P-T-k;B>0&&(R.style.width=`${B}px`);}let Be=s?.hanging&&s.hanging>0,Me=s?.firstLine&&s.firstLine>0;if(C?c>0&&Be?(R.style.paddingLeft=`${c}px`,R.style.textIndent=`-${s.hanging}px`):c>0&&Me?(R.style.paddingLeft=`${c}px`,R.style.textIndent=`${s.firstLine}px`):c>0?R.style.paddingLeft=`${c}px`:Me&&(R.style.textIndent=`${s.firstLine}px`):c>0?R.style.paddingLeft=`${c}px`:Be&&(R.style.paddingLeft=`${s.hanging}px`),x>0&&(R.style.paddingRight=`${x}px`),C&&t.attrs?.listMarker&&!t.attrs?.listMarkerHidden){let B=Math.max(0,c-(s?.hanging??0));R.style.paddingLeft=`${B}px`,R.style.textIndent="0";let L;if(!t.attrs.listMarkerFontFamily||!t.attrs.listMarkerFontSize)for(let $=F.fromRun;$<=F.toRun;$++){let ue=t.runs[$];if(ue&&ue.kind==="text"){L=ue;break}}let he=t.attrs.listMarkerFontFamily??L?.fontFamily??t.attrs.defaultFontFamily,O=t.attrs.listMarkerFontSize??L?.fontSize??t.attrs.defaultFontSize,ve=kt(t.attrs.listMarker,s,i,he,O);if((s?.hanging??0)>0)R.insertBefore(ve,R.firstChild);else {let $=i.createElement("div");$.className="layout-line layout-list-marker-line",$.style.height=`${F.lineHeight}px`,$.style.lineHeight=`${F.lineHeight}px`,$.appendChild(ve),a.appendChild($);}}a.appendChild(R);}return a}function Ft(e,t){return (e.segments?.length??0)>1&&!t.attrs?.listMarker}function kt(e,t,n,o,r){let i=n.createElement("span");if(i.className="layout-list-marker",o&&(i.style.fontFamily=chunkN3Y5BUKV_js.a(o).cssFallback),r){let l=r*96/72;i.style.fontSize=`${l}px`;}i.textContent=e,i.style.textAlign="left",i.style.boxSizing="border-box";let a=t?.hanging??0;return i.style.display="inline-block",a>0&&(i.style.minWidth=`${a}px`),i}function V(e,t,n){let o=t.createElement("div");o.className=n.layerClass,o.style.position="absolute",o.style.top="0",o.style.left="0",n.sizing==="inset0"?(o.style.right="0",o.style.bottom="0"):(o.style.width="100%",o.style.height="100%",o.style.overflow="hidden"),o.style.pointerEvents="none",n.layerMode==="front"&&(o.style.zIndex="10");for(let r of e){let i=t.createElement("div");i.className=n.itemClass,i.style.position="absolute",i.style.pointerEvents="auto",i.style.top=`${r.y}px`,i.style.left=`${r.x}px`,r.pmStart!==void 0&&(i.dataset.pmStart=String(r.pmStart)),r.pmEnd!==void 0&&(i.dataset.pmEnd=String(r.pmEnd));let a=t.createElement("img");a.src=r.src,a.style.width=`${r.width}px`,a.style.height=`${r.height}px`,a.style.display="block",r.alt&&(a.alt=r.alt),r.transform&&(a.style.transform=r.transform,a.style.transformOrigin="center center"),q(r)&&J(a,r),i.appendChild(a),o.appendChild(i);}return o}var A={table:"layout-table",row:"layout-table-row",cell:"layout-table-cell",cellContent:"layout-table-cell-content",resizeHandle:"layout-table-resize-handle",rowResizeHandle:"layout-table-row-resize-handle",tableEdgeHandleBottom:"layout-table-edge-handle-bottom",tableEdgeHandleRight:"layout-table-edge-handle-right"};function It(e,t,n){let o=[],r=0;for(let i=0;i<e.blocks.length;i++){let a=e.blocks[i];if(a?.kind!=="paragraph"){let g=t.blocks[i];g&&g.kind==="table"&&(r+=g.totalHeight??0);continue}let l=a;for(let g of l.runs){if(g.kind!=="image")continue;let s=g;if(!H(s))continue;let c=s.position,x=s.distTop??0,b=s.distBottom??0,f=s.distLeft??12,h=s.distRight??12,m="left",p=0;if(c?.horizontal){let u=c.horizontal;u.align==="right"?(m="right",p=n-s.width):u.align==="left"?p=0:u.align==="center"?p=(n-s.width)/2:u.posOffset!==void 0&&(p=chunk4Q2IP5FW_js.e(u.posOffset),m=p>n/2?"right":"left");}else s.cssFloat==="right"&&(m="right",p=n-s.width);let y=r;if(c?.vertical){let u=c.vertical;u.posOffset!==void 0?y=r+chunk4Q2IP5FW_js.e(u.posOffset):u.align==="top"&&(y=0);}p=Math.max(0,Math.min(p,n-s.width)),o.push({src:s.src,width:s.width,height:s.height,alt:s.alt,transform:s.transform,x:p,y,side:m,distTop:x,distBottom:b,distLeft:f,distRight:h,wrapText:oe(s.cssFloat),wrapType:s.wrapType,pmStart:s.pmStart,pmEnd:s.pmEnd});}let d=t.blocks[i];d&&d.kind==="paragraph"&&(r+=d.totalHeight);}return o}function Rt(e,t,n,o){let r=o.createElement("div");r.className=A.cellContent,r.style.position="relative";let i=e.padding?.left??7,a=e.padding?.right??7,l=Math.max(0,t.width-i-a);r.style.width=`${l}px`;let d=It(e,t,l),g;if(d.length>0){g=d.filter(Z).map(f=>{let h=f.x+f.width+f.distRight,m=f.y-f.distTop,p=f.y+f.height+f.distBottom,y=0,u=0,w=f.wrapText??"bothSides";return w==="right"?y=h:w==="left"?u=l-(f.x-f.distLeft):f.side==="left"?y=h:u=l-(f.x-f.distLeft),{leftMargin:y,rightMargin:u,topY:m,bottomY:p}});let b=d.filter(G);b.length>0&&r.appendChild(V(b,o,{layerClass:"layout-cell-floating-images-layer",itemClass:"layout-cell-floating-image",sizing:"fullSize",layerMode:"behind"}));}let s=0,c=0;for(let b=0;b<e.blocks.length;b++){let f=e.blocks[b],h=t.blocks[b];if(f?.kind==="paragraph"&&h?.kind==="paragraph"){let m=f,p=h,y=m.attrs?.spacing,u=Math.max(c,y?.before??0);s+=u,g&&g.length>0&&(p=chunkDY2MJCSV_js.r(m,l,{floatingZones:g,paragraphYOffset:s}));let w={blockId:m.id,width:l,height:p.totalHeight,fromLine:0,toLine:p.lines.length,pmStart:m.pmStart,pmEnd:m.pmEnd},F={...n,insideTableCell:true},S=v(w,m,p,F,{document:o});S.style.position="relative",u>0&&(S.style.marginTop=`${u}px`),r.appendChild(S),s+=p.totalHeight,c=y?.after??0;}else if(f?.kind==="table"&&h?.kind==="table"){let m=f,p=h,y=c,u=Ct(m,p,n,o);u.style.position="relative",y>0&&(u.style.marginTop=`${y}px`),r.appendChild(u),s+=y+(h.totalHeight??0),c=0;}}c>0&&(r.style.paddingBottom=`${c}px`);let x=d.filter(b=>!G(b));return x.length>0&&r.appendChild(V(x,o,{layerClass:"layout-cell-floating-images-layer",itemClass:"layout-cell-floating-image",sizing:"fullSize",layerMode:"front"})),r}function Ct(e,t,n,o){let r=o.createElement("div");r.className=`${A.table} layout-nested-table`,r.style.position="relative",r.style.width=`${t.totalWidth}px`,r.style.display="block",e.justification==="center"?(r.style.marginLeft="auto",r.style.marginRight="auto"):e.justification==="right"?r.style.marginLeft="auto":e.indent&&(r.style.marginLeft=`${e.indent}px`),r.dataset.blockId=String(e.id),e.pmStart!==void 0&&(r.dataset.pmStart=String(e.pmStart)),e.pmEnd!==void 0&&(r.dataset.pmEnd=String(e.pmEnd));let i=[],a=0;for(let g=0;g<t.rows.length;g++)i.push(a),a+=t.rows[g]?.height??0;i.push(a);let l=new Map,d=0;for(let g=0;g<e.rows.length;g++){let s=e.rows[g],c=t.rows[g];if(!s||!c)continue;let x=Ie(s,c,g,d,t.columnWidths,e.rows.length,n,o,l,i);r.appendChild(x),d+=c.height;}return r.style.height=`${d}px`,r}function se(e,t,n){let o=`border${t.charAt(0).toUpperCase()+t.slice(1)}`;if(!n||n.style==="none"||n.style==="nil"||n.width===0)e.style[o]="none";else {let r=n.width??1,i=n.color??"#000000",a=n.style??"solid";e.style[o]=`${r}px ${a} ${i}`;}}function Pt(e,t,n,o,r,i,a){let l=a.createElement("div");l.className=A.cell,l.style.position="absolute",l.style.left=`${n}px`,l.style.top="0",l.style.width=`${t.width}px`,l.style.height=`${o}px`,l.style.overflow="hidden",l.style.boxSizing="border-box";let d=e.padding?.top??1,g=e.padding?.right??7,s=e.padding?.bottom??1,c=e.padding?.left??7;if(l.style.padding=`${d}px ${g}px ${s}px ${c}px`,e.borders&&(r.isFirstRow&&se(l,"top",e.borders.top),se(l,"right",e.borders.right),se(l,"bottom",e.borders.bottom),r.isFirstCol&&se(l,"left",e.borders.left)),e.background&&(l.style.backgroundColor=e.background),e.noWrap&&(l.style.whiteSpace="nowrap"),e.verticalAlign)switch(l.style.display="flex",l.style.flexDirection="column",e.verticalAlign){case "top":l.style.justifyContent="flex-start";break;case "center":l.style.justifyContent="center";break;case "bottom":l.style.justifyContent="flex-end";break}let x=Rt(e,t,i,a);if(l.appendChild(x),e.blocks.length>0){let b=e.blocks[0],f=e.blocks[e.blocks.length-1];b&&"pmStart"in b&&b.pmStart!==void 0&&(l.dataset.pmStart=String(b.pmStart)),f&&"pmEnd"in f&&f.pmEnd!==void 0&&(l.dataset.pmEnd=String(f.pmEnd));}return l}function Ie(e,t,n,o,r,i,a,l,d,g,s){let c=l.createElement("div");c.className=A.row,c.style.position="absolute",c.style.left="0",c.style.top=`${o}px`,c.style.width="100%",c.style.height=`${t.height}px`,c.dataset.rowIndex=String(n);let x=new Set;if(d){for(let[,h]of d)if(h.startRow<n&&h.startRow+h.rowSpan>n)for(let m=0;m<h.colSpan;m++)x.add(h.columnIndex+m);}let b=0,f=0;for(;x.has(f);)b+=r[f]??0,f++;for(let h=0;h<e.cells.length;h++){let m=e.cells[h],p=t.cells[h];if(!m||!p)continue;let y=m.colSpan??1,u=m.rowSpan??1,w=t.height;if(u>1&&g){w=0;for(let k=n;k<n+u&&k<g.length-1;k++)w+=(g[k+1]??0)-(g[k]??0);w===0&&(w=t.height*u);}let F=n===0||s===true,I=f===0;f+y>=r.length;let T=Pt(m,p,b,w,{isFirstRow:F,isFirstCol:I},a,l);if(T.dataset.cellIndex=String(h),T.dataset.columnIndex=String(f),u>1&&(T.dataset.rowSpan=String(u)),c.appendChild(T),u>1&&d){let k=`${n}-${f}`;d.set(k,{cell:m,cellMeasure:p,columnIndex:f,startRow:n,rowSpan:u,colSpan:y,x:b,totalHeight:w});}for(let k=0;k<y&&f+k<r.length;k++)b+=r[f+k]??0;for(f+=y;x.has(f);)b+=r[f]??0,f++;}return c}function Y(e,t,n,o,r={}){let i=r.document??document,a=i.createElement("div");a.className=A.table,a.style.position=o.positioning==="flow"?"relative":"absolute",a.style.width=`${e.width}px`,a.style.height=`${e.height}px`,a.style.overflow="hidden",a.dataset.blockId=String(e.blockId),a.dataset.fromRow=String(e.fromRow),a.dataset.toRow=String(e.toRow),e.pmStart!==void 0&&(a.dataset.pmStart=String(e.pmStart)),e.pmEnd!==void 0&&(a.dataset.pmEnd=String(e.pmEnd));let l=0;for(let f=0;f<n.columnWidths.length-1;f++){l+=n.columnWidths[f]??0;let h=i.createElement("div");h.className=A.resizeHandle,h.style.position="absolute",h.style.left=`${l-3}px`,h.style.top="0",h.style.width="6px",h.style.height="100%",h.style.cursor="col-resize",h.style.zIndex="10",h.dataset.columnIndex=String(f),h.dataset.tableBlockId=String(e.blockId),e.pmStart!==void 0&&(h.dataset.tablePmStart=String(e.pmStart)),a.appendChild(h);}let d=[],g=0;for(let f=0;f<n.rows.length;f++)d.push(g),g+=n.rows[f]?.height??0;d.push(g);let s=new Map,c=e.headerRowCount??0,x=0;if(c>0&&e.continuesFromPrev)for(let f=0;f<c;f++){let h=t.rows[f],m=n.rows[f];if(!h||!m)continue;let p=Ie(h,m,f,x,n.columnWidths,t.rows.length,o,i,s,d,f===0);p.dataset.repeatedHeader="true",a.appendChild(p),x+=m.height;}for(let f=e.fromRow;f<e.toRow;f++){let h=t.rows[f],m=n.rows[f];if(!h||!m)continue;let p=c>0&&e.continuesFromPrev?false:e.continuesFromPrev&&f===e.fromRow,y=Ie(h,m,f,x,n.columnWidths,t.rows.length,o,i,s,d,p);a.appendChild(y),x+=m.height;}let b=0;for(let f=e.fromRow;f<e.toRow;f++)if(b+=n.rows[f]?.height??0,f<e.toRow-1){let h=i.createElement("div");h.className=A.rowResizeHandle,h.style.position="absolute",h.style.left="0",h.style.top=`${b-3}px`,h.style.width="100%",h.style.height="6px",h.style.cursor="row-resize",h.style.zIndex="10",h.dataset.rowIndex=String(f),h.dataset.tableBlockId=String(e.blockId),e.pmStart!==void 0&&(h.dataset.tablePmStart=String(e.pmStart)),a.appendChild(h);}if(e.toRow===t.rows.length){let f=i.createElement("div");f.className=A.tableEdgeHandleBottom,f.style.position="absolute",f.style.left="0",f.style.top=`${b-3}px`,f.style.width="100%",f.style.height="6px",f.style.cursor="row-resize",f.style.zIndex="10",f.dataset.rowIndex=String(t.rows.length-1),f.dataset.tableBlockId=String(e.blockId),f.dataset.isEdge="bottom",e.pmStart!==void 0&&(f.dataset.tablePmStart=String(e.pmStart)),a.appendChild(f);}if(e.toRow===t.rows.length){let f=n.columnWidths.reduce((m,p)=>m+p,0),h=i.createElement("div");h.className=A.tableEdgeHandleRight,h.style.position="absolute",h.style.left=`${f-3}px`,h.style.top="0",h.style.width="6px",h.style.height="100%",h.style.cursor="col-resize",h.style.zIndex="10",h.dataset.columnIndex=String(n.columnWidths.length-1),h.dataset.tableBlockId=String(e.blockId),h.dataset.isEdge="right",e.pmStart!==void 0&&(h.dataset.tablePmStart=String(e.pmStart)),a.appendChild(h);}return a}var Et={textBox:"layout-textbox"};function le(e,t,n,o,r={}){let i=r.document??document,a=i.createElement("div");if(a.className=Et.textBox,a.style.position="absolute",a.style.width=`${e.width}px`,a.style.height=`${e.height}px`,a.style.overflow="hidden",a.style.boxSizing="border-box",Lt(a,e),t.fillColor&&(a.style.backgroundColor=t.fillColor),t.outlineWidth&&t.outlineWidth>0){let s=t.outlineStyle||"solid",c=t.outlineColor||"#000000";a.style.border=`${t.outlineWidth}px ${s} ${c}`;}let l=t.margins??chunkDROCYKAR_js.a;a.style.padding=`${l.top}px ${l.right}px ${l.bottom}px ${l.left}px`,a.dataset.blockId=String(e.blockId),e.pmStart!==void 0&&(a.dataset.pmStart=String(e.pmStart)),e.pmEnd!==void 0&&(a.dataset.pmEnd=String(e.pmEnd));let d=e.width-l.left-l.right,g=0;for(let s=0;s<t.content.length;s++){let c=t.content[s],x=n.innerMeasures[s];if(!x)continue;let b={blockId:c.id,width:d,height:x.totalHeight,pmStart:c.pmStart,pmEnd:c.pmEnd,fromLine:0,toLine:x.lines.length},f=v(b,c,x,{...o,positioning:"flow"},{document:i});a.appendChild(f),g+=x.totalHeight;}return a}function Lt(e,t){!t.isFloating&&t.zIndex===void 0||(e.style.zIndex=String(t.zIndex??10));}function Qe(e){return {pageWidth:e.size.w,pageHeight:e.size.h,marginLeft:e.margins.left,marginTop:e.margins.top,contentWidth:e.size.w-e.margins.left-e.margins.right,contentHeight:e.size.h-e.margins.top-e.margins.bottom}}function Re(e,t,n,o){let{x:r,side:i}=Bt(e,n,o),a=vt(e,t,o);return {x:r,y:a,side:i}}function Bt(e,t,n){let o=e.position?.horizontal;if(!o)return e.cssFloat==="right"?{x:t-e.width,side:"right"}:{x:0,side:"left"};let r=Mt(o.relativeTo,t,n);if(o.align==="right")return {x:r.size?r.base+r.size-e.width:0,side:"right"};if(o.align==="left")return {x:r.base,side:"left"};if(o.align==="center")return {x:r.size?r.base+(r.size-e.width)/2:0,side:"left"};if(o.posOffset!==void 0){let i=r.base+chunk4Q2IP5FW_js.e(o.posOffset);return {x:i,side:i>t/2?"right":"left"}}return {x:r.base,side:"left"}}function Mt(e,t,n){let o=n?.pageWidth??0,r=n?.marginLeft??0;switch(e){case "page":return {base:-r,size:o};case "leftMargin":return {base:-r,size:r};case "rightMargin":return {base:t,size:r};case "character":return {base:0,size:0};default:return {base:0,size:t}}}function vt(e,t,n){let o=e.position?.vertical;if(!o)return t;let r=$t(o.relativeTo,t,n);return o.align==="top"?r.base:o.align==="center"?r.size?r.base+(r.size-e.height)/2:t:o.align==="bottom"?r.size?r.base+r.size-e.height:t:o.posOffset!==void 0?r.base+chunk4Q2IP5FW_js.e(o.posOffset):o.relativeTo==="paragraph"||o.relativeTo==="line"?t:r.base}function $t(e,t,n){let o=n?.pageHeight??0,r=n?.marginTop??0,i=n?.contentHeight??0;switch(e){case "paragraph":case "line":return {base:t,size:0};case "page":return {base:-r,size:o};case "topMargin":return {base:-r,size:r};case "bottomMargin":return {base:i,size:r};default:return {base:0,size:i}}}function et(e){return e?.align??e?.alignment}function Ht(e,t){let n=e.position.vertical;if(!n)return e.paragraphY;let o=et(n),r=n.posOffset!==void 0?chunk4Q2IP5FW_js.e(n.posOffset):void 0;if(n.relativeTo==="page"){if(r!==void 0)return r-t.flowTop;if(o==="top")return -t.flowTop;if(o==="bottom")return t.pageHeight-e.height-t.flowTop;if(o==="center")return (t.pageHeight-e.height)/2-t.flowTop}if(n.relativeTo==="margin"){let i=t.margins.top,a=t.pageHeight-t.margins.top-t.margins.bottom;if(r!==void 0)return i+r-t.flowTop;if(o==="top")return i-t.flowTop;if(o==="bottom")return i+a-e.height-t.flowTop;if(o==="center")return i+(a-e.height)/2-t.flowTop}return r!==void 0?e.paragraphY+r:e.paragraphY}function At(e,t,n){let o=t.position.horizontal;if(!o){e.style.left="0";return}let r=et(o);if(o.relativeTo==="page"){if(o.posOffset!==void 0){e.style.left=`${chunk4Q2IP5FW_js.e(o.posOffset)-n.flowLeft}px`;return}if(r==="right"){e.style.left=`${n.pageWidth-t.width-n.flowLeft}px`;return}if(r==="center"){e.style.left=`${(n.pageWidth-t.width)/2-n.flowLeft}px`;return}if(r==="left"){e.style.left=`${-n.flowLeft}px`;return}}if(o.posOffset!==void 0){e.style.left=`${chunk4Q2IP5FW_js.e(o.posOffset)}px`;return}if(r==="right"){e.style.left=`${n.contentWidth-t.width}px`;return}if(r==="center"){e.style.left=`${(n.contentWidth-t.width)/2}px`;return}e.style.left="0";}function tt(e,t){let n=e.tblpY??0;e.vertAnchor==="page"?n-=t.flowTop:e.vertAnchor==="margin"&&(n+=t.margins.top-t.flowTop);let o=e.tblpX??0;return e.horzAnchor==="page"?o-=t.flowLeft:e.horzAnchor==="margin"&&(o+=t.margins.left-t.flowLeft),{left:o,top:n}}function Ce(e,t,n,o){let r=n.document??document,i=r.createElement("div");i.style.position="relative";let a=t.contentWidth??600,l=[],d=0;for(let g=0;g<e.blocks.length;g++){let s=e.blocks[g],c=e.measures[g];if(!(!s||!c)){if(s.kind==="paragraph"&&c.kind==="paragraph"){let x=s,b=c,f=x.attrs?.spacing?.before??0,h=d,m=[];for(let w of x.runs)if(w.kind==="image"&&"position"in w&&w.position){let F=w;l.push({src:F.src,width:F.width,height:F.height,alt:F.alt,paragraphY:h,position:F.position});}else m.push(w);let p={...x,runs:m},y={blockId:x.id,width:a,height:b.totalHeight,fromLine:0,toLine:b.lines.length},u=v(y,p,b,{...t,positioning:"absolute"},{document:r});u.style.top=`${d+f}px`,u.style.left="0",u.style.width=`${a}px`,i.appendChild(u),d+=b.totalHeight;}else if(s.kind==="table"&&c.kind==="table"){let x={blockId:s.id,width:c.totalWidth,height:c.totalHeight,fromRow:0,toRow:c.rows.length,pmStart:s.pmStart,pmEnd:s.pmEnd},b=Y(x,s,c,{...t,positioning:"absolute"},{document:r});if(s.floating){let{left:f,top:h}=tt(s.floating,o);b.style.top=`${h}px`,b.style.left=`${f}px`,i.appendChild(b);}else b.style.top=`${d}px`,b.style.left="0",i.appendChild(b),d+=c.totalHeight;}}}for(let g of l){let s=r.createElement("img");s.src=g.src,s.width=g.width,s.height=g.height,g.alt&&(s.alt=g.alt),s.style.position="absolute",s.style.display="block",s.style.width=`${g.width}px`,s.style.height=`${g.height}px`,s.style.maxWidth="none",s.style.maxHeight="none",At(s,g,o),s.style.top=`${Ht(g,o)}px`,i.appendChild(s);}return i}var de=12,nt=6;function zt(e,t){if(e.size!==t.size)return false;for(let[n,o]of e)if(t.get(n)!==o)return false;return true}var Pe=8;function jn(e){let t=[];for(let n of e)if(n.kind==="paragraph")for(let o of n.runs)o.kind==="text"&&o.footnoteRefId!=null&&t.push({footnoteId:o.footnoteRefId,pmPos:o.pmStart??0});return t}function Ee(e,t){let n=new Map;if(t.length===0)return n;for(let o of t)for(let r of e){let i=false;for(let a of r.fragments){let l=a.pmStart??-1,d=a.pmEnd??-1;if(l>=0&&d>=0&&o.pmPos>=l&&o.pmPos<d){let g=n.get(r.number)??[];g.includes(o.footnoteId)||g.push(o.footnoteId),n.set(r.number,g),i=true;break}}if(i)break}return n}function Ot(e,t){if(e.length===0)return [{kind:"paragraph",id:`fn-empty-${t}`,runs:[{kind:"text",text:`${t} `,fontSize:Pe,superscript:true}]}];let n=e.map(r=>{if(r.kind!=="paragraph")return r;let i=r;return {...i,runs:i.runs.map(a=>(a.kind==="text"||a.kind==="tab")&&a.fontSize==null?{...a,fontSize:Pe}:a)}}),o=n[0];if(o.kind==="paragraph"){let r={kind:"text",text:`${t} `,fontSize:Pe,superscript:true};n[0]={...o,runs:[r,...o.runs]};}return n}function Nt(e,t,n,o){let r=chunkY7JZPBBW_js.c(e.content,{styles:o.styles??void 0,theme:o.theme??null}),i=chunkN27FJQTG_js.d(r,{theme:o.theme??void 0}),a=Ot(i,t),l=o.measureBlocks(a,n),d=l.reduce((g,s)=>s.kind==="paragraph"||s.kind==="table"?g+s.totalHeight:s.kind==="image"||s.kind==="textBox"?g+s.height:g,0);return {id:e.id,displayNumber:t,blocks:a,measures:l,height:d}}function Yn(e,t,n,o){let r=new Map,i=new Map;for(let d of e)(d.noteType==="normal"||d.noteType==null)&&i.set(d.id,d);let a=1,l=new Set;for(let d of t){if(l.has(d.footnoteId))continue;l.add(d.footnoteId);let g=i.get(d.footnoteId);g&&(r.set(d.footnoteId,Nt(g,a,n,o)),a++);}return r}function ot(e,t){let n=new Map;for(let[o,r]of e){let i=0;for(let a of r){let l=t.get(a);l&&(i+=l.height);}i>0&&(i+=de,n.set(o,i));}return n}function Kn(e){let{blocks:t,measures:n,layoutOpts:o,footnoteRefs:r,footnoteContentMap:i,initialLayout:a}=e,l=Ee(a.pages,r),d=ot(l,i);if(d.size===0)return {layout:a,pageFootnoteMap:l,converged:true};let g=a,s=false;for(let c=0;c<nt;c++){g=chunk44RUAQA2_js.q(t,n,{...o,footnoteReservedHeights:d});let x=Ee(g.pages,r),b=ot(x,i);if(l=x,zt(d,b)){d=b,s=true;break}d=b;}s||(g=chunk44RUAQA2_js.q(t,n,{...o,footnoteReservedHeights:d}),l=Ee(g.pages,r),console.warn(`[docx-editor] footnote layout did not stabilize within ${nt} passes; settling with best-effort reservation. If footnotes appear misplaced, please file a bug with the document.`));for(let[c,x]of l){let b=g.pages.find(f=>f.number===c);b&&(b.footnoteIds=x);}return {layout:g,pageFootnoteMap:l,converged:s}}function Un(e,t,n){let o=new Map;if(!n?.package?.footnotes)return o;let r=new Map;for(let i of n.package.footnotes)i.noteType&&i.noteType!=="normal"||r.set(i.id,i);for(let[i,a]of e){let l=[];for(let d of a){let g=r.get(d);if(!g)continue;let s=t.get(d),c=s?.displayNumber??0;l.push({displayNumber:String(c),text:chunkCWAP26GB_js.v(g),content:s});}l.length>0&&o.set(i,l);}return o}function Dt(e,t,n,o){let r=o.createElement("div");r.className="layout-footnote-content",r.style.position="relative",r.style.width=`${t}px`,r.style.height=`${e.height}px`;let i=0;for(let a=0;a<e.blocks.length;a++){let l=e.blocks[a],d=e.measures[a];if(!(!l||!d)){if(l.kind==="paragraph"&&d.kind==="paragraph"){let g=l.attrs?.spacing?.before??0,s={blockId:l.id,width:t,height:d.totalHeight,pmStart:l.pmStart,pmEnd:l.pmEnd,fromLine:0,toLine:d.lines.length},c=v(s,l,d,{...n,section:"body",contentWidth:t,positioning:"absolute"},{document:o});c.style.top=`${i+g}px`,c.style.left="0",c.style.width=`${t}px`,c.style.height=`${d.totalHeight}px`,r.appendChild(c),i+=d.totalHeight;}else if(l.kind==="table"&&d.kind==="table"){let g={blockId:l.id,width:d.totalWidth,height:d.totalHeight,pmStart:l.pmStart,pmEnd:l.pmEnd,fromRow:0,toRow:d.rows.length},s=Y(g,l,d,{...n,section:"body",contentWidth:t,positioning:"absolute"},{document:o});s.style.top=`${i}px`,s.style.left="0",r.appendChild(s),i+=d.totalHeight;}else if(l.kind==="image"&&d.kind==="image"){let g={blockId:l.id,width:d.width,height:d.height,pmStart:l.pmStart,pmEnd:l.pmEnd},s=re(g,l,d,{...n},{document:o});s.style.top=`${i}px`,s.style.left="0",r.appendChild(s),i+=d.height;}else if(l.kind==="textBox"&&d.kind==="textBox"){let g={blockId:l.id,width:d.width,height:d.height,pmStart:l.pmStart,pmEnd:l.pmEnd},s=le(g,l,d,{...n,section:"body",contentWidth:t,positioning:"absolute"},{document:o});s.style.top=`${i}px`,s.style.left="0",r.appendChild(s),i+=d.height;}}}return r}function _t(e,t){let n=t.createElement("div");n.style.fontSize="10px",n.style.lineHeight="1.3",n.style.marginBottom="4px",n.style.color="#000";let o=t.createElement("sup");o.textContent=e.displayNumber,o.style.fontSize="7px",o.style.marginRight="2px",n.appendChild(o);let r=t.createTextNode(" "+e.text);return n.appendChild(r),n}function rt(e){let t=de;for(let n of e)n.content&&(t+=n.content.height);return t}function it(e,t,n,o){let r=o.createElement("div");r.className="layout-footnote-area",r.style.width=`${t}px`;let i=o.createElement("div"),a=.5,l=(de-a)/2;i.style.width="33%",i.style.height=`${a}px`,i.style.backgroundColor="#000",i.style.marginBottom=`${l}px`,i.style.marginTop=`${l}px`,r.appendChild(i);for(let d of e)r.appendChild(d.content?Dt(d.content,t,n,o):_t(d,o));return r}function Le(e,t,n){let o={pageNumber:e.number,totalPages:t,section:"body",resolvedCommentIds:n.resolvedCommentIds},r={...n};if(n.titlePg&&e.number===1&&(r.headerContent=n.firstPageHeaderContent,r.footerContent=n.firstPageFooterContent),n.footnotesByPage){let i=n.footnotesByPage.get(e.number);i&&i.length>0&&(r.footnoteArea=i);}return {context:o,pageOptions:r}}function at(e){let t=[];t.push(`s:${e.size.w},${e.size.h}`),t.push(`m:${e.margins.top},${e.margins.right},${e.margins.bottom},${e.margins.left}`),t.push(`n:${e.number}`),e.footnoteReservedHeight&&t.push(`fn:${e.footnoteReservedHeight}`);for(let n of e.fragments){let o=`${n.kind}:${n.blockId},${n.x},${n.y},${n.width},${n.height}`;n.pmStart!==void 0&&(o+=`,ps:${n.pmStart}`),n.pmEnd!==void 0&&(o+=`,pe:${n.pmEnd}`),n.kind==="paragraph"?o+=`,fl:${n.fromLine},tl:${n.toLine}`:n.kind==="table"&&(o+=`,fr:${n.fromRow},tr:${n.toRow}`),t.push(o);}return t.join("|")}function Wt(e){let t=[];return e.headerContent&&t.push(`hdr:${e.headerContent.blocks.length},${e.headerContent.height},${e.headerContent.visualTop??0},${e.headerContent.visualBottom??e.headerContent.height}`),e.footerContent&&t.push(`ftr:${e.footerContent.blocks.length},${e.footerContent.height},${e.footerContent.visualTop??0},${e.footerContent.visualBottom??e.footerContent.height}`),e.firstPageHeaderContent&&t.push(`fp-hdr:${e.firstPageHeaderContent.blocks.length},${e.firstPageHeaderContent.height}`),e.firstPageFooterContent&&t.push(`fp-ftr:${e.firstPageFooterContent.blocks.length},${e.firstPageFooterContent.height}`),e.titlePg&&t.push("titlePg"),e.theme&&t.push(`thm:${e.theme.name??"default"}`),e.pageBorders&&t.push(`pb:${JSON.stringify(e.pageBorders)}`),e.headerDistance!==void 0&&t.push(`hd:${e.headerDistance}`),e.footerDistance!==void 0&&t.push(`fd:${e.footerDistance}`),t.join("|")}function Gt(e,t){e.style.display="flex",e.style.flexDirection="column",e.style.alignItems="center",e.style.gap=`${t}px`,e.style.padding=`${t}px`,e.style.backgroundColor="var(--doc-bg, #f8f9fa)";}var pe=2,Vt=8;function jt(e,t,n={}){let o=e.length,r=n.pageGap??24,i=t,a=i.__pageRenderState,l=Wt(n),d=o>=Vt;if(a&&a.optionsHash===l&&d){let m=a.pageStates,p=a.pageDataMap,y=i.__pageObserver,u=[];for(let S of e)u.push(at(S));let w=a.totalPages!==o,F=Math.min(m.length,e.length);for(let S=0;S<F;S++){let I=m[S],C=u[S];if(I.fingerprint===C&&!w){let P=p.get(I.element);P&&(P.page=e[S]);continue}let T=I.element,k=p.get(T);k&&(k.page=e[S],k.rendered&&Yt(T,p,o,n)),I.fingerprint=C,ee(T,e[S].size.w,e[S].size.h,n),T.dataset.pageNumber=String(e[S].number);}if(e.length>m.length){let S=n.document??document;for(let I=m.length;I<e.length;I++){let C=e[I],T=S.createElement("div");T.className=n.pageClassName??z.page,T.dataset.pageNumber=String(C.number),T.dataset.pageIndex=String(I),ee(T,C.size.w,C.size.h,n),t.appendChild(T),m.push({element:T,fingerprint:u[I]}),p.set(T,{page:C,index:I,rendered:false}),y&&y.observe(T);}}if(e.length<m.length){for(let S=m.length-1;S>=e.length;S--){let I=m[S].element;y&&y.unobserve(I),p.delete(I),t.removeChild(I);}m.length=e.length;}for(let S=0;S<m.length;S++){let I=p.get(m[S].element);I&&(I.index=S);}return a.totalPages=o,a.currentOptions=n,"incremental"}let s=i.__pageObserver;s&&(s.disconnect(),i.__pageObserver=void 0),t.innerHTML="",i.__pageRenderState=void 0,Gt(t,r);let c=[],x=[];for(let m=0;m<e.length;m++){let p=e[m];if(x.push(at(p)),d){let u=(n.document??document).createElement("div");u.className=n.pageClassName??z.page,u.dataset.pageNumber=String(p.number),u.dataset.pageIndex=String(m),ee(u,p.size.w,p.size.h,n),t.appendChild(u),c.push(u);}else {let{context:y,pageOptions:u}=Le(p,o,n),w=ge(p,y,u);t.appendChild(w),c.push(w);}}if(!d)return "full";let b=new Map;for(let m=0;m<e.length;m++)b.set(c[m],{page:e[m],index:m,rendered:false});let f=new IntersectionObserver(m=>{let p=i.__pageRenderState;if(!p)return;let{currentOptions:y,totalPages:u,pageDataMap:w}=p;for(let C of m){let T=C.target,k=w.get(T);if(k&&C.isIntersecting){ce(T,w,u,y);for(let P=-pe;P<=pe;P++){let R=k.index+P;R>=0&&R<p.pageStates.length&&R!==k.index&&ce(p.pageStates[R].element,w,u,y);}}}let F=window.innerHeight,S=F*3,I=new Set;for(let[C,T]of w){if(!T.rendered)continue;let k=C.getBoundingClientRect();k.bottom>-S&&k.top<F+S&&I.add(T.index);}for(let[C,T]of w){if(!T.rendered)continue;let k=false;for(let P of I)if(Math.abs(T.index-P)<=pe+1){k=true;break}!k&&I.size>0&&Kt(C,w);}},{root:null,rootMargin:"1500px 0px 1500px 0px"});for(let m of c)f.observe(m);i.__pageObserver=f,i.__pageRenderState={pageStates:c.map((m,p)=>({element:m,fingerprint:x[p]})),totalPages:o,optionsHash:l,pageDataMap:b,currentOptions:n};let h=Math.min(e.length,pe+3);for(let m=0;m<h;m++)ce(c[m],b,o,n);return "full"}function ce(e,t,n,o){let r=t.get(e);if(!r||r.rendered)return;let{context:i,pageOptions:a}=Le(r.page,n,o),l=ge(r.page,i,a);for(;l.firstChild;)e.appendChild(l.firstChild);r.rendered=true;}function Yt(e,t,n,o){let r=t.get(e);if(!r)return;let{context:i,pageOptions:a}=Le(r.page,n,o),d=ge(r.page,i,a).querySelector(`.${z.content}`),g=e.querySelector(`.${z.content}`);d&&g?e.replaceChild(d,g):(e.innerHTML="",r.rendered=false,ce(e,t,n,o));}function Kt(e,t){let n=t.get(e);!n||!n.rendered||(e.innerHTML="",n.rendered=false);}var z={page:"layout-page",content:"layout-page-content",header:"layout-page-header",footer:"layout-page-footer"};function ee(e,t,n,o){e.style.position="relative",e.style.width=`${t}px`,e.style.height=`${n}px`,e.style.backgroundColor=o.backgroundColor??"#ffffff",e.style.overflow="hidden",e.style.fontFamily=chunkN3Y5BUKV_js.a("Calibri").cssFallback,e.style.fontSize=`${1056/72}px`,e.style.color="#000000",o.showBorders&&(e.style.border="1px solid #ccc"),o.showShadow&&(e.style.boxShadow="0 2px 8px rgba(0, 0, 0, 0.15)");}function Ut(e,t){switch(t??"allPages"){case "firstPage":return e===1;case "notFirstPage":return e!==1;default:return true}}function fe(e){return e?.space!==void 0?chunk4Q2IP5FW_js.i(e.space):0}function me(e,t,n,o){if(!t||t.style==="none"||t.style==="nil")return;let r=chunkBHBOAP6Z_js.c(t,n,o);for(let[d,g]of Object.entries(r))e.style[d]=String(g);let i=`border${n}Style`,a=`border${n}Width`;if(e.style[i]==="double"){let d=parseFloat(e.style[a]);(!Number.isFinite(d)||d<3)&&(e.style[a]="3px");}}function Xt(e,t,n){let o=t.pageBorders;if(!o||!Ut(e.number,o.display)||![o.top,o.bottom,o.left,o.right].some(c=>c&&c.style!=="none"&&c.style!=="nil"))return null;let i=o.offsetFrom??"text",a=fe(o.top),l=fe(o.right),d=fe(o.bottom),g=fe(o.left),s=n.createElement("div");return s.className="layout-page-border",s.style.position="absolute",s.style.pointerEvents="none",s.style.boxSizing="border-box",s.style.zIndex=o.zOrder==="back"?"0":"20",i==="page"?(s.style.top=`${a}px`,s.style.right=`${l}px`,s.style.bottom=`${d}px`,s.style.left=`${g}px`):(s.style.top=`${Math.max(0,e.margins.top-a)}px`,s.style.right=`${Math.max(0,e.margins.right-l)}px`,s.style.bottom=`${Math.max(0,e.margins.bottom-d)}px`,s.style.left=`${Math.max(0,e.margins.left-g)}px`),me(s,o.top,"Top",t.theme),me(s,o.bottom,"Bottom",t.theme),me(s,o.left,"Left",t.theme),me(s,o.right,"Right",t.theme),s}function Zt(e,t){let n=t.margins;e.style.position="absolute",e.style.top=`${n.top}px`,e.style.left=`${n.left}px`,e.style.right=`${n.right}px`,e.style.bottom=`${n.bottom}px`,e.style.overflow="visible";}function qt(e,t,n){e.style.position="absolute",e.style.left=`${t.x-n.left}px`,e.style.top=`${t.y-n.top}px`,e.style.width=`${t.width}px`,"height"in t&&(e.style.height=`${t.height}px`);}function Jt(e,t,n,o){let r=[];for(let i of e.runs){if(i.kind!=="image")continue;let a=i;if(!H(a))continue;let l=a.distTop??0,d=a.distBottom??0,g=a.distLeft??12,s=a.distRight??12,{x:c,y:x,side:b}=Re(a,t,n,o);r.push({src:a.src,width:a.width,height:a.height,alt:a.alt,transform:a.transform,side:b,x:c,y:x,distTop:l,distBottom:d,distLeft:g,distRight:s,pmStart:a.pmStart,pmEnd:a.pmEnd,wrapText:oe(a.cssFloat),wrapType:a.wrapType,cropTop:a.cropTop,cropRight:a.cropRight,cropBottom:a.cropBottom,cropLeft:a.cropLeft,opacity:a.opacity});}return r}function ge(e,t,n={}){let o=n.document??document,r=o.createElement("div");r.className=n.pageClassName??z.page,r.dataset.pageNumber=String(e.number),ee(r,e.size.w,e.size.h,n);let i=Xt(e,n,o);i&&n.pageBorders?.zOrder==="back"&&r.appendChild(i);let a=o.createElement("div");a.className=z.content,Zt(a,e);let l=Qe(e),d=l.contentWidth,g=[],s=[];for(let p of e.fragments)if(p.kind==="paragraph"&&n.blockLookup){let y=n.blockLookup.get(String(p.blockId));if(y?.block.kind==="paragraph"){let u=y.block,w=p.y-e.margins.top,F=Jt(u,w,d,l);g.push(...F);}}for(let p of g)Z(p)&&s.push({side:p.side,x:p.x,y:p.y,width:p.width,height:p.height,distTop:p.distTop,distBottom:p.distBottom,distLeft:p.distLeft,distRight:p.distRight,wrapText:p.wrapText,wrapType:p.wrapType});if(n.blockLookup)for(let p of e.fragments){if(p.kind!=="table")continue;let y=n.blockLookup.get(String(p.blockId));if(y?.block.kind!=="table")continue;let w=y.block.floating;if(!w)continue;let F=p.x-e.margins.left,S=p.y-e.margins.top,I=w.topFromText??0,C=w.bottomFromText??0,T=w.leftFromText??12,k=w.rightFromText??12,P=F<d/2?"left":"right";s.push({side:P,x:F,y:S,width:p.width,height:p.height,distTop:I,distBottom:C,distLeft:T,distRight:k});}if(n.blockLookup)for(let p of e.fragments){if(p.kind!=="textBox")continue;let y=n.blockLookup.get(String(p.blockId));if(y?.block.kind!=="textBox")continue;let u=y.block;if(!chunk44RUAQA2_js.g(u))continue;let w=p.y-e.margins.top,F=Re({width:p.width,height:p.height,position:u.position,cssFloat:u.cssFloat},w,d,l);p.x=e.margins.left+F.x,p.y=e.margins.top+F.y,chunk44RUAQA2_js.h(u)&&s.push({side:F.side,x:F.x,y:F.y,width:p.width,height:p.height,distTop:u.distTop??0,distBottom:u.distBottom??0,distLeft:u.distLeft??12,distRight:u.distRight??12,wrapText:u.wrapText,wrapType:u.wrapType});}let c=s.length>0?chunkDY2MJCSV_js.p(s,d):[],x=g.filter(G),b=g.filter(p=>!G(p));if(x.length>0){let p=V(x,o,{layerClass:"layout-floating-images-layer",itemClass:"layout-page-floating-image",sizing:"inset0",layerMode:"behind"});a.appendChild(p);}let f=p=>{if(p.kind!=="paragraph"||!n.blockLookup||!p.blockId)return;let y=n.blockLookup.get(String(p.blockId));if(y?.block.kind==="paragraph")return y.block.attrs?.borders},h,m=new Map;for(let p=0;p<e.fragments.length;p++){let y=e.fragments[p],u,w={...t,section:"body",contentWidth:d},F=y.y-e.margins.top;if(n.blockLookup&&y.blockId){let S=n.blockLookup.get(String(y.blockId));if(y.kind==="paragraph"&&S?.block.kind==="paragraph"&&S?.measure.kind==="paragraph"){let I=S.block,C=p+1<e.fragments.length?f(e.fragments[p+1]):void 0,T=String(y.blockId),k=m.get(T);k||(k=new Set,m.set(T,k));let P=S.measure;c.length>0&&(P=chunkDY2MJCSV_js.r(I,d,{floatingZones:c,paragraphYOffset:F})),u=v(y,I,P,w,{document:o,prevBorders:h,nextBorders:C,renderedInlineImageKeys:k}),h=I.attrs?.borders;}else y.kind==="table"&&S?.block.kind==="table"&&S?.measure.kind==="table"?(u=Y(y,S.block,S.measure,w,{document:o}),h=void 0):y.kind==="image"&&S?.block.kind==="image"&&S?.measure.kind==="image"?(u=re(y,S.block,S.measure,w,{document:o}),h=void 0):y.kind==="textBox"&&S?.block.kind==="textBox"&&S?.measure.kind==="textBox"?(u=le(y,S.block,S.measure,w,{document:o}),h=void 0):(u=xe(y,w,{document:o}),h=void 0);}else u=xe(y,w,{document:o}),h=void 0;qt(u,y,{left:e.margins.left,top:e.margins.top}),a.appendChild(u);}if(b.length>0){let p=V(b,o,{layerClass:"layout-floating-images-layer",itemClass:"layout-page-floating-image",sizing:"inset0",layerMode:"front"});a.appendChild(p);}if(e.columns&&e.columns.separator&&e.columns.count>1){let p=e.columns.count,y=e.columns.gap,u=(d-(p-1)*y)/p,w=e.size.h-e.margins.top-e.margins.bottom;for(let F=0;F<p-1;F++){let S=(F+1)*u+F*y+y/2,I=o.createElement("div");I.style.position="absolute",I.style.left=`${S}px`,I.style.top="0",I.style.height=`${w}px`,I.style.width="0.5px",I.style.backgroundColor="#000",I.style.pointerEvents="none",a.appendChild(I);}}if(n.footnoteArea&&n.footnoteArea.length>0){let p=it(n.footnoteArea,d,t,o);p.style.position="absolute";let y=Math.max(e.footnoteReservedHeight??0,rt(n.footnoteArea)),u=e.size.h-e.margins.bottom-e.margins.top;p.style.top=`${Math.max(-e.margins.top,u-y)}px`,p.style.left="0",p.style.right="0",a.appendChild(p);}r.appendChild(a);{let y=n.headerDistance??e.margins.header??48,u=e.size.w-e.margins.left-e.margins.right,w=Math.max(e.margins.top-y,48),F=n.headerContent?.visualTop??0,S=n.headerContent?.visualBottom??n.headerContent?.height??0,I=Math.max(S-F,24),C=S>w,T=o.createElement("div");T.className=z.header,T.style.position="absolute",T.style.top=`${y+F}px`,T.style.left=`${e.margins.left}px`,T.style.right=`${e.margins.right}px`,T.style.width=`${u}px`,T.style.height=`${I}px`,T.style.minHeight=`${I}px`;let k=!C;if(n.headerContent&&n.headerContent.blocks.length>0){let P={flowTop:y,flowLeft:e.margins.left,contentWidth:u,pageWidth:e.size.w,pageHeight:e.size.h,margins:e.margins},R=Ce(n.headerContent,{...t,section:"header",contentWidth:u},n,P);R.style.top=`${-F}px`,R.querySelector("img")&&(k=false),T.appendChild(R);}k&&(T.style.maxHeight=`${w}px`,T.style.overflow="hidden"),r.appendChild(T);}{let y=n.footerDistance??e.margins.footer??48,u=e.size.w-e.margins.left-e.margins.right,w=Math.max(e.margins.bottom-y,48),F=n.footerContent?.visualTop??0,S=n.footerContent?.visualBottom??n.footerContent?.height??0,I=Math.max(S-F,24),C=I>w,T=o.createElement("div");T.className=z.footer,T.style.position="absolute",T.style.top=`${e.size.h-y-I}px`,T.style.left=`${e.margins.left}px`,T.style.right=`${e.margins.right}px`,T.style.width=`${u}px`,T.style.height=`${I}px`,T.style.minHeight=`${I}px`;let k=!C;if(n.footerContent&&n.footerContent.blocks.length>0){let P={flowTop:e.size.h-y-(n.footerContent?.height??0),flowLeft:e.margins.left,contentWidth:u,pageWidth:e.size.w,pageHeight:e.size.h,margins:e.margins},R=Ce(n.footerContent,{...t,section:"footer",contentWidth:u},n,P);R.style.top=`${-F}px`,R.querySelector("img")&&(k=false),T.appendChild(R);}k&&(T.style.maxHeight=`${w}px`,T.style.overflow="hidden"),r.appendChild(T);}return i&&n.pageBorders?.zOrder!=="back"&&r.appendChild(i),r}
|
|
2
|
+
exports.A=le;exports.B=tt;exports.C=jt;exports.D=z;exports.E=ee;exports.F=ge;exports.a=de;exports.b=nt;exports.c=zt;exports.d=jn;exports.e=Ee;exports.f=Ot;exports.g=Nt;exports.h=Yn;exports.i=ot;exports.j=Kn;exports.k=Un;exports.l=_;exports.m=xe;exports.n=Z;exports.o=G;exports.p=H;exports.q=ft;exports.r=je;exports.s=re;exports.t=qe;exports.u=ae;exports.v=v;exports.w=V;exports.x=A;exports.y=Y;exports.z=Et;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var chunkDC7S76ZX_js=require('./chunk-DC7S76ZX.js');var a=class{constructor(){chunkDC7S76ZX_js.a(this,"plugins",new Map);chunkDC7S76ZX_js.a(this,"commandHandlers",new Map);chunkDC7S76ZX_js.a(this,"eventListeners",new Set);chunkDC7S76ZX_js.a(this,"initialized",new Set);}register(e,r){let t=[];if(!e.id)return {success:false,error:"Plugin must have an id"};if(this.plugins.has(e.id))return {success:false,error:`Plugin '${e.id}' is already registered`};if(e.dependencies){for(let i of e.dependencies)if(!this.plugins.has(i))return {success:false,error:`Plugin '${e.id}' requires '${i}' which is not registered`}}if(e.commandHandlers)for(let[i,o]of Object.entries(e.commandHandlers)){if(this.commandHandlers.has(i)){let d=this.commandHandlers.get(i);t.push(`Command '${i}' from '${e.id}' overrides handler from '${d.pluginId}'`);}this.commandHandlers.set(i,{pluginId:e.id,handler:o});}if(this.plugins.set(e.id,e),e.initialize&&!this.initialized.has(e.id))try{let i=e.initialize();i instanceof Promise?i.then(()=>{this.initialized.add(e.id);}).catch(o=>{this.emit({type:"error",pluginId:e.id,error:o});}):this.initialized.add(e.id);}catch(i){this.emit({type:"error",pluginId:e.id,error:i});}return r?.debug&&console.log(`[PluginRegistry] Registered plugin: ${e.id}`),this.emit({type:"registered",plugin:e}),{success:true,plugin:e,warnings:t.length>0?t:void 0}}unregister(e){let r=this.plugins.get(e);if(!r)return false;for(let[t,i]of this.plugins)if(i.dependencies?.includes(e))return console.warn(`Cannot unregister '${e}': '${t}' depends on it`),false;for(let[t,{pluginId:i}]of this.commandHandlers)i===e&&this.commandHandlers.delete(t);if(r.destroy)try{let t=r.destroy();t instanceof Promise&&t.catch(i=>{this.emit({type:"error",pluginId:e,error:i});});}catch(t){this.emit({type:"error",pluginId:e,error:t});}return this.plugins.delete(e),this.initialized.delete(e),this.emit({type:"unregistered",pluginId:e}),true}get(e){return this.plugins.get(e)}getAll(){return Array.from(this.plugins.values())}has(e){return this.plugins.has(e)}get size(){return this.plugins.size}getCommandHandler(e){return this.commandHandlers.get(e)?.handler}getCommandTypes(){return Array.from(this.commandHandlers.keys())}hasCommandHandler(e){return this.commandHandlers.has(e)}getMcpTools(){let e=[];for(let r of this.plugins.values())r.mcpTools&&e.push(...r.mcpTools);return e}getMcpToolsForPlugin(e){return this.plugins.get(e)?.mcpTools||[]}getMcpTool(e){for(let r of this.plugins.values())if(r.mcpTools){let t=r.mcpTools.find(i=>i.name===e);if(t)return t}}addEventListener(e){this.eventListeners.add(e);}removeEventListener(e){this.eventListeners.delete(e);}emit(e){for(let r of this.eventListeners)try{r(e);}catch(t){console.error("[PluginRegistry] Event listener error:",t);}}clear(){for(let e of this.plugins.values())if(e.destroy)try{e.destroy();}catch{}this.plugins.clear(),this.commandHandlers.clear(),this.initialized.clear();}getDebugInfo(){return {plugins:Array.from(this.plugins.keys()),commandTypes:Array.from(this.commandHandlers.keys()),mcpTools:this.getMcpTools().map(e=>e.name),initialized:Array.from(this.initialized)}}},l=new a;function c(s,e){return s.map(r=>l.register(r,e))}function g(s){return e=>l.register(e,s)}exports.a=a;exports.b=l;exports.c=c;exports.d=g;
|