@eigenpal/docx-editor-core 1.4.0 → 1.6.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/dist/agent/index.d.mts +8 -7
- package/dist/agent/index.d.ts +8 -7
- package/dist/agent/index.js +1 -1
- package/dist/agent/index.mjs +1 -1
- package/dist/chunk-2KPOGFFR.js +1 -0
- package/dist/{chunk-KXVCCT2A.js → chunk-2KUOYHXX.js} +1 -1
- package/dist/chunk-2LVK7EF5.mjs +2 -0
- package/dist/chunk-2ZTKTE7P.js +1 -0
- package/dist/{chunk-C45EFOVP.js → chunk-34DJT72K.js} +1 -1
- package/dist/chunk-3HLRRK6N.mjs +2 -0
- package/dist/chunk-4272FQ2E.js +1 -0
- package/dist/chunk-4DCTKHS5.js +1 -0
- package/dist/chunk-4JPHW7ZI.js +2 -0
- package/dist/chunk-4QJEMD23.mjs +4 -0
- package/dist/chunk-4QSFBX26.mjs +1 -0
- package/dist/chunk-4SZAFWLV.mjs +1 -0
- package/dist/{chunk-GGUHM74A.mjs → chunk-5JULVEYK.mjs} +1 -1
- package/dist/chunk-6AGU57TL.mjs +1 -0
- package/dist/chunk-6ENZQGYR.mjs +1 -0
- package/dist/chunk-6KYOT4E7.js +4 -0
- package/dist/chunk-77X765ZO.js +1 -0
- package/dist/chunk-7UMOUKSF.js +1 -0
- package/dist/chunk-AXVWVIIN.js +1 -0
- package/dist/chunk-B6FA4MJ5.mjs +1 -0
- package/dist/chunk-BBJMUBTD.mjs +1 -0
- package/dist/chunk-BJSG6TEG.js +1 -0
- package/dist/chunk-BKP5QMTS.js +1 -0
- package/dist/chunk-C57BOE7B.mjs +2 -0
- package/dist/chunk-CDBKFBC2.mjs +15 -0
- package/dist/{chunk-BUEMXRXH.js → chunk-CDGV7CLS.js} +1 -1
- package/dist/{chunk-6IZOFIQH.js → chunk-CWPIXUU2.js} +1 -1
- package/dist/chunk-DX5XU6JN.js +1 -0
- package/dist/chunk-E7UN3PVC.mjs +1 -0
- package/dist/chunk-EJ2JAYRI.js +1 -0
- package/dist/{chunk-CHN26LLL.mjs → chunk-F24WZXN4.mjs} +1 -1
- package/dist/{chunk-2SGJZYQF.js → chunk-F44XU6G5.js} +1 -1
- package/dist/{chunk-TE2AF7FM.js → chunk-FETIBXTH.js} +1 -1
- package/dist/{chunk-CZSAC65M.js → chunk-GFM6PERG.js} +1 -1
- package/dist/chunk-GLPOVLZD.mjs +1 -0
- package/dist/chunk-H57LNDBH.js +1 -0
- package/dist/chunk-HEJJXAXN.mjs +1 -0
- package/dist/chunk-ILPNMG7Q.js +1 -0
- package/dist/chunk-IM56AITE.mjs +1 -0
- package/dist/{chunk-BH3ACQ3M.js → chunk-JQUIUKRO.js} +3 -3
- package/dist/chunk-KK673XRZ.mjs +1 -0
- package/dist/chunk-KNY7SXPJ.mjs +1 -0
- package/dist/{chunk-DFUWJHKF.mjs → chunk-KSW6W2EK.mjs} +4 -4
- package/dist/chunk-LVUL7O27.js +1 -0
- package/dist/{chunk-SCK6ZM5V.js → chunk-LW5OFHSW.js} +2 -2
- package/dist/chunk-M65C4SQJ.mjs +2 -0
- package/dist/chunk-MA3HLGFO.js +1 -0
- package/dist/chunk-MWOHCSZE.js +1 -0
- package/dist/chunk-NO6PIL32.mjs +1 -0
- package/dist/chunk-NTBZRITU.mjs +1 -0
- package/dist/chunk-NTYJIOUE.js +2 -0
- package/dist/chunk-NY36MZ55.mjs +1 -0
- package/dist/chunk-PJEB3ZWG.mjs +3 -0
- package/dist/chunk-Q2VALXEU.js +3 -0
- package/dist/chunk-QVRMX2AC.js +15 -0
- package/dist/{chunk-FYRJTDC4.mjs → chunk-QZPVZY6S.mjs} +1 -1
- package/dist/{chunk-3QPKTG2Y.js → chunk-RGHRXIIZ.js} +3 -3
- package/dist/chunk-RRJKF2XI.mjs +1 -0
- package/dist/{chunk-ZBCFIW2V.js → chunk-T3UP6LF5.js} +1 -1
- package/dist/chunk-UC7JW66O.mjs +1 -0
- package/dist/chunk-V3NE7Q22.js +2 -0
- package/dist/chunk-VDKSZ5BQ.mjs +1 -0
- package/dist/chunk-VJFIAFZ5.mjs +1 -0
- package/dist/chunk-WCB25ESG.mjs +1 -0
- package/dist/chunk-WEQA5PPW.mjs +1 -0
- package/dist/{chunk-HPAUUQAX.mjs → chunk-WQJWT4RB.mjs} +1 -1
- package/dist/chunk-WWG6PUWU.js +1 -0
- package/dist/chunk-X6AICTHN.js +1 -0
- package/dist/{chunk-YNUPP7UG.mjs → chunk-XTPT4TNP.mjs} +2 -2
- package/dist/{chunk-CHTIWTHQ.mjs → chunk-YMXWLXVF.mjs} +1 -1
- package/dist/{colorResolver-8A-qj-LP.d.ts → colorResolver-C696sd9x.d.ts} +1 -1
- package/dist/{colorResolver-BCvxTlLF.d.mts → colorResolver-DCBfI4ld.d.mts} +1 -1
- package/dist/{content-C8fc_tL6.d.ts → content-BebvPfXc.d.ts} +4 -148
- package/dist/{content-3xF4WDE8.d.mts → content-CbBCrsr0.d.mts} +4 -148
- package/dist/{contentControlValues-DGDKD589.d.ts → contentControlValues-Com1GnZS.d.ts} +1 -1
- package/dist/{contentControlValues-DjWvoJQ-.d.mts → contentControlValues-DVJyudKU.d.mts} +1 -1
- package/dist/core-plugins.d.mts +5 -4
- package/dist/core-plugins.d.ts +5 -4
- package/dist/core-plugins.js +1 -1
- package/dist/core-plugins.mjs +1 -1
- package/dist/core.d.mts +12 -11
- package/dist/core.d.ts +12 -11
- package/dist/core.js +1 -1
- package/dist/core.mjs +1 -1
- package/dist/{documentStyles-qR0VR2s0.d.mts → documentStyles-1G0xTl1v.d.mts} +1 -1
- package/dist/{documentStyles-C7k_8Sye.d.ts → documentStyles-Bw98BwEy.d.ts} +1 -1
- package/dist/docx/index.d.mts +8 -68
- package/dist/docx/index.d.ts +8 -68
- package/dist/docx/index.js +1 -1
- package/dist/docx/index.mjs +1 -1
- package/dist/docx/parser.d.mts +5 -4
- package/dist/docx/parser.d.ts +5 -4
- package/dist/docx/parser.js +1 -1
- package/dist/docx/parser.mjs +1 -1
- package/dist/docx/rezip.d.mts +5 -4
- package/dist/docx/rezip.d.ts +5 -4
- package/dist/docx/rezip.js +1 -1
- package/dist/docx/rezip.mjs +1 -1
- package/dist/docx/serializer/index.d.mts +6 -5
- package/dist/docx/serializer/index.d.ts +6 -5
- package/dist/docx/serializer/index.js +1 -1
- package/dist/docx/serializer/index.mjs +1 -1
- package/dist/editor/index.d.mts +5 -4
- package/dist/editor/index.d.ts +5 -4
- package/dist/editor/index.js +1 -1
- package/dist/editor/index.mjs +1 -1
- package/dist/executor-FHL5D4CB.js +1 -0
- package/dist/executor-FL6XGVP3.mjs +1 -0
- package/dist/{fontLoader-CUS1BPv7.d.mts → fontLoader-B4uFKpAy.d.mts} +48 -5
- package/dist/{fontLoader-Dl9SEKex.d.ts → fontLoader-D9SBYuZZ.d.ts} +48 -5
- package/dist/{formatting-BH4hcZiq.d.mts → formatting-DFtuRFQY.d.mts} +13 -0
- package/dist/{formatting-_OXU8gLB.d.ts → formatting-JhqWT_XM.d.ts} +13 -0
- package/dist/{headerFooterLayout-AtAOhM8E.d.ts → headerFooterLayout-CtVsfqxQ.d.ts} +2 -2
- package/dist/{headerFooterLayout-CU6hvszp.d.mts → headerFooterLayout-D2LZLkDC.d.mts} +2 -2
- package/dist/headless.d.mts +10 -9
- package/dist/headless.d.ts +10 -9
- package/dist/headless.js +1 -1
- package/dist/headless.mjs +1 -1
- package/dist/layout-bridge/clickToPositionDom.js +1 -1
- package/dist/layout-bridge/clickToPositionDom.mjs +1 -1
- package/dist/layout-bridge/index.d.mts +70 -7
- package/dist/layout-bridge/index.d.ts +70 -7
- package/dist/layout-bridge/index.js +1 -1
- package/dist/layout-bridge/index.mjs +1 -1
- package/dist/layout-bridge/measuring/index.d.mts +4 -3
- package/dist/layout-bridge/measuring/index.d.ts +4 -3
- package/dist/layout-bridge/measuring/index.js +1 -1
- package/dist/layout-bridge/measuring/index.mjs +1 -1
- package/dist/layout-bridge/tableInsertHover.js +1 -1
- package/dist/layout-bridge/tableInsertHover.mjs +1 -1
- package/dist/layout-bridge/toFlowBlocks.d.mts +5 -4
- package/dist/layout-bridge/toFlowBlocks.d.ts +5 -4
- package/dist/layout-bridge/toFlowBlocks.js +1 -1
- package/dist/layout-bridge/toFlowBlocks.mjs +1 -1
- package/dist/layout-engine/index.d.mts +5 -4
- package/dist/layout-engine/index.d.ts +5 -4
- package/dist/layout-engine/index.js +1 -1
- package/dist/layout-engine/index.mjs +1 -1
- package/dist/layout-engine/types.d.mts +22 -10
- package/dist/layout-engine/types.d.ts +22 -10
- package/dist/layout-painter/index.d.mts +6 -5
- package/dist/layout-painter/index.d.ts +6 -5
- package/dist/layout-painter/index.js +1 -1
- package/dist/layout-painter/index.mjs +1 -1
- package/dist/layout-painter/renderPage.d.mts +6 -5
- package/dist/layout-painter/renderPage.d.ts +6 -5
- package/dist/layout-painter/renderPage.js +1 -1
- package/dist/layout-painter/renderPage.mjs +1 -1
- package/dist/lists-Bn29SzeS.d.ts +148 -0
- package/dist/lists-CyGxd5Y2.d.mts +148 -0
- package/dist/managers/AutoSaveManager.d.mts +5 -4
- package/dist/managers/AutoSaveManager.d.ts +5 -4
- package/dist/managers/TableSelectionManager.d.mts +5 -4
- package/dist/managers/TableSelectionManager.d.ts +5 -4
- package/dist/managers/types.d.mts +5 -4
- package/dist/managers/types.d.ts +5 -4
- package/dist/{marks-BY573yZn.d.mts → marks-CzrbFi4o.d.mts} +1 -1
- package/dist/{marks-CjC9tF5k.d.ts → marks-Dq1QsxKA.d.ts} +1 -1
- package/dist/mcp-cli.mjs +23 -23
- package/dist/mcp.d.mts +5 -4
- package/dist/mcp.d.ts +5 -4
- package/dist/mcp.js +8 -8
- package/dist/mcp.mjs +7 -7
- package/dist/{nodes-75Q9GBxV.d.ts → nodes-Bd6tTkp0.d.ts} +17 -2
- package/dist/{nodes-cEI7hVY2.d.mts → nodes-BvO8GGD4.d.mts} +17 -2
- package/dist/numberingParser-ZSQ3SDCV.d.ts +81 -0
- package/dist/numberingParser-nSPZlzKr.d.mts +81 -0
- package/dist/prosemirror/applyFormatting.d.mts +39 -6
- package/dist/prosemirror/applyFormatting.d.ts +39 -6
- package/dist/prosemirror/applyFormatting.js +1 -1
- package/dist/prosemirror/applyFormatting.mjs +1 -1
- package/dist/prosemirror/cellDragSelection.d.mts +46 -0
- package/dist/prosemirror/cellDragSelection.d.ts +46 -0
- package/dist/prosemirror/cellDragSelection.js +1 -0
- package/dist/prosemirror/cellDragSelection.mjs +1 -0
- package/dist/prosemirror/commands/formatting.d.mts +2 -2
- package/dist/prosemirror/commands/formatting.d.ts +2 -2
- package/dist/prosemirror/commands/formatting.js +1 -1
- package/dist/prosemirror/commands/formatting.mjs +1 -1
- package/dist/prosemirror/commands/index.d.mts +34 -4
- package/dist/prosemirror/commands/index.d.ts +34 -4
- package/dist/prosemirror/commands/index.js +1 -1
- package/dist/prosemirror/commands/index.mjs +1 -1
- package/dist/prosemirror/commands/paragraph.d.mts +11 -1
- package/dist/prosemirror/commands/paragraph.d.ts +11 -1
- package/dist/prosemirror/commands/paragraph.js +1 -1
- package/dist/prosemirror/commands/paragraph.mjs +1 -1
- package/dist/prosemirror/commands/sectionBreak.d.mts +25 -0
- package/dist/prosemirror/commands/sectionBreak.d.ts +25 -0
- package/dist/prosemirror/commands/sectionBreak.js +1 -0
- package/dist/prosemirror/commands/sectionBreak.mjs +1 -0
- package/dist/prosemirror/commentIdAllocator.d.mts +4 -3
- package/dist/prosemirror/commentIdAllocator.d.ts +4 -3
- package/dist/prosemirror/commentOps.d.mts +4 -3
- package/dist/prosemirror/commentOps.d.ts +4 -3
- package/dist/prosemirror/conversion/fromProseDoc.d.mts +5 -4
- package/dist/prosemirror/conversion/fromProseDoc.d.ts +5 -4
- package/dist/prosemirror/conversion/fromProseDoc.js +1 -1
- package/dist/prosemirror/conversion/fromProseDoc.mjs +1 -1
- package/dist/prosemirror/conversion/index.d.mts +5 -4
- package/dist/prosemirror/conversion/index.d.ts +5 -4
- package/dist/prosemirror/conversion/index.js +1 -1
- package/dist/prosemirror/conversion/index.mjs +1 -1
- package/dist/prosemirror/editor.css +13 -0
- package/dist/prosemirror/extensions/index.d.mts +1 -1
- package/dist/prosemirror/extensions/index.d.ts +1 -1
- package/dist/prosemirror/extensions/index.js +1 -1
- package/dist/prosemirror/extensions/index.mjs +1 -1
- package/dist/prosemirror/extensions/nodes/TableExtension.js +1 -1
- package/dist/prosemirror/extensions/nodes/TableExtension.mjs +1 -1
- package/dist/prosemirror/index.d.mts +21 -11
- package/dist/prosemirror/index.d.ts +21 -11
- package/dist/prosemirror/index.js +3 -3
- package/dist/prosemirror/index.mjs +3 -3
- package/dist/prosemirror/plugins/index.d.mts +6 -5
- package/dist/prosemirror/plugins/index.d.ts +6 -5
- package/dist/prosemirror/plugins/index.js +1 -1
- package/dist/prosemirror/plugins/index.mjs +1 -1
- package/dist/prosemirror/plugins/selectionTracker.d.mts +1 -1
- package/dist/prosemirror/plugins/selectionTracker.d.ts +1 -1
- package/dist/prosemirror/queries.d.mts +46 -4
- package/dist/prosemirror/queries.d.ts +46 -4
- package/dist/prosemirror/queries.js +2 -2
- package/dist/prosemirror/queries.mjs +2 -2
- package/dist/prosemirror/schema/index.d.mts +6 -5
- package/dist/prosemirror/schema/index.d.ts +6 -5
- package/dist/prosemirror/schema/index.js +1 -1
- package/dist/prosemirror/schema/index.mjs +1 -1
- package/dist/prosemirror/styles/index.d.mts +2 -2
- package/dist/prosemirror/styles/index.d.ts +2 -2
- package/dist/prosemirror/tableResize.js +1 -1
- package/dist/prosemirror/tableResize.mjs +1 -1
- package/dist/prosemirror/utils/extractTrackedChanges.d.mts +4 -3
- package/dist/prosemirror/utils/extractTrackedChanges.d.ts +4 -3
- package/dist/prosemirror/utils/extractTrackedChanges.js +1 -1
- package/dist/prosemirror/utils/extractTrackedChanges.mjs +1 -1
- package/dist/{sectionPropertiesSerializer-uXyGONxu.d.ts → sectionPropertiesSerializer-CzgskSoA.d.ts} +1 -1
- package/dist/{sectionPropertiesSerializer-D86QlzlT.d.mts → sectionPropertiesSerializer-D3yI82iZ.d.mts} +1 -1
- package/dist/{selectionContext-BPAqgNgk.d.ts → selectionContext-BJZZW1JA.d.ts} +1 -1
- package/dist/{selectionContext-CoZat7QZ.d.mts → selectionContext-BjMyVQZO.d.mts} +1 -1
- package/dist/{styles-BOJ93SAm.d.mts → styles-Dqec8Aw6.d.mts} +1 -1
- package/dist/{styles-BWqX2AS-.d.ts → styles-gEujs7j6.d.ts} +1 -1
- package/dist/types/agentApi.d.mts +1 -1
- package/dist/types/agentApi.d.ts +1 -1
- package/dist/types/content.d.mts +4 -3
- package/dist/types/content.d.ts +4 -3
- package/dist/types/content.js +1 -1
- package/dist/types/content.mjs +1 -1
- package/dist/types/document.d.mts +8 -6
- package/dist/types/document.d.ts +8 -6
- package/dist/types/document.js +1 -1
- package/dist/types/document.mjs +1 -1
- package/dist/utils/cardStyles.js +1 -1
- package/dist/utils/cardStyles.mjs +1 -1
- package/dist/utils/comments.d.mts +4 -3
- package/dist/utils/comments.d.ts +4 -3
- package/dist/utils/index.d.mts +41 -7
- package/dist/utils/index.d.ts +41 -7
- package/dist/utils/index.js +3 -3
- package/dist/utils/index.mjs +3 -3
- package/dist/utils/stylePreview.d.mts +83 -0
- package/dist/utils/stylePreview.d.ts +83 -0
- package/dist/utils/stylePreview.js +1 -0
- package/dist/utils/stylePreview.mjs +1 -0
- package/dist/utils/units.d.mts +7 -1
- package/dist/utils/units.d.ts +7 -1
- package/dist/utils/units.js +1 -1
- package/dist/utils/units.mjs +1 -1
- package/dist/{variableDetector-CaY-sDau.d.mts → variableDetector-D2-xDa2O.d.mts} +1 -1
- package/dist/{variableDetector-1mxzPfs2.d.ts → variableDetector-d-PpDlNV.d.ts} +1 -1
- package/dist/{watermark-DAcnAs_J.d.mts → watermark-D90356ZM.d.mts} +7 -1
- package/dist/{watermark-DAcnAs_J.d.ts → watermark-D90356ZM.d.ts} +7 -1
- package/package.json +25 -1
- package/dist/chunk-2WGTGBBS.js +0 -2
- package/dist/chunk-3G44SFHX.mjs +0 -4
- package/dist/chunk-4Q2IP5FW.js +0 -1
- package/dist/chunk-55XWETY4.mjs +0 -1
- package/dist/chunk-77GRQUSK.js +0 -1
- package/dist/chunk-7CZEZ3UL.mjs +0 -2
- package/dist/chunk-7LRR7RKE.mjs +0 -15
- package/dist/chunk-7OW3VCZE.mjs +0 -1
- package/dist/chunk-BHBOAP6Z.js +0 -3
- package/dist/chunk-CRMZH7U7.mjs +0 -2
- package/dist/chunk-CUY2THAO.mjs +0 -1
- package/dist/chunk-D3PRIF3Y.mjs +0 -1
- package/dist/chunk-DKKTY56Q.js +0 -1
- package/dist/chunk-EM33RGHT.mjs +0 -1
- package/dist/chunk-ESCPS4AO.mjs +0 -1
- package/dist/chunk-EUZLYQRB.mjs +0 -1
- package/dist/chunk-EV4LVK4X.js +0 -1
- package/dist/chunk-FW23IMBF.mjs +0 -1
- package/dist/chunk-HKN2NKOG.mjs +0 -1
- package/dist/chunk-INDYZOOS.js +0 -1
- package/dist/chunk-IUJCUITW.mjs +0 -1
- package/dist/chunk-IYKBX24M.js +0 -1
- package/dist/chunk-J3YFJDZD.js +0 -1
- package/dist/chunk-JHTURDPX.mjs +0 -1
- package/dist/chunk-KAOLVBLH.js +0 -1
- package/dist/chunk-L5NPEM7C.js +0 -1
- package/dist/chunk-LERLET2D.js +0 -4
- package/dist/chunk-MNOHUTKE.js +0 -15
- package/dist/chunk-MOKKS75W.mjs +0 -3
- package/dist/chunk-NAFMAKLK.js +0 -2
- package/dist/chunk-OEC6SBDV.mjs +0 -1
- package/dist/chunk-OF373DBR.mjs +0 -1
- package/dist/chunk-OTHV7YV2.js +0 -2
- package/dist/chunk-Q4IEATDJ.js +0 -1
- package/dist/chunk-QAJSNLJR.mjs +0 -1
- package/dist/chunk-RSU4HTC6.js +0 -1
- package/dist/chunk-TUIEV7Q7.js +0 -1
- package/dist/chunk-U67MWOPZ.mjs +0 -1
- package/dist/chunk-UE2ZKRYB.mjs +0 -2
- package/dist/chunk-VOCHZNOF.mjs +0 -1
- package/dist/chunk-VW22RZ6C.mjs +0 -1
- package/dist/chunk-WVERBZZU.js +0 -1
- package/dist/chunk-WWNOXNEX.mjs +0 -2
- package/dist/chunk-XLB6AC5Q.js +0 -1
- package/dist/chunk-YPQACU4A.js +0 -1
- package/dist/chunk-ZX26QZJ5.mjs +0 -1
- package/dist/executor-DZAMMQ35.js +0 -1
- package/dist/executor-ZCJRLT3Z.mjs +0 -1
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use strict';var l=new Set,m=new Map,C=new Set,c=new Map,b=new Set,p=new Set,u=false,h=true,F=new Set,w=new Set;function y(e,t){let n=e instanceof Error?e.message:String(e),r=new Error(`[font] ${t}: ${n}`,{cause:e});if(p.size>0)for(let o of p)try{o(r);}catch(i){console.error("Font error subscriber threw:",i);}else console.warn(r.message);}function v(e,t="normal"){return `${e.trim()}|${t}`}function x(e){return F.has(e)?false:w.has(e)?true:R(e)?(w.add(e),queueMicrotask(()=>A([e])),true):false}function B(e){let t=`${e}|`,n=[];for(let[r,o]of c)r.startsWith(t)&&n.push(o);return n}function k(e,t){C.add(e),l.add(t),A([t]);}function L(e,t=[400,700],n=["normal","italic"]){let r=encodeURIComponent(e),o=[];for(let a of n){let s=a==="italic"?1:0;for(let f of t)o.push(`${s},${f}`);}o.sort();let i=o.join(";");return `https://fonts.googleapis.com/css2?family=${r}:ital,wght@${i}&display=swap`}async function P(e,t){if(typeof document>"u")return false;let n=e.trim();if(l.has(n))return true;let r=m.get(n);if(r)return r;if(!t&&x(n))return true;let o=B(n);if(!h&&o.length===0)return false;let i=(async()=>{u=true;try{if(o.length>0&&(await Promise.all(o),l.has(n)||!t&&x(n)))return !0;if(!h)return !1;let a=L(n,t?.weights,t?.styles),s=document.createElement("link");return s.rel="stylesheet",s.href=a,await new Promise(d=>{let $=setTimeout(()=>d(!1),5e3);s.onload=()=>{clearTimeout($),d(!0);},s.onerror=()=>{clearTimeout($),d(!1);},document.head.appendChild(s);})?(await S(n,3e3),l.add(n),A([n]),!0):!1}catch(a){return y(a,`failed to load "${n}"`),false}finally{m.delete(n),m.size===0&&c.size===0&&(u=false);}})();return m.set(n,i),i}async function T(e,t){let n=e.filter(r=>!l.has(r.trim()));n.length!==0&&await Promise.all(n.map(r=>P(r,t)));}function G(e){let t=e.trim();return l.has(t)||w.has(t)}function j(e){h=e;}function _(){return h}function V(){return u}function J(){return Array.from(new Set([...l,...w]))}function K(e){return b.add(e),()=>{b.delete(e);}}function A(e){for(let t of b)try{t(e);}catch(n){y(n,"load callback threw");}}function X(e){return p.add(e),()=>{p.delete(e);}}async function S(e,t){if("fonts"in document)try{let n=`400 16px "${e}"`;return await Promise.race([document.fonts.load(n),new Promise(r=>setTimeout(r,t))]),document.fonts.check(n)}catch{}return await new Promise(n=>setTimeout(n,100)),true}var g,E=new Map,z="abcdefghijklmnopqrstuvwxyz0123456789";function M(){return g===void 0&&(g=document.createElement("canvas").getContext("2d"),g&&(g.textBaseline="top")),g}function R(e,t="sans-serif"){if(typeof document>"u")return false;let n=M();if(!n)return false;let r=i=>(n.font=i,n.measureText(z).width),o=i=>{let a=E.get(i);return a===void 0&&(a=r(`72px ${i}`),E.set(i,a)),r(`72px "${e}", ${i}`)!==a};return o(t)||o(t==="sans-serif"?"serif":"sans-serif")}async function H(e,t,n){if(typeof document>"u")return false;let r=e.trim(),o=v(r,n?.weight);if(F.add(r),C.has(o))return true;let i=c.get(o);if(i)return i;let a=(async()=>{u=true;try{let s=new Blob([t],{type:"font/ttf"}),f=URL.createObjectURL(s),d=document.createElement("style");return d.textContent=`
|
|
2
|
+
@font-face {
|
|
3
|
+
font-family: "${r}";
|
|
4
|
+
src: url(${f}) format('truetype');
|
|
5
|
+
font-weight: ${n?.weight??"normal"};
|
|
6
|
+
font-display: swap;
|
|
7
|
+
}
|
|
8
|
+
`,document.head.appendChild(d),await S(r,3e3),k(o,r),!0}catch(s){return y(s,`failed to load "${r}" from buffer`),false}finally{c.delete(o),m.size===0&&c.size===0&&(u=false);}})();return c.set(o,a),a}function U(e){let t=e.split("?")[0].split("#")[0].toLowerCase();return t.endsWith(".woff2")?"woff2":t.endsWith(".woff")?"woff":t.endsWith(".otf")?"opentype":"truetype"}async function D(e,t,n){if(typeof document>"u")return false;if(/[<>]/.test(t))return y(new Error(`invalid src URL for "${e}": contains '<' or '>'`),"rejected src"),false;let r=e.trim(),o=v(r,n?.weight);if(F.add(r),C.has(o))return true;let i=c.get(o);if(i)return i;let a=(async()=>{u=true;try{let s=document.createElement("style");return s.textContent=`
|
|
9
|
+
@font-face {
|
|
10
|
+
font-family: "${r}";
|
|
11
|
+
src: url(${JSON.stringify(t)}) format('${U(t)}');
|
|
12
|
+
font-weight: ${n?.weight??"normal"};
|
|
13
|
+
font-display: swap;
|
|
14
|
+
}
|
|
15
|
+
`,document.head.appendChild(s),await S(r,3e3),k(o,r),!0}catch(s){return y(s,`failed to load "${r}" from ${t}`),false}finally{c.delete(o),m.size===0&&c.size===0&&(u=false);}})();return c.set(o,a),a}async function Q(e){!e||e.length===0||await Promise.all(e.map(t=>D(t.family,t.src,{weight:t.weight})));}var I={Calibri:"Carlito",Cambria:"Caladea",Arial:"Arimo","Times New Roman":"Tinos","Courier New":"Cousine",Garamond:"EB Garamond","Book Antiqua":"EB Garamond",Georgia:"Tinos",Verdana:"Open Sans",Tahoma:"Open Sans","Trebuchet MS":"Source Sans Pro","Century Gothic":"Poppins","Franklin Gothic":"Libre Franklin",Palatino:"EB Garamond","Palatino Linotype":"EB Garamond","Lucida Sans":"Open Sans","Segoe UI":"Open Sans",Impact:"Anton","Comic Sans MS":"Comic Neue",Consolas:"Inconsolata","Lucida Console":"Inconsolata",Monaco:"Fira Code"};function O(e){let t=e.trim();return I[t]||t}async function W(e){let t=e.trim(),n=O(t);if(n!==t){if(!F.has(t)&&G(t)||x(t))return true;let r=await P(n);return r&&l.add(t),r}return P(n)}async function N(e){let t=[...new Set(e.map(n=>n.trim()))];await Promise.all(t.map(n=>W(n)));}async function Y(){await T(["Carlito","Caladea","Arimo","Tinos","Cousine","EB Garamond"]);}function q(e){let t=new Set,n=e;if(!n?.package)return t;let r=n.package?.document?.content;if(Array.isArray(r)){for(let i of r)if(i?.type==="paragraph"&&Array.isArray(i.content)){for(let a of i.content)if(a?.type==="run"&&a.formatting?.fontFamily){let{ascii:s,hAnsi:f}=a.formatting.fontFamily;s&&t.add(s),f&&f!==s&&t.add(f);}}}let o=n.package?.styles?.styles;if(Array.isArray(o)){for(let i of o)if(i?.runProperties?.fontFamily){let{ascii:a,hAnsi:s}=i.runProperties.fontFamily;a&&t.add(a),s&&s!==a&&t.add(s);}}return t}async function Z(e){let t=q(e);t.size!==0&&await N(Array.from(t));}async function te(e){if(e instanceof ArrayBuffer)return e;if(e instanceof Uint8Array){let t=new ArrayBuffer(e.byteLength);return new Uint8Array(t).set(e),t}if(e instanceof Blob)return e.arrayBuffer();throw new TypeError(`Unsupported DocxInput type: ${typeof e}`)}exports.a=P;exports.b=T;exports.c=G;exports.d=j;exports.e=_;exports.f=V;exports.g=J;exports.h=K;exports.i=X;exports.j=R;exports.k=H;exports.l=D;exports.m=Q;exports.n=I;exports.o=O;exports.p=W;exports.q=N;exports.r=Y;exports.s=q;exports.t=Z;exports.u=te;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {g,a as a$1,c,d,e,f,b,q as q$1,n as n$1}from'./chunk-
|
|
1
|
+
import {g,a as a$1,c,d,e,f,b,q as q$1,n as n$1}from'./chunk-F24WZXN4.mjs';import {h,j as j$1,l,m,n}from'./chunk-2LVK7EF5.mjs';import {a}from'./chunk-W77JXDEV.mjs';function Z(e,s){let r=G(s),t=new RegExp(`<w:p[\\s][^>]*w14:paraId="${r}"`,"g"),o=[],i;for(;(i=t.exec(e))!==null;)o.push(i.index);if(o.length===0||o.length>1)return null;let l=o[0],n=l,a=0;for(;n<e.length;){let m=e.indexOf("<",n);if(m===-1)break;if(e.startsWith("<w:p",m)){let y=e[m+4];if(y===">"||y===" "||y==="/"){let f=e.indexOf(">",m);if(f===-1)break;if(e[f-1]==="/"){if(a===0)return {start:l,end:f+1};n=f+1;}else a++,n=f+1;}else n=m+1;}else if(e.startsWith("</w:p>",m)){if(a--,a===0)return {start:l,end:m+6};n=m+6;}else n=m+1;}return null}function j(e,s){let r=Z(e,s);return r?e.substring(r.start,r.end):null}function H(e){let s=0,r=/<w:p[\s>]/g,t;for(;(t=r.exec(e))!==null;){let o=t.index,i=e[o+4];(i===">"||i===" ")&&s++;}return s}function W(e){let s=new Map,r=/w14:paraId="([^"]+)"/g,t;for(;(t=r.exec(e))!==null;){let o=t[1];s.set(o,(s.get(o)||0)+1);}return s}function q(e,s,r){if(r.size===0)return {safe:true};let t=W(e),o=W(s);for(let n of r){let a=t.get(n)||0;if(a===0)return {safe:false,reason:`paraId-not-found-in-original: ${n}`};if(a>1)return {safe:false,reason:`duplicate-paraId-in-original: ${n}`}}for(let n of r){let a=o.get(n)||0;if(a===0)return {safe:false,reason:`paraId-not-found-in-serialized: ${n}`};if(a>1)return {safe:false,reason:`duplicate-paraId-in-serialized: ${n}`}}let i=H(e),l=H(s);return i!==l?{safe:false,reason:`paragraph-count-mismatch: original=${i}, serialized=${l}`}:{safe:true}}function J(e,s,r){if(r.size===0)return e;if(!q(e,s,r).safe)return null;let o=[];for(let l of r){let n=Z(e,l);if(!n)return null;let a=j(s,l);if(!a)return null;o.push({start:n.start,end:n.end,newXml:a});}o.sort((l,n)=>n.start-l.start);let i=e;for(let{start:l,end:n,newXml:a}of o)i=i.substring(0,l)+a+i.substring(n);return i}function G(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function L(e){let s=r=>r.content.some(t=>t.type==="drawing"&&t.image?.src?.startsWith("data:")&&!t.image?.rId);for(let r of e)if(r.type==="paragraph")for(let t of r.content)if(t.type==="run"){if(s(t))return true}else {if(t.type==="hyperlink"&&t.href&&!t.rId&&!t.anchor)return true;if(t.type==="insertion"||t.type==="deletion"||t.type==="moveFrom"||t.type==="moveTo"){for(let o of t.content)if(o.type==="run"&&s(o))return true}}else if(r.type==="table"){for(let t of r.rows)for(let o of t.cells)if(L(o.content))return true}return false}async function oe(e$1,s,r){let{changedParaIds:t,structuralChange:o,hasUntrackedChanges:i}=r;if(o||i||!s)return null;let l$1=e$1.package.document.content;if(L(l$1))return null;let n$2=e$1.package.document.comments,a$2=n$2&&n$2.length>0,m$1=g(e$1);try{let f$1=await(await import('jszip')).default.loadAsync(s),u=new Map,I=e$1.package.relationships;if(I)for(let c of I.values()){if(!c.target||c.type!==a.header&&c.type!==a.footer)continue;let d=a$1(c.target).replace(/^\//,"");if(!f$1.file(d))return null}if(t.size>0){let c=f$1.file("word/document.xml");if(!c)return null;let d=await c.async("text"),w=h(e$1),x=J(d,w,t);if(!x)return null;u.set("word/document.xml",x);}if(a$2){let{xml:c$1,paraInfos:d$1}=j$1(n$2);u.set("word/comments.xml",c$1);let w=l(d$1);w&&u.set("word/commentsExtended.xml",w);let x=m(d$1);x&&u.set("word/commentsIds.xml",x);let S=n(d$1,n$2);S&&u.set("word/commentsExtensible.xml",S);let N=f$1.file("[Content_Types].xml");if(N){let p=u.get("[Content_Types].xml")??await N.async("text"),h=!1,C=[["/word/comments.xml",c],["/word/commentsExtended.xml",d],["/word/commentsIds.xml",e],["/word/commentsExtensible.xml",f]];for(let[E,b]of C)p.includes(E)||(p=p.replace("</Types>",`<Override PartName="${E}" ContentType="${b}"/></Types>`),h=!0);h&&u.set("[Content_Types].xml",p);}let T="word/_rels/document.xml.rels",O=f$1.file(T);if(O){let p=u.get(T)??await O.async("text"),h=!1,C=[["comments.xml",a.comments],["commentsExtended.xml",a.commentsExtended],["commentsIds.xml",a.commentsIds],["commentsExtensible.xml",a.commentsExtensible]];for(let[E,b$1]of C)if(!p.includes(E)){let V=b(p);p=p.replace("</Relationships>",`<Relationship Id="rId${V+1}" Type="${b$1}" Target="${E}"/></Relationships>`),h=!0;}h&&u.set(T,p);}}for(let[c,d]of m$1)u.set(c,d);let P=f$1.file("docProps/core.xml");if(P){let c=await P.async("text");u.set("docProps/core.xml",q$1(c,{updateModifiedDate:!0}));}return await n$1(f$1,u)}catch{return null}}
|
|
2
2
|
export{q as a,J as b,oe as c};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
'use strict';var chunkU4UCHBZ7_js=require('./chunk-U4UCHBZ7.js'),chunkESI4BSBF_js=require('./chunk-ESI4BSBF.js'),
|
|
1
|
+
'use strict';var chunkU4UCHBZ7_js=require('./chunk-U4UCHBZ7.js'),chunkESI4BSBF_js=require('./chunk-ESI4BSBF.js'),chunkV3NE7Q22_js=require('./chunk-V3NE7Q22.js');function M(o){return typeof o=="object"&&o!==null&&("_def"in o||"parse"in o||"safeParse"in o)}function v(o,i){let s=i,{position:n,variableName:t}=s,e=JSON.parse(JSON.stringify(o)),a=e.package.document.content.filter(m=>m.type==="paragraph");if(n.paragraphIndex>=a.length)throw new Error(`Paragraph index ${n.paragraphIndex} out of bounds`);let l=a[n.paragraphIndex],p=`{${t}}`;return C(l,n.offset,p),e.templateVariables||(e.templateVariables=[]),e.templateVariables.includes(t)||e.templateVariables.push(t),e}function w(o,i){let s=i,{range:n,variableName:t}=s,e=JSON.parse(JSON.stringify(o)),a=e.package.document.content.filter(m=>m.type==="paragraph");if(n.start.paragraphIndex!==n.end.paragraphIndex)throw new Error("Template variable replacement cannot span multiple paragraphs");if(n.start.paragraphIndex>=a.length)throw new Error(`Paragraph index ${n.start.paragraphIndex} out of bounds`);let l=a[n.start.paragraphIndex];I(l,n.start.offset,n.end.offset);let p=`{${t}}`;return C(l,n.start.offset,p),e.templateVariables||(e.templateVariables=[]),e.templateVariables.includes(t)||e.templateVariables.push(t),e}function C(o,i,s){let n=0,t=false;for(let e=0;e<o.content.length;e++){let r=o.content[e];if(r.type==="run"){let a=g(r),l=n,p=n+a.length;if(!t&&i>=l&&i<=p){let m=i-l,f=a.slice(0,m),x=a.slice(m),d=[];for(let c=0;c<e;c++)d.push(o.content[c]);f&&d.push({type:"run",formatting:r.formatting,content:[{type:"text",text:f}]}),d.push({type:"run",formatting:r.formatting,content:[{type:"text",text:s}]}),x&&d.push({type:"run",formatting:r.formatting,content:[{type:"text",text:x}]});for(let c=e+1;c<o.content.length;c++)d.push(o.content[c]);o.content=d,t=true;break}n=p;}else if(r.type==="hyperlink")for(let a of r.children)a.type==="run"&&(n+=g(a).length);}t||o.content.push({type:"run",content:[{type:"text",text:s}]});}function I(o,i,s){let n=[],t=0;for(let e of o.content)if(e.type==="run"){let r=g(e),a=t,l=t+r.length;if(l<=i||a>=s)n.push(e);else {let p="";a<i&&(p+=r.slice(0,i-a)),l>s&&(p+=r.slice(s-a)),p.length>0&&n.push({type:"run",formatting:e.formatting,content:[{type:"text",text:p}]});}t=l;}else n.push(e);o.content=n;}function g(o){return o.content.filter(i=>i.type==="text").map(i=>i.text).join("")}var u={type:"string",description:"Document ID from a previous docx_load call"},D={type:"object",properties:{paragraphIndex:{type:"number",description:"Index of the paragraph (0-indexed)"},offset:{type:"number",description:"Character offset within the paragraph"}},required:["paragraphIndex","offset"]},V={name:"docx_get_variables",description:`List all template variables ({name} format) found in the document.
|
|
2
2
|
Returns variable names without braces, along with their locations (body, headers, footers, etc.).
|
|
3
3
|
Use this to discover what data fields a template document expects.`,inputSchema:{type:"object",properties:{documentId:u},required:["documentId"]},handler:async(o,i)=>{let{documentId:s}=o,n=i.session.documents.get(s);if(!n)return {isError:true,content:[{type:"text",text:`Document not found: ${s}`}]};try{let t=chunkU4UCHBZ7_js.b(n.document);return {content:[{type:"text",text:JSON.stringify({variables:t.variables,count:t.variables.length,totalOccurrences:t.totalOccurrences,byLocation:t.byLocation},null,2)}]}}catch(t){return {isError:true,content:[{type:"text",text:`Failed to detect variables: ${t.message}`}]}}},annotations:{category:"template",readOnly:true,complexity:"low",examples:[{description:"Get all variables from a loaded document",input:{documentId:"doc_123"},output:'{"variables": ["customer_name", "invoice_date"], "count": 2}'}]}},R={name:"docx_insert_variable",description:`Insert a template variable placeholder ({name}) at a specific position in the document.
|
|
4
4
|
The variable can later be substituted with actual values using docx_apply_template.
|
|
5
|
-
Variable names should follow the pattern: letters, numbers, underscores, starting with a letter.`,inputSchema:{type:"object",properties:{documentId:u,position:D,variableName:{type:"string",description:'Variable name without braces (e.g., "customer_name"). Will be inserted as {customer_name}',pattern:"^[a-zA-Z_][a-zA-Z0-9_]*$"}},required:["documentId","position","variableName"]},handler:async(o,i)=>{let{documentId:s,position:n,variableName:t}=o,e=i.session.documents.get(s);if(!e)return {isError:true,content:[{type:"text",text:`Document not found: ${s}`}]};if(!/^[a-zA-Z_][a-zA-Z0-9_\-.]*$/.test(t))return {isError:true,content:[{type:"text",text:`Invalid variable name: ${t}. Must start with letter/underscore and contain only alphanumeric, underscore, hyphen, or dot.`}]};try{let{executeCommand:r}=await import('./executor-
|
|
5
|
+
Variable names should follow the pattern: letters, numbers, underscores, starting with a letter.`,inputSchema:{type:"object",properties:{documentId:u,position:D,variableName:{type:"string",description:'Variable name without braces (e.g., "customer_name"). Will be inserted as {customer_name}',pattern:"^[a-zA-Z_][a-zA-Z0-9_]*$"}},required:["documentId","position","variableName"]},handler:async(o,i)=>{let{documentId:s,position:n,variableName:t}=o,e=i.session.documents.get(s);if(!e)return {isError:true,content:[{type:"text",text:`Document not found: ${s}`}]};if(!/^[a-zA-Z_][a-zA-Z0-9_\-.]*$/.test(t))return {isError:true,content:[{type:"text",text:`Invalid variable name: ${t}. Must start with letter/underscore and contain only alphanumeric, underscore, hyphen, or dot.`}]};try{let{executeCommand:r}=await import('./executor-FHL5D4CB.js'),a=r(e.document,{type:"insertText",position:n,text:`{${t}}`});return e.document=a,e.lastModified=Date.now(),a.templateVariables||(a.templateVariables=[]),a.templateVariables.includes(t)||a.templateVariables.push(t),{content:[{type:"text",text:JSON.stringify({success:!0,variable:t,insertedAs:`{${t}}`,position:n})}]}}catch(r){return {isError:true,content:[{type:"text",text:`Failed to insert variable: ${r.message}`}]}}},annotations:{category:"template",readOnly:false,complexity:"low",examples:[{description:"Insert customer name variable at start of first paragraph",input:{documentId:"doc_123",position:{paragraphIndex:0,offset:0},variableName:"customer_name"}}]}},S={name:"docx_apply_template",description:`Substitute template variables with actual values in the document.
|
|
6
6
|
Replaces all {variable} placeholders with the corresponding values provided.
|
|
7
7
|
Preserves all formatting (fonts, styles, colors, tables).
|
|
8
|
-
Use docx_get_variables first to discover what variables exist in the document.`,inputSchema:{type:"object",properties:{documentId:u,variables:{type:"object",description:'Map of variable names to values (e.g., {"customer_name": "John Doe", "date": "2024-01-15"})',additionalProperties:{type:"string"}},keepUnmatchedVariables:{type:"boolean",description:"If true, keep {variable} placeholders for variables not in the map. If false, replace with empty string. Default: true",default:true}},required:["documentId","variables"]},handler:async(o,i)=>{let{documentId:s,variables:n,keepUnmatchedVariables:t=true}=o,e=i.session.documents.get(s);if(!e)return {isError:true,content:[{type:"text",text:`Document not found: ${s}`}]};if(!e.buffer)return {isError:true,content:[{type:"text",text:"Cannot apply template: document was not loaded from a DOCX buffer"}]};try{let r=chunkESI4BSBF_js.b(e.buffer,n,{nullGetter:t?"keep":"empty"}),a=await
|
|
8
|
+
Use docx_get_variables first to discover what variables exist in the document.`,inputSchema:{type:"object",properties:{documentId:u,variables:{type:"object",description:'Map of variable names to values (e.g., {"customer_name": "John Doe", "date": "2024-01-15"})',additionalProperties:{type:"string"}},keepUnmatchedVariables:{type:"boolean",description:"If true, keep {variable} placeholders for variables not in the map. If false, replace with empty string. Default: true",default:true}},required:["documentId","variables"]},handler:async(o,i)=>{let{documentId:s,variables:n,keepUnmatchedVariables:t=true}=o,e=i.session.documents.get(s);if(!e)return {isError:true,content:[{type:"text",text:`Document not found: ${s}`}]};if(!e.buffer)return {isError:true,content:[{type:"text",text:"Cannot apply template: document was not loaded from a DOCX buffer"}]};try{let r=chunkESI4BSBF_js.b(e.buffer,n,{nullGetter:t?"keep":"empty"}),a=await chunkV3NE7Q22_js.a(r.buffer);return e.document=a,e.buffer=r.buffer,e.lastModified=Date.now(),{content:[{type:"text",text:JSON.stringify({success:!0,replacedVariables:r.replacedVariables,unreplacedVariables:r.unreplacedVariables,warnings:r.warnings})}]}}catch(r){return {isError:true,content:[{type:"text",text:`Failed to apply template: ${r.message}`}]}}},annotations:{category:"template",readOnly:false,complexity:"medium",examples:[{description:"Fill in customer and date values",input:{documentId:"doc_123",variables:{customer_name:"Jane Smith",invoice_date:"2024-02-15",amount:"$1,234.56"}}}]}},k={name:"docx_validate_template",description:`Validate that a document is a valid docxtemplater template.
|
|
9
9
|
Checks for syntax errors like unclosed braces, invalid tag names, etc.
|
|
10
10
|
Returns validation result with any errors found and list of valid tags.`,inputSchema:{type:"object",properties:{documentId:u},required:["documentId"]},handler:async(o,i)=>{let{documentId:s}=o,n=i.session.documents.get(s);if(!n)return {isError:true,content:[{type:"text",text:`Document not found: ${s}`}]};if(!n.buffer)return {isError:true,content:[{type:"text",text:"Cannot validate template: document was not loaded from a DOCX buffer"}]};try{let t=chunkESI4BSBF_js.f(n.buffer);return {content:[{type:"text",text:JSON.stringify({valid:t.valid,tags:t.tags,errors:t.errors.map(e=>({message:e.message,variable:e.variable,type:e.type}))},null,2)}]}}catch(t){return {isError:true,content:[{type:"text",text:`Failed to validate template: ${t.message}`}]}}},annotations:{category:"template",readOnly:true,complexity:"low"}},P=[V,R,S,k];var E={id:"docxtemplater",name:"Docxtemplater",version:"1.0.0",description:"Template variable support using standard docxtemplater syntax ({variable})",commandHandlers:{insertTemplateVariable:v,replaceWithTemplateVariable:w},mcpTools:P};exports.a=M;exports.b=E;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var y=".layout-page-content";function M(e){return Array.from(e.querySelectorAll(`${y} span[data-pm-start][data-pm-end]`))}function S(e){return Array.from(e.querySelectorAll(`${y} .layout-empty-run`))}function P(e){return Array.from(e.querySelectorAll(`${y} [data-pm-start]`))}function _(e,t){return Number.isFinite(t)?e.querySelector(`${y} [data-pm-start="${t}"]`):null}function F(e,t,a,o=1){let i=document.elementsFromPoint(t,a),c=i.find(r=>r.classList.contains("layout-page"));if(!c)return null;let p=i.find(r=>r.tagName==="SPAN"&&r.dataset.pmStart!==void 0&&r.dataset.pmEnd!==void 0);if(p)return L(p,t);let n=i.find(r=>r.classList.contains("layout-empty-run"));if(n){let r=n.closest(".layout-paragraph");if(r&&r.dataset.pmStart)return Number(r.dataset.pmStart)}let m=i.find(r=>r.classList.contains("layout-paragraph")&&r.dataset.pmStart!==void 0);if(m&&m.dataset.pmStart){let r=H(m,t,a);return r!==null?r:Number(m.dataset.pmStart)}let s=i.find(r=>r.classList.contains("layout-table-cell"));return s?H(s,t,a):B(e,c,t,a)}function L(e,t,a){let o=Number(e.dataset.pmStart),i=Number(e.dataset.pmEnd);if(e.classList.contains("layout-run-tab")){let l=e.getBoundingClientRect(),d=(l.left+l.right)/2;return t<d?o:i}let c=e.firstChild;if(!c||c.nodeType!==Node.TEXT_NODE)return o;let p=c,n=p.length;if(n===0)return o;let m=e.ownerDocument;if(!m)return o;let s=0,r=n;for(;s<r;){let l=Math.floor((s+r)/2),d=m.createRange();d.setStart(p,l),d.setEnd(p,l);let f=d.getBoundingClientRect().left;t<f?r=l:s=l+1;}if(s>0&&s<=n){let l=m.createRange();l.setStart(p,s-1),l.setEnd(p,s-1);let d=l.getBoundingClientRect();l.setStart(p,Math.min(s,n)),l.setEnd(p,Math.min(s,n));let u=l.getBoundingClientRect(),f=Math.abs(t-d.left),g=Math.abs(t-u.left);if(f<g)return o+(s-1)}return o+Math.min(s,i-o)}function H(e,t,a){let o=e.querySelector(".layout-empty-run");if(o){let l=o.closest(".layout-paragraph");if(l&&l.dataset.pmStart)return Number(l.dataset.pmStart)}let i=e.querySelectorAll(".layout-line"),c=null,p=1/0;for(let l of Array.from(i)){let d=l,u=d.getBoundingClientRect(),f=(u.top+u.bottom)/2,g=Math.abs(a-f);g<p&&(p=g,c=d);}if(!c){let l=e.querySelector(".layout-paragraph[data-pm-start]");return l?.dataset.pmStart?Number(l.dataset.pmStart):e.dataset.pmStart?Number(e.dataset.pmStart):null}let n=c.querySelectorAll("span[data-pm-start][data-pm-end]");if(n.length===0){let l=c.closest(".layout-paragraph");return l?.dataset.pmStart?Number(l.dataset.pmStart):null}let m=null,s=1/0;for(let l of Array.from(n)){let d=l,u=d.getBoundingClientRect();if(t>=u.left&&t<=u.right)return L(d,t);let f=t<u.left?u.left-t:t-u.right;f<s&&(s=f,m=d);}if(!m)return null;let r=m.getBoundingClientRect();return t<r.left?Number(m.dataset.pmStart):Number(m.dataset.pmEnd)}function B(e,t,a,o,i){if(t.querySelectorAll("span[data-pm-start][data-pm-end]").length===0){let u=t.querySelectorAll(".layout-paragraph");if(u.length>0){let f=u[0];return Number(f.dataset.pmStart)||0}return null}let p=t.querySelectorAll(".layout-line"),n=null,m=1/0;for(let u of Array.from(p)){let f=u,g=f.getBoundingClientRect(),b=(g.top+g.bottom)/2,h=Math.abs(o-b);h<m&&(m=h,n=f);}if(!n)return null;let s=n.querySelectorAll("span[data-pm-start][data-pm-end]");if(s.length===0){let u=n.closest(".layout-paragraph");return u?.dataset.pmStart?Number(u.dataset.pmStart):null}let r=null,l=1/0;for(let u of Array.from(s)){let f=u,g=f.getBoundingClientRect();if(a>=g.left&&a<=g.right)return L(f,a);let b=a<g.left?g.left-a:a-g.right;b<l&&(l=b,r=f);}if(!r)return null;let d=r.getBoundingClientRect();return a<d.left?Number(r.dataset.pmStart):Number(r.dataset.pmEnd)}var A=.5;function D(e,t){let a=e.closest(".layout-table:not(.layout-nested-table)");if(!a)return {left:t.left,top:t.top,right:t.right,bottom:t.bottom};let o=a.getBoundingClientRect(),i=Math.max(t.top,o.top),c=Math.min(t.bottom,o.bottom);return c-i<=A?null:{left:t.left,top:i,right:t.right,bottom:c}}var I=4;function N(e,t){let o=(e.closest(".layout-line")??e).getBoundingClientRect(),i=e.getBoundingClientRect().left,c=D(e,{left:i,top:o.top,right:i+I,bottom:o.bottom});if(!c)return null;let p=e.closest(".layout-page");return {x:c.left-t.left,y:c.top-t.top,width:c.right-c.left,height:c.bottom-c.top,pageIndex:p?Number(p.dataset.pageNumber||1)-1:0}}function O(e){let t=e.closest(".layout-paragraph");if(!t)return null;let a=Number(t.dataset.pmStart),o=Number(t.dataset.pmEnd);return !Number.isFinite(a)||!Number.isFinite(o)?null:{pmStart:a,pmEnd:o}}function $(e,t,a,o){let i=[],c=M(e);for(let p of Array.from(c)){let n=p,m=Number(n.dataset.pmStart),s=Number(n.dataset.pmEnd);if(s<=t||m>=a)continue;let r=n.closest(".layout-page"),l=r?Number(r.dataset.pageNumber||1)-1:0,d=T=>{let E=D(n,T);E&&i.push({x:E.left-o.left,y:E.top-o.top,width:E.right-E.left,height:E.bottom-E.top,pageIndex:l});};if(m===s){let T=N(n,o);T&&i.push(T);continue}if(n.classList.contains("layout-run-tab")){d(n.getBoundingClientRect());continue}let u=null;if(n.firstChild?.nodeType===Node.TEXT_NODE?u=n.firstChild:n.firstChild?.nodeType===Node.ELEMENT_NODE&&n.firstChild.tagName==="A"&&n.firstChild.firstChild?.nodeType===Node.TEXT_NODE&&(u=n.firstChild.firstChild),!u)continue;let f=n.ownerDocument;if(!f)continue;let g=Math.max(0,t-m),b=Math.min(u.length,a-m);if(g>=b)continue;let h=f.createRange();h.setStart(u,g),h.setEnd(u,b);for(let T of Array.from(h.getClientRects()))d(T);}for(let p of S(e)){let n=O(p);if(!n||n.pmEnd<=t||n.pmStart>=a)continue;let m=N(p,o);m&&i.push(m);}return i}function C(e,t){let a=e.closest(".layout-table:not(.layout-nested-table)");if(!a)return false;let o=a.getBoundingClientRect(),i=(t.top+t.bottom)/2;return i<o.top-.5||i>o.bottom+.5}function R(e,t,a,o){let i=e.closest(".layout-page"),c=i?Number(i.dataset.pageNumber||1)-1:0,p=e.closest(".layout-line"),n=p?p.offsetHeight:16,m=e.firstChild;if(e.classList.contains("layout-run-tab")||!m||m.nodeType!==Node.TEXT_NODE){let g=e.getBoundingClientRect();return {x:g.left-o.left,y:g.top-o.top,height:n,pageIndex:c}}let r=m,l=Math.min(t-a,r.length),u=e.ownerDocument.createRange();u.setStart(r,l),u.setEnd(r,l);let f=u.getBoundingClientRect();return {x:f.left-o.left,y:f.top-o.top,height:f.height||n,pageIndex:c}}function W(e,t,a){let o=M(e),i=null,c=0;for(let m of Array.from(o)){let s=m,r=Number(s.dataset.pmStart),l=Number(s.dataset.pmEnd);if(!(s.classList.contains("layout-run-tab")?t>=r&&t<l:t>=r&&t<=l))continue;let f=s.getBoundingClientRect();if(C(s,f)){i||(i=s,c=r);continue}return R(s,t,r,a)}if(i)return R(i,t,c,a);let p=e.querySelectorAll(".layout-paragraph"),n=null;for(let m of Array.from(p)){let s=m,r=Number(s.dataset.pmStart),l=Number(s.dataset.pmEnd);if(t>=r&&t<=l){let u=s.querySelector(".layout-empty-run")||s,f=u.getBoundingClientRect();if(C(s,f)){n||(n={el:s,targetEl:u});continue}return x(s,u,a)}}return n?x(n.el,n.targetEl,a):null}function x(e,t,a){let o=t.getBoundingClientRect(),i=e.closest(".layout-page"),c=i?Number(i.dataset.pageNumber||1)-1:0,n=(t.closest(".layout-line")||t).offsetHeight||16;return {x:o.left-a.left,y:o.top-a.top,height:n,pageIndex:c}}export{M as a,S as b,P as c,_ as d,F as e,D as f,$ as g,W as h};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunk77X765ZO_js=require('./chunk-77X765ZO.js'),chunkBJSG6TEG_js=require('./chunk-BJSG6TEG.js'),chunkDC7S76ZX_js=require('./chunk-DC7S76ZX.js');var i={runImage:"layout-run-image",blockImage:"layout-block-image",pageFloatingImage:"layout-page-floating-image",cellFloatingImage:"layout-cell-floating-image",pageContent:"layout-page-content",paragraph:"layout-paragraph"},y=[`.${i.pageFloatingImage}`,`.${i.cellFloatingImage}`,`.${i.blockImage}`,`.${i.runImage}`].join(", ");function L(n){if(!(n instanceof Element))return null;let e=n.closest(y);if(!e)return null;let o=e.dataset.pmStart;if(o===void 0)return null;let t=Number(o);return Number.isNaN(t)?null:{pos:t,imageEl:e}}function b(n){if(!(n instanceof HTMLElement))return null;if(n.tagName==="IMG"&&n.classList.contains(i.runImage))return n;let e=n.closest(y);return e&&e.dataset.pmStart?e:null}function x(n,e=1){if(!n.classList.contains(i.runImage))return;let o=n.closest(`.${i.pageContent}`),t=n.closest(`.${i.paragraph}`);if(!o||!t)return;let r=n.getBoundingClientRect(),a=o.getBoundingClientRect(),l=t.getBoundingClientRect(),p=e>0?e:1;return {horizontalEmu:Math.round(chunkBJSG6TEG_js.g((r.left-a.left)/p)),verticalEmu:Math.round(chunkBJSG6TEG_js.g((r.top-l.top)/p))}}function T(n,e){return n==="inline"?"inline":n==="behind"?"behind":n==="inFront"?"inFront":n==="square"||n==="tight"||n==="through"?e==="right"?"squareRight":"squareLeft":null}var k=[{choice:"inline",i18nLabelKey:"inLineWithText",i18nDescKey:"inLineWithText",iconHint:"inline"},{choice:"squareLeft",i18nLabelKey:"squareLeft",i18nDescKey:"squareLeft",iconHint:"squareLeft"},{choice:"squareRight",i18nLabelKey:"squareRight",i18nDescKey:"squareRight",iconHint:"squareRight"},{choice:"behind",i18nLabelKey:"behindText",i18nDescKey:"behindText",iconHint:"behind"},{choice:"inFront",i18nLabelKey:"inFrontOfText",i18nDescKey:"inFrontOfText",iconHint:"inFront"}];function I(n,e){return true}function E(n){switch(n){case "inline":return "inline";case "square":case "tight":case "through":return "squareLeft";case "topAndBottom":return "topAndBottom";case "behind":return "behind";case "inFront":return "inFront";case "wrapRight":return "squareLeft";case "wrapLeft":return "squareRight";default:return}}function X(n,e){let o=new Map;for(let t=0;t<n.length;t++){let r=n[t],a=e[t];r&&a&&o.set(String(r.id),{block:r,measure:a});}return o}var c=class{constructor(e={}){chunkDC7S76ZX_js.a(this,"container",null);chunkDC7S76ZX_js.a(this,"blockLookup",new Map);chunkDC7S76ZX_js.a(this,"pageStates",[]);chunkDC7S76ZX_js.a(this,"totalPages",0);chunkDC7S76ZX_js.a(this,"options");chunkDC7S76ZX_js.a(this,"doc");chunkDC7S76ZX_js.a(this,"resolvedCommentIds",new Set);this.options=e,this.doc=e.document??document;}setBlockLookup(e){this.blockLookup=e;}mount(e){this.container=e,this.applyContainerStyles();}unmount(){this.container&&(this.container.innerHTML=""),this.container=null,this.pageStates=[];}applyContainerStyles(){if(!this.container)return;let e=this.options.pageGap??24;this.container.style.display="flex",this.container.style.flexDirection="column",this.container.style.alignItems="center",this.container.style.gap=`${e}px`,this.container.style.padding=`${e}px`,this.container.style.backgroundColor=this.options.containerBackground??"var(--doc-bg, #f8f9fa)",this.container.style.minHeight="100%";}paint(e){if(!this.container)throw new Error("LayoutPainter: not mounted");let{pages:o}=e;this.totalPages=o.length,this.container.innerHTML="",this.pageStates=[];for(let t=0;t<o.length;t++){let r=o[t],a={pageNumber:r.number,totalPages:this.totalPages,section:"body",resolvedCommentIds:this.resolvedCommentIds},l=this.renderPageWithLookup(r,a);this.container.appendChild(l),this.pageStates.push({element:l,pageNumber:r.number,fragmentCount:r.fragments.length});}}renderPageWithLookup(e,o){let t=this.doc.createElement("div");t.className="layout-page",t.dataset.pageNumber=String(e.number),t.style.position="relative",t.style.width=`${e.size.w}px`,t.style.height=`${e.size.h}px`,t.style.backgroundColor=this.options.pageBackground??"var(--doc-page-bg, #ffffff)",t.style.color="var(--doc-page-text, #000000)",t.style.overflow="hidden",this.options.showShadow&&(t.style.boxShadow="0 2px 8px rgba(0, 0, 0, 0.15)");let r=this.doc.createElement("div");r.className="layout-page-content",r.style.position="absolute",r.style.top=`${e.margins.top}px`,r.style.left=`${e.margins.left}px`,r.style.right=`${e.margins.right}px`,r.style.bottom=`${e.margins.bottom}px`,r.style.overflow="visible";for(let a of e.fragments){let l=this.renderFragmentWithLookup(a,o);this.applyFragmentPosition(l,a),r.appendChild(l);}return t.appendChild(r),t}renderFragmentWithLookup(e,o){let t=this.blockLookup.get(String(e.blockId));if(e.kind==="paragraph"&&t){let r=t.block,a=t.measure;return chunk77X765ZO_js.t(e,r,a,o,{document:this.doc})}if(e.kind==="table"&&t){let r=t.block,a=t.measure;return chunk77X765ZO_js.w(e,r,a,o,{document:this.doc})}if(e.kind==="image"&&t){let r=t.block,a=t.measure;return chunk77X765ZO_js.q(e,r,a,o,{document:this.doc})}if(e.kind==="textBox"&&t){let r=t.block,a=t.measure;return chunk77X765ZO_js.y(e,r,a,o,{document:this.doc})}return chunk77X765ZO_js.o(e,o,{document:this.doc})}applyFragmentPosition(e,o){e.style.position="absolute",e.style.left=`${o.x}px`,e.style.top=`${o.y}px`,e.style.width=`${o.width}px`,"height"in o&&(e.style.height=`${o.height}px`);}getPageCount(){return this.totalPages}getPageElement(e){return this.pageStates[e]?.element??null}scrollToPage(e){let o=this.pageStates.find(t=>t.pageNumber===e);o?.element&&o.element.scrollIntoView({behavior:"smooth",block:"start"});}};function Z(n){return new c(n)}exports.a=i;exports.b=L;exports.c=b;exports.d=x;exports.e=T;exports.f=k;exports.g=I;exports.h=E;exports.i=X;exports.j=c;exports.k=Z;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var o=["CONFIDENTIAL","DRAFT","DO NOT COPY","SAMPLE","URGENT","ASAP"];function r(t,n){if(!(t>0)||!(n>0))return;let e=t/n;return e>=1?{widthEmu:3954780,heightEmu:Math.round(3954780/e)}:{widthEmu:Math.round(3954780*e),heightEmu:3954780}}export{o as a,r as b};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use strict';var chunk6KYOT4E7_js=require('./chunk-6KYOT4E7.js'),chunkFIGLFSNR_js=require('./chunk-FIGLFSNR.js'),chunkQVRMX2AC_js=require('./chunk-QVRMX2AC.js'),chunkZ3LGMBJC_js=require('./chunk-Z3LGMBJC.js'),chunkGSKMHXHG_js=require('./chunk-GSKMHXHG.js'),chunkH57LNDBH_js=require('./chunk-H57LNDBH.js'),chunk3R7QHNI5_js=require('./chunk-3R7QHNI5.js'),He=require('jszip');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var He__default=/*#__PURE__*/_interopDefault(He);async function G(t){let n=await He__default.default.loadAsync(t),e={documentXml:null,stylesXml:null,themeXml:null,numberingXml:null,fontTableXml:null,settingsXml:null,webSettingsXml:null,headers:new Map,footers:new Map,footnotesXml:null,endnotesXml:null,commentsXml:null,commentsExtensibleXml:null,commentsExtendedXml:null,documentRels:null,packageRels:null,contentTypesXml:null,corePropsXml:null,appPropsXml:null,customPropsXml:null,media:new Map,fonts:new Map,allXml:new Map,originalZip:n,originalBuffer:t};for(let[o,i]of Object.entries(n.files)){if(i.dir)continue;let r=o.toLowerCase();if(r.endsWith(".xml")||r.endsWith(".rels")){let a=await i.async("text");if(e.allXml.set(o,a),r==="word/document.xml")e.documentXml=a;else if(r==="word/styles.xml")e.stylesXml=a;else if(r==="word/theme/theme1.xml")e.themeXml=a;else if(r==="word/numbering.xml")e.numberingXml=a;else if(r==="word/fonttable.xml")e.fontTableXml=a;else if(r==="word/settings.xml")e.settingsXml=a;else if(r==="word/websettings.xml")e.webSettingsXml=a;else if(r==="word/footnotes.xml")e.footnotesXml=a;else if(r==="word/endnotes.xml")e.endnotesXml=a;else if(r==="word/comments.xml")e.commentsXml=a;else if(r==="word/commentsextensible.xml")e.commentsExtensibleXml=a;else if(r==="word/commentsextended.xml")e.commentsExtendedXml=a;else if(r==="word/_rels/document.xml.rels")e.documentRels=a;else if(r==="_rels/.rels")e.packageRels=a;else if(r==="[content_types].xml")e.contentTypesXml=a;else if(r==="docprops/core.xml")e.corePropsXml=a;else if(r==="docprops/app.xml")e.appPropsXml=a;else if(r==="docprops/custom.xml")e.customPropsXml=a;else if(r.match(/^word\/header\d+\.xml$/)){let c=o.split("/").pop()||o;e.headers.set(c,a);}else if(r.match(/^word\/footer\d+\.xml$/)){let c=o.split("/").pop()||o;e.footers.set(c,a);}}else if(r.startsWith("word/media/")){let a=await i.async("arraybuffer");e.media.set(o,a);}else if(r.startsWith("word/fonts/")){let a=await i.async("arraybuffer");e.fonts.set(o,a);}}return e}function Me(t){switch(t.toLowerCase().split(".").pop()){case "png":return "image/png";case "jpg":case "jpeg":return "image/jpeg";case "gif":return "image/gif";case "bmp":return "image/bmp";case "tif":case "tiff":return "image/tiff";case "wmf":return "image/x-wmf";case "emf":return "image/x-emf";case "svg":return "image/svg+xml";case "webp":return "image/webp";default:return "application/octet-stream"}}function Y(t,n,e,o){let i={};return t&&t!=="auto"?i.rgb=t:t==="auto"&&(i.auto=true),n&&(i.themeColor=n),e&&(i.themeTint=e),o&&(i.themeShade=o),i}function W(t){if(!t)return;let n={},e=chunk3R7QHNI5_js.j(t,"w","color");e&&e!=="auto"&&(n.color={rgb:e});let o=chunk3R7QHNI5_js.j(t,"w","fill");o&&o!=="auto"&&(n.fill={rgb:o});let i=chunk3R7QHNI5_js.j(t,"w","themeFill");i&&(n.fill=n.fill||{},n.fill.themeColor=i);let r=chunk3R7QHNI5_js.j(t,"w","themeFillTint");r&&n.fill&&(n.fill.themeTint=r);let a=chunk3R7QHNI5_js.j(t,"w","themeFillShade");a&&n.fill&&(n.fill.themeShade=a);let c=chunk3R7QHNI5_js.j(t,"w","val");return c&&(n.pattern=c),Object.keys(n).length>0?n:void 0}function $(t,n){if(!t)return;let e={},o=chunk3R7QHNI5_js.e(t,"w","b");o&&(e.bold=chunk3R7QHNI5_js.m(o));let i=chunk3R7QHNI5_js.e(t,"w","bCs");i&&(e.boldCs=chunk3R7QHNI5_js.m(i));let r=chunk3R7QHNI5_js.e(t,"w","i");r&&(e.italic=chunk3R7QHNI5_js.m(r));let a=chunk3R7QHNI5_js.e(t,"w","iCs");a&&(e.italicCs=chunk3R7QHNI5_js.m(a));let c=chunk3R7QHNI5_js.e(t,"w","u");if(c){let m=chunk3R7QHNI5_js.j(c,"w","val");if(m){e.underline={style:m};let P=chunk3R7QHNI5_js.j(c,"w","color"),I=chunk3R7QHNI5_js.j(c,"w","themeColor");(P||I)&&(e.underline.color=Y(P,I,chunk3R7QHNI5_js.j(c,"w","themeTint"),chunk3R7QHNI5_js.j(c,"w","themeShade")));}}let g=chunk3R7QHNI5_js.e(t,"w","strike");g&&(e.strike=chunk3R7QHNI5_js.m(g));let d=chunk3R7QHNI5_js.e(t,"w","dstrike");d&&(e.doubleStrike=chunk3R7QHNI5_js.m(d));let h=chunk3R7QHNI5_js.e(t,"w","vertAlign");if(h){let m=chunk3R7QHNI5_js.j(h,"w","val");(m==="superscript"||m==="subscript"||m==="baseline")&&(e.vertAlign=m);}let b=chunk3R7QHNI5_js.e(t,"w","smallCaps");b&&(e.smallCaps=chunk3R7QHNI5_js.m(b));let u=chunk3R7QHNI5_js.e(t,"w","caps");u&&(e.allCaps=chunk3R7QHNI5_js.m(u));let S=chunk3R7QHNI5_js.e(t,"w","vanish");S&&(e.hidden=chunk3R7QHNI5_js.m(S));let f=chunk3R7QHNI5_js.e(t,"w","color");f&&(e.color=Y(chunk3R7QHNI5_js.j(f,"w","val"),chunk3R7QHNI5_js.j(f,"w","themeColor"),chunk3R7QHNI5_js.j(f,"w","themeTint"),chunk3R7QHNI5_js.j(f,"w","themeShade")));let y=chunk3R7QHNI5_js.e(t,"w","highlight");if(y){let m=chunk3R7QHNI5_js.j(y,"w","val");m&&(e.highlight=m);}let C=chunk3R7QHNI5_js.e(t,"w","shd");C&&(e.shading=W(C));let D=chunk3R7QHNI5_js.e(t,"w","sz");if(D){let m=chunk3R7QHNI5_js.l(D,"w","val");m!==void 0&&(e.fontSize=m);}let B=chunk3R7QHNI5_js.e(t,"w","szCs");if(B){let m=chunk3R7QHNI5_js.l(B,"w","val");m!==void 0&&(e.fontSizeCs=m);}let v=chunk3R7QHNI5_js.e(t,"w","rFonts");if(v){e.fontFamily={ascii:chunk3R7QHNI5_js.j(v,"w","ascii")??void 0,hAnsi:chunk3R7QHNI5_js.j(v,"w","hAnsi")??void 0,eastAsia:chunk3R7QHNI5_js.j(v,"w","eastAsia")??void 0,cs:chunk3R7QHNI5_js.j(v,"w","cs")??void 0};let m=chunk3R7QHNI5_js.j(v,"w","asciiTheme");m&&(e.fontFamily.asciiTheme=m,n&&!e.fontFamily.ascii&&(e.fontFamily.ascii=chunk6KYOT4E7_js.b(n,m)));let P=chunk3R7QHNI5_js.j(v,"w","hAnsiTheme");P&&(e.fontFamily.hAnsiTheme=P,n&&!e.fontFamily.hAnsi&&(e.fontFamily.hAnsi=chunk6KYOT4E7_js.b(n,P)));let I=chunk3R7QHNI5_js.j(v,"w","eastAsiaTheme");I&&(e.fontFamily.eastAsiaTheme=I,n&&!e.fontFamily.eastAsia&&(e.fontFamily.eastAsia=chunk6KYOT4E7_js.b(n,I)));let U=chunk3R7QHNI5_js.j(v,"w","cstheme");U&&(e.fontFamily.csTheme=U,n&&!e.fontFamily.cs&&(e.fontFamily.cs=chunk6KYOT4E7_js.b(n,U)));}let X=chunk3R7QHNI5_js.e(t,"w","spacing");if(X){let m=chunk3R7QHNI5_js.l(X,"w","val");m!==void 0&&(e.spacing=m);}let p=chunk3R7QHNI5_js.e(t,"w","position");if(p){let m=chunk3R7QHNI5_js.l(p,"w","val");m!==void 0&&(e.position=m);}let x=chunk3R7QHNI5_js.e(t,"w","w");if(x){let m=chunk3R7QHNI5_js.l(x,"w","val");m!==void 0&&(e.scale=m);}let F=chunk3R7QHNI5_js.e(t,"w","kern");if(F){let m=chunk3R7QHNI5_js.l(F,"w","val");m!==void 0&&(e.kerning=m);}let A=chunk3R7QHNI5_js.e(t,"w","effect");if(A){let m=chunk3R7QHNI5_js.j(A,"w","val");m&&(e.effect=m);}let k=chunk3R7QHNI5_js.e(t,"w","em");if(k){let m=chunk3R7QHNI5_js.j(k,"w","val");m&&(e.emphasisMark=m);}let M=chunk3R7QHNI5_js.e(t,"w","emboss");M&&(e.emboss=chunk3R7QHNI5_js.m(M));let R=chunk3R7QHNI5_js.e(t,"w","imprint");R&&(e.imprint=chunk3R7QHNI5_js.m(R));let V=chunk3R7QHNI5_js.e(t,"w","outline");V&&(e.outline=chunk3R7QHNI5_js.m(V));let L=chunk3R7QHNI5_js.e(t,"w","shadow");L&&(e.shadow=chunk3R7QHNI5_js.m(L));let N=chunk3R7QHNI5_js.e(t,"w","rtl");N&&(e.rtl=chunk3R7QHNI5_js.m(N));let H=chunk3R7QHNI5_js.e(t,"w","cs");H&&(e.cs=chunk3R7QHNI5_js.m(H));let _=chunk3R7QHNI5_js.e(t,"w","rStyle");if(_){let m=chunk3R7QHNI5_js.j(_,"w","val");m&&(e.styleId=m);}return Object.keys(e).length>0?e:void 0}function E(t){if(!t)return;let n=chunk3R7QHNI5_js.j(t,"w","val");if(!n)return;let e={style:n},o=chunk3R7QHNI5_js.j(t,"w","color"),i=chunk3R7QHNI5_js.j(t,"w","themeColor");(o||i)&&(e.color=Y(o,i,chunk3R7QHNI5_js.j(t,"w","themeTint"),chunk3R7QHNI5_js.j(t,"w","themeShade")));let r=chunk3R7QHNI5_js.l(t,"w","sz");r!==void 0&&(e.size=r);let a=chunk3R7QHNI5_js.l(t,"w","space");a!==void 0&&(e.space=a);let c=chunk3R7QHNI5_js.j(t,"w","shadow");c&&(e.shadow=c==="1"||c==="true");let g=chunk3R7QHNI5_js.j(t,"w","frame");return g&&(e.frame=g==="1"||g==="true"),e}function je(t){if(!t)return;let n=chunk3R7QHNI5_js.f(t,"w","tab");if(n.length===0)return;let e=[];for(let o of n){let i=chunk3R7QHNI5_js.l(o,"w","pos"),r=chunk3R7QHNI5_js.j(o,"w","val");if(i!==void 0&&r){let a={position:i,alignment:r},c=chunk3R7QHNI5_js.j(o,"w","leader");c&&(a.leader=c),e.push(a);}}return e.length>0?e:void 0}function K(t,n){if(!t)return;let e={},o=chunk3R7QHNI5_js.e(t,"w","jc");if(o){let p=chunk3R7QHNI5_js.j(o,"w","val");p&&(e.alignment=p);}let i=chunk3R7QHNI5_js.e(t,"w","bidi");i&&(e.bidi=chunk3R7QHNI5_js.m(i));let r=chunk3R7QHNI5_js.e(t,"w","spacing");if(r){let p=chunk3R7QHNI5_js.l(r,"w","before");p!==void 0&&(e.spaceBefore=p);let x=chunk3R7QHNI5_js.l(r,"w","after");x!==void 0&&(e.spaceAfter=x);let F=chunk3R7QHNI5_js.l(r,"w","line");F!==void 0&&(e.lineSpacing=F);let A=chunk3R7QHNI5_js.j(r,"w","lineRule");A&&(e.lineSpacingRule=A);let k=chunk3R7QHNI5_js.j(r,"w","beforeAutospacing");k&&(e.beforeAutospacing=k==="1"||k==="true");let M=chunk3R7QHNI5_js.j(r,"w","afterAutospacing");M&&(e.afterAutospacing=M==="1"||M==="true");}let a=chunk3R7QHNI5_js.e(t,"w","ind");if(a){let p=chunk3R7QHNI5_js.l(a,"w","left");p!==void 0&&(e.indentLeft=p);let x=chunk3R7QHNI5_js.l(a,"w","right");x!==void 0&&(e.indentRight=x);let F=chunk3R7QHNI5_js.l(a,"w","firstLine");F!==void 0&&(e.indentFirstLine=F);let A=chunk3R7QHNI5_js.l(a,"w","hanging");A!==void 0&&(e.indentFirstLine=-A,e.hangingIndent=true);}let c=chunk3R7QHNI5_js.e(t,"w","pBdr");if(c){let p={},x=E(chunk3R7QHNI5_js.e(c,"w","top"));x&&(p.top=x);let F=E(chunk3R7QHNI5_js.e(c,"w","bottom"));F&&(p.bottom=F);let A=E(chunk3R7QHNI5_js.e(c,"w","left"));A&&(p.left=A);let k=E(chunk3R7QHNI5_js.e(c,"w","right"));k&&(p.right=k);let M=E(chunk3R7QHNI5_js.e(c,"w","between"));M&&(p.between=M);let R=E(chunk3R7QHNI5_js.e(c,"w","bar"));R&&(p.bar=R),Object.keys(p).length>0&&(e.borders=p);}let g=chunk3R7QHNI5_js.e(t,"w","shd");g&&(e.shading=W(g));let d=chunk3R7QHNI5_js.e(t,"w","tabs");d&&(e.tabs=je(d));let h=chunk3R7QHNI5_js.e(t,"w","keepNext");h&&(e.keepNext=chunk3R7QHNI5_js.m(h));let b=chunk3R7QHNI5_js.e(t,"w","keepLines");b&&(e.keepLines=chunk3R7QHNI5_js.m(b));let u=chunk3R7QHNI5_js.e(t,"w","widowControl");u&&(e.widowControl=chunk3R7QHNI5_js.m(u));let S=chunk3R7QHNI5_js.e(t,"w","pageBreakBefore");S&&(e.pageBreakBefore=chunk3R7QHNI5_js.m(S));let f=chunk3R7QHNI5_js.e(t,"w","contextualSpacing");f&&(e.contextualSpacing=chunk3R7QHNI5_js.m(f));let y=chunk3R7QHNI5_js.e(t,"w","numPr");if(y){let p=chunk3R7QHNI5_js.e(y,"w","numId"),x=chunk3R7QHNI5_js.e(y,"w","ilvl");if(p||x){if(e.numPr={},p){let F=chunk3R7QHNI5_js.l(p,"w","val");F!==void 0&&(e.numPr.numId=F);}if(x){let F=chunk3R7QHNI5_js.l(x,"w","val");F!==void 0&&(e.numPr.ilvl=F);}}}let C=chunk3R7QHNI5_js.e(t,"w","outlineLvl");if(C){let p=chunk3R7QHNI5_js.l(C,"w","val");p!==void 0&&(e.outlineLevel=p);}let D=chunk3R7QHNI5_js.e(t,"w","pStyle");if(D){let p=chunk3R7QHNI5_js.j(D,"w","val");p&&(e.styleId=p);}let B=chunk3R7QHNI5_js.e(t,"w","suppressLineNumbers");B&&(e.suppressLineNumbers=chunk3R7QHNI5_js.m(B));let v=chunk3R7QHNI5_js.e(t,"w","suppressAutoHyphens");v&&(e.suppressAutoHyphens=chunk3R7QHNI5_js.m(v));let X=chunk3R7QHNI5_js.e(t,"w","rPr");return X&&(e.runProperties=$(X,n)),Object.keys(e).length>0?e:void 0}function j(t){if(!t)return;let n=chunk3R7QHNI5_js.l(t,"w","w"),e=chunk3R7QHNI5_js.j(t,"w","type");if(n!==void 0&&e)return {value:n,type:e}}function De(t){if(!t)return;let n={},e=E(chunk3R7QHNI5_js.e(t,"w","top"));e&&(n.top=e);let o=E(chunk3R7QHNI5_js.e(t,"w","bottom"));o&&(n.bottom=o);let i=E(chunk3R7QHNI5_js.e(t,"w","left"));i&&(n.left=i);let r=E(chunk3R7QHNI5_js.e(t,"w","right"));r&&(n.right=r);let a=E(chunk3R7QHNI5_js.e(t,"w","insideH"));a&&(n.insideH=a);let c=E(chunk3R7QHNI5_js.e(t,"w","insideV"));return c&&(n.insideV=c),Object.keys(n).length>0?n:void 0}function Ae(t){if(!t)return;let n={},e=j(chunk3R7QHNI5_js.e(t,"w","top"));e&&(n.top=e);let o=j(chunk3R7QHNI5_js.e(t,"w","bottom"));o&&(n.bottom=o);let i=j(chunk3R7QHNI5_js.e(t,"w","left"));i&&(n.left=i);let r=j(chunk3R7QHNI5_js.e(t,"w","right"));return r&&(n.right=r),Object.keys(n).length>0?n:void 0}function Le(t){if(!t)return;let n={},e=chunk3R7QHNI5_js.j(t,"w","val");if(e){let d=parseInt(e,16);isNaN(d)||(n.firstRow=(d&32)!==0,n.lastRow=(d&64)!==0,n.firstColumn=(d&128)!==0,n.lastColumn=(d&256)!==0,n.noHBand=(d&512)!==0,n.noVBand=(d&1024)!==0);}let o=chunk3R7QHNI5_js.j(t,"w","firstColumn");o&&(n.firstColumn=o==="1");let i=chunk3R7QHNI5_js.j(t,"w","firstRow");i&&(n.firstRow=i==="1");let r=chunk3R7QHNI5_js.j(t,"w","lastColumn");r&&(n.lastColumn=r==="1");let a=chunk3R7QHNI5_js.j(t,"w","lastRow");a&&(n.lastRow=a==="1");let c=chunk3R7QHNI5_js.j(t,"w","noHBand");c&&(n.noHBand=c==="1");let g=chunk3R7QHNI5_js.j(t,"w","noVBand");return g&&(n.noVBand=g==="1"),Object.keys(n).length>0?n:void 0}function le(t,n){if(!t)return;let e={},o=chunk3R7QHNI5_js.e(t,"w","tblW");o&&(e.width=j(o));let i=chunk3R7QHNI5_js.e(t,"w","jc");if(i){let f=chunk3R7QHNI5_js.j(i,"w","val");(f==="left"||f==="center"||f==="right")&&(e.justification=f);}let r=chunk3R7QHNI5_js.e(t,"w","tblCellSpacing");r&&(e.cellSpacing=j(r));let a=chunk3R7QHNI5_js.e(t,"w","tblInd");a&&(e.indent=j(a));let c=chunk3R7QHNI5_js.e(t,"w","tblBorders");c&&(e.borders=De(c));let g=chunk3R7QHNI5_js.e(t,"w","tblCellMar");g&&(e.cellMargins=Ae(g));let d=chunk3R7QHNI5_js.e(t,"w","tblLayout");if(d){let f=chunk3R7QHNI5_js.j(d,"w","type");(f==="fixed"||f==="autofit")&&(e.layout=f);}let h=chunk3R7QHNI5_js.e(t,"w","tblStyle");if(h){let f=chunk3R7QHNI5_js.j(h,"w","val");f&&(e.styleId=f);}let b=chunk3R7QHNI5_js.e(t,"w","tblLook");b&&(e.look=Le(b));let u=chunk3R7QHNI5_js.e(t,"w","shd");u&&(e.shading=W(u));let S=chunk3R7QHNI5_js.e(t,"w","bidiVisual");return S&&(e.bidi=chunk3R7QHNI5_js.m(S)),Object.keys(e).length>0?e:void 0}function ce(t){if(!t)return;let n={},e=chunk3R7QHNI5_js.e(t,"w","trHeight");if(e){n.height=j(e);let c=chunk3R7QHNI5_js.j(e,"w","hRule");c&&(n.heightRule=c);}let o=chunk3R7QHNI5_js.e(t,"w","tblHeader");o&&(n.header=chunk3R7QHNI5_js.m(o));let i=chunk3R7QHNI5_js.e(t,"w","cantSplit");i&&(n.cantSplit=chunk3R7QHNI5_js.m(i));let r=chunk3R7QHNI5_js.e(t,"w","jc");if(r){let c=chunk3R7QHNI5_js.j(r,"w","val");(c==="left"||c==="center"||c==="right")&&(n.justification=c);}let a=chunk3R7QHNI5_js.e(t,"w","hidden");return a&&(n.hidden=chunk3R7QHNI5_js.m(a)),Object.keys(n).length>0?n:void 0}function fe(t,n){if(!t)return;let e={},o=chunk3R7QHNI5_js.e(t,"w","tcW");o&&(e.width=j(o));let i=chunk3R7QHNI5_js.e(t,"w","tcBorders");i&&(e.borders=De(i));let r=chunk3R7QHNI5_js.e(t,"w","tcMar");r&&(e.margins=Ae(r));let a=chunk3R7QHNI5_js.e(t,"w","shd");a&&(e.shading=W(a));let c=chunk3R7QHNI5_js.e(t,"w","vAlign");if(c){let f=chunk3R7QHNI5_js.j(c,"w","val");(f==="top"||f==="center"||f==="bottom")&&(e.verticalAlign=f);}let g=chunk3R7QHNI5_js.e(t,"w","textDirection");if(g){let f=chunk3R7QHNI5_js.j(g,"w","val");f&&(e.textDirection=f);}let d=chunk3R7QHNI5_js.e(t,"w","gridSpan");if(d){let f=chunk3R7QHNI5_js.l(d,"w","val");f!==void 0&&(e.gridSpan=f);}let h=chunk3R7QHNI5_js.e(t,"w","vMerge");if(h){let f=chunk3R7QHNI5_js.j(h,"w","val");e.vMerge=f==="restart"?"restart":"continue";}let b=chunk3R7QHNI5_js.e(t,"w","tcFitText");b&&(e.fitText=chunk3R7QHNI5_js.m(b));let u=chunk3R7QHNI5_js.e(t,"w","noWrap");u&&(e.noWrap=chunk3R7QHNI5_js.m(u));let S=chunk3R7QHNI5_js.e(t,"w","hideMark");return S&&(e.hideMark=chunk3R7QHNI5_js.m(S)),Object.keys(e).length>0?e:void 0}function Ue(t,n){let e={styleId:chunk3R7QHNI5_js.j(t,"w","styleId")??"",type:chunk3R7QHNI5_js.j(t,"w","type")??"paragraph"},o=chunk3R7QHNI5_js.j(t,"w","default");o&&(e.default=o==="1"||o==="true");let i=chunk3R7QHNI5_js.e(t,"w","name");i&&(e.name=chunk3R7QHNI5_js.j(i,"w","val")??void 0);let r=chunk3R7QHNI5_js.e(t,"w","basedOn");r&&(e.basedOn=chunk3R7QHNI5_js.j(r,"w","val")??void 0);let a=chunk3R7QHNI5_js.e(t,"w","next");a&&(e.next=chunk3R7QHNI5_js.j(a,"w","val")??void 0);let c=chunk3R7QHNI5_js.e(t,"w","link");c&&(e.link=chunk3R7QHNI5_js.j(c,"w","val")??void 0);let g=chunk3R7QHNI5_js.e(t,"w","uiPriority");if(g){let X=chunk3R7QHNI5_js.l(g,"w","val");X!==void 0&&(e.uiPriority=X);}let d=chunk3R7QHNI5_js.e(t,"w","hidden");d&&(e.hidden=chunk3R7QHNI5_js.m(d));let h=chunk3R7QHNI5_js.e(t,"w","semiHidden");h&&(e.semiHidden=chunk3R7QHNI5_js.m(h));let b=chunk3R7QHNI5_js.e(t,"w","unhideWhenUsed");b&&(e.unhideWhenUsed=chunk3R7QHNI5_js.m(b));let u=chunk3R7QHNI5_js.e(t,"w","qFormat");u&&(e.qFormat=chunk3R7QHNI5_js.m(u));let S=chunk3R7QHNI5_js.e(t,"w","personal");S&&(e.personal=chunk3R7QHNI5_js.m(S));let f=chunk3R7QHNI5_js.e(t,"w","pPr");f&&(e.pPr=K(f,n));let y=chunk3R7QHNI5_js.e(t,"w","rPr");y&&(e.rPr=$(y,n));let C=chunk3R7QHNI5_js.e(t,"w","tblPr");C&&(e.tblPr=le(C));let D=chunk3R7QHNI5_js.e(t,"w","trPr");D&&(e.trPr=ce(D));let B=chunk3R7QHNI5_js.e(t,"w","tcPr");B&&(e.tcPr=fe(B));let v=chunk3R7QHNI5_js.f(t,"w","tblStylePr");if(v.length>0){e.tblStylePr=[];for(let X of v){let p=chunk3R7QHNI5_js.j(X,"w","type");if(p){let x={type:p},F=chunk3R7QHNI5_js.e(X,"w","pPr");F&&(x.pPr=K(F,n));let A=chunk3R7QHNI5_js.e(X,"w","rPr");A&&(x.rPr=$(A,n));let k=chunk3R7QHNI5_js.e(X,"w","tblPr");k&&(x.tblPr=le(k));let M=chunk3R7QHNI5_js.e(X,"w","trPr");M&&(x.trPr=ce(M));let R=chunk3R7QHNI5_js.e(X,"w","tcPr");R&&(x.tcPr=fe(R)),e.tblStylePr.push(x);}}}return e}function Oe(t,n){if(!t)return;let e={},o=chunk3R7QHNI5_js.e(t,"w","rPrDefault");if(o){let r=chunk3R7QHNI5_js.e(o,"w","rPr");r&&(e.rPr=$(r,n));}let i=chunk3R7QHNI5_js.e(t,"w","pPrDefault");if(i){let r=chunk3R7QHNI5_js.e(i,"w","pPr");r&&(e.pPr=K(r,n));}return e.rPr||e.pPr?e:void 0}function ze(t,n){if(!n)return t;if(!t)return n?{...n}:void 0;let e={...t};for(let o of Object.keys(n)){let i=n[o];if(i!==void 0)if(o==="runProperties")e.runProperties=chunkGSKMHXHG_js.b(e.runProperties,n.runProperties);else if(o==="borders"||o==="numPr"||o==="frame"){let r=e[o],a=i;e[o]={...r||{},...a||{}};}else o==="tabs"&&Array.isArray(i)?e.tabs=[...i]:e[o]=i;}return e}function Be(t,n,e,o=new Set){if(o.has(t.styleId)||(o.add(t.styleId),!t.basedOn))return t;let i=n.get(t.basedOn);if(!i)return t;let r=Be(i,n,e,o),a={...t,pPr:ze(r.pPr,t.pPr),rPr:chunkGSKMHXHG_js.b(r.rPr,t.rPr)};return t.type==="table"&&((r.tblPr||t.tblPr)&&(a.tblPr={...r.tblPr||{},...t.tblPr||{}}),(r.trPr||t.trPr)&&(a.trPr={...r.trPr||{},...t.trPr||{}}),(r.tcPr||t.tcPr)&&(a.tcPr={...r.tcPr||{},...t.tcPr||{}})),a}function ue(t,n){let e=new Map;try{let o=chunk3R7QHNI5_js.c(t);if(!o)return e;let i=chunk3R7QHNI5_js.f(o,"w","style");for(let r of i){let a=Ue(r,n);a.styleId&&e.set(a.styleId,a);}for(let[r,a]of e){let c=Be(a,e,n);e.set(r,c);}}catch(o){console.warn("Failed to parse styles:",o);}return e}function ke(t,n){let e={styles:[]};try{let o=chunk3R7QHNI5_js.c(t);if(!o)return e;let i=chunk3R7QHNI5_js.e(o,"w","docDefaults");e.docDefaults=Oe(i,n);let r=chunk3R7QHNI5_js.e(o,"w","latentStyles");r&&(e.latentStyles={defLockedState:chunk3R7QHNI5_js.j(r,"w","defLockedState")==="1",defUIPriority:chunk3R7QHNI5_js.l(r,"w","defUIPriority"),defSemiHidden:chunk3R7QHNI5_js.j(r,"w","defSemiHidden")==="1",defUnhideWhenUsed:chunk3R7QHNI5_js.j(r,"w","defUnhideWhenUsed")==="1",defQFormat:chunk3R7QHNI5_js.j(r,"w","defQFormat")==="1",count:chunk3R7QHNI5_js.l(r,"w","count")});let a=ue(t,n);e.styles=Array.from(a.values());}catch(o){console.warn("Failed to parse style definitions:",o);}return e}var Ie=/\{([a-zA-Z_][a-zA-Z0-9_\-\.]*)\}/g;function Re(t){let n=[],e;for(Ie.lastIndex=0;(e=Ie.exec(t))!==null;){let o=e[1].trim();o&&!n.includes(o)&&n.push(o);}return n}function ee(t){let n=[];for(let e of t)if(e.type==="paragraph"){let o=chunk6KYOT4E7_js.N(e),i=Re(o);for(let r of i)n.includes(r)||n.push(r);}else if(e.type==="table"){let o=Ee(e);for(let i of o)n.includes(i)||n.push(i);}return n}function Ee(t){let n=[];for(let e of t.rows)for(let o of e.cells)for(let i of o.content)if(i.type==="paragraph"){let r=chunk6KYOT4E7_js.N(i),a=Re(r);for(let c of a)n.includes(c)||n.push(c);}else if(i.type==="table"){let r=Ee(i);for(let a of r)n.includes(a)||n.push(a);}return n}function We(t,n){let e=[],o=[];for(let i of t)o.push(i),i.type==="paragraph"&&i.sectionProperties&&(e.push({properties:i.sectionProperties,content:o}),o=[]);return (o.length>0||e.length===0)&&e.push({properties:n??chunk6KYOT4E7_js.C(),content:o}),e}function te(t,n=null,e=null,o=null,i=null,r=null){let a={content:[]};if(!t)return a;let c=chunk3R7QHNI5_js.a(t);if(!c)return a;let g=(c.elements??[]).find(u=>u.type==="element"&&(u.name==="w:document"||u.name?.endsWith(":document")));if(!g)return a;let d=chunk3R7QHNI5_js.e(g,"w","body");if(!d)return a;a.content=chunk6KYOT4E7_js.q(d,n,e,o,i,r);let h=chunk3R7QHNI5_js.e(d,"w","sectPr");h&&(a.finalSectionProperties=chunk6KYOT4E7_js.B(h,i));let b=We(a.content,a.finalSectionProperties);return a.sections=chunk6KYOT4E7_js.D(b),a.finalSectionProperties&&a.sections.length>0&&(a.finalSectionProperties=a.sections[a.sections.length-1].properties),a}function $e(t){let n=new Map,e=chunk3R7QHNI5_js.a(t);if(!e)return n;let o=chunk3R7QHNI5_js.e(e,"w16cex","commentsExtensible")??e;for(let i of chunk3R7QHNI5_js.i(o)){if((i.name?.replace(/^.*:/,"")??"")!=="comment")continue;let a=chunk3R7QHNI5_js.j(i,"w16cex","paraId")??chunk3R7QHNI5_js.j(i,"w15","paraId")??i.attributes?.["w16cex:paraId"]??i.attributes?.["w15:paraId"],c=chunk3R7QHNI5_js.j(i,"w16cex","dateUtc")??chunk3R7QHNI5_js.j(i,"w15","dateUtc")??i.attributes?.["w16cex:dateUtc"]??i.attributes?.["w15:dateUtc"];a&&c&&n.set(String(a).toUpperCase(),String(c));}return n}function _e(t){let n=new Map,e=new Map,o=chunk3R7QHNI5_js.a(t);if(!o)return {parentByParaId:n,doneByParaId:e};let i=chunk3R7QHNI5_js.e(o,"w15","commentsEx")??o;for(let r of chunk3R7QHNI5_js.i(i)){if((r.name?.replace(/^.*:/,"")??"")!=="commentEx")continue;let c=chunk3R7QHNI5_js.j(r,"w15","paraId")??r.attributes?.["w15:paraId"],g=chunk3R7QHNI5_js.j(r,"w15","paraIdParent")??r.attributes?.["w15:paraIdParent"],d=chunk3R7QHNI5_js.j(r,"w15","done")??r.attributes?.["w15:done"];if(c){let h=String(c).toUpperCase();g&&n.set(h,String(g).toUpperCase()),d==="1"&&e.set(h,true);}}return {parentByParaId:n,doneByParaId:e}}function Ne(t,n,e,o,i,r,a){if(!t)return [];let c=chunk3R7QHNI5_js.a(t);if(!c)return [];let g=r?$e(r):new Map,d=a?_e(a):null,h=chunk3R7QHNI5_js.e(c,"w","comments")??c,b=chunk3R7QHNI5_js.i(h),u=[],S=[];for(let f of b){if((f.name?.replace(/^.*:/,"")??"")!=="comment")continue;let C=parseInt(chunk3R7QHNI5_js.j(f,"w","id")??"0",10),D=chunk3R7QHNI5_js.j(f,"w","author")??"Unknown",B=chunk3R7QHNI5_js.j(f,"w","initials"),v=B!=null?String(B):void 0,X=chunk3R7QHNI5_js.j(f,"w","date"),p=X!=null?String(X):void 0,x=chunk3R7QHNI5_js.j(f,"w14","paraId")??f.attributes?.["w14:paraId"]??chunk3R7QHNI5_js.j(f,"w","paraId"),A=(x?g.get(String(x).toUpperCase()):void 0)??p,k=chunk3R7QHNI5_js.j(f,"w","done")??f.attributes?.["w:done"],M=k==="1"||k==="true"?true:void 0,R=chunk3R7QHNI5_js.j(f,"w16cid","parentId")??chunk3R7QHNI5_js.j(f,"w","parentId")??f.attributes?.["w16cid:parentId"]??f.attributes?.["w:parentId"],V=R!=null?parseInt(String(R),10):void 0,L=[],N="";for(let H of chunk3R7QHNI5_js.i(f))if((H.name?.replace(/^.*:/,"")??"")==="p"){let m=chunk6KYOT4E7_js.O(H,n,e,null,o,i);L.push(m);let P=chunk3R7QHNI5_js.j(H,"w14","paraId")??H.attributes?.["w14:paraId"];P&&(N=String(P).toUpperCase());}M==null&&d&&N&&d.doneByParaId.get(N)&&(M=true),S.push(N),u.push({id:C,author:D,initials:v,date:A,content:L,...M!=null?{done:M}:{},...V!=null&&!isNaN(V)?{parentId:V}:{}});}if(d&&d.parentByParaId.size>0){let f=new Map;for(let y=0;y<u.length;y++){let C=S[y];C&&f.set(C,u[y].id);}for(let y=0;y<u.length;y++){if(u[y].parentId!=null)continue;let C=S[y];if(!C)continue;let D=d.parentByParaId.get(C);if(!D)continue;let B=f.get(D);B!=null&&(u[y]={...u[y],parentId:B});}}return u}async function Ve(t,n={}){let e=t instanceof ArrayBuffer?t:await chunkQVRMX2AC_js.u(t),{onProgress:o=()=>{},preloadFonts:i=true,parseHeadersFooters:r=true,parseNotes:a=true,detectVariables:c=true}=n,g=[];try{let u=function(P,I){let U=performance.now(),oe=I(),O=performance.now()-U;return b.push({stage:P,ms:O}),O>1e3&&console.warn(`[parseDocx] ${P} took ${Math.round(O)}ms`),oe};var d=u;let h=performance.now(),b=[];async function S(P,I){let U=performance.now(),oe=await I(),O=performance.now()-U;return b.push({stage:P,ms:O}),O>1e3&&console.warn(`[parseDocx] ${P} took ${Math.round(O)}ms`),oe}o("Extracting DOCX...",0);let f=await S("unzip",()=>G(e));o("Extracted DOCX",10),o("Parsing relationships...",10);let y=u("relationships",()=>f.documentRels?chunkZ3LGMBJC_js.b(f.documentRels):new Map);o("Parsed relationships",15),o("Parsing theme...",15);let C=u("theme",()=>chunk6KYOT4E7_js.a(f.themeXml));o("Parsed theme",20),o("Parsing styles...",20);let D=null,B;u("styles",()=>{f.stylesXml&&(D=ue(f.stylesXml,C),B=ke(f.stylesXml,C));}),o("Parsed styles",30),o("Parsing numbering...",30);let v=u("numbering",()=>chunkH57LNDBH_js.a(f.numberingXml)),X=u("settings",()=>chunkFIGLFSNR_js.b(f.settingsXml));o("Parsed numbering",35),o("Processing media files...",35);let p=u("media",()=>Ze(f,y));o("Processed media",40),o("Parsing document body...",40);let x={content:[]};u("documentBody",()=>{f.documentXml?x=te(f.documentXml,D,C,v,y,p):g.push("No document.xml found in DOCX");}),o("Parsed document body",55);let F,A;if(r){o("Parsing headers/footers...",55);let P=u("headersFooters",()=>qe(f,D,C,v,y,p));F=P.headers,A=P.footers,o("Parsed headers/footers",65);}else o("Skipping headers/footers",65);let k,M,R,V;if(a){o("Parsing footnotes/endnotes...",65);let P=u("footnotesEndnotes",()=>Je(f,D,C,v,y,p));k=P.footnotes,M=P.endnotes,R=P.footnoteSeparators,V=P.endnoteSeparators,o("Parsed footnotes/endnotes",75);}else o("Skipping footnotes/endnotes",75);o("Parsing comments...",75);let L=u("comments",()=>Ne(f.commentsXml,D,C,y,p,f.commentsExtensibleXml,f.commentsExtendedXml));L.length>0&&(x.comments=L);let N;c?(o("Detecting template variables...",75),N=u("variables",()=>ee(x.content)),o("Detected variables",80)):o("Skipping variable detection",80),i?(o("Loading fonts...",80),await S("fonts",()=>Qe(C,B,x)),o("Loaded fonts",95)):o("Skipping font loading",95),o("Assembling document...",95);let _={package:{document:x,styles:B,theme:C,numbering:v.definitions,settings:X,headers:F,footers:A,footnotes:k,endnotes:M,footnoteSeparators:R,endnoteSeparators:V,relationships:y,media:p},originalBuffer:e,templateVariables:N,warnings:g.length>0?g:void 0},m=performance.now()-h;if(m>2e3){let P=b.filter(I=>I.ms>100).map(I=>`${I.stage}: ${Math.round(I.ms)}ms`).join(", ");console.warn(`[parseDocx] Total: ${Math.round(m)}ms`+(P?` (${P})`:""));}return o("Complete",100),_}catch(h){let b=h instanceof Error?h.message:String(h);throw console.error("[parseDocx] Failed to parse DOCX:",b,h),new Error(`Failed to parse DOCX: ${b}`)}}function Ze(t,n){let e=new Map;for(let[o,i]of t.media.entries()){let r=o.split("/").pop()||o,a=Me(o),c=new Uint8Array(i),g="";for(let S=0;S<c.length;S++)g+=String.fromCharCode(c[S]);let d=btoa(g),h=`data:${a};base64,${d}`,b={path:o,filename:r,mimeType:a,data:i,dataUrl:h};e.set(o,b);let u=o.replace(/^word\//,"");u!==o&&e.set(u,b);}return e}function ne(t,n){let e=n.toLowerCase();for(let[o,i]of t.entries())if(o.toLowerCase()===e)return i}function qe(t,n,e,o,i,r){let a=new Map,c=new Map;for(let[g,d]of i.entries())if(d.type===chunkZ3LGMBJC_js.a.header&&d.target){let h=d.target.split("/").pop()||d.target,b=ne(t.headers,h);if(b){let u=`word/_rels/${h}.rels`,S=ne(t.allXml,u),f=S?chunkZ3LGMBJC_js.b(S):i,y=chunk6KYOT4E7_js.r(b,"default",n,e,o,f,r);a.set(g,y);}}else if(d.type===chunkZ3LGMBJC_js.a.footer&&d.target){let h=d.target.split("/").pop()||d.target,b=ne(t.footers,h);if(b){let u=`word/_rels/${h}.rels`,S=ne(t.allXml,u),f=S?chunkZ3LGMBJC_js.b(S):i,y=chunk6KYOT4E7_js.s(b,"default",n,e,o,f,r);c.set(g,y);}}return {headers:a,footers:c}}function Je(t,n,e,o,i,r){let a=chunk6KYOT4E7_js.t(t.footnotesXml,n,e,o,i,r),c=chunk6KYOT4E7_js.u(t.endnotesXml,n,e,o,i,r);return {footnotes:a.getNormalFootnotes(),endnotes:c.getNormalEndnotes(),footnoteSeparators:a.footnotes.filter(chunk6KYOT4E7_js.z),endnoteSeparators:c.endnotes.filter(chunk6KYOT4E7_js.A)}}async function Qe(t,n,e){let o=new Set;if(t?.fontScheme){let{majorFont:i,minorFont:r}=t.fontScheme;i?.latin&&o.add(i.latin),r?.latin&&o.add(r.latin);}if(n?.docDefaults?.rPr?.fontFamily?.ascii&&o.add(n.docDefaults.rPr.fontFamily.ascii),n?.styles)for(let i of n.styles)i.rPr?.fontFamily?.ascii&&o.add(i.rPr.fontFamily.ascii),i.rPr?.fontFamily?.hAnsi&&o.add(i.rPr.fontFamily.hAnsi);if(e.content){for(let i of e.content)if(i.type==="paragraph")for(let r of i.content)r.type==="run"&&r.formatting?.fontFamily&&(r.formatting.fontFamily.ascii&&o.add(r.formatting.fontFamily.ascii),r.formatting.fontFamily.hAnsi&&o.add(r.formatting.fontFamily.hAnsi));}if(o.size>0)try{await chunkQVRMX2AC_js.q(Array.from(o));}catch(i){console.warn("Failed to load some fonts:",i);}}async function Et(t){return Ve(t,{preloadFonts:false,parseHeadersFooters:false,parseNotes:false,detectVariables:true})}async function Nt(t,n){return Ve(t,{onProgress:n,preloadFonts:true,parseHeadersFooters:true,parseNotes:true,detectVariables:true})}async function Vt(t){let n=await G(t);if(!n.documentXml)return [];let e=te(n.documentXml);return ee(e.content)}async function Ht(t){let n=await G(t),e=n.documentXml?ee(te(n.documentXml).content):[];return {hasDocument:n.documentXml!==null,hasStyles:n.stylesXml!==null,hasTheme:n.themeXml!==null,hasNumbering:n.numberingXml!==null,headerCount:n.headers.size,footerCount:n.footers.size,mediaCount:n.media.size,variableCount:e.length}}
|
|
2
|
+
exports.a=Ve;exports.b=Et;exports.c=Nt;exports.d=Vt;exports.e=Ht;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var B={entries:[],commentToRevision:new Map};function O(S){if(!S)return B;let{doc:K,schema:v}=S,b=v.marks.insertion,g=v.marks.deletion,w=v.marks.comment;if(!b&&!g)return B;let d=[],C=new Map;K.descendants((e,t)=>{if(e.type.name==="paragraph"){let r=e.attrs.pPrIns,i=e.attrs.pPrDel;r&&d.push({type:"paragraphMarkInsertion",text:e.textContent||"",author:r.author||"",date:r.date??void 0,from:t,to:t+e.nodeSize,revisionId:r.revisionId}),i&&d.push({type:"paragraphMarkDeletion",text:e.textContent||"",author:i.author||"",date:i.date??void 0,from:t,to:t+e.nodeSize,revisionId:i.revisionId});let o=e.attrs.pPrChange;if(Array.isArray(o))for(let a of o)d.push({type:"paragraphPropertiesChanged",text:e.textContent||"",author:a.info.author||"",date:a.info.date??void 0,from:t,to:t+e.nodeSize,revisionId:a.info.id});}if(e.type.name==="tableRow"){let r=e.attrs.trIns,i=e.attrs.trDel;r&&d.push({type:"rowInserted",text:e.textContent||"",author:r.author||"",date:r.date??void 0,from:t,to:t+e.nodeSize,revisionId:r.revisionId}),i&&d.push({type:"rowDeleted",text:e.textContent||"",author:i.author||"",date:i.date??void 0,from:t,to:t+e.nodeSize,revisionId:i.revisionId});let o=e.attrs.trPrChange;if(Array.isArray(o))for(let a of o)!a?.info||typeof a.info.id!="number"||d.push({type:"rowPropertiesChanged",text:e.textContent||"",author:a.info.author||"",date:a.info.date??void 0,from:t,to:t+e.nodeSize,revisionId:a.info.id});}if(e.type.name==="tableCell"||e.type.name==="tableHeader"){let r=e.attrs.cellMarker;if(r?.info&&typeof r.info.revisionId=="number"){let a={ins:"cellInserted",del:"cellDeleted",merge:"cellMerged"}[r.kind];a&&d.push({type:a,text:e.textContent||"",author:r.info.author||"",date:r.info.date??void 0,from:t,to:t+e.nodeSize,revisionId:r.info.revisionId});}let i=e.attrs.tcPrChange;if(Array.isArray(i))for(let o of i)!o?.info||typeof o.info.id!="number"||d.push({type:"cellPropertiesChanged",text:e.textContent||"",author:o.info.author||"",date:o.info.date??void 0,from:t,to:t+e.nodeSize,revisionId:o.info.id});}if(e.type.name==="table"){let r=e.attrs.tblPrChange;if(Array.isArray(r))for(let l of r)!l?.info||typeof l.info.id!="number"||d.push({type:"tablePropertiesChanged",text:"",author:l.info.author||"",date:l.info.date??void 0,from:t,to:t+e.nodeSize,revisionId:l.info.id});let i=e.firstChild,o=i?.attrs.trIns,a=i?.attrs.trDel,x=o?"trIns":a?"trDel":null;if(x){let l=o??a,R=true,M=[];if(e.forEach(p=>{if(p.type.name!=="tableRow"){R=false;return}let c=p.attrs[x];if(!c||(c.author??"")!==(l.author??"")||(c.date??null)!==(l.date??null)){R=false;return}M.push(c.revisionId);}),R){let p="";g?e.descendants(h=>{h.isText&&!h.marks.some(P=>P.type===g)&&(p+=h.text||"");}):p=e.textContent||"";let c=l.revisionId,A=M.filter((h,P)=>h!==c&&M.indexOf(h)===P);d.push({type:x==="trIns"?"tableInserted":"tableDeleted",text:p,author:l.author||"",date:l.date??void 0,from:t,to:t+e.nodeSize,revisionId:c,...A.length>0?{coalescedRevisionIds:A}:{}});}}}if(!e.isInline)return;let n=e.isText?e.text||"":e.type.name==="image"?e.attrs.alt||"image":e.type.name,s=null;for(let r of e.marks)(r.type===b||r.type===g)&&(d.push({type:r.type===b?"insertion":"deletion",text:n,author:r.attrs.author||"",date:r.attrs.date,from:t,to:t+e.nodeSize,revisionId:r.attrs.revisionId}),s=r);if(w&&s){let r=e.marks.find(i=>i.type===w);if(r){let i=r.attrs.commentId,o=s.attrs.revisionId;C.has(i)||C.set(i,o);}}});let k={tableInserted:6,tableDeleted:6,tablePropertiesChanged:5,rowInserted:4,rowDeleted:4,rowPropertiesChanged:4,cellInserted:3,cellDeleted:3,cellMerged:3,cellPropertiesChanged:3,paragraphMarkInsertion:2,paragraphMarkDeletion:2,paragraphPropertiesChanged:2},U=e=>e in k,E=new Map,f=[],T=(e,t)=>{let n=new Set(e.coalescedRevisionIds??[]);for(let s of t.coalescedRevisionIds??[])n.add(s);return n.add(t.revisionId),n.delete(e.revisionId),[...n]};for(let e of d){if(!U(e.type)){f.push(e);continue}let t=`${e.author}|${e.date??""}`,n=E.get(t);if(n===void 0){E.set(t,f.push(e)-1);continue}let s=f[n],r=k[e.type]??0,i=k[s.type]??0;r>i?f[n]={...e,coalescedRevisionIds:T(e,s)}:f[n]={...s,coalescedRevisionIds:T(s,e)};}let D=new Map,y=[];for(let e of f){if(!(e.type==="insertion"||e.type==="deletion")){y.push({...e});continue}let n=`${e.type}|${e.author}|${e.date??""}`,s=D.get(n);if(s){let r=s.to===e.from?"":" ";if(s.text+=r+e.text,s.to=e.to,e.revisionId!==s.revisionId){let i=new Set(s.coalescedRevisionIds??[]);for(let o of e.coalescedRevisionIds??[])i.add(o);i.add(e.revisionId),i.delete(s.revisionId),s.coalescedRevisionIds=i.size>0?[...i]:void 0;}}else {let r={...e};D.set(n,r),y.push(r);}}let u=[];for(let e=0;e<y.length;e++){let t=y[e],n=y[e+1];t.type==="deletion"&&n&&n.type==="insertion"&&t.author===n.author&&t.date===n.date&&t.to===n.from?(u.push({type:"replacement",text:n.text,deletedText:t.text,author:t.author,date:t.date,from:t.from,to:n.to,revisionId:t.revisionId,insertionRevisionId:n.revisionId}),e++):u.push(t);}let I=new Map;for(let e of u)if(e.type==="insertion"||e.type==="deletion"||e.type==="replacement"){let t=`${e.author}|${e.date??""}`;I.has(t)||I.set(t,e);}for(let e of u){if(e.type!=="paragraphMarkInsertion"&&e.type!=="paragraphMarkDeletion")continue;let t=I.get(`${e.author}|${e.date??""}`);if(!t)continue;let n=new Set(t.coalescedRevisionIds??[]);for(let s of e.coalescedRevisionIds??[])n.add(s);n.add(e.revisionId),n.delete(t.revisionId),t.type==="replacement"&&t.insertionRevisionId!=null&&n.delete(t.insertionRevisionId),t.coalescedRevisionIds=n.size>0?[...n]:void 0;}let z=new Set,m=new Map;for(let e of u){if(e.type!=="tableInserted"&&e.type!=="tableDeleted")continue;let t=`${e.author}|${e.date??""}`;e.text.trim().length>0||(z.add(e),m.has(t)||m.set(t,e));}for(let e of u){if(e.type!=="paragraphMarkInsertion"&&e.type!=="paragraphMarkDeletion")continue;let t=m.get(`${e.author}|${e.date??""}`);if(!t)continue;let n=new Set(t.coalescedRevisionIds??[]);for(let s of e.coalescedRevisionIds??[])n.add(s);n.add(e.revisionId),n.delete(t.revisionId),t.coalescedRevisionIds=n.size>0?[...n]:void 0;}let H=u.filter(e=>e.type==="insertion"||e.type==="replacement"),$=new Set;for(let e of u){if(e.type!=="paragraphPropertiesChanged")continue;let t=H.find(s=>s.author===e.author&&s.from<e.to&&e.from<s.to);if(!t)continue;let n=new Set(T(t,e));t.type==="replacement"&&t.insertionRevisionId!=null&&n.delete(t.insertionRevisionId),t.coalescedRevisionIds=n.size>0?[...n]:void 0,$.add(e);}return {entries:u.filter(e=>{let t=`${e.author}|${e.date??""}`;return e.type==="tableInserted"||e.type==="tableDeleted"?z.has(e):e.type==="paragraphMarkInsertion"||e.type==="paragraphMarkDeletion"?!I.has(t)&&!m.has(t):e.type==="paragraphPropertiesChanged"?!$.has(e):e.type==="insertion"||e.type==="deletion"||e.type==="replacement"?!m.has(t):true}),commentToRevision:C}}export{O as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {c,f,j as j$1,e,m,l}from'./chunk-3ANZ3252.mjs';function z(e){let n={abstractNums:[],nums:[]};if(!e)return F(n);let r=c(e);if(!r)return F(n);let t=f(r,"w","abstractNum");for(let l of t){let a=k(l);a&&n.abstractNums.push(a);}let i=f(r,"w","num");for(let l of i){let a=D(l);a&&n.nums.push(a);}return F(n)}function k(e$1){let n=j$1(e$1,"w","abstractNumId");if(n===null)return null;let r=parseInt(n,10);if(isNaN(r))return null;let t={abstractNumId:r,levels:[]},i=e(e$1,"w","multiLevelType");if(i){let d=j$1(i,"w","val");(d==="hybridMultilevel"||d==="multilevel"||d==="singleLevel")&&(t.multiLevelType=d);}let l=e(e$1,"w","name");l&&(t.name=j$1(l,"w","val")??void 0);let a=e(e$1,"w","numStyleLink");a&&(t.numStyleLink=j$1(a,"w","val")??void 0);let o=e(e$1,"w","styleLink");o&&(t.styleLink=j$1(o,"w","val")??void 0);let s=f(e$1,"w","lvl");for(let d of s){let f=T(d);f&&t.levels.push(f);}return t.levels.sort((d,f)=>d.ilvl-f.ilvl),t}function D(e$1){let n=j$1(e$1,"w","numId");if(n===null)return null;let r=parseInt(n,10);if(isNaN(r))return null;let t=e(e$1,"w","abstractNumId");if(!t)return null;let i=j$1(t,"w","val");if(i===null)return null;let l=parseInt(i,10);if(isNaN(l))return null;let a={numId:r,abstractNumId:l},o=f(e$1,"w","lvlOverride");if(o.length>0){a.levelOverrides=[];for(let s of o){let d=j$1(s,"w","ilvl");if(d===null)continue;let f=parseInt(d,10);if(isNaN(f))continue;let g={ilvl:f},w=e(s,"w","startOverride");if(w){let m=j$1(w,"w","val");if(m!==null){let h=parseInt(m,10);isNaN(h)||(g.startOverride=h);}}let N=e(s,"w","lvl");N&&(g.lvl=T(N)??void 0),a.levelOverrides.push(g);}}return a}function T(e$1){let n=j$1(e$1,"w","ilvl");if(n===null)return null;let r=parseInt(n,10);if(isNaN(r)||r<0||r>8)return null;let t={ilvl:r,numFmt:"decimal",lvlText:""},i=e(e$1,"w","start");if(i){let m=j$1(i,"w","val");if(m!==null){let h=parseInt(m,10);isNaN(h)||(t.start=h);}}let l$1=e(e$1,"w","numFmt");if(l$1)t.numFmt=E(l$1)??"decimal";else {let m=e(e$1,"mc","AlternateContent");if(m){let h=E(e(e(m,"mc","Choice"),"w","numFmt")),S=E(e(e(m,"mc","Fallback"),"w","numFmt"));t.numFmt=h??S??t.numFmt;}}let a=e(e$1,"w","lvlText");a&&(t.lvlText=j$1(a,"w","val")??"");let o=e(e$1,"w","lvlJc");if(o){let m=j$1(o,"w","val");(m==="left"||m==="center"||m==="right")&&(t.lvlJc=m);}let s=e(e$1,"w","suff");if(s){let m=j$1(s,"w","val");(m==="tab"||m==="space"||m==="nothing")&&(t.suffix=m);}let d=e(e$1,"w","isLgl");d&&(t.isLgl=m(d));let f=e(e$1,"w","lvlRestart");if(f){let m=j$1(f,"w","val");if(m!==null){let h=parseInt(m,10);isNaN(h)||(t.lvlRestart=h);}}let g=e(e$1,"w","legacy");g&&(t.legacy={legacy:m(g),legacySpace:l(g,"w","legacySpace"),legacyIndent:l(g,"w","legacyIndent")});let w=e(e$1,"w","pPr");w&&(t.pPr=R(w));let N=e(e$1,"w","rPr");return N&&(t.rPr=Z(N)),t}var A={decimal:"decimal",upperRoman:"upperRoman",lowerRoman:"lowerRoman",upperLetter:"upperLetter",lowerLetter:"lowerLetter",ordinal:"ordinal",cardinalText:"cardinalText",ordinalText:"ordinalText",hex:"hex",chicago:"chicago",bullet:"bullet",none:"none",decimalZero:"decimalZero",ganada:"ganada",chosung:"chosung",ideographDigital:"ideographDigital",japaneseCounting:"japaneseCounting",aiueo:"aiueo",iroha:"iroha",decimalFullWidth:"decimalFullWidth",decimalHalfWidth:"decimalHalfWidth",japaneseLegal:"japaneseLegal",japaneseDigitalTenThousand:"japaneseDigitalTenThousand",decimalEnclosedCircle:"decimalEnclosedCircle",decimalFullWidth2:"decimalFullWidth2",aiueoFullWidth:"aiueoFullWidth",irohaFullWidth:"irohaFullWidth",decimalEnclosedFullstop:"decimalEnclosedFullstop",decimalEnclosedParen:"decimalEnclosedParen",decimalEnclosedCircleChinese:"decimalEnclosedCircleChinese",ideographEnclosedCircle:"ideographEnclosedCircle",ideographTraditional:"ideographTraditional",ideographZodiac:"ideographZodiac",ideographZodiacTraditional:"ideographZodiacTraditional",taiwaneseCounting:"taiwaneseCounting",ideographLegalTraditional:"ideographLegalTraditional",taiwaneseCountingThousand:"taiwaneseCountingThousand",taiwaneseDigital:"taiwaneseDigital",chineseCounting:"chineseCounting",chineseLegalSimplified:"chineseLegalSimplified",chineseCountingThousand:"chineseCountingThousand",koreanDigital:"koreanDigital",koreanCounting:"koreanCounting",koreanLegal:"koreanLegal",koreanDigital2:"koreanDigital2",vietnameseCounting:"vietnameseCounting",russianLower:"russianLower",russianUpper:"russianUpper",numberInDash:"numberInDash",hebrew1:"hebrew1",hebrew2:"hebrew2",arabicAlpha:"arabicAlpha",arabicAbjad:"arabicAbjad",hindiVowels:"hindiVowels",hindiConsonants:"hindiConsonants",hindiNumbers:"hindiNumbers",hindiCounting:"hindiCounting",thaiLetters:"thaiLetters",thaiNumbers:"thaiNumbers",thaiCounting:"thaiCounting"};function E(e){if(!e)return null;let n=j$1(e,"w","val");return n?n==="custom"?M(j$1(e,"w","format")):A[n]??null:null}function M(e){let n=e?.split(",")[0]?.trim()??"";if(/^0+1$/.test(n))switch(Math.min(n.length,5)){case 2:return "decimalZero";case 3:return "decimalZero3";case 4:return "decimalZero4";case 5:return "decimalZero5"}return null}function R(e$1){let n={},r=e(e$1,"w","ind");if(r){let i=l(r,"w","left"),l$1=l(r,"w","right"),a=l(r,"w","start"),o=l(r,"w","end"),s=l(r,"w","firstLine"),d=l(r,"w","hanging"),f=i??a,g=l$1??o;f!==void 0&&(n.indentLeft=f),g!==void 0&&(n.indentRight=g),d!==void 0?(n.indentFirstLine=-d,n.hangingIndent=true):s!==void 0&&(n.indentFirstLine=s);}let t=e(e$1,"w","tabs");if(t){n.tabs=[];let i=f(t,"w","tab");for(let l$1 of i){let a=l(l$1,"w","pos"),o=j$1(l$1,"w","val"),s=j$1(l$1,"w","leader");a!==void 0&&o&&n.tabs.push({position:a,alignment:P(o),leader:O(s)});}}return n}function P(e){switch(e){case "left":return "left";case "center":return "center";case "right":return "right";case "decimal":return "decimal";case "bar":return "bar";case "clear":return "clear";case "num":return "num";default:return "left"}}function O(e){if(e)switch(e){case "none":return "none";case "dot":return "dot";case "hyphen":return "hyphen";case "underscore":return "underscore";case "heavy":return "heavy";case "middleDot":return "middleDot";default:return}}function Z(e$1){let n={},r=e(e$1,"w","rFonts");r&&(n.fontFamily={ascii:j$1(r,"w","ascii")??void 0,hAnsi:j$1(r,"w","hAnsi")??void 0,eastAsia:j$1(r,"w","eastAsia")??void 0,cs:j$1(r,"w","cs")??void 0});let t=e(e$1,"w","sz");if(t){let s=l(t,"w","val");s!==void 0&&(n.fontSize=s);}let i=e(e$1,"w","color");if(i){let s=j$1(i,"w","val"),d=j$1(i,"w","themeColor");s==="auto"?n.color={auto:true}:d?n.color={themeColor:d,themeTint:j$1(i,"w","themeTint")??void 0,themeShade:j$1(i,"w","themeShade")??void 0}:s&&(n.color={rgb:s});}let l$1=e(e$1,"w","b");l$1&&(n.bold=m(l$1));let a=e(e$1,"w","i");a&&(n.italic=m(a));let o=e(e$1,"w","vanish");return o&&(n.hidden=m(o)),n}var C=new WeakMap;function X(e){let n=C.get(e);return n||(n=F(e),C.set(e,n)),n}function F(e){let n=new Map;for(let t of e.abstractNums)n.set(t.abstractNumId,t);let r=new Map;for(let t of e.nums)r.set(t.numId,t);return {definitions:e,getLevel(t,i){let l=r.get(t);if(!l)return null;if(l.levelOverrides){let o=l.levelOverrides.find(s=>s.ilvl===i);if(o){if(o.lvl)return o.lvl;let s=n.get(l.abstractNumId);if(s){let d=s.levels.find(f=>f.ilvl===i);if(d&&o.startOverride!==void 0)return {...d,start:o.startOverride}}}}let a=n.get(l.abstractNumId);if(!a)return null;if(a.numStyleLink&&a.levels.length===0){for(let o of n.values())if(o.styleLink===a.numStyleLink&&o.levels.length>0){a=o;break}}return a.levels.find(o=>o.ilvl===i)??null},getAbstract(t){return n.get(t)??null},getInstance(t){return r.get(t)??null},hasNumbering(t){return r.has(t)}}}function B(e,n){let{numId:r,ilvl:t=0}=e;if(r===void 0||r===0)return null;let i=n.getLevel(r,t);if(!i)return null;let l=[];for(let s=0;s<=t;s+=1){let d=n.getLevel(r,s);l.push(d?.numFmt??"decimal");}let a=n.getInstance(r),o=a?.levelOverrides?.find(s=>s.ilvl===t);return {level:t,numId:r,marker:i.lvlText,isBullet:i.numFmt==="bullet",numFmt:i.numFmt,markerHidden:i.rPr?.hidden||void 0,markerFontFamily:i.rPr?.fontFamily?.ascii||i.rPr?.fontFamily?.hAnsi||void 0,markerFontSize:i.rPr?.fontSize?i.rPr.fontSize/2:void 0,markerSuffix:i.suffix,levelNumFmts:l,abstractNumId:a?.abstractNumId,startOverride:o?.startOverride}}function W(e,n){switch(n){case "decimal":return e.toString();case "decimalZero":return L(e,2);case "decimalZero3":return L(e,3);case "decimalZero4":return L(e,4);case "decimalZero5":return L(e,5);case "upperRoman":return y(e).toUpperCase();case "lowerRoman":return y(e).toLowerCase();case "upperLetter":return x(e).toUpperCase();case "lowerLetter":return x(e).toLowerCase();case "ordinal":return j(e);case "bullet":return "\u2022";case "none":return "";case "decimalEnclosedParen":return `(${e})`;case "numberInDash":return `-${e}-`;default:return e.toString()}}function L(e,n){return e<0?e.toString():e.toString().padStart(n,"0")}function y(e){if(e<=0||e>3999)return e.toString();let n=[[1e3,"m"],[900,"cm"],[500,"d"],[400,"cd"],[100,"c"],[90,"xc"],[50,"l"],[40,"xl"],[10,"x"],[9,"ix"],[5,"v"],[4,"iv"],[1,"i"]],r="",t=e;for(let[i,l]of n)for(;t>=i;)r+=l,t-=i;return r}function x(e){if(e<=0)return "";let n="",r=e;for(;r>0;)r--,n=String.fromCharCode(97+r%26)+n,r=Math.floor(r/26);return n}function j(e){let n=["th","st","nd","rd"],r=e%100;return e+(n[(r-20)%10]||n[r]||n[0])}function U(e,n,r){let t=e;for(let i=1;i<=9;i++){let l=`%${i}`;if(t.includes(l)){let a=i-1,o=n[a]??1,s=r[a]??"decimal",d=W(o,s);t=t.replace(l,d);}}return t}function $(e){if(e.lvlText)return e.lvlText;let n=e.rPr?.fontFamily?.ascii||e.rPr?.fontFamily?.hAnsi;if(n){let r=n.toLowerCase();if(r==="symbol")return "\u2022";if(r.includes("wingding"))return "\u2751"}return "\u2022"}function H(e){return e.numFmt==="bullet"||e.numFmt==="none"}export{z as a,X as b,F as c,B as d,W as e,L as f,U as g,$ as h,H as i};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {a as a$1}from'./chunk-QPFJJPIC.mjs';import {f as f$1,g as g$1}from'./chunk-KNY7SXPJ.mjs';function u(e){return {sdtType:e.sdtType,id:e.id??null,alias:e.alias??null,tag:e.tag??null,lock:e.lock??null,placeholder:e.placeholder??null,showingPlaceholder:e.showingPlaceholder??false,dateFormat:e.dateFormat??null,listItems:e.listItems?JSON.stringify(e.listItems):null,checked:e.checked??null,dataBinding:e.dataBinding?JSON.stringify(e.dataBinding):null,rawPropertiesXml:e.rawPropertiesXml??null,rawEndPropertiesXml:e.rawEndPropertiesXml??null}}function g(e){let i={sdtType:e.sdtType??"richText"};if(typeof e.id=="number"&&(i.id=e.id),e.alias!=null&&(i.alias=String(e.alias)),e.tag!=null&&(i.tag=String(e.tag)),e.lock!=null&&(i.lock=e.lock),e.placeholder!=null&&(i.placeholder=String(e.placeholder)),e.showingPlaceholder&&(i.showingPlaceholder=true),e.dateFormat!=null&&(i.dateFormat=String(e.dateFormat)),typeof e.listItems=="string"&&e.listItems)try{i.listItems=JSON.parse(e.listItems);}catch{}if(e.checked!=null&&(i.checked=e.checked),typeof e.dataBinding=="string"&&e.dataBinding)try{i.dataBinding=JSON.parse(e.dataBinding);}catch{}return e.rawPropertiesXml!=null&&(i.rawPropertiesXml=String(e.rawPropertiesXml)),e.rawEndPropertiesXml!=null&&(i.rawEndPropertiesXml=String(e.rawEndPropertiesXml)),i}function a(e){return !!e.wrap&&e.wrap.type!=="inline"}function w(e){let i=e.wrap?.type??"inline",t=e.wrap?.wrapText,l=e.position?.horizontal?.alignment;return {displayMode:d(i),cssFloat:p(i,t,l),wrapType:i,wrapText:t,anchorTarget:a(e)?"followingBlock":void 0,position:e.position?f(e.position):void 0,distTop:e.wrap?.distT!=null?f$1(e.wrap.distT):void 0,distBottom:e.wrap?.distB!=null?f$1(e.wrap.distB):void 0,distLeft:e.wrap?.distL!=null?f$1(e.wrap.distL):void 0,distRight:e.wrap?.distR!=null?f$1(e.wrap.distR):void 0}}function x(e){return e.anchorTarget==="followingBlock"||s(e)}function P(e){let i=e.position;if(!(!i?.horizontal&&!i?.vertical))return {horizontal:{relativeTo:i.horizontal?.relativeTo??"margin",alignment:i.horizontal?.align,posOffset:i.horizontal?.posOffset},vertical:{relativeTo:i.vertical?.relativeTo??"paragraph",alignment:i.vertical?.align,posOffset:i.vertical?.posOffset}}}function y(e){let i=e.wrapType??(e.displayMode==="float"?"square":"inline");if(!i||i==="inline")return;let t={type:i};return e.wrapText&&(t.wrapText=e.wrapText),e.distTop!=null&&(t.distT=g$1(e.distTop)),e.distBottom!=null&&(t.distB=g$1(e.distBottom)),e.distLeft!=null&&(t.distL=g$1(e.distLeft)),e.distRight!=null&&(t.distR=g$1(e.distRight)),t}function d(e){return e==="inline"?"inline":e==="topAndBottom"?"block":"float"}function s(e){return e.displayMode==="float"||a$1(e.wrapType)}function p(e,i,t){return e==="inline"||e==="topAndBottom"?"none":i==="left"?"right":i==="right"||t==="left"?"left":t==="right"?"right":"none"}function f(e){return {horizontal:e.horizontal?{relativeTo:e.horizontal.relativeTo,posOffset:e.horizontal.posOffset,align:e.horizontal.alignment}:void 0,vertical:e.vertical?{relativeTo:e.vertical.relativeTo,posOffset:e.vertical.posOffset,align:e.vertical.alignment}:void 0}}export{u as a,g as b,a as c,w as d,x as e,P as f,y as g};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {e,b,c,a as a$1}from'./chunk-KQTB5Y7P.mjs';import {a}from'./chunk-NO6PIL32.mjs';import {i,g}from'./chunk-MJ6XZFVD.mjs';import {TextSelection}from'prosemirror-state';function _(e){let{$from:t}=e.selection,n=null,r=null,s=null,a=-1,o=-1;for(let i=t.depth;i>0;i--){let c=t.node(i);if(c.type.name==="tableCell"||c.type.name==="tableHeader"){s=c;let l=t.node(i-1);if(l?.type.name==="tableRow"){let b=0;l.forEach((h,y,S)=>{if(o===-1){if(S===t.index(i-1)){o=b;return}b+=h.attrs.colspan||1;}});}}else if(c.type.name==="tableRow")t.node(i-1)?.type.name==="table"&&(a=t.index(i-1));else if(c.type.name==="table"){n=c,r=t.before(i);break}}return !n||r==null||!s||a<0||o<0?null:{table:n,tablePos:r,cell:s,row:a,col:o,rowspan:s.attrs.rowspan||1,colspan:s.attrs.colspan||1}}function H(e){let t=[],n=[],r=0;for(let s=0;s<e.childCount;s++){let a=e.child(s),o=0;a.forEach(i=>{for(;t[s]?.[o];)o++;let c=i.attrs.rowspan||1,l=i.attrs.colspan||1;n.push({data:i,row:s,col:o,rowspan:c,colspan:l});for(let b=s;b<s+c;b++){let h=t[b]??[];t[b]=h;for(let y=o;y<o+l;y++)h[y]=true;}o+=l,r=Math.max(r,o);});}return {anchors:n,totalCols:r}}function j(e,t,n,r,s){let a={...e.attrs},o=s.reduce((l,b)=>l+b,0),i=a$1(s,t,n),c=n!==(e.attrs.colspan||1)||r!==(e.attrs.rowspan||1);return a.colspan=n,a.rowspan=r,a.colwidth=null,o>0&&(a.width=Math.round(i/o*5e3),a.widthType="pct"),c&&(a._originalFormatting=null),a}function Y(e,t,n,r){let s=t+1;for(let a=0;a<e.childCount;a++){let o=e.child(a),i=s+1,c=0;for(let l=0;l<o.childCount;l++){let b=o.child(l);if(a===n&&c===r)return i;c+=b.attrs.colspan||1,i+=b.nodeSize;}s+=o.nodeSize;}return null}function q(e,t){let n=e.attrs.width??9360;return Array.isArray(e.attrs.columnWidths)&&e.attrs.columnWidths.length>0?[...e.attrs.columnWidths]:Array.from({length:t},()=>Math.floor(n/Math.max(t,1)))}function Q(e$1){let t=_(e$1);return t?{...e(t.rowspan,t.colspan),capturedCellRow:t.row,capturedCellCol:t.col}:null}function Z(e,t,n,r,s,a){if(n<1||r<1)return false;let o=_(e);if(!o||!t)return false;let i=o;if(s!=null&&a!=null&&(s!==o.row||a!==o.col)){let{anchors:p}=H(o.table),g=p.find(T=>T.row===s&&T.col===a);if(!g)return false;i={...o,cell:g.data,row:g.row,col:g.col,rowspan:g.rowspan,colspan:g.colspan};}if(n<i.rowspan||r<i.colspan||n===1&&r===1)return false;let{anchors:c$1,totalCols:l}=H(i.table),b$1=q(i.table,l),h=b(b$1,i.col,i.colspan,r),y=c$1.find(p=>p.row===i.row&&p.col===i.col);if(!y)return false;let S=c(c$1,y,n,r,i.table.childCount,p=>{if(p)return y.data;let g=y.data.type.schema.nodes.paragraph.create(),T=j(y.data,0,1,1,h);return y.data.type.create(T,g)}),x=i.row+i.rowspan,w=Array.from({length:S.newRowCount},(p,g)=>g<x?{...i.table.child(g)?.attrs??{}}:g<i.row+n?{...i.table.child(x-1)?.attrs??{}}:{...i.table.child(g-S.deltaRows)?.attrs??{}}),k=Array.from({length:S.newRowCount},()=>[]);S.anchors.sort((p,g)=>p.row===g.row?p.col-g.col:p.row-g.row).forEach(p=>{let g=j(p.data,p.col,p.colspan,p.rowspan,h);k[p.row].push(p.data.type.create(g,p.data.content));});let u=k.map((p,g)=>i.table.type.schema.nodes.tableRow.create(w[g],p)),d=i.table.type.create({...i.table.attrs,columnWidths:h},u),f=e.tr.replaceWith(i.tablePos,i.tablePos+i.table.nodeSize,d),C=f.doc.nodeAt(i.tablePos);if(C){let p=Y(C,i.tablePos,i.row,i.col);p!=null&&(f=f.setSelection(TextSelection.near(f.doc.resolve(p+1))));}return t(f.scrollIntoView()),true}var m=a.getCommands();function re(e,t){return m.insertTable(e,t)}function ne(e,t){return m.addRowAbove()(e,t)}function oe(e,t){return m.addRowBelow()(e,t)}function ae(e,t){return m.deleteRow()(e,t)}function ie(e,t){return m.addColumnLeft()(e,t)}function se(e,t){return m.addColumnRight()(e,t)}function le(e,t){return m.deleteColumn()(e,t)}function ce(e,t){return m.deleteTable()(e,t)}function de(e,t){return m.selectTable()(e,t)}function ue(e,t){return m.selectRow()(e,t)}function pe(e,t){return m.selectColumn()(e,t)}function me(e,t){return m.mergeCells()(e,t)}function fe(e,t){return m.splitCell()(e,t)}function ge(e,t,n){return m.setCellBorder(e,t,n)}function be(e,t){return m.setTableBorders(e,t)}function he(e,t){return m.removeTableBorders()(e,t)}function ye(e,t,n){return m.setAllTableBorders(n)(e,t)}function Ce(e,t,n){return m.setOutsideTableBorders(n)(e,t)}function Te(e,t,n){return m.setInsideTableBorders(n)(e,t)}function Se(e){return m.setCellVerticalAlign(e)}function ke(e){return m.setCellMargins(e)}function ve(e){return m.setCellTextDirection(e)}function xe(){return m.toggleNoWrap()}function we(e,t){return m.setRowHeight(e,t)}function Ie(){return m.toggleHeaderRow()}function Pe(){return m.distributeColumns()}function Ae(){return m.autoFitContents()}function Ee(e){return m.setTableProperties(e)}function Me(e){return m.applyTableStyle(e)}function Re(e){return m.setCellFillColor(e)}function Ne(e){return m.setTableBorderColor(e)}function Be(e){return m.setTableBorderWidth(e)}var Fe=a.getCommands();function O(e,t,n,r){if(!t)return true;let s=e.tr.insert(r,n),a=i(e),o=e.schema.marks.insertion;return a&&o&&s.addMark(r,r+n.nodeSize,o.create({revisionId:a.revisionId,author:a.author,date:a.date})),t(s.scrollIntoView()),true}var V=612;function We(e,t,n){let r=n?.maxWidth??V,s=new FileReader;s.onload=()=>{let a=s.result,o=new Image;o.onload=()=>{let i=o.naturalWidth,c=o.naturalHeight;i>r&&(c=Math.round(c*(r/i)),i=r);let l=e.state.schema.nodes.image.create({src:a,alt:t.name,width:i,height:c,rId:`rId_img_${Date.now()}_${Math.round(Math.random()*1e9)}`,wrapType:"inline",displayMode:"inline"});O(e.state,e.dispatch,l,e.state.selection.from),e.focus(),n?.onInserted?.();},o.onerror=()=>n?.onError?.(new Error("Failed to decode image")),o.src=a;},s.onerror=()=>n?.onError?.(s.error),s.readAsDataURL(t);}function De(e,t,n){return Fe.setImageWrapType(e,t,n)}function Le(e){return (t,n)=>{let{from:r,to:s,empty:a}=t.selection;if(a)return false;let o=t.schema.marks.comment;if(!o)return false;if(n){let i=t.tr.addMark(r,s,o.create({commentId:e}));n(i);}return true}}function ze(e){return (t,n)=>{let r=t.schema.marks.comment;if(!r)return false;if(n){let s=t.tr;t.doc.descendants((a,o)=>{if(a.isText)for(let i of a.marks)i.type===r&&i.attrs.commentId===e&&s.removeMark(o,o+a.nodeSize,i);}),s.steps.length>0&&n(s);}return true}}function $(e,t,n){return (r,s)=>{let a=r.schema.marks.insertion,o=r.schema.marks.deletion;if(!a&&!o)return false;let i=n==="accept"?a:o,c=n==="accept"?o:a;if(s){let l=r.tr,b=[];r.doc.nodesBetween(e,t,(h,y)=>{if(!h.isInline)return;let S=y+h.nodeSize,x=Math.max(e,y),w=Math.min(t,S);c&&h.marks.some(k=>k.type===c)&&b.push({from:x,to:w}),i&&h.marks.some(k=>k.type===i)&&l.removeMark(x,w,i);});for(let h of b.reverse())l.delete(h.from,h.to);l.steps.length>0&&s(l);}return true}}function He(e,t){return $(e,t,"accept")}function je(e,t){return $(e,t,"reject")}function U(e){let t=new Set,n=[],r=o=>{typeof o=="number"&&!t.has(o)&&(t.add(o),n.push(o));},s=e.schema.marks.insertion,a=e.schema.marks.deletion;return e.doc.descendants(o=>{if(o.type.name==="paragraph"){r(o.attrs.pPrIns?.revisionId),r(o.attrs.pPrDel?.revisionId);let i=o.attrs.pPrChange;if(Array.isArray(i))for(let c of i)r(c.info.id);}if(o.type.name==="tableRow"){r(o.attrs.trIns?.revisionId),r(o.attrs.trDel?.revisionId);let i=o.attrs.trPrChange;if(Array.isArray(i))for(let c of i)r(c.info.id);}if(o.type.name==="tableCell"||o.type.name==="tableHeader"){let i=o.attrs.cellMarker;r(i?.info?.revisionId);let c=o.attrs.tcPrChange;if(Array.isArray(c))for(let l of c)r(l.info.id);}if(o.type.name==="table"){let i=o.attrs.tblPrChange;if(Array.isArray(i))for(let c of i)r(c.info.id);}if(o.isInline)for(let i of o.marks)(s&&i.type===s||a&&i.type===a)&&r(i.attrs.revisionId);}),n}function _e(){return (e,t)=>{let n=U(e);if(n.length===0)return false;if(!t)return true;let r=e,s=a=>{t(a),r=r.apply(a);};for(let a of n)M(a,"accept")(r,s);return true}}function Oe(){return (e,t)=>{let n=U(e);if(n.length===0)return false;if(!t)return true;let r=e,s=a=>{t(a),r=r.apply(a);};for(let a of n)M(a,"reject")(r,s);return true}}function G(e,t){let n=e.schema.marks.insertion,r=e.schema.marks.deletion;if(!n&&!r)return null;let s=null;return e.doc.descendants((a,o)=>{if(s)return false;if(a.isInline&&!(o+a.nodeSize<=t)){for(let i of a.marks)if(i.type===n||i.type===r)return s={from:Math.max(o,t),to:o+a.nodeSize,type:i.type===n?"insertion":"deletion"},false}}),!s&&t>0?G(e,0):s}function Ve(e,t){let n=[];return e.doc.descendants((r,s)=>{if(r.type.name!=="paragraph")return;let a=r.attrs.pPrIns,o=r.attrs.pPrDel;a&&a.revisionId===t&&n.push({pos:s,node:r,kind:"pPrIns"}),o&&o.revisionId===t&&n.push({pos:s,node:r,kind:"pPrDel"});}),n}function $e(e,t){let n=[];return e.doc.descendants((r,s)=>{if(r.type.name!=="paragraph")return;let a=r.attrs.pPrChange;Array.isArray(a)&&a.forEach((o,i)=>{!o?.info||typeof o.info.id!="number"||o.info.id===t&&n.push({pos:s,node:r,entryIndex:i,prior:o.previousFormatting,current:o.currentFormatting});});}),n}function Ue(e,t){let n=[],r=e.schema.marks.insertion,s=e.schema.marks.deletion;return e.doc.descendants((a,o)=>{if(a.isInline){for(let i of a.marks)if((r&&i.type===r||s&&i.type===s)&&i.attrs.revisionId===t){let c=i.type===r?"insertion":"deletion",l=n[n.length-1];l&&l.markName===c&&l.to===o?l.to=o+a.nodeSize:n.push({from:o,to:o+a.nodeSize,markName:c});}}}),n}function Ge(e,t,n){let r=e.doc.nodeAt(t);if(!r)return;let s=t+r.nodeSize,a=e.doc.nodeAt(s);!a||a.type.name!=="paragraph"||(e.setNodeMarkup(t,void 0,{...a.attrs,pPrIns:null,pPrDel:null}),e.join(s));}function N(e,t,n){let r=e.doc.nodeAt(t);if(!r)return;let s={...r.attrs};s[n]=null,e.setNodeMarkup(t,void 0,s);}function Xe(e,t,n){let r=e.doc.nodeAt(t);if(!r)return;let s=r.attrs.pPrChange;if(!Array.isArray(s)||n<0||n>=s.length)return;let a=s.slice();a.splice(n,1),e.setNodeMarkup(t,void 0,{...r.attrs,pPrChange:a.length>0?a:null});}function Je(e,t,n){let r={...e},s=["alignment","spaceBefore","spaceAfter","lineSpacing","lineSpacingRule","beforeAutospacing","afterAutospacing","spacingExplicit","indentLeft","indentRight","indentFirstLine","hangingIndent","styleId","borders","shading","tabs","pageBreakBefore","keepNext","keepLines","contextualSpacing","bidi","outlineLevel","numPr"];for(let a of s)Object.prototype.hasOwnProperty.call(t,a)&&(r[a]=t[a]??null);return n?.numPr&&!Object.prototype.hasOwnProperty.call(t,"numPr")&&(r.numPr=null),r.numPr==null&&(r.listIsBullet=null,r.listNumFmt=null,r.listMarker=null),r}function Ke(e,t){let n=[];return e.doc.descendants((r,s)=>{if(r.type.name!=="tableRow")return;let a=r.attrs.trIns,o=r.attrs.trDel;a&&a.revisionId===t&&n.push({pos:s,node:r,kind:"trIns"}),o&&o.revisionId===t&&n.push({pos:s,node:r,kind:"trDel"});}),n}function Ye(e,t){let n=[];return e.doc.descendants((r,s)=>{if(r.type.name!=="tableCell"&&r.type.name!=="tableHeader")return;let a=r.attrs.cellMarker;a?.info?.revisionId===t&&n.push({pos:s,node:r,cellKind:a.kind});}),n}function M(e,t){return (n,r)=>{let s=Ve(n,e),a=Ue(n,e),o=$e(n,e),i=Ke(n,e),c=Ye(n,e);if(s.length===0&&a.length===0&&o.length===0&&i.length===0&&c.length===0)return false;if(!r)return true;let l=n.tr;l.setMeta(g,true);let b=n.schema.marks.insertion,h=n.schema.marks.deletion,y=[...a].sort((u,d)=>d.from-u.from);for(let u of y){let d=u.markName==="insertion";if(t==="accept"&&!d||t==="reject"&&d)l.delete(u.from,u.to);else {let C=d?b:h;C&&l.removeMark(u.from,u.to,C);}}let S=[...s].sort((u,d)=>d.pos-u.pos);for(let u of S){let d=l.mapping.map(u.pos),f=l.doc.nodeAt(d);if(!f||f.type.name!=="paragraph")continue;let C=u.kind==="pPrIns"&&f.attrs.pPrIns?.revisionId===e,p=u.kind==="pPrDel"&&f.attrs.pPrDel?.revisionId===e;if(!C&&!p)continue;if(t==="reject"&&u.kind==="pPrIns"||t==="accept"&&u.kind==="pPrDel"){let T=d+f.nodeSize,R=l.doc.nodeAt(T);!R||R.type.name!=="paragraph"?N(l,d,u.kind):(N(l,d,u.kind),Ge(l,d));}else N(l,d,u.kind);}let x=[...o].sort((u,d)=>d.pos-u.pos);for(let u of x){let d=l.mapping.map(u.pos),f=l.doc.nodeAt(d);if(!f||f.type.name!=="paragraph")continue;let C=f.attrs.pPrChange;if(!Array.isArray(C))continue;let p=C.findIndex(g=>g.info.id===e);if(!(p<0))if(t==="reject"&&u.prior){let g=Je(f.attrs,u.prior,u.current),T=C.slice();T.splice(p,1),l.setNodeMarkup(d,void 0,{...g,pPrChange:T.length>0?T:null});}else Xe(l,d,p);}let w=[...c].sort((u,d)=>d.pos-u.pos);for(let u of w){let d=l.mapping.map(u.pos),f=l.doc.nodeAt(d);if(!f||f.type.name!=="tableCell"&&f.type.name!=="tableHeader")continue;let C=f.attrs.cellMarker;!C||C.info.revisionId!==e||l.setNodeMarkup(d,void 0,{...f.attrs,cellMarker:null});}let k=[...i].sort((u,d)=>d.pos-u.pos);for(let u of k){let d=l.mapping.map(u.pos),f=l.doc.nodeAt(d);if(!f||f.type.name!=="tableRow")continue;let C=f.attrs.trIns,p=f.attrs.trDel,g=C?.revisionId===e,T=p?.revisionId===e;if(!g&&!T)continue;if(t==="reject"&&g||t==="accept"&&T){let v=l.doc.resolve(d+1),I=v.node(v.depth-1),P=v.before(v.depth-1);if(I?.type.name==="table"&&I.childCount>1)l.delete(d,d+f.nodeSize);else if(I?.type.name==="table")if(l.doc.resolve(P).parent.childCount===1){let J=l.doc.type.schema.nodes.paragraph;l.replaceWith(P,P+I.nodeSize,J.create());}else l.delete(P,P+I.nodeSize);else {let A={...f.attrs};g&&(A.trIns=null),T&&(A.trDel=null),l.setNodeMarkup(d,void 0,A);}}else {let v={...f.attrs};g&&(v.trIns=null),T&&(v.trDel=null),l.setNodeMarkup(d,void 0,v);}}return l.steps.length===0?false:(r(l),true)}}function qe(e){return M(e,"accept")}function Qe(e){return M(e,"reject")}function X(e,t){let n=e.schema.marks.insertion,r=e.schema.marks.deletion;if(!n&&!r)return null;let s=null;return e.doc.descendants((a,o)=>{if(a.isInline){if(o>=t)return false;for(let i of a.marks)(i.type===n||i.type===r)&&(s={from:o,to:o+a.nodeSize,type:i.type===n?"insertion":"deletion"});}}),!s&&t<e.doc.content.size?X(e,e.doc.content.size):s}function Ze(e){return e.doc.attrs.watermark??null}function et(e){return (t,n)=>(n&&n(t.tr.setDocAttribute("watermark",e)),true)}export{Ie as A,Pe as B,Ae as C,Ee as D,Me as E,Re as F,Ne as G,Be as H,O as I,V as J,We as K,De as L,Le as M,ze as N,He as O,je as P,_e as Q,Oe as R,G as S,qe as T,Qe as U,X as V,Ze as W,et as X,Q as a,Z as b,re as c,ne as d,oe as e,ae as f,ie as g,se as h,le as i,ce as j,de as k,ue as l,pe as m,me as n,fe as o,ge as p,be as q,he as r,ye as s,Ce as t,Te as u,Se as v,ke as w,ve as x,xe as y,we as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {t,w,q,y as y$1,o}from'./chunk-
|
|
1
|
+
import {t,w,q,y as y$1,o}from'./chunk-4QSFBX26.mjs';import {g}from'./chunk-KNY7SXPJ.mjs';import {a}from'./chunk-QYUPLKLP.mjs';var i={runImage:"layout-run-image",blockImage:"layout-block-image",pageFloatingImage:"layout-page-floating-image",cellFloatingImage:"layout-cell-floating-image",pageContent:"layout-page-content",paragraph:"layout-paragraph"},y=[`.${i.pageFloatingImage}`,`.${i.cellFloatingImage}`,`.${i.blockImage}`,`.${i.runImage}`].join(", ");function L(n){if(!(n instanceof Element))return null;let e=n.closest(y);if(!e)return null;let o=e.dataset.pmStart;if(o===void 0)return null;let t=Number(o);return Number.isNaN(t)?null:{pos:t,imageEl:e}}function b(n){if(!(n instanceof HTMLElement))return null;if(n.tagName==="IMG"&&n.classList.contains(i.runImage))return n;let e=n.closest(y);return e&&e.dataset.pmStart?e:null}function x(n,e=1){if(!n.classList.contains(i.runImage))return;let o=n.closest(`.${i.pageContent}`),t=n.closest(`.${i.paragraph}`);if(!o||!t)return;let r=n.getBoundingClientRect(),a=o.getBoundingClientRect(),l=t.getBoundingClientRect(),p=e>0?e:1;return {horizontalEmu:Math.round(g((r.left-a.left)/p)),verticalEmu:Math.round(g((r.top-l.top)/p))}}function T(n,e){return n==="inline"?"inline":n==="behind"?"behind":n==="inFront"?"inFront":n==="square"||n==="tight"||n==="through"?e==="right"?"squareRight":"squareLeft":null}var k=[{choice:"inline",i18nLabelKey:"inLineWithText",i18nDescKey:"inLineWithText",iconHint:"inline"},{choice:"squareLeft",i18nLabelKey:"squareLeft",i18nDescKey:"squareLeft",iconHint:"squareLeft"},{choice:"squareRight",i18nLabelKey:"squareRight",i18nDescKey:"squareRight",iconHint:"squareRight"},{choice:"behind",i18nLabelKey:"behindText",i18nDescKey:"behindText",iconHint:"behind"},{choice:"inFront",i18nLabelKey:"inFrontOfText",i18nDescKey:"inFrontOfText",iconHint:"inFront"}];function I(n,e){return true}function E(n){switch(n){case "inline":return "inline";case "square":case "tight":case "through":return "squareLeft";case "topAndBottom":return "topAndBottom";case "behind":return "behind";case "inFront":return "inFront";case "wrapRight":return "squareLeft";case "wrapLeft":return "squareRight";default:return}}function X(n,e){let o=new Map;for(let t=0;t<n.length;t++){let r=n[t],a=e[t];r&&a&&o.set(String(r.id),{block:r,measure:a});}return o}var c=class{constructor(e={}){a(this,"container",null);a(this,"blockLookup",new Map);a(this,"pageStates",[]);a(this,"totalPages",0);a(this,"options");a(this,"doc");a(this,"resolvedCommentIds",new Set);this.options=e,this.doc=e.document??document;}setBlockLookup(e){this.blockLookup=e;}mount(e){this.container=e,this.applyContainerStyles();}unmount(){this.container&&(this.container.innerHTML=""),this.container=null,this.pageStates=[];}applyContainerStyles(){if(!this.container)return;let e=this.options.pageGap??24;this.container.style.display="flex",this.container.style.flexDirection="column",this.container.style.alignItems="center",this.container.style.gap=`${e}px`,this.container.style.padding=`${e}px`,this.container.style.backgroundColor=this.options.containerBackground??"var(--doc-bg, #f8f9fa)",this.container.style.minHeight="100%";}paint(e){if(!this.container)throw new Error("LayoutPainter: not mounted");let{pages:o}=e;this.totalPages=o.length,this.container.innerHTML="",this.pageStates=[];for(let t=0;t<o.length;t++){let r=o[t],a={pageNumber:r.number,totalPages:this.totalPages,section:"body",resolvedCommentIds:this.resolvedCommentIds},l=this.renderPageWithLookup(r,a);this.container.appendChild(l),this.pageStates.push({element:l,pageNumber:r.number,fragmentCount:r.fragments.length});}}renderPageWithLookup(e,o){let t=this.doc.createElement("div");t.className="layout-page",t.dataset.pageNumber=String(e.number),t.style.position="relative",t.style.width=`${e.size.w}px`,t.style.height=`${e.size.h}px`,t.style.backgroundColor=this.options.pageBackground??"var(--doc-page-bg, #ffffff)",t.style.color="var(--doc-page-text, #000000)",t.style.overflow="hidden",this.options.showShadow&&(t.style.boxShadow="0 2px 8px rgba(0, 0, 0, 0.15)");let r=this.doc.createElement("div");r.className="layout-page-content",r.style.position="absolute",r.style.top=`${e.margins.top}px`,r.style.left=`${e.margins.left}px`,r.style.right=`${e.margins.right}px`,r.style.bottom=`${e.margins.bottom}px`,r.style.overflow="visible";for(let a of e.fragments){let l=this.renderFragmentWithLookup(a,o);this.applyFragmentPosition(l,a),r.appendChild(l);}return t.appendChild(r),t}renderFragmentWithLookup(e,o$1){let t$1=this.blockLookup.get(String(e.blockId));if(e.kind==="paragraph"&&t$1){let r=t$1.block,a=t$1.measure;return t(e,r,a,o$1,{document:this.doc})}if(e.kind==="table"&&t$1){let r=t$1.block,a=t$1.measure;return w(e,r,a,o$1,{document:this.doc})}if(e.kind==="image"&&t$1){let r=t$1.block,a=t$1.measure;return q(e,r,a,o$1,{document:this.doc})}if(e.kind==="textBox"&&t$1){let r=t$1.block,a=t$1.measure;return y$1(e,r,a,o$1,{document:this.doc})}return o(e,o$1,{document:this.doc})}applyFragmentPosition(e,o){e.style.position="absolute",e.style.left=`${o.x}px`,e.style.top=`${o.y}px`,e.style.width=`${o.width}px`,"height"in o&&(e.style.height=`${o.height}px`);}getPageCount(){return this.totalPages}getPageElement(e){return this.pageStates[e]?.element??null}scrollToPage(e){let o=this.pageStates.find(t=>t.pageNumber===e);o?.element&&o.element.scrollIntoView({behavior:"smooth",block:"start"});}};function Z(n){return new c(n)}export{i as a,L as b,b as c,x as d,T as e,k as f,I as g,E as h,X as i,c as j,Z as k};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var chunk34DJT72K_js=require('./chunk-34DJT72K.js'),chunkRQVHKDXK_js=require('./chunk-RQVHKDXK.js'),chunkBJSG6TEG_js=require('./chunk-BJSG6TEG.js');function D(t){return t.attrs.href||""}function H(t){let e=t.filter(n=>n.type.name!=="hyperlink");return e.length===0?"":e.map(n=>`${n.type.name}:${JSON.stringify(n.attrs)}`).sort().join("|")}function k(t){let e={};for(let n of t)switch(n.type.name){case "bold":e.bold=true,e.boldCs=true;break;case "italic":e.italic=true,e.italicCs=true;break;case "underline":{let o=n.attrs;e.underline={style:o.style||"single",color:o.color};break}case "strike":n.attrs.double?e.doubleStrike=true:e.strike=true;break;case "textColor":{let o=n.attrs;e.color={rgb:o.rgb,themeColor:o.themeColor,themeTint:o.themeTint,themeShade:o.themeShade};break}case "highlight":e.highlight=n.attrs.color;break;case "fontSize":e.fontSize=n.attrs.size,e.fontSizeCs=n.attrs.size;break;case "fontFamily":{let o=n.attrs;e.fontFamily={ascii:o.ascii,hAnsi:o.hAnsi,eastAsia:o.eastAsia||void 0,cs:o.cs||o.ascii||void 0,asciiTheme:o.asciiTheme,hAnsiTheme:o.hAnsiTheme||void 0,eastAsiaTheme:o.eastAsiaTheme||void 0,csTheme:o.csTheme||void 0};break}case "superscript":e.vertAlign="superscript";break;case "subscript":e.vertAlign="subscript";break;case "allCaps":e.allCaps=true;break;case "smallCaps":e.smallCaps=true;break;case "characterSpacing":{n.attrs.spacing!=null&&(e.spacing=n.attrs.spacing),n.attrs.position!=null&&(e.position=n.attrs.position),n.attrs.scale!=null&&(e.scale=n.attrs.scale),n.attrs.kerning!=null&&(e.kerning=n.attrs.kerning);break}case "emboss":e.emboss=true;break;case "imprint":e.imprint=true;break;case "textShadow":e.shadow=true;break;case "emphasisMark":e.emphasisMark=n.attrs.type||"dot";break;case "textOutline":e.outline=true;break;case "hidden":e.hidden=true;break;case "rtl":e.rtl=true;break;case "textEffect":e.effect=n.attrs.effect||"blinkBackground";break;case "runStyle":n.attrs.styleId&&(e.styleId=n.attrs.styleId);break}return e}function W(t){let e=t.attrs.href;return e?.startsWith("#")?{type:"hyperlink",anchor:e.substring(1),tooltip:t.attrs.tooltip||void 0,children:[]}:{type:"hyperlink",href:e,tooltip:t.attrs.tooltip||void 0,rId:t.attrs.rId||void 0,children:[]}}function P(t,e){let n=e.marks.filter(o=>o.type.name!=="hyperlink");e.isText&&e.text?t.children.push(M(e.text,n)):e.type.name==="tab"?t.children.push(v()):e.type.name==="hardBreak"&&t.children.push(w());}function M(t,e){let n=k(e),o={type:"text",text:t};return {type:"run",formatting:Object.keys(n).length>0?n:void 0,content:[o]}}function j(t,e){let n=t.content[t.content.length-1];n&&n.type==="text"?n.text+=e:t.content.push({type:"text",text:e});}function w(){return {type:"run",content:[{type:"break",breakType:"textWrapping"}]}}function v(){return {type:"run",content:[{type:"tab"}]}}function z(t,e){let n=t.attrs,o=e&&e.length>0?k(e):void 0,i=n.displayText||"";if(!i)switch(n.fieldType){case "PAGE":i="1";break;case "NUMPAGES":i="1";break;default:i=" ";break}let r={type:"run",content:[{type:"text",text:i}],...o&&Object.keys(o).length>0?{formatting:o}:{}};return n.fieldKind==="complex"?{type:"complexField",instruction:n.instruction,fieldType:n.fieldType,fieldCode:[],fieldResult:[r],fldLock:n.fldLock||void 0,dirty:n.dirty||void 0}:{type:"simpleField",instruction:n.instruction,fieldType:n.fieldType,content:[r],fldLock:n.fldLock||void 0,dirty:n.dirty||void 0}}function V(t){let e=t.attrs;return {type:"mathEquation",display:e.display||"inline",ommlXml:e.ommlXml,plainText:e.plainText||void 0}}function R(t){let e=t.attrs,o={type:e.wrapType||"inline"};e.distTop!==void 0&&(o.distT=chunkBJSG6TEG_js.g(e.distTop)),e.distBottom!==void 0&&(o.distB=chunkBJSG6TEG_js.g(e.distBottom)),e.distLeft!==void 0&&(o.distL=chunkBJSG6TEG_js.g(e.distLeft)),e.distRight!==void 0&&(o.distR=chunkBJSG6TEG_js.g(e.distRight)),e.wrapText&&(o.wrapText=e.wrapText);let i={type:"image",rId:e.rId||"",src:e.src,alt:e.alt||void 0,title:e.title||void 0,size:{width:chunkBJSG6TEG_js.g(e.width||0),height:chunkBJSG6TEG_js.g(e.height||0)},wrap:o};if(e.transform){let a=e.transform,l={},p=a.match(/rotate\(([-\d.]+)deg\)/);p&&(l.rotation=parseFloat(p[1])),a.includes("scaleX(-1)")&&(l.flipH=true),a.includes("scaleY(-1)")&&(l.flipV=true),(l.rotation||l.flipH||l.flipV)&&(i.transform=l);}if(e.position?.horizontal&&e.position?.vertical){let a=e.position;i.position={horizontal:{relativeTo:a.horizontal.relativeTo||"column",alignment:a.horizontal.align,posOffset:a.horizontal.posOffset},vertical:{relativeTo:a.vertical.relativeTo||"paragraph",alignment:a.vertical.align,posOffset:a.vertical.posOffset}};}if(e.borderWidth&&e.borderWidth>0){let a={solid:"solid",dotted:"dot",dashed:"dash",double:"solid",groove:"solid",ridge:"solid",inset:"solid",outset:"solid"};i.outline={width:chunkBJSG6TEG_js.g(e.borderWidth),color:e.borderColor?{rgb:e.borderColor.replace("#","")}:void 0,style:e.borderStyle&&a[e.borderStyle]||"solid"};}if(e.hlinkHref&&(i.hlinkHref=e.hlinkHref),e.cropTop!==void 0||e.cropRight!==void 0||e.cropBottom!==void 0||e.cropLeft!==void 0){let a={};e.cropTop!==void 0&&e.cropTop!==null&&(a.top=e.cropTop),e.cropRight!==void 0&&e.cropRight!==null&&(a.right=e.cropRight),e.cropBottom!==void 0&&e.cropBottom!==null&&(a.bottom=e.cropBottom),e.cropLeft!==void 0&&e.cropLeft!==null&&(a.left=e.cropLeft),Object.keys(a).length>0&&(i.crop=a);}if(e.opacity!==void 0&&e.opacity!==null&&e.opacity<1&&(i.opacity=e.opacity),e.layoutInCell!==void 0&&e.layoutInCell!==null&&(i.layoutInCell=e.layoutInCell),e.allowOverlap!==void 0&&e.allowOverlap!==null&&(i.allowOverlap=e.allowOverlap),e.effectExtentTop||e.effectExtentBottom||e.effectExtentLeft||e.effectExtentRight){let a={};e.effectExtentTop&&(a.top=chunkBJSG6TEG_js.g(e.effectExtentTop)),e.effectExtentBottom&&(a.bottom=chunkBJSG6TEG_js.g(e.effectExtentBottom)),e.effectExtentLeft&&(a.left=chunkBJSG6TEG_js.g(e.effectExtentLeft)),e.effectExtentRight&&(a.right=chunkBJSG6TEG_js.g(e.effectExtentRight)),Object.keys(a).length>0&&(i.padding=a);}return {type:"run",content:[{type:"drawing",image:i}]}}function S(t){let e=t.attrs,n={type:"shape",shapeType:e.shapeType||"rect",id:e.shapeId||void 0,size:{width:e.width?chunkBJSG6TEG_js.g(e.width):0,height:e.height?chunkBJSG6TEG_js.g(e.height):0}};if(e.fillType==="gradient"&&e.gradientStops)try{let i=JSON.parse(e.gradientStops);n.fill={type:"gradient",gradient:{type:e.gradientType||"linear",angle:e.gradientAngle||void 0,stops:i.map(r=>({position:r.position,color:{rgb:r.color.replace("#","")}}))}};}catch{n.fill={type:"solid",color:{rgb:(e.fillColor||"000000").replace("#","")}};}else e.fillColor?n.fill={type:e.fillType||"solid",color:{rgb:e.fillColor.replace("#","")}}:e.fillType==="none"&&(n.fill={type:"none"});if(e.outlineWidth&&e.outlineWidth>0){let i={solid:"solid",dotted:"dot",dashed:"dash"};n.outline={width:chunkBJSG6TEG_js.g(e.outlineWidth),color:e.outlineColor?{rgb:e.outlineColor.replace("#","")}:void 0,style:e.outlineStyle&&i[e.outlineStyle]||"solid"};}return {type:"run",content:[{type:"shape",shape:n}]}}function T(t){let e=t.attrs,n=J($(t),t),o=e.bookmarks;if(o&&o.length>0){let r=o.map(l=>({type:"bookmarkStart",id:l.id,name:l.name})),a=o.map(l=>({type:"bookmarkEnd",id:l.id}));n=[...r,...n,...a];}let i={type:"paragraph",paraId:e.paraId||void 0,textId:e.textId||void 0,formatting:q(e),content:n};return e.renderedPageBreakBefore&&(i.renderedPageBreakBefore=true),e.pPrIns&&(i.pPrIns={id:e.pPrIns.revisionId,author:e.pPrIns.author,...e.pPrIns.date?{date:e.pPrIns.date}:{}}),e.pPrDel&&(i.pPrDel={id:e.pPrDel.revisionId,author:e.pPrDel.author,...e.pPrDel.date?{date:e.pPrDel.date}:{}}),e.pPrChange&&e.pPrChange.length>0&&(i.propertyChanges=e.pPrChange),e._sectionProperties?i.sectionProperties=e._sectionProperties:e.sectionBreakType&&(i.sectionProperties={sectionStart:e.sectionBreakType}),i}function J(t,e){let n=new Set;if(e.forEach(a=>{for(let l of a.marks)l.type.name==="comment"&&n.add(l.attrs.commentId);}),n.size===0)return t;let o=[],i=new Set,r=0;e.forEach(a=>{let l=new Set;for(let p of a.marks)p.type.name==="comment"&&l.add(p.attrs.commentId);for(let p of [...i])l.has(p)||(o.push({type:"commentRangeEnd",id:p}),i.delete(p));for(let p of l)i.has(p)||(o.push({type:"commentRangeStart",id:p}),i.add(p));r<t.length&&o.push(t[r]),r++;});for(let a of i)o.push({type:"commentRangeEnd",id:a});return o}function _(t){return t.numPrFromStyle!=null&&t.numPr!=null&&JSON.stringify(t.numPr)===JSON.stringify(t.numPrFromStyle)}function q(t){if(t._originalFormatting){let n=t._originalFormatting,o={...n};return t.alignment!==(n.alignment||void 0)&&(o.alignment=t.alignment||void 0),_(t)?(delete o.numPr,delete o.numPrFromStyle):t.numPr!==n.numPr&&JSON.stringify(t.numPr)!==JSON.stringify(n.numPr)&&(o.numPr=t.numPr||void 0,delete o.numPrFromStyle),t.styleId!==(n.styleId||void 0)&&(o.styleId=t.styleId||void 0),t.pageBreakBefore!==(n.pageBreakBefore||void 0)&&(o.pageBreakBefore=t.pageBreakBefore||void 0),t.bidi!==(n.bidi||void 0)&&(o.bidi=t.bidi||void 0),o}if(t.alignment||t.spaceBefore||t.spaceAfter||t.lineSpacing||t.indentLeft||t.indentRight||t.indentFirstLine||t.numPr||t.styleId||t.borders||t.shading||t.tabs||t.outlineLevel!=null||t.contextualSpacing||t.bidi)return {alignment:t.alignment||void 0,spaceBefore:t.spaceBefore||void 0,spaceAfter:t.spaceAfter||void 0,lineSpacing:t.lineSpacing||void 0,lineSpacingRule:t.lineSpacingRule||void 0,indentLeft:t.indentLeft||void 0,indentRight:t.indentRight||void 0,indentFirstLine:t.indentFirstLine||void 0,hangingIndent:t.hangingIndent||void 0,numPr:_(t)?void 0:t.numPr||void 0,styleId:t.styleId||void 0,borders:t.borders||void 0,shading:t.shading||void 0,tabs:t.tabs||void 0,outlineLevel:t.outlineLevel??void 0,contextualSpacing:t.contextualSpacing||void 0,bidi:t.bidi||void 0}}function $(t){let e=[],n=null,o=null,i=null;return t.forEach(r=>{let a=r.marks.find(d=>d.type.name==="footnoteRef");if(a){n&&(e.push(n),n=null,o=null),i&&(e.push(i),i=null);let f={type:a.attrs.noteType==="endnote"?"endnoteRef":"footnoteRef",id:parseInt(a.attrs.id,10)||0};e.push({type:"run",content:[f]});return}let l=r.marks.find(d=>d.type.name==="insertion"),p=r.marks.find(d=>d.type.name==="deletion");if(l||p){n&&(e.push(n),n=null,o=null),i&&(e.push(i),i=null);let d=l||p,f;if(r.type.name==="image")f=R(r);else if(r.type.name==="shape")f=S(r);else {let h=r.marks.filter(g=>g.type.name!=="insertion"&&g.type.name!=="deletion"),m=k(h);f={type:"run",content:r.isText&&r.text?[{type:"text",text:r.text}]:[],...Object.keys(m).length>0?{formatting:m}:{}};}let c={id:d.attrs.revisionId,author:d.attrs.author||"Unknown",date:d.attrs.date||void 0},b=d.attrs.isMovePair===true;l?b?e.push({type:"moveTo",info:c,content:[f]}):e.push({type:"insertion",info:c,content:[f]}):b?e.push({type:"moveFrom",info:c,content:[f]}):e.push({type:"deletion",info:c,content:[f]});return}let s=r.marks.find(d=>d.type.name==="hyperlink");if(s){let d=D(s),f=i?.href||(i?.anchor?`#${i.anchor}`:"");i&&f===d?P(i,r):(n&&(e.push(n),n=null,o=null),i&&e.push(i),i=W(s),P(i,r));return}if(i&&(e.push(i),i=null),r.isText){let d=H(r.marks);n&&o===d?j(n,r.text||""):(n&&e.push(n),n=M(r.text||"",r.marks),o=d);}else r.type.name==="hardBreak"?(n&&(e.push(n),n=null,o=null),e.push(w())):r.type.name==="image"?(n&&(e.push(n),n=null,o=null),e.push(R(r))):r.type.name==="shape"?(n&&(e.push(n),n=null,o=null),e.push(S(r))):r.type.name==="tab"?(n&&(e.push(n),n=null,o=null),e.push(v())):r.type.name==="field"?(n&&(e.push(n),n=null,o=null),e.push(z(r,r.marks))):r.type.name==="sdt"?(n&&(e.push(n),n=null,o=null),e.push(U(r))):r.type.name==="math"&&(n&&(e.push(n),n=null,o=null),e.push(V(r)));}),n&&e.push(n),i&&e.push(i),e}function U(t){let e=chunk34DJT72K_js.b(t.attrs),o=$(t).filter(i=>i.type==="run"||i.type==="hyperlink"||i.type==="simpleField"||i.type==="complexField"||i.type==="inlineSdt"||i.type==="mathEquation");return {type:"inlineSdt",properties:e,content:o}}function X(t){for(let e of t)for(let n of e.cells){let o=n.formatting?.borders;if(o){let i=o.top||o.left||o.right||o.bottom||o.insideH||o.insideV;return i?{top:o.top??i,bottom:o.bottom??i,left:o.left??i,right:o.right??i,insideH:o.insideH??o.bottom??i,insideV:o.insideV??o.right??i}:void 0}}}function G(t){let e=[],n=[],o=0;for(let i=0;i<t.childCount;i++){let r=t.child(i),a=0;r.forEach(l=>{if(l.type.name!=="tableCell"&&l.type.name!=="tableHeader")return;for(;e[i]?.[a];)a++;let p=l.attrs.rowspan||1,s=l.attrs.colspan||1;n.push({row:i,col:a,rowspan:p,colspan:s,cell:ee(l)});for(let d=i;d<i+p;d++){let f=e[d]??[];e[d]=f;for(let c=a;c<a+s;c++)f[c]=true;}a+=s,o=Math.max(o,a);});}return {anchors:n,totalCols:o}}function Y(t){let e=new Map;t.forEach((o,i)=>{let r=0;for(let a of o.cells){let l=r;if(r+=a.formatting?.gridSpan??1,a.formatting?.vMerge){let p=e.get(l)??[];p.push({rowIndex:i,cell:a}),e.set(l,p);}}});let n=o=>{o.formatting&&(delete o.formatting.vMerge,Object.keys(o.formatting).length===0&&(o.formatting=void 0));};for(let o of e.values()){let i=null,r=0,a=-1,l=()=>{i&&r<2&&n(i),i=null,r=0;};for(let{rowIndex:p,cell:s}of o){let d=s.formatting?.vMerge;d==="restart"?(l(),i=s,r=1,a=p):d==="continue"&&(i&&p===a+1?(r++,a=p):(l(),n(s)));}l();}}function I(t){let e=t.attrs,{anchors:n,totalCols:o}=G(t),i=new Map,r=new Map;for(let s of n){i.set(`${s.row}-${s.col}`,s);for(let d=s.row;d<s.row+s.rowspan;d++)for(let f=s.col;f<s.col+s.colspan;f++)r.set(`${d}-${f}`,s);}let a=[];for(let s=0;s<t.childCount;s++){let d=t.child(s),f=[];for(let h=0;h<o;){let m=i.get(`${s}-${h}`);if(m){let y={...m.cell.formatting??{}};m.colspan>1?y.gridSpan=m.colspan:delete y.gridSpan,m.rowspan>1?y.vMerge="restart":y.vMerge!=="restart"&&y.vMerge!=="continue"&&delete y.vMerge,f.push({...m.cell,formatting:Object.keys(y).length?y:void 0}),h+=m.colspan;continue}let g=r.get(`${s}-${h}`);if(!g){h++;continue}let x={...g.cell.formatting??{}};g.colspan>1?x.gridSpan=g.colspan:delete x.gridSpan,x.vMerge="continue",f.push({...g.cell,content:[],formatting:x}),h+=g.colspan;}let c=d.attrs,b={type:"tableRow",formatting:Z(c),cells:f};c.trIns?b.structuralChange={type:"tableRowInsertion",info:{id:c.trIns.revisionId,author:c.trIns.author,...c.trIns.date?{date:c.trIns.date}:{}}}:c.trDel&&(b.structuralChange={type:"tableRowDeletion",info:{id:c.trDel.revisionId,author:c.trDel.author,...c.trDel.date?{date:c.trDel.date}:{}}}),c.trPrChange&&c.trPrChange.length>0&&(b.propertyChanges=c.trPrChange),a.push(b);}Y(a);let l=Q(e)||void 0;if(!l?.borders){let s=X(a);if(s)if(l)l.borders=s;else return {type:"table",columnWidths:e.columnWidths||void 0,formatting:{borders:s},rows:a}}let p={type:"table",columnWidths:e.columnWidths||void 0,formatting:l,rows:a};return e.tblPrChange&&e.tblPrChange.length>0&&(p.propertyChanges=e.tblPrChange),p}function Q(t){if(t._originalFormatting){let i=t._originalFormatting,r={...i};t.styleId!==(i.styleId||void 0)&&(r.styleId=t.styleId||void 0),t.justification!==(i.justification||void 0)&&(r.justification=t.justification||void 0),t.floating!==(i.floating||void 0)&&(r.floating=t.floating||void 0),t.tableLayout!==(i.layout||void 0)&&(r.layout=t.tableLayout||void 0),t.look!==(i.look||void 0)&&(r.look=t.look||void 0);let a=i.width?.value,l=i.width?.type;return (t.width!==a||t.widthType!==l)&&(t.width!=null||t.widthType?r.width={value:t.width??0,type:t.widthType||"dxa"}:r.width=void 0),t.cellMargins&&(r.cellMargins={top:t.cellMargins.top!=null?{value:t.cellMargins.top,type:"dxa"}:void 0,bottom:t.cellMargins.bottom!=null?{value:t.cellMargins.bottom,type:"dxa"}:void 0,left:t.cellMargins.left!=null?{value:t.cellMargins.left,type:"dxa"}:void 0,right:t.cellMargins.right!=null?{value:t.cellMargins.right,type:"dxa"}:void 0}),r}if(!(t.styleId||t.width!=null||t.widthType||t.justification||t.tableLayout||t.floating||t.cellMargins||t.look))return;let n=t.cellMargins?{top:t.cellMargins.top!=null?{value:t.cellMargins.top,type:"dxa"}:void 0,bottom:t.cellMargins.bottom!=null?{value:t.cellMargins.bottom,type:"dxa"}:void 0,left:t.cellMargins.left!=null?{value:t.cellMargins.left,type:"dxa"}:void 0,right:t.cellMargins.right!=null?{value:t.cellMargins.right,type:"dxa"}:void 0}:void 0,o;return (t.width!=null||t.widthType)&&(o={value:t.width??0,type:t.widthType||"dxa"}),{styleId:t.styleId||void 0,width:o,justification:t.justification||void 0,layout:t.tableLayout||void 0,floating:t.floating||void 0,cellMargins:n,look:t.look||void 0}}function Z(t){if(t._originalFormatting){let n=t._originalFormatting,o={...n};return t.height!==(n.height?.value||void 0)&&(o.height=t.height?{value:t.height,type:"dxa"}:void 0),t.heightRule!==(n.heightRule||void 0)&&(o.heightRule=t.heightRule||void 0),t.isHeader!==(n.header||void 0)&&(o.header=t.isHeader||void 0),o}if(t.height||t.isHeader)return {height:t.height?{value:t.height,type:"dxa"}:void 0,heightRule:t.heightRule||void 0,header:t.isHeader||void 0}}function ee(t){let e=t.attrs,n=[];t.forEach(i=>{i.type.name==="paragraph"?n.push(T(i)):i.type.name==="table"&&n.push(I(i));});let o={type:"tableCell",formatting:te(e),content:n};if(e.cellMarker){let i=e.cellMarker,r={id:i.info.revisionId,author:i.info.author,...i.info.date?{date:i.info.date}:{}};i.kind==="ins"?o.structuralChange={type:"tableCellInsertion",info:r}:i.kind==="del"?o.structuralChange={type:"tableCellDeletion",info:r}:o.structuralChange={type:"tableCellMerge",info:r,...i.vMerge?{vMerge:i.vMerge}:{},...i.vMergeOrig?{vMergeOrig:i.vMergeOrig}:{}};}return e.tcPrChange&&e.tcPrChange.length>0&&(o.propertyChanges=e.tcPrChange),o}function te(t){if(t._originalFormatting){let o=t._originalFormatting,i={...o};if(t.colspan>1&&(i.gridSpan=t.colspan),t.width!=null&&(i.width={value:t.width,type:t.widthType||"dxa"}),t.verticalAlign!==(o.verticalAlign||void 0)&&(i.verticalAlign=t.verticalAlign||void 0),t.backgroundColor?t._originalResolvedFill===t.backgroundColor&&o.shading?i.shading=o.shading:i.shading={fill:{rgb:t.backgroundColor}}:o.shading&&(i.shading=void 0),t.borders&&(i.borders=t.borders),t.margins){let r=t.margins,a={};r.top!=null&&(a.top={value:r.top,type:"dxa"}),r.bottom!=null&&(a.bottom={value:r.bottom,type:"dxa"}),r.left!=null&&(a.left={value:r.left,type:"dxa"}),r.right!=null&&(a.right={value:r.right,type:"dxa"}),i.margins=a;}return t.textDirection!==(o.textDirection||void 0)&&(i.textDirection=t.textDirection||void 0),i}if(!(t.colspan>1||t.rowspan>1||t.width!=null||t.verticalAlign||t.backgroundColor||t.borders||t.margins||t.textDirection))return;let n;if(t.margins){let o=t.margins;n={},o.top!=null&&(n.top={value:o.top,type:"dxa"}),o.bottom!=null&&(n.bottom={value:o.bottom,type:"dxa"}),o.left!=null&&(n.left={value:o.left,type:"dxa"}),o.right!=null&&(n.right={value:o.right,type:"dxa"});}return {gridSpan:t.colspan>1?t.colspan:void 0,width:t.width!=null?{value:t.width,type:t.widthType||"dxa"}:void 0,verticalAlign:t.verticalAlign||void 0,textDirection:t.textDirection||void 0,shading:t.backgroundColor?{fill:{rgb:t.backgroundColor}}:void 0,borders:t.borders,margins:n}}function F(t){let e=t.attrs,n=[];t.forEach(l=>{l.type.name==="paragraph"&&n.push(T(l));});let o={type:"shape",shapeType:"rect",id:e.textBoxId||void 0,size:{width:e.width?chunkBJSG6TEG_js.g(e.width):0,height:e.height?chunkBJSG6TEG_js.g(e.height):0},textBody:{content:n.length>0?n:[{type:"paragraph",content:[]}],margins:{top:e.marginTop!=null?chunkBJSG6TEG_js.g(e.marginTop):void 0,bottom:e.marginBottom!=null?chunkBJSG6TEG_js.g(e.marginBottom):void 0,left:e.marginLeft!=null?chunkBJSG6TEG_js.g(e.marginLeft):void 0,right:e.marginRight!=null?chunkBJSG6TEG_js.g(e.marginRight):void 0}}},i=chunk34DJT72K_js.f(e);i&&(o.position=i);let r=chunk34DJT72K_js.g(e);if(r&&(o.wrap=r),e.fillColor&&(o.fill={type:"solid",color:{rgb:e.fillColor.replace("#","")}}),e.outlineWidth&&e.outlineWidth>0){let l={solid:"solid",dotted:"dot",dashed:"dash"};o.outline={width:chunkBJSG6TEG_js.g(e.outlineWidth),color:e.outlineColor?{rgb:e.outlineColor.replace("#","")}:void 0,style:e.outlineStyle&&l[e.outlineStyle]||"solid"};}return {type:"run",content:[{type:"shape",shape:o}]}}function K(t){return {type:"paragraph",content:[F(t)]}}function ne(t,e){let o={content:A(t),finalSectionProperties:e?.package.document.finalSectionProperties,sections:e?.package.document.sections,comments:e?.package.document.comments},i=e?{...e,package:{...e.package,document:o}}:{package:{document:o}},r=t.attrs.watermark??null,a=chunkRQVHKDXK_js.a(i)??null;return r!==a?chunkRQVHKDXK_js.b(i,r):i}function A(t){let e=[],n=[],o=()=>{for(let i of n)e.push({type:"paragraph",content:[i]});n=[];};return t.forEach(i=>{if(i.type.name==="paragraph"){let r=T(i);n.length>0&&(r.content=[...n,...r.content],n=[]),e.push(r);}else if(i.type.name==="table")o(),e.push(I(i));else if(i.type.name==="blockSdt")o(),e.push(ie(i));else if(i.type.name==="textBox"){let r=i.attrs;chunk34DJT72K_js.e(r)?n.push(F(i)):(o(),e.push(K(i)));}else i.type.name==="pageBreak"&&(o(),e.push(oe()));}),o(),e}function ie(t){return {type:"blockSdt",properties:chunk34DJT72K_js.b(t.attrs),content:A(t)}}function oe(){return {type:"paragraph",content:[{type:"run",content:[{type:"break",breakType:"page"}]}]}}function we(t,e){return ne(e,t)}function ve(t){return A(t)}exports.a=ne;exports.b=we;exports.c=ve;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var chunk7HANRHHL_js=require('./chunk-7HANRHHL.js'),chunkMJ5FQX7Q_js=require('./chunk-MJ5FQX7Q.js'),prosemirrorCommands=require('prosemirror-commands'),prosemirrorTables=require('prosemirror-tables'),prosemirrorState=require('prosemirror-state'),prosemirrorView=require('prosemirror-view');function He(n){switch(n.toLowerCase()){case "solid":return "single";case "double":return "double";case "dotted":return "dotted";case "dashed":return "dashed";case "groove":return "threeDEngrave";case "ridge":return "threeDEmboss";case "inset":return "inset";case "outset":return "outset";default:return "single"}}function Le(n){if(!n)return 8;let t=n.trim().toLowerCase();if(t==="thin")return 4;if(t==="medium")return 8;if(t==="thick")return 16;let e=parseFloat(t);return isNaN(e)?8:t.endsWith("pt")?Math.round(e*8):(t.endsWith("px"),Math.round(e*6))}function X(n){if(!n||n==="transparent"||n==="inherit")return null;let t=n.match(/#([0-9a-fA-F]{6})/);if(t)return {rgb:t[1].toUpperCase()};let e=n.match(/#([0-9a-fA-F]{3})$/);if(e){let[r,l,s]=e[1];return {rgb:(r+r+l+l+s+s).toUpperCase()}}let o=n.match(/rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/);return o?{rgb:[o[1],o[2],o[3]].map(l=>parseInt(l).toString(16).padStart(2,"0")).join("").toUpperCase()}:null}function Fe(n){let t=(s,i,c)=>{if(!(!s||s==="none"||s==="hidden"))return {style:He(s),color:X(i)||void 0,size:Le(c)}},e=t(n.borderTopStyle,n.borderTopColor,n.borderTopWidth),o=t(n.borderBottomStyle,n.borderBottomColor,n.borderBottomWidth),r=t(n.borderLeftStyle,n.borderLeftColor,n.borderLeftWidth),l=t(n.borderRightStyle,n.borderRightColor,n.borderRightWidth);return !e&&!o&&!r&&!l?null:{top:e,bottom:o,left:r,right:l}}function Oe(n){let t=s=>{if(!s||s==="0px")return;let i=parseFloat(s);if(!(isNaN(i)||i===0))return s.endsWith("pt")?Math.round(i*20):Math.round(i*15)},e=t(n.paddingTop),o=t(n.paddingRight),r=t(n.paddingBottom),l=t(n.paddingLeft);return e===void 0&&o===void 0&&r===void 0&&l===void 0?null:{top:e,right:o,bottom:r,left:l}}function Ge(n){if(n)switch(n.toLowerCase()){case "top":return "top";case "middle":return "center";case "bottom":return "bottom";default:return}}function _e(n){return X(n)?.rgb}function O(n){let t=n.style,e=Fe(t),o=Oe(t);return {colspan:n.colSpan||1,rowspan:n.rowSpan||1,verticalAlign:n.dataset.valign||Ge(t.verticalAlign)||void 0,backgroundColor:n.dataset.bgcolor||_e(t.backgroundColor)||void 0,borders:e||void 0,margins:o||void 0}}var Z={content:"tableRow+",group:"block",tableRole:"table",isolating:true,attrs:{styleId:{default:null},width:{default:null},widthType:{default:null},justification:{default:null},columnWidths:{default:null},tableLayout:{default:null},floating:{default:null},cellMargins:{default:null},look:{default:null},_originalFormatting:{default:null},tblPrChange:{default:null}},parseDOM:[{tag:"table",getAttrs(n){let t=n;return {styleId:t.dataset.styleId||void 0,justification:t.dataset.justification}}}],toDOM(n){let t=n.attrs,e={class:"docx-table"};t.styleId&&(e["data-style-id"]=t.styleId);let o=["border-collapse: collapse"];if(t.width&&t.widthType==="pct")o.push(`width: ${t.width/50}%`),o.push("table-layout: fixed");else if(t.width&&t.widthType==="dxa"){let r=Math.round(t.width/20*1.333);o.push(`width: ${r}px`),o.push("table-layout: fixed");}else o.push("width: 100%"),o.push("table-layout: fixed");if(t.justification==="center"?o.push("margin-left: auto","margin-right: auto"):t.justification==="right"&&o.push("margin-left: auto"),e.style=o.join("; "),Array.isArray(t.tblPrChange)&&t.tblPrChange.length>0){let r=t.tblPrChange[0];e.class+=" ep-revision-prop-change",e["data-revision-id"]=String(r.info.id),e["data-revision-author"]=r.info.author,r.info.date&&(e["data-revision-date"]=r.info.date);}return ["table",e,["tbody",0]]}},ee={content:"(tableCell | tableHeader)+",tableRole:"row",attrs:{height:{default:null},heightRule:{default:null},isHeader:{default:false},_originalFormatting:{default:null},trIns:{default:null},trDel:{default:null},trPrChange:{default:null}},parseDOM:[{tag:"tr"}],toDOM(n){let t=n.attrs,e={};if(t.height){let o=Math.round(t.height/20*1.333);e.style=`height: ${o}px`;}if(t.trIns||t.trDel){let o=t.trIns??t.trDel,r=t.trIns?"ep-revision-ins":"ep-revision-del";e.class="ep-revision-row "+r,e["data-revision-id"]=String(o.revisionId),e["data-revision-author"]=o.author,o.date&&(e["data-revision-date"]=o.date);}else if(Array.isArray(t.trPrChange)&&t.trPrChange.length>0){let o=t.trPrChange[0];e.class="ep-revision-prop-change",e["data-revision-id"]=String(o.info.id),e["data-revision-author"]=o.info.author,o.info.date&&(e["data-revision-date"]=o.info.date);}return ["tr",e,0]}},Ue={single:"solid",double:"double",dotted:"dotted",dashed:"dashed",thick:"solid",dashSmallGap:"dashed",dotDash:"dashed",dotDotDash:"dotted",triple:"double",thinThickSmallGap:"double",thickThinSmallGap:"double",thinThickThinSmallGap:"double",thinThickMediumGap:"double",thickThinMediumGap:"double",thinThickThinMediumGap:"double",thinThickLargeGap:"double",thickThinLargeGap:"double",thinThickThinLargeGap:"double",wave:"solid",doubleWave:"double",dashDotStroked:"dashed",threeDEmboss:"ridge",threeDEngrave:"groove",outset:"outset",inset:"inset"};function te(n){let t=[],e=n.borders;if(!e)return t;let o=r=>{if(!r||!r.style||r.style==="none"||r.style==="nil")return "none";let l=r.size?Math.max(1,Math.round(r.size/8*1.333)):1,s=Ue[r.style]||"solid",i=chunkMJ5FQX7Q_js.a(r.color,void 0);return `${l}px ${s} ${i}`};return t.push(`border-top: ${o(e.top)}`),t.push(`border-bottom: ${o(e.bottom)}`),t.push(`border-left: ${o(e.left)}`),t.push(`border-right: ${o(e.right)}`),t}function oe(n){let t=n.margins;if(!t){let i=Math.round(7.1982);return [`padding: ${i}px ${i}px`]}let e=i=>i?Math.round(i/20*1.333):0,o=e(t.top),r=e(t.right),l=e(t.bottom),s=e(t.left);return [`padding: ${o}px ${r}px ${l}px ${s}px`]}function ne(n){if(!n)return [];let t=[];switch(n){case "tbRl":case "tbRlV":t.push("writing-mode: vertical-rl");break;case "btLr":t.push("writing-mode: vertical-lr","transform: rotate(180deg)");break;case "rl":case "rlV":t.push("direction: rtl");break;case "tb":case "tbV":t.push("writing-mode: vertical-lr");break}return t}function re(n){let t=[];if(n.colwidth&&n.colwidth.length>0){let e=n.colwidth.reduce((o,r)=>o+r,0);t.push(`width: ${e}px`);}else if(n.width&&n.widthType==="pct")t.push(`width: ${n.width}%`);else if(n.width){let e=Math.round(n.width/20*1.333);t.push(`width: ${e}px`);}return t}var le={content:"(paragraph | table)+",tableRole:"cell",isolating:true,attrs:{colspan:{default:1},rowspan:{default:1},colwidth:{default:null},width:{default:null},widthType:{default:null},verticalAlign:{default:null},backgroundColor:{default:null},borders:{default:null},margins:{default:null},textDirection:{default:null},noWrap:{default:false},_originalFormatting:{default:null},_originalResolvedFill:{default:null},cellMarker:{default:null},tcPrChange:{default:null}},parseDOM:[{tag:"td",getAttrs:n=>O(n)}],toDOM(n){let t=n.attrs,e={class:"docx-table-cell"};if(t.cellMarker){let r=t.cellMarker,l=r.kind==="ins"?"ep-revision-ins":r.kind==="del"?"ep-revision-del":"ep-revision-merge";e.class=`${e.class} ep-revision-cell ${l}`,e["data-revision-id"]=String(r.info.revisionId),e["data-revision-author"]=r.info.author,r.info.date&&(e["data-revision-date"]=r.info.date),r.kind==="merge"&&(e["data-vmerge"]=r.vMerge);}else if(Array.isArray(t.tcPrChange)&&t.tcPrChange.length>0){let r=t.tcPrChange[0];e.class=`${e.class} ep-revision-prop-change`,e["data-revision-id"]=String(r.info.id),e["data-revision-author"]=r.info.author,r.info.date&&(e["data-revision-date"]=r.info.date);}t.colspan>1&&(e.colspan=String(t.colspan)),t.rowspan>1&&(e.rowspan=String(t.rowspan));let o=[];return o.push(...oe(t)),t.noWrap?o.push("white-space: nowrap"):o.push("word-wrap: break-word","overflow-wrap: break-word","overflow: hidden"),o.push(...re(t)),o.push(...te(t)),o.push(...ne(t.textDirection)),t.verticalAlign&&(e["data-valign"]=t.verticalAlign,o.push(`vertical-align: ${t.verticalAlign}`)),t.backgroundColor&&(e["data-bgcolor"]=t.backgroundColor,o.push(`background-color: #${t.backgroundColor}`)),e.style=o.join("; "),["td",e,0]}},se={content:"(paragraph | table)+",tableRole:"header_cell",isolating:true,attrs:{colspan:{default:1},rowspan:{default:1},colwidth:{default:null},width:{default:null},widthType:{default:null},verticalAlign:{default:null},backgroundColor:{default:null},borders:{default:null},margins:{default:null},textDirection:{default:null},noWrap:{default:false},_originalFormatting:{default:null},_originalResolvedFill:{default:null},cellMarker:{default:null},tcPrChange:{default:null}},parseDOM:[{tag:"th",getAttrs:n=>O(n)}],toDOM(n){let t=n.attrs,e={class:"docx-table-header"};if(t.colspan>1&&(e.colspan=String(t.colspan)),t.rowspan>1&&(e.rowspan=String(t.rowspan)),t.cellMarker){let r=t.cellMarker,l=r.kind==="ins"?"ep-revision-ins":r.kind==="del"?"ep-revision-del":"ep-revision-merge";e.class=`${e.class} ep-revision-cell ${l}`,e["data-revision-id"]=String(r.info.revisionId),e["data-revision-author"]=r.info.author,r.info.date&&(e["data-revision-date"]=r.info.date),r.kind==="merge"&&(e["data-vmerge"]=r.vMerge);}else if(Array.isArray(t.tcPrChange)&&t.tcPrChange.length>0){let r=t.tcPrChange[0];e.class=`${e.class} ep-revision-prop-change`,e["data-revision-id"]=String(r.info.id),e["data-revision-author"]=r.info.author,r.info.date&&(e["data-revision-date"]=r.info.date);}let o=["font-weight: bold"];return o.push(...oe(t)),t.noWrap?o.push("white-space: nowrap"):o.push("word-wrap: break-word","overflow-wrap: break-word","overflow: hidden"),o.push(...re(t)),o.push(...te(t)),o.push(...ne(t.textDirection)),t.verticalAlign&&(e["data-valign"]=t.verticalAlign,o.push(`vertical-align: ${t.verticalAlign}`)),t.backgroundColor&&(e["data-bgcolor"]=t.backgroundColor,o.push(`background-color: #${t.backgroundColor}`)),e.style=o.join("; "),["th",e,0]}};function y(n){let{selection:t}=n,{$from:e}=t,r=t instanceof prosemirrorTables.CellSelection&&t.$anchorCell.pos!==t.$headCell.pos,l,s,i,c,a;for(let m=e.depth;m>0;m--){let h=e.node(m);if(h.type.name==="tableCell"||h.type.name==="tableHeader"){a=h;let g=e.node(m-1);if(g&&g.type.name==="tableRow"){let w=0,x=false;g.forEach((S,C,P)=>{x||(P===e.index(m-1)?(c=w,x=true):w+=S.attrs.colspan||1);});}}else if(h.type.name==="tableRow"){let g=e.node(m-1);g&&g.type.name==="table"&&(i=e.index(m-1));}else if(h.type.name==="table"){l=h,s=e.before(m);break}}if(!l)return {isInTable:false};let d=0,u=0;l.forEach(m=>{if(m.type.name==="tableRow"){d++;let h=0;m.forEach(g=>{h+=g.attrs.colspan||1;}),u=Math.max(u,h);}});let f=!!a&&!r,p,b;if(a){let m=a.attrs;m.backgroundColor&&typeof m.backgroundColor=="string"&&(b=m.backgroundColor);let h=m.borders;if(h)for(let g of ["top","right","bottom","left"]){let w=h[g];if(w?.color&&w.style&&w.style!=="none"&&w.style!=="nil"){p=w.color;break}}}return {isInTable:true,table:l,tablePos:s,rowIndex:i,columnIndex:c,rowCount:d,columnCount:u,hasMultiCellSelection:r,canSplitCell:!!f,cellBorderColor:p,cellBackgroundColor:b}}function G(n){let{$from:t}=n.selection;for(let e=t.depth;e>0;e--){let o=t.node(e);if(o.type.name==="tableCell"||o.type.name==="tableHeader")return true}return false}function ae(n){let{$from:t}=n.selection,e=-1,o=-1,r=-1;for(let l=t.depth;l>0;l--){let s=t.node(l);if(s.type.name==="tableCell"||s.type.name==="tableHeader")e=l;else if(s.type.name==="tableRow")o=l;else if(s.type.name==="table"){r=l;break}}return e===-1||o===-1||r===-1?null:{cellDepth:e,cellPos:t.before(e),rowDepth:o,tableDepth:r}}function qe(){return (n,t)=>{if(!G(n))return false;let e=ae(n);if(!e)return false;let{$from:o}=n.selection,r=o.node(e.tableDepth),l=o.node(e.rowDepth),s=o.index(e.rowDepth),i=o.index(e.tableDepth);if(s<l.childCount-1){let c=e.cellPos+o.node(e.cellDepth).nodeSize;if(t){let a=c+1+1,d=n.tr.setSelection(prosemirrorState.Selection.near(n.doc.resolve(a)));t(d.scrollIntoView());}return true}if(i<r.childCount-1){let a=o.before(e.rowDepth)+l.nodeSize;if(t){let d=a+1+1+1,u=n.tr.setSelection(prosemirrorState.Selection.near(n.doc.resolve(d)));t(u.scrollIntoView());}return true}return false}}function Je(){return (n,t)=>{if(!G(n))return false;let e=ae(n);if(!e)return false;let{$from:o}=n.selection,r=o.node(e.tableDepth),l=o.index(e.rowDepth),s=o.index(e.tableDepth);if(l>0){let c=o.node(e.rowDepth).child(l-1),a=e.cellPos-c.nodeSize;if(t){let d=a+c.nodeSize-2,u=n.tr.setSelection(prosemirrorState.Selection.near(n.doc.resolve(d),-1));t(u.scrollIntoView());}return true}if(s>0){let i=r.child(s-1),a=o.before(e.rowDepth)-i.nodeSize;if(t){let u=a+i.nodeSize-1-1,f=n.tr.setSelection(prosemirrorState.Selection.near(n.doc.resolve(u),-1));t(f.scrollIntoView());}return true}return false}}function E(n,t={}){let e=n?.attrs??{};return {colspan:e.colspan||1,rowspan:1,colwidth:e.colwidth,width:e.width,widthType:e.widthType,verticalAlign:e.verticalAlign,backgroundColor:e.backgroundColor,borders:e.borders,margins:e.margins,textDirection:e.textDirection,noWrap:e.noWrap,...t}}function z(n,t){let{$from:e}=n.selection;for(let o=e.depth;o>0;o--){let r=e.node(o);if(r.type.name===t)return {pos:e.before(o),node:r}}return null}function B(n){let t=n.selection;if(t instanceof prosemirrorTables.CellSelection){let o=[];return t.forEachCell((r,l)=>{o.push({pos:l,node:r});}),o}let e=z(n,"tableCell")??z(n,"tableHeader");return e?[e]:[]}function V(n,t){let e=new Map,o=new Map,r=n.childCount,l=0;return n.forEach((s,i,c)=>{if(s.type.name!=="tableRow")return;let a=0;s.forEach((d,u)=>{let f=t+i+u+2,p=d.attrs.colspan||1;e.set(f,{rowIdx:c,colIdx:a,colspan:p,pos:f,node:d}),o.set(`${c},${a}`,f),a+=p;}),l=Math.max(l,a);}),{cellByPos:e,cellByRC:o,totalRows:r,totalCols:l}}function ie(n,t,e){let o=[];return t.forEach(r=>{let l=n.nodes.paragraph.create(),i={...E(r),cellMarker:{kind:"ins",info:e}};o.push(n.nodes.tableCell.create(i,l));}),n.nodes.tableRow.create({height:t.attrs.height??360,heightRule:t.attrs.heightRule??"atLeast",isHeader:t.attrs.isHeader??false,trIns:e},o)}function Xe(n){return function(e,o,r="000000",l=9360,s){let i=[],c=Math.floor(l/o),a=360,d="atLeast",u={style:"single",size:4,color:{rgb:r}},f={top:u,bottom:u,left:u,right:u};for(let b=0;b<e;b++){let m=[];for(let g=0;g<o;g++){let w=n.nodes.paragraph.create(),x={colspan:1,rowspan:1,borders:f,width:c,widthType:"dxa"};s&&(x.cellMarker={kind:"ins",info:s}),m.push(n.nodes.tableCell.create(x,w));}let h={height:a,heightRule:d};s&&(h.trIns=s),i.push(n.nodes.tableRow.create(h,m));}let p=Array(o).fill(c);return n.nodes.table.create({columnWidths:p,width:l,widthType:"dxa",tableLayout:"fixed"},i)}}function de(n){let t=Xe(n);return function(o,r){return (l,s)=>{let{$from:i}=l.selection,c="000000",a=l.storedMarks||i.marks();for(let u of a)if(u.type.name==="textColor"&&u.attrs.rgb){c=u.attrs.rgb;break}let d=i.pos;for(let u=i.depth;u>0;u--){let f=i.node(u);if(f.type.name==="paragraph"||f.type.name==="table"){d=i.after(u);break}}if(s){let u=9360;for(let P=i.depth;P>0;P--){let R=i.node(P);if(R.type.name==="tableCell"||R.type.name==="tableHeader"){let T=R.attrs.width;T&&T>0&&(u=Math.max(T-216,360));break}}let f=chunk7HANRHHL_js.i(l),p=t(o,r,c,u,f),b=n.nodes.paragraph.create(),h=l.doc.resolve(d).nodeBefore?.type.name==="table",g=h?[b,p,b]:[p,b],w=l.tr.insert(d,g),x=d+1;h&&(x+=b.nodeSize);let C=x+1+1;w.setSelection(prosemirrorState.TextSelection.create(w.doc,C)),s(w.scrollIntoView());}return true}}}function ce(n){return (t,e)=>{let o=y(t);if(!o.isInTable||o.rowIndex===void 0||!o.table||o.tablePos===void 0)return false;if(e){let r=t.tr,l=o.table.child(o.rowIndex),s=chunk7HANRHHL_js.i(t),i;if(s)i=ie(n,l,s);else {let a=[];l.forEach(d=>{let u=n.nodes.paragraph.create(),f=E(d);a.push(n.nodes.tableCell.create(f,u));}),i=n.nodes.tableRow.create({height:l.attrs.height??360,heightRule:l.attrs.heightRule??"atLeast"},a);}let c=o.tablePos+1;for(let a=0;a<o.rowIndex;a++)c+=o.table.child(a).nodeSize;r.insert(c,i),e(r.scrollIntoView());}return true}}function ue(n){return (t,e)=>{let o=y(t);if(!o.isInTable||o.rowIndex===void 0||!o.table||o.tablePos===void 0)return false;if(e){let r=t.tr,l=o.table.child(o.rowIndex),s=chunk7HANRHHL_js.i(t),i;if(s)i=ie(n,l,s);else {let a=[];l.forEach(d=>{let u=n.nodes.paragraph.create(),f=E(d);a.push(n.nodes.tableCell.create(f,u));}),i=n.nodes.tableRow.create({height:l.attrs.height??360,heightRule:l.attrs.heightRule??"atLeast"},a);}let c=o.tablePos+1;for(let a=0;a<=o.rowIndex;a++)c+=o.table.child(a).nodeSize;r.insert(c,i),e(r.scrollIntoView());}return true}}function fe(n){return (t,e)=>{let o=y(t);if(!o.isInTable||o.columnIndex===void 0||!o.table||o.tablePos===void 0)return false;if(e){let r=t.tr,l=(o.columnCount||1)+1,s=Math.floor(5e3/l),i=[],c=o.tablePos+1;o.table.forEach(d=>{i.push(c),c+=d.nodeSize;}),o.table.forEach((d,u,f)=>{if(d.type.name==="tableRow"){let b=r.mapping.map(i[f])+1,m=0,h=false;if(d.forEach(g=>{if(!h&&m===o.columnIndex){let w=n.nodes.paragraph.create(),x=E(g,{colspan:1,rowspan:1});x.width=s,x.widthType="pct";let S=n.nodes.tableCell.create(x,w);r=r.insert(b,S),h=true;}b+=g.nodeSize,m+=g.attrs.colspan||1;}),!h&&m<=o.columnIndex){let g=n.nodes.paragraph.create(),w=E(d.child(d.childCount-1)??null,{colspan:1,rowspan:1});w.width=s,w.widthType="pct";let x=n.nodes.tableCell.create(w,g);r=r.insert(b,x);}}});let a=r.doc.nodeAt(o.tablePos);if(a&&a.type.name==="table"){let d=a.child(0);if(d&&d.type.name==="tableRow"){let b=o.tablePos+2;d.forEach(m=>{(m.type.name==="tableCell"||m.type.name==="tableHeader")&&(r=r.setNodeMarkup(b,void 0,{...m.attrs,width:s,widthType:"pct"})),b+=m.nodeSize;});}let u=d?.childCount??l,f=a.attrs.width||9360,p=Math.floor(f/Math.max(1,u));r=r.setNodeMarkup(o.tablePos,void 0,{...a.attrs,columnWidths:Array(u).fill(p)});}e(r.scrollIntoView());}return true}}function pe(n){return (t,e)=>{let o=y(t);if(!o.isInTable||o.columnIndex===void 0||!o.table||o.tablePos===void 0)return false;if(e){let r=t.tr,l=(o.columnCount||1)+1,s=Math.floor(5e3/l),i=[],c=o.tablePos+1;o.table.forEach(d=>{i.push(c),c+=d.nodeSize;}),o.table.forEach((d,u,f)=>{if(d.type.name==="tableRow"){let b=r.mapping.map(i[f])+1,m=0,h=false;if(d.forEach(g=>{if(b+=g.nodeSize,m+=g.attrs.colspan||1,!h&&m>o.columnIndex){let w=n.nodes.paragraph.create(),x=E(g,{colspan:1,rowspan:1});x.width=s,x.widthType="pct";let S=n.nodes.tableCell.create(x,w);r=r.insert(b,S),h=true;}}),!h){let g=n.nodes.paragraph.create(),w=E(d.child(d.childCount-1)??null,{colspan:1,rowspan:1});w.width=s,w.widthType="pct";let x=n.nodes.tableCell.create(w,g);r=r.insert(b,x);}}});let a=r.doc.nodeAt(o.tablePos);if(a&&a.type.name==="table"){let d=a.child(0);if(d&&d.type.name==="tableRow"){let b=o.tablePos+2;d.forEach(m=>{(m.type.name==="tableCell"||m.type.name==="tableHeader")&&(r=r.setNodeMarkup(b,void 0,{...m.attrs,width:s,widthType:"pct"})),b+=m.nodeSize;});}let u=d?.childCount??l,f=a.attrs.width||9360,p=Math.floor(f/Math.max(1,u));r=r.setNodeMarkup(o.tablePos,void 0,{...a.attrs,columnWidths:Array(u).fill(p)});}e(r.scrollIntoView());}return true}}var be=(n,t)=>{let e=y(n);if(!e.isInTable||e.rowIndex===void 0||!e.table||e.tablePos===void 0||(e.rowCount||0)<=1)return false;let o=e.rowCount??0,r=prosemirrorTables.selectedRect(n),l=Math.max(0,Math.min(r.top,o-1)),s=Math.min(Math.max(r.bottom-1,l),o-1);if(t){let i=n.tr,c=e.table,a=chunk7HANRHHL_js.i(n);if(!a&&l===0&&s>=o-1)return i.delete(e.tablePos,e.tablePos+c.nodeSize),t(i.scrollIntoView()),true;let d=[],u=e.tablePos+1;if(c.forEach(f=>{d.push(u),u+=f.nodeSize;}),a)for(let f=l;f<=s;f++){let p=c.child(f),b=d[f];i.setNodeMarkup(b,void 0,{...p.attrs,trDel:a});let m=b+1;p.forEach(h=>{(h.type.name==="tableCell"||h.type.name==="tableHeader")&&i.setNodeMarkup(m,void 0,{...h.attrs,cellMarker:{kind:"del",info:a}}),m+=h.nodeSize;});}else for(let f=s;f>=l;f--){let p=c.child(f),b=d[f];i.delete(b,b+p.nodeSize);}t(i.scrollIntoView());}return true},me=(n,t)=>{let e=y(n);if(!e.isInTable||e.columnIndex===void 0||!e.table||e.tablePos===void 0||(e.columnCount||0)<=1)return false;if(t){let o=n.tr,r=(e.columnCount||2)-1,l=Math.floor(5e3/r),s=[],i=e.tablePos+1;e.table.forEach(a=>{if(a.type.name==="tableRow"){let d=i+1,u=0;a.forEach(f=>{let p=d,b=d+f.nodeSize,m=f.attrs.colspan||1;u<=e.columnIndex&&e.columnIndex<u+m&&s.push({start:p,end:b}),d=b,u+=m;});}i+=a.nodeSize;}),s.reverse().forEach(({start:a,end:d})=>{o=o.delete(a,d);});let c=o.doc.nodeAt(e.tablePos);if(c&&c.type.name==="table"){let a=c.child(0);if(a&&a.type.name==="tableRow"){let p=e.tablePos+2;a.forEach(b=>{(b.type.name==="tableCell"||b.type.name==="tableHeader")&&(o=o.setNodeMarkup(p,void 0,{...b.attrs,width:l,widthType:"pct"})),p+=b.nodeSize;});}let d=a?.childCount??r,u=c.attrs.width||9360,f=Math.floor(u/Math.max(1,d));o=o.setNodeMarkup(e.tablePos,void 0,{...c.attrs,columnWidths:Array(d).fill(f)});}t(o.scrollIntoView());}return true},he=(n,t)=>{let e=y(n);if(!e.isInTable||e.tablePos===void 0||!e.table)return false;if(t){let o=n.tr;o.delete(e.tablePos,e.tablePos+e.table.nodeSize),t(o.scrollIntoView());}return true},_=(n,t)=>{let e=n.selection;if(!("$anchorCell"in e&&typeof e.forEachCell=="function"))return false;let r=y(n);if(!r.isInTable||r.tablePos===void 0||!r.table)return false;let l=0;r.table.descendants(c=>{(c.type.name==="tableCell"||c.type.name==="tableHeader")&&(l+=1);});let s=0;if(e.forEachCell(()=>{s+=1;}),!(l>0&&s>=l))return false;if(t){let c=n.tr.delete(r.tablePos,r.tablePos+r.table.nodeSize);t(c.scrollIntoView());}return true},U=n=>{let{$from:t,empty:e}=n.selection;if(!e)return false;let o=t.parent;if(o.type.name!=="paragraph"||o.textContent.length>0)return false;let r=t.depth;if(r<1)return false;let l=t.node(r-1),s=t.index(r-1),i=s>0?l.child(s-1):null,c=s+1<l.childCount?l.child(s+1):null,a=i?.type.name==="table",d=c?.type.name==="table";return !!(a||d)};var ge=(n,t)=>{let e=y(n);if(!e.isInTable||e.tablePos===void 0||!e.table)return false;if(t){let o=e.tablePos+1,r=n.doc.resolve(o),l=n.doc.resolve(e.tablePos+e.table.nodeSize-2),s=prosemirrorTables.CellSelection.create(n.doc,r.pos,l.pos);t(n.tr.setSelection(s));}return true},we=(n,t)=>{let e=y(n);if(!e.isInTable||e.tablePos===void 0||!e.table||e.rowIndex===void 0)return false;if(t){let r=e.tablePos+1;for(let a=0;a<e.rowIndex;a++){let d=e.table.child(a);r+=d.nodeSize;}let l=e.table.child(e.rowIndex),s=r+1,i=r+l.nodeSize-2,c=prosemirrorTables.CellSelection.create(n.doc,s,i);t(n.tr.setSelection(c));}return true},Ce=(n,t)=>{let e=y(n);if(!e.isInTable||e.tablePos===void 0||!e.table||e.columnIndex===void 0)return false;if(t){let o=e.tablePos+1,r=e.table.child(0),l=e.table.child(e.table.childCount-1),s=o+1;for(let d=0;d<e.columnIndex&&d<r.childCount;d++)s+=r.child(d).nodeSize;let i=o;for(let d=0;d<e.table.childCount-1;d++)i+=e.table.child(d).nodeSize;let c=i+1;for(let d=0;d<e.columnIndex&&d<l.childCount;d++)c+=l.child(d).nodeSize;let a=prosemirrorTables.CellSelection.create(n.doc,s,c);t(n.tr.setSelection(a));}return true};var F={top:{adjSide:"bottom",dRow:-1,dCol:0},bottom:{adjSide:"top",dRow:1,dCol:0},left:{adjSide:"right",dRow:0,dCol:-1},right:{adjSide:"left",dRow:0,dCol:1}};function W(n,t){return (e,o)=>{let r=y(e);if(!r.isInTable||r.tablePos===void 0||!r.table)return false;if(o){let l=e.tr,s=r.table,i=r.tablePos,c=t??{style:"single",size:4,color:{rgb:"000000"}},a={style:"none"},{cellByPos:d,cellByRC:u}=V(s,i),f=B(e),p=1/0,b=-1,m=1/0,h=-1;for(let{pos:S}of f){let C=d.get(S);C&&(p=Math.min(p,C.rowIdx),b=Math.max(b,C.rowIdx),m=Math.min(m,C.colIdx),h=Math.max(h,C.colIdx+C.colspan-1));}let g=new Map,w=(S,C)=>g.get(S)??{...C.attrs},x=(S,C)=>{g.set(S,C);};for(let{pos:S}of f){let C=d.get(S);if(!C)continue;let P=C.rowIdx===p,R=C.rowIdx===b,T=C.colIdx===m,M=C.colIdx+C.colspan-1===h,k;switch(n){case "all":k={top:c,bottom:c,left:c,right:c};break;case "outside":k={top:P?c:a,bottom:R?c:a,left:T?c:a,right:M?c:a};break;case "inside":k={top:P?a:c,bottom:R?a:c,left:T?a:c,right:M?a:c};break;case "none":k={top:a,bottom:a,left:a,right:a};break}let N=w(S,C.node),v=N.borders||{};x(S,{...N,borders:{...v,...k}});for(let A of ["top","bottom","left","right"]){let $=k[A];if(!$)continue;let I=F[A],We=A==="right"?C.colIdx+C.colspan:C.colIdx+I.dCol,H=u.get(`${C.rowIdx+I.dRow},${We}`);if(H===void 0)continue;let je=d.get(H),J=w(H,je.node),Ve=J.borders||{};x(H,{...J,borders:{...Ve,[I.adjSide]:$}});}}for(let[S,C]of g)l.setNodeMarkup(l.mapping.map(S),void 0,C);o(l.scrollIntoView());}return true}}function xe(n,t,e){return (o,r)=>{let l=y(o);if(!l.isInTable||l.tablePos===void 0||!l.table)return false;if(r){let s=o.tr,i=B(o),c=t||{style:"none"},a={style:"none"},d=["top","bottom","left","right"],{cellByPos:u,cellByRC:f}=V(l.table,l.tablePos),p=new Map,b=(h,g)=>p.get(h)??{...g.attrs},m=(h,g)=>p.set(h,g);for(let{pos:h,node:g}of i){let w=u.get(h),x=b(h,g),S=x.borders||{},C=n==="all"?d:[n],P=e?{top:a,bottom:a,left:a,right:a}:{...S};for(let R of C)P[R]=c;if(w){let R=e?d:C;for(let T of R){let M=P[T],k=F[T],N=T==="right"?w.colIdx+w.colspan:w.colIdx+k.dCol,v=f.get(`${w.rowIdx+k.dRow},${N}`);if(v!==void 0){let A=u.get(v),$=b(v,A.node),I=$.borders||{};m(v,{...$,borders:{...I,[k.adjSide]:M}});}}}m(h,{...x,borders:P});}for(let[h,g]of p)s.setNodeMarkup(s.mapping.map(h),void 0,g);r(s.scrollIntoView());}return true}}function ye(n){return (t,e)=>{let o=y(t);if(!o.isInTable||o.tablePos===void 0||!o.table)return false;if(e){let r=t.tr,l=B(t),s=n.replace(/^#/,""),i={style:"single",size:4},{cellByPos:c,cellByRC:a}=V(o.table,o.tablePos),d=new Map,u=(p,b)=>d.get(p)??{...b.attrs},f=(p,b)=>d.set(p,b);for(let{pos:p,node:b}of l){let m=c.get(p),h=u(p,b),g=h.borders||{},w={};for(let x of ["top","bottom","left","right"]){let S={...i,...g[x],color:{rgb:s}};if(w[x]=S,m){let C=F[x],P=x==="right"?m.colIdx+m.colspan:m.colIdx+C.dCol,R=a.get(`${m.rowIdx+C.dRow},${P}`);if(R!==void 0){let T=c.get(R),M=u(R,T.node),k=M.borders||{};f(R,{...M,borders:{...k,[C.adjSide]:S}});}}}f(p,{...h,borders:{...g,...w}});}for(let[p,b]of d)r.setNodeMarkup(r.mapping.map(p),void 0,b);e(r.scrollIntoView());}return true}}function Se(n){return (t,e)=>{let o=y(t);if(!o.isInTable||o.tablePos===void 0||!o.table)return false;if(e){let r=t.tr,l=B(t),s={style:"single",color:{rgb:"000000"}},{cellByPos:i,cellByRC:c}=V(o.table,o.tablePos),a=new Map,d=(f,p)=>a.get(f)??{...p.attrs},u=(f,p)=>a.set(f,p);for(let{pos:f,node:p}of l){let b=i.get(f),m=d(f,p),h=m.borders||{},g={};for(let w of ["top","bottom","left","right"]){let x={...s,...h[w],size:n};if(g[w]=x,b){let S=F[w],C=w==="right"?b.colIdx+b.colspan:b.colIdx+S.dCol,P=c.get(`${b.rowIdx+S.dRow},${C}`);if(P!==void 0){let R=i.get(P),T=d(P,R.node),M=T.borders||{};u(P,{...T,borders:{...M,[S.adjSide]:x}});}}}u(f,{...m,borders:{...h,...g}});}for(let[f,p]of a)r.setNodeMarkup(r.mapping.map(f),void 0,p);e(r.scrollIntoView());}return true}}function Te(n){return (t,e)=>{let o=y(t);if(!o.isInTable||o.tablePos===void 0||!o.table)return false;if(e){let r=t.tr,l=B(t),s=n?n.replace(/^#/,""):null;for(let{pos:i,node:c}of l)r.setNodeMarkup(r.mapping.map(i),void 0,{...c.attrs,backgroundColor:s});e(r.scrollIntoView());}return true}}function Pe(n){return (t,e)=>{let o=y(t);if(!o.isInTable||o.tablePos===void 0||!o.table)return false;if(e){let r=t.tr,l=B(t);for(let{pos:s,node:i}of l)r.setNodeMarkup(r.mapping.map(s),void 0,{...i.attrs,verticalAlign:n});e(r.scrollIntoView());}return true}}function Re(n){return (t,e)=>{let o=y(t);if(!o.isInTable||o.tablePos===void 0||!o.table)return false;if(e){let r=t.tr,l=B(t);for(let{pos:s,node:i}of l){let a={...i.attrs.margins||{},...n};r.setNodeMarkup(r.mapping.map(s),void 0,{...i.attrs,margins:a});}e(r.scrollIntoView());}return true}}function Ie(n){return (t,e)=>{let o=y(t);if(!o.isInTable||o.tablePos===void 0||!o.table)return false;if(e){let r=t.tr,l=B(t);for(let{pos:s,node:i}of l)r.setNodeMarkup(r.mapping.map(s),void 0,{...i.attrs,textDirection:n});e(r.scrollIntoView());}return true}}var ke=(n,t)=>{let e=y(n);if(!e.isInTable||e.tablePos===void 0||!e.table)return false;if(t){let o=n.tr,r=B(n);for(let{pos:l,node:s}of r)o.setNodeMarkup(o.mapping.map(l),void 0,{...s.attrs,noWrap:!s.attrs.noWrap});t(o.scrollIntoView());}return true};function Me(n,t){return (e,o)=>{let r=y(e);if(!r.isInTable||r.tablePos===void 0||!r.table)return false;if(o){let l=z(e,"tableRow");if(!l)return true;let s=e.tr.setNodeMarkup(l.pos,void 0,{...l.node.attrs,height:n,heightRule:n?t||"atLeast":null});o(s.scrollIntoView());}return true}}var ve=(n,t)=>{let e=y(n);if(!e.isInTable||e.tablePos===void 0||!e.table||!e.columnCount)return false;if(t){let o=n.tr,r=e.table,l=e.columnCount,s=r.attrs.columnWidths,i=s?s.reduce((u,f)=>u+f,0):9360,c=Math.floor(i/l),a=e.tablePos+1;r.forEach(u=>{if(u.type.name==="tableRow"){let f=a+1;u.forEach(p=>{(p.type.name==="tableCell"||p.type.name==="tableHeader")&&(o=o.setNodeMarkup(f,void 0,{...p.attrs,width:c,widthType:"dxa",colwidth:null})),f+=p.nodeSize;});}a+=u.nodeSize;});let d=Array(l).fill(c);o=o.setNodeMarkup(e.tablePos,void 0,{...r.attrs,columnWidths:d}),t(o.scrollIntoView());}return true},Ae=(n,t)=>{let e=y(n);if(!e.isInTable||e.tablePos===void 0||!e.table)return false;if(t){let o=n.tr,r=e.table,l=e.tablePos+1;r.forEach(s=>{if(s.type.name==="tableRow"){let i=l+1;s.forEach(c=>{(c.type.name==="tableCell"||c.type.name==="tableHeader")&&(o=o.setNodeMarkup(i,void 0,{...c.attrs,width:null,widthType:null,colwidth:null})),i+=c.nodeSize;});}l+=s.nodeSize;}),o=o.setNodeMarkup(e.tablePos,void 0,{...r.attrs,columnWidths:null,width:null,widthType:"auto"}),t(o.scrollIntoView());}return true};function Be(n){return (t,e)=>{let o=y(t);if(!o.isInTable||o.tablePos===void 0||!o.table)return false;if(e){let r=t.tr,l=o.table,s=o.tablePos,i=l.childCount,c=n.look??{firstRow:true,lastRow:false,noHBand:false},a=n.conditionals??{},d=n.tableBorders;r=r.setNodeMarkup(s,void 0,{...l.attrs,styleId:n.styleId});let u=0,f=s+1;for(let p=0;p<i;p++){let b=l.child(p),m=p===0&&!!c.firstRow,h=p===i-1&&!!c.lastRow,g=c.noHBand!==true,w=b.childCount,x;m?x="firstRow":h?x="lastRow":(g&&(x=u%2===0?"band1Horz":"band2Horz"),u++);let S=f+1;for(let C=0;C<w;C++){let P=b.child(C),R=r.mapping.map(S),T=x,M=C===0&&!!c.firstCol,k=C===w-1&&!!c.lastCol;m&&M&&a.nwCell?T="nwCell":m&&k&&a.neCell?T="neCell":h&&M&&a.swCell?T="swCell":h&&k&&a.seCell?T="seCell":M?T="firstCol":k&&(T="lastCol");let N=T?a[T]:void 0,v={...P.attrs};N?.backgroundColor?v.backgroundColor=N.backgroundColor:v.backgroundColor=null;let A={},$=["top","bottom","left","right"];for(let I of $)N?.borders&&N.borders[I]!==void 0?A[I]=N.borders[I]:d&&(I==="top"&&p>0||I==="bottom"&&p<i-1?A[I]=d.insideH??d[I]:I==="left"&&C>0||I==="right"&&C<w-1?A[I]=d.insideV??d[I]:A[I]=d[I]);Object.keys(A).length>0?v.borders=A:v.borders=null,r=r.setNodeMarkup(R,void 0,v),S+=P.nodeSize;}f+=b.nodeSize;}e(r.scrollIntoView());}return true}}function Ne(n){return (t,e)=>{let o=y(t);if(!o.isInTable||o.tablePos===void 0||!o.table)return false;if(e){let r=t.tr,l={...o.table.attrs};"width"in n&&(l.width=n.width),"widthType"in n&&(l.widthType=n.widthType),"justification"in n&&(l.justification=n.justification),r.setNodeMarkup(o.tablePos,void 0,l),e(r.scrollIntoView());}return true}}var Ee=(n,t)=>{let e=y(n);if(!e.isInTable||e.tablePos===void 0||!e.table)return false;if(t){let o=z(n,"tableRow");if(!o)return true;let r=n.tr.setNodeMarkup(o.pos,void 0,{...o.node.attrs,isHeader:!o.node.attrs.isHeader});t(r.scrollIntoView());}return true};function $e(){let n=new prosemirrorState.PluginKey("activeCell");return new prosemirrorState.Plugin({key:n,props:{decorations(t){let{selection:e}=t;if(e instanceof prosemirrorTables.CellSelection)return prosemirrorView.DecorationSet.empty;let{$from:o}=e;for(let r=o.depth;r>0;r--){let l=o.node(r);if(l.type.name==="tableCell"||l.type.name==="tableHeader"){let s=o.before(r);return prosemirrorView.DecorationSet.create(t.doc,[prosemirrorView.Decoration.node(s,s+l.nodeSize,{class:"activeCell"})])}}return prosemirrorView.DecorationSet.empty}}})}function ze(n){let{schema:t}=n,e=de(t),o=ce(t),r=ue(t),l=fe(t),s=pe(t);return {plugins:[prosemirrorTables.columnResizing({handleWidth:5,cellMinWidth:25,lastColumnResizable:true}),prosemirrorTables.tableEditing(),$e()],keyboardShortcuts:{Backspace:prosemirrorCommands.chainCommands(_,U),Delete:prosemirrorCommands.chainCommands(_,U)},commands:{insertTable:e,addRowAbove:()=>o,addRowBelow:()=>r,deleteRow:()=>be,addColumnLeft:()=>l,addColumnRight:()=>s,deleteColumn:()=>me,deleteTable:()=>he,selectTable:()=>ge,selectRow:()=>we,selectColumn:()=>Ce,mergeCells:()=>prosemirrorTables.mergeCells,splitCell:()=>prosemirrorTables.splitCell,setCellBorder:xe,setTableBorders:W,setCellVerticalAlign:Pe,setCellMargins:Re,setCellTextDirection:Ie,toggleNoWrap:()=>ke,setRowHeight:Me,toggleHeaderRow:()=>Ee,distributeColumns:()=>ve,autoFitContents:()=>Ae,setTableProperties:Ne,applyTableStyle:Be,setCellFillColor:Te,setTableBorderColor:ye,setTableBorderWidth:Se,removeTableBorders:()=>W("none"),setAllTableBorders:i=>W("all",i),setOutsideTableBorders:i=>W("outside",i),setInsideTableBorders:i=>W("inside",i)}}}var it=chunk7HANRHHL_js.c({name:"table",schemaNodeName:"table",nodeSpec:Z}),dt=chunk7HANRHHL_js.c({name:"tableRow",schemaNodeName:"tableRow",nodeSpec:ee}),ct=chunk7HANRHHL_js.c({name:"tableCell",schemaNodeName:"tableCell",nodeSpec:le}),ut=chunk7HANRHHL_js.c({name:"tableHeader",schemaNodeName:"tableHeader",nodeSpec:se}),ft=chunk7HANRHHL_js.b({name:"tablePlugin",onSchemaReady:ze});function fo(){return [it(),dt(),ct(),ut(),ft()]}exports.a=y;exports.b=G;exports.c=qe;exports.d=Je;exports.e=it;exports.f=dt;exports.g=ct;exports.h=ut;exports.i=ft;exports.j=fo;
|