@eigenpal/docx-editor-core 1.0.2 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +13 -16
- package/README.md +1 -1
- package/dist/agent/index.d.mts +4 -5
- package/dist/agent/index.d.ts +4 -5
- package/dist/agent/index.js +1 -1
- package/dist/agent/index.mjs +1 -1
- package/dist/{chunk-NLTX7XVR.js → chunk-25KY5HLN.js} +1 -1
- package/dist/chunk-44FHVKSI.js +1 -0
- package/dist/{chunk-4S5VOHQK.mjs → chunk-5CDBSK2R.mjs} +1 -1
- package/dist/chunk-6Y6LON6Y.mjs +1 -0
- package/dist/chunk-6ZXL3EIP.mjs +2 -0
- package/dist/chunk-73AZQWIE.js +1 -0
- package/dist/chunk-7HANRHHL.js +1 -0
- package/dist/chunk-7LRR7RKE.mjs +15 -0
- package/dist/{chunk-AGNZEOVL.mjs → chunk-7Z2AGPNQ.mjs} +1 -1
- package/dist/chunk-BGE57OES.js +1 -0
- package/dist/chunk-BOOHU5EW.mjs +1 -0
- package/dist/chunk-CA2EYL6T.mjs +1 -0
- package/dist/chunk-CTHHUJAB.mjs +2 -0
- package/dist/chunk-DLCDDB66.mjs +3 -0
- package/dist/chunk-DV6GWBUJ.js +2 -0
- package/dist/chunk-E4JMCA5X.js +2 -0
- package/dist/chunk-F44ZLDZS.js +4 -0
- package/dist/chunk-FCJWLEKT.mjs +1 -0
- package/dist/chunk-FDEDN2RC.mjs +0 -0
- package/dist/chunk-FEWCI2E5.mjs +1 -0
- package/dist/chunk-GFDIPDJ6.mjs +1 -0
- package/dist/chunk-GM4USWKO.js +2 -0
- package/dist/chunk-GWBVJZVT.js +3 -0
- package/dist/chunk-GY5BWVM7.js +1 -0
- package/dist/{chunk-7SGC3CXJ.js → chunk-H42RXHT4.js} +1 -1
- package/dist/chunk-HMBVSDCH.mjs +1 -0
- package/dist/chunk-HQPWFUP5.js +2 -0
- package/dist/chunk-HV6HE6YR.js +59 -0
- package/dist/chunk-IF4C25FN.mjs +1 -0
- package/dist/chunk-IMKU4O3P.js +1 -0
- package/dist/chunk-IQG3KLWY.mjs +2 -0
- package/dist/{chunk-AFMMYLPX.js → chunk-J4J2Y6EU.js} +2 -2
- package/dist/chunk-KGDXHUYC.js +1 -0
- package/dist/chunk-KHF4JU7D.mjs +1 -0
- package/dist/chunk-LCICADWM.js +2 -0
- package/dist/{chunk-GFQM7PKY.js → chunk-LOCW6MR2.js} +1 -1
- package/dist/chunk-LTHT4A4S.js +1 -0
- package/dist/chunk-MJ6XZFVD.mjs +1 -0
- package/dist/chunk-MNOHUTKE.js +15 -0
- package/dist/chunk-MP4QSEO2.mjs +1 -0
- package/dist/chunk-MZ2XCZAN.mjs +1 -0
- package/dist/chunk-OAWTQ3IY.js +1 -0
- package/dist/chunk-OEXVWIHW.mjs +2 -0
- package/dist/chunk-ONRBRDIC.mjs +59 -0
- package/dist/{chunk-6PR4XHQ3.mjs → chunk-ONWOHAFW.mjs} +1 -1
- package/dist/{chunk-EXOP727C.mjs → chunk-OUEKNYX5.mjs} +1 -1
- package/dist/chunk-OX75Q5ZG.mjs +1 -0
- package/dist/chunk-QEACB5VG.js +1 -0
- package/dist/chunk-RFC2SXZ6.mjs +4 -0
- package/dist/chunk-RFVFX5WK.mjs +1 -0
- package/dist/chunk-SORYYVJ7.js +1 -0
- package/dist/chunk-TUIEV7Q7.js +1 -0
- package/dist/chunk-U74VPTIU.js +1 -0
- package/dist/chunk-UOQT6A7P.js +1 -0
- package/dist/chunk-V5VDCQDN.mjs +1 -0
- package/dist/chunk-VHUVPHPI.mjs +1 -0
- package/dist/{chunk-XCMA7AY7.js → chunk-W7GLQ6DV.js} +1 -1
- package/dist/chunk-WLHNIXWC.mjs +2 -0
- package/dist/chunk-X6HFDXKB.js +1 -0
- package/dist/chunk-XPV6VILW.mjs +1 -0
- package/dist/chunk-Y3ZQQI4D.js +1 -0
- package/dist/chunk-YTDWMXNS.js +1 -0
- package/dist/chunk-ZUGNF5KU.js +1 -0
- package/dist/chunk-ZX26QZJ5.mjs +1 -0
- package/dist/{colorResolver-CVsPLsw1.d.ts → colorResolver-BZ_yScf4.d.ts} +1 -1
- package/dist/{colorResolver-C3q7MLLD.d.mts → colorResolver-C6DtsoFI.d.mts} +1 -1
- package/dist/content-5Mrz6w_b.d.mts +1360 -0
- package/dist/content-CmqAwdFL.d.ts +1360 -0
- package/dist/core-plugins.d.mts +3 -4
- package/dist/core-plugins.d.ts +3 -4
- package/dist/core-plugins.js +1 -1
- package/dist/core-plugins.mjs +1 -1
- package/dist/core.d.mts +10 -11
- package/dist/core.d.ts +10 -11
- package/dist/core.js +1 -1
- package/dist/core.mjs +1 -1
- package/dist/{documentSerializer-Chn7J1WG.d.ts → documentSerializer-BRaaXIHm.d.ts} +1 -1
- package/dist/{documentSerializer-C1ueey5d.d.mts → documentSerializer-DgO3A9av.d.mts} +1 -1
- package/dist/docx/index.d.mts +3 -4
- package/dist/docx/index.d.ts +3 -4
- package/dist/docx/index.js +1 -1
- package/dist/docx/index.mjs +1 -1
- package/dist/docx/parser.d.mts +3 -4
- package/dist/docx/parser.d.ts +3 -4
- package/dist/docx/parser.js +1 -1
- package/dist/docx/parser.mjs +1 -1
- package/dist/docx/rezip.d.mts +3 -4
- package/dist/docx/rezip.d.ts +3 -4
- package/dist/docx/rezip.js +1 -1
- package/dist/docx/rezip.mjs +1 -1
- package/dist/docx/serializer/index.d.mts +4 -5
- package/dist/docx/serializer/index.d.ts +4 -5
- package/dist/docx/serializer/index.js +1 -1
- package/dist/docx/serializer/index.mjs +1 -1
- package/dist/{fontLoader-BOt95Jtf.d.mts → fontLoader-8b4X-AIh.d.mts} +63 -3
- package/dist/{fontLoader-QPwbcX5j.d.ts → fontLoader-CK2QLq68.d.ts} +63 -3
- package/dist/{formatting-D9I-lFS4.d.mts → formatting-BH4hcZiq.d.mts} +1 -1
- package/dist/{formatting-BwpZWdGi.d.ts → formatting-_OXU8gLB.d.ts} +1 -1
- package/dist/{headerFooterLayout-DkclHZ0Z.d.mts → headerFooterLayout-72Vz7yp3.d.mts} +94 -3
- package/dist/{headerFooterLayout-B3QVg556.d.ts → headerFooterLayout-Ca4ESDHF.d.ts} +94 -3
- package/dist/headless.d.mts +9 -9
- package/dist/headless.d.ts +9 -9
- package/dist/headless.js +1 -1
- package/dist/headless.mjs +1 -1
- package/dist/layout-bridge/index.d.mts +7 -7
- package/dist/layout-bridge/index.d.ts +7 -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 +43 -2
- package/dist/layout-bridge/measuring/index.d.ts +43 -2
- 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 +11 -3
- package/dist/layout-bridge/toFlowBlocks.d.ts +11 -3
- package/dist/layout-bridge/toFlowBlocks.js +1 -1
- package/dist/layout-bridge/toFlowBlocks.mjs +1 -1
- package/dist/layout-engine/index.d.mts +33 -3
- package/dist/layout-engine/index.d.ts +33 -3
- package/dist/layout-engine/index.js +1 -1
- package/dist/layout-engine/index.mjs +1 -1
- package/dist/layout-engine/types.d.mts +53 -0
- package/dist/layout-engine/types.d.ts +53 -0
- package/dist/layout-painter/index.d.mts +4 -5
- package/dist/layout-painter/index.d.ts +4 -5
- package/dist/layout-painter/index.js +1 -1
- package/dist/layout-painter/index.mjs +1 -1
- package/dist/layout-painter/renderPage.d.mts +4 -5
- package/dist/layout-painter/renderPage.d.ts +4 -5
- package/dist/layout-painter/renderPage.js +1 -1
- package/dist/layout-painter/renderPage.mjs +1 -1
- package/dist/managers/AutoSaveManager.d.mts +3 -4
- package/dist/managers/AutoSaveManager.d.ts +3 -4
- package/dist/managers/TableSelectionManager.d.mts +3 -4
- package/dist/managers/TableSelectionManager.d.ts +3 -4
- package/dist/managers/types.d.mts +3 -4
- package/dist/managers/types.d.ts +3 -4
- package/dist/{marks-CCPVlQzL.d.mts → marks-BY573yZn.d.mts} +1 -1
- package/dist/{marks-BujVxYP4.d.ts → marks-CjC9tF5k.d.ts} +1 -1
- package/dist/mcp-cli.mjs +24 -23
- package/dist/mcp.d.mts +3 -4
- package/dist/mcp.d.ts +3 -4
- package/dist/mcp.js +3 -3
- package/dist/mcp.mjs +1 -1
- package/dist/{nodes-BXi1Uu3e.d.mts → nodes-7753Bgi_.d.mts} +66 -3
- package/dist/{nodes-DfKj9kUA.d.ts → nodes-CC_nwkT_.d.ts} +66 -3
- 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 +82 -8
- package/dist/prosemirror/commands/index.d.ts +82 -8
- package/dist/prosemirror/commands/index.js +1 -1
- package/dist/prosemirror/commands/index.mjs +1 -1
- package/dist/prosemirror/commands/paragraph.d.mts +1 -1
- package/dist/prosemirror/commands/paragraph.d.ts +1 -1
- package/dist/prosemirror/commands/paragraph.js +1 -1
- package/dist/prosemirror/commands/paragraph.mjs +1 -1
- package/dist/prosemirror/conversion/fromProseDoc.d.mts +3 -4
- package/dist/prosemirror/conversion/fromProseDoc.d.ts +3 -4
- package/dist/prosemirror/conversion/fromProseDoc.js +1 -1
- package/dist/prosemirror/conversion/fromProseDoc.mjs +1 -1
- package/dist/prosemirror/conversion/index.d.mts +11 -4
- package/dist/prosemirror/conversion/index.d.ts +11 -4
- package/dist/prosemirror/conversion/index.js +1 -1
- package/dist/prosemirror/conversion/index.mjs +1 -1
- package/dist/prosemirror/editor.css +155 -95
- 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 +5 -6
- package/dist/prosemirror/index.d.ts +5 -6
- package/dist/prosemirror/index.js +1 -1
- package/dist/prosemirror/index.mjs +1 -1
- package/dist/prosemirror/plugins/index.d.mts +122 -18
- package/dist/prosemirror/plugins/index.d.ts +122 -18
- 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/schema/index.d.mts +4 -5
- package/dist/prosemirror/schema/index.d.ts +4 -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/utils/extractTrackedChanges.d.mts +45 -23
- package/dist/prosemirror/utils/extractTrackedChanges.d.ts +45 -23
- package/dist/prosemirror/utils/extractTrackedChanges.js +1 -1
- package/dist/prosemirror/utils/extractTrackedChanges.mjs +1 -1
- package/dist/{selectionContext-85CE0f7a.d.ts → selectionContext-BPAqgNgk.d.ts} +1 -1
- package/dist/{selectionContext-Xq3AY7pn.d.mts → selectionContext-CoZat7QZ.d.mts} +1 -1
- package/dist/{styles-jqO45PSq.d.ts → styles-BBv7doYK.d.ts} +1 -1
- package/dist/{styles-BBoqh07F.d.mts → styles-EI2lxeEN.d.mts} +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 -1167
- package/dist/types/content.d.ts +4 -1167
- package/dist/types/document.d.mts +25 -8
- package/dist/types/document.d.ts +25 -8
- package/dist/utils/comments.d.mts +79 -6
- package/dist/utils/comments.d.ts +79 -6
- package/dist/utils/comments.js +1 -1
- package/dist/utils/comments.mjs +1 -1
- package/dist/utils/highlightColors.js +1 -1
- package/dist/utils/highlightColors.mjs +1 -1
- package/dist/utils/index.d.mts +5 -6
- package/dist/utils/index.d.ts +5 -6
- package/dist/utils/index.js +3 -3
- package/dist/utils/index.mjs +3 -3
- package/dist/{variableDetector-CAdt8yOr.d.mts → variableDetector-DF3-nxUC.d.mts} +1 -1
- package/dist/{variableDetector-W4XEN9YC.d.ts → variableDetector-sBkgVh3f.d.ts} +1 -1
- package/package.json +3 -3
- package/dist/chunk-2D3UPAMA.mjs +0 -1
- package/dist/chunk-2RCMY2GE.mjs +0 -1
- package/dist/chunk-3GNIP6IX.mjs +0 -4
- package/dist/chunk-44RUAQA2.js +0 -1
- package/dist/chunk-5N5DBQJV.mjs +0 -1
- package/dist/chunk-5TNMVXDS.mjs +0 -1
- package/dist/chunk-6DK4UBGM.js +0 -1
- package/dist/chunk-6LOYA7G5.mjs +0 -2
- package/dist/chunk-7VCMJCBY.js +0 -2
- package/dist/chunk-APFTVA4F.mjs +0 -1
- package/dist/chunk-BKHQA6JJ.js +0 -1
- package/dist/chunk-BOYVCOLZ.mjs +0 -1
- package/dist/chunk-BS35CXMN.js +0 -1
- package/dist/chunk-BTOBVF4I.mjs +0 -1
- package/dist/chunk-C6GSFUV2.js +0 -2
- package/dist/chunk-CP5OSG5Z.mjs +0 -1
- package/dist/chunk-CP767TWV.js +0 -1
- package/dist/chunk-DV6IEOP5.js +0 -4
- package/dist/chunk-IBNUQL57.mjs +0 -2
- package/dist/chunk-KBU6QQFU.js +0 -9
- package/dist/chunk-LDKESXXK.mjs +0 -3
- package/dist/chunk-LTYW3NLX.js +0 -59
- package/dist/chunk-NERY274X.js +0 -1
- package/dist/chunk-NMSU4MWP.mjs +0 -1
- package/dist/chunk-NNQWQOC5.mjs +0 -1
- package/dist/chunk-OLKDLRJ4.js +0 -1
- package/dist/chunk-P3AXSRLG.mjs +0 -1
- package/dist/chunk-P6RNOYAG.mjs +0 -2
- package/dist/chunk-R7RR6M4A.mjs +0 -2
- package/dist/chunk-RCS6UNIJ.mjs +0 -1
- package/dist/chunk-T5RYEG2V.js +0 -1
- package/dist/chunk-TRJWRZZD.js +0 -1
- package/dist/chunk-TYYOBPNK.js +0 -1
- package/dist/chunk-UCZVMHB5.mjs +0 -59
- package/dist/chunk-V435QKZB.js +0 -3
- package/dist/chunk-VQ2QGHYS.js +0 -2
- package/dist/chunk-WZP6ZHBR.js +0 -1
- package/dist/chunk-XDH55WXX.mjs +0 -1
- package/dist/chunk-Y5HZAMND.mjs +0 -9
- package/dist/chunk-YE357WVA.js +0 -1
- package/dist/chunk-YGHHSCPR.js +0 -2
- package/dist/lists-CdiIk_c1.d.ts +0 -142
- package/dist/lists-JDB80qyP.d.mts +0 -142
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {c}from'./chunk-V5VDCQDN.mjs';import {P,g,h}from'./chunk-6Y6LON6Y.mjs';import {b}from'./chunk-FEWCI2E5.mjs';import {e}from'./chunk-VW22RZ6C.mjs';function j(e,t){if(e.pages.length===0)return null;let a=e.pageGap??0,o=0,n=null,r=1/0;for(let s=0;s<e.pages.length;s++){let i=e.pages[s],l=i.size?.h??e.pageSize.h,u=o,f=u+l;if(t.y>=u&&t.y<f)return {pageIndex:s,page:i,pageY:t.y-u};let c=u+l/2,h=Math.abs(t.y-c);h<r&&(r=h,n=s),o=f+a;}if(n!==null){let s=e.pages[n],i=A(e,n);return {pageIndex:n,page:s,pageY:Math.max(0,Math.min(t.y-i,s.size?.h??e.pageSize.h))}}return null}function A(e,t){let a=e.pageGap??0,o=0;for(let n=0;n<t&&n<e.pages.length;n++){let s=e.pages[n].size?.h??e.pageSize.h;o+=s+a;}return o}function Me(e,t){return j(e,{y:t})?.pageIndex??null}function $(e,t){return e.findIndex(a=>a.id===t)}function ye(e,t){let a=0;for(let o=e.fromLine;o<e.toLine&&o<t.lines.length;o++)a+=t.lines[o].lineHeight;return a}function ae(e,t,a,o){let n=[...e.page.fragments].sort((r,s)=>{let i=r.y-s.y;return Math.abs(i)>.5?i:r.x-s.x});for(let r of n){let s=$(t,r.blockId);if(s===-1)continue;let i=t[s],l=a[s];if(!i||!l)continue;let u;if(r.kind==="paragraph"){if(i.kind!=="paragraph"||l.kind!=="paragraph")continue;u=ye(r,l);}else if(r.kind==="table")u=r.height;else if(r.kind==="image")u=r.height;else continue;let f=o.x>=r.x&&o.x<=r.x+r.width,c=o.y>=r.y&&o.y<=r.y+u;if(f&&c)return {fragment:r,block:i,measure:l,pageIndex:e.pageIndex,localX:o.x-r.x,localY:o.y-r.y}}return null}function He(e,t,a,o){for(let n of e.page.fragments){if(n.kind!=="image")continue;let r=$(t,n.blockId);if(r===-1)continue;let s=t[r],i=a[r];if(!s||!i)continue;let l=o.x>=n.x&&o.x<=n.x+n.width,u=o.y>=n.y&&o.y<=n.y+n.height;if(l&&u)return {fragment:n,block:s,measure:i,pageIndex:e.pageIndex,localX:o.x-n.x,localY:o.y-n.y}}return null}function se(e,t,a,o){for(let n of e.page.fragments){if(n.kind!=="table")continue;let r=n,s=o.x>=r.x&&o.x<=r.x+r.width,i=o.y>=r.y&&o.y<=r.y+r.height;if(!s||!i)continue;let l=$(t,r.blockId);if(l===-1)continue;let u=t[l],f=a[l];if(!u||u.kind!=="table"||!f||f.kind!=="table")continue;let c=u,h=f,p=o.x-r.x,m=o.y-r.y,g=r.headerRowCount??0,d=g>0&&r.continuesFromPrev?P(h,g):0,b=0,x=-1;if(h.rows.length===0||c.rows.length===0)continue;if(d>0&&m<d){let T=0;for(let M=0;M<g&&M<h.rows.length;M++){let L=h.rows[M];if(m>=T&&m<T+L.height){x=M;break}T+=L.height;}x===-1&&(x=0);}else {let T=m-d;for(let M=r.fromRow;M<r.toRow&&M<h.rows.length;M++){let L=h.rows[M];if(T>=b&&T<b+L.height){x=M;break}b+=L.height;}}if(x===-1&&(x=Math.min(r.toRow-1,h.rows.length-1),x<r.fromRow))continue;let k=h.rows[x],F=c.rows[x];if(!k||!F)continue;let P$1=0,y=-1;if(k.cells.length===0||F.cells.length===0)continue;for(let T=0;T<k.cells.length;T++){let M=k.cells[T];if(p>=P$1&&p<P$1+M.width){y=T;break}P$1+=M.width;}if(y===-1&&(y=k.cells.length-1,y<0))continue;let H=k.cells[y],w=F.cells[y];if(!H||!w)continue;let R=0;if(d>0&&x<g)for(let T=0;T<x;T++)R+=h.rows[T]?.height??0;else {R=d;for(let T=r.fromRow;T<x;T++)R+=h.rows[T]?.height??0;}let B=0;for(let T=0;T<y;T++)B+=k.cells[T]?.width??0;let C,S;if(w.blocks&&w.blocks.length>0){let T=w.blocks[0],M=H.blocks[0];T.kind==="paragraph"&&M?.kind==="paragraph"&&(C=T,S=M);}let D=p-B,E=m-R;return {fragment:r,block:c,measure:h,pageIndex:e.pageIndex,rowIndex:x,colIndex:y,cellBlock:C,cellMeasure:S,cellLocalX:Math.max(0,D),cellLocalY:Math.max(0,E)}}return null}function we(e,t,a,o){let n={pageHit:null,fragmentHit:null,tableCellHit:null};if(n.pageHit=j(e,o),!n.pageHit)return n;let r=A(e,n.pageHit.pageIndex),s={x:o.x,y:o.y-r};return n.fragmentHit=ae(n.pageHit,t,a,s),n.fragmentHit?.fragment.kind==="table"&&(n.tableCellHit=se(n.pageHit,t,a,s)),n}function Re(e){if(e.pages.length===0)return 0;let t=e.pageGap??0,a=0;for(let o=0;o<e.pages.length;o++){let n=e.pages[o];a+=n.size?.h??e.pageSize.h,o<e.pages.length-1&&(a+=t);}return a}function Be(e,t){return A(e,t)}function Ie(e,t){if(t<0||t>=e.pages.length)return null;let a=A(e,t),n=e.pages[t].size?.h??e.pageSize.h;return {top:a,bottom:a+n}}function J(e){return {fontFamily:e.fontFamily??"Arial",fontSize:e.fontSize??12,bold:e.bold,italic:e.italic,letterSpacing:e.letterSpacing}}function le(e,t){let a=[];for(let o=t.fromRun;o<=t.toRun&&o<e.runs.length;o++){let n=e.runs[o];if(n){if(n.kind==="tab"||n.kind==="image"||n.kind==="lineBreak"){a.push(n);continue}if(n.kind==="text"){let r=n.text??"",s=o===t.fromRun,i=o===t.toRun;if(s||i){let l=s?t.fromChar:0,u=i?t.toChar:r.length,f=r.slice(l,u);f.length>0&&a.push({...n,text:f});}else a.push(n);}}}return a}function ce(e,t){let a,o,n=e.pmStart??0,r=0;for(let s=0;s<e.runs.length&&s<=t.toRun;s++){let i=e.runs[s];i&&(s<t.fromRun?i.kind==="text"?r+=(i.text??"").length:(i.kind==="tab"||i.kind==="lineBreak"||i.kind==="image")&&(r+=1):s===t.fromRun&&(r+=t.fromChar,a=n+r,i.kind==="text"&&(r=t.fromChar)));}if(a!==void 0){let s=0;for(let i=t.fromRun;i<=t.toRun&&i<e.runs.length;i++){let l=e.runs[i];if(l)if(l.kind==="text"){let u=l.text??"",f=i===t.fromRun?t.fromChar:0,c=i===t.toRun?t.toChar:u.length;s+=c-f;}else (l.kind==="tab"||l.kind==="lineBreak"||l.kind==="image")&&(s+=1);}o=a+s;}return {pmStart:a,pmEnd:o}}function Se(e,t,a,o){let n=0;for(let r=a;r<o&&r<e.lines.length;r++){let i=e.lines[r].lineHeight;if(t>=n&&t<n+i)return r;n+=i;}return o>a?Math.min(o-1,e.lines.length-1):null}function Ee(e,t,a,o){let{pmStart:n,pmEnd:r}=ce(e,t);if(n===void 0||r===void 0)return {charOffset:0,pmPosition:e.pmStart??0};let s=e.attrs?.alignment??"left",i=0;s==="center"?i=Math.max(0,(o-t.width)/2):s==="right"&&(i=Math.max(0,o-t.width));let l=Math.max(0,a-i);if(l<=0)return {charOffset:0,pmPosition:n};let u=le(e,t);if(u.length===0)return {charOffset:0,pmPosition:n};let f=0,c=0;for(let p of u){if(p.kind==="tab"){let m=p.width??48,g=f+m;if(l<=g){let d=f+m/2;return l<d?{charOffset:c,pmPosition:n+c}:{charOffset:c+1,pmPosition:n+c+1}}f=g,c+=1;continue}if(p.kind==="image"){let m=p.width,g=f+m;if(l<=g){let d=f+m/2;return l<d?{charOffset:c,pmPosition:n+c}:{charOffset:c+1,pmPosition:n+c+1}}f=g,c+=1;continue}if(p.kind==="lineBreak"){if(l>=f)return {charOffset:c,pmPosition:n+c};c+=1;continue}if(p.kind==="text"){let m=p.text??"";if(m.length===0)continue;let g$1=J(p),d=g(m,g$1),b=f+d.width;if(l<=b){let x=l-f,k=h(x,d.charWidths),F=c+k;return {charOffset:F,pmPosition:n+F}}f=b,c+=m.length;}}return {charOffset:r-n,pmPosition:r}}function K(e){let{fragment:t,block:a,measure:o,localX:n,localY:r}=e;if(t.kind!=="paragraph"||a.kind!=="paragraph"||o.kind!=="paragraph")return null;let s=t,i=a,l=o,u=Se(l,r,s.fromLine,s.toLine);if(u===null)return null;let f=l.lines[u];if(!f)return null;let c=0;for(let k=s.fromLine;k<u;k++)c+=l.lines[k]?.lineHeight??0;let h=i.attrs?.indent,p=h?.left??0,m=h?.right??0,g=Math.max(0,t.width-p-m),d=n-p,{charOffset:b,pmPosition:x}=Ee(i,f,d,g);return {pmPosition:x,charOffset:b,lineIndex:u}}function ue(e){let{cellBlock:t,cellMeasure:a,cellLocalX:o,cellLocalY:n}=e;if(!t||!a)return null;let r={fragment:{kind:"paragraph",blockId:t.id,x:0,y:0,width:a.lines.reduce((i,l)=>Math.max(i,l.width),100),fromLine:0,toLine:a.lines.length,height:a.totalHeight},block:t,measure:a,pageIndex:e.pageIndex,localX:o,localY:n};return K(r)?.pmPosition??null}function Le(e,t){if(t)return ue(t);if(!e)return null;let{fragment:a}=e;return a.kind==="paragraph"?K(e)?.pmPosition??null:a.kind==="image"?a.pmStart??null:null}function fe(e,t,a,o){let n=e.pmStart??0,r=e.pmEnd??n;if(a<n||a>r)return null;let s=a-n;for(let i=0;i<t.lines.length;i++){let l=t.lines[i],{pmStart:u,pmEnd:f}=ce(e,l);if(u===void 0||f===void 0)continue;let c=u-n,h=f-n;if(s>=c&&s<=h){let p=s-c,m=le(e,l),g$1=0,d=0;for(let b of m)if(b.kind==="tab"){if(p<=d+1)return p<=d?{x:g$1,lineIndex:i}:{x:g$1+(b.width??48),lineIndex:i};g$1+=b.width??48,d+=1;}else if(b.kind==="image"){if(p<=d+1)return p<=d?{x:g$1,lineIndex:i}:{x:g$1+b.width,lineIndex:i};g$1+=b.width,d+=1;}else if(b.kind==="lineBreak"){if(p<=d)return {x:g$1,lineIndex:i};d+=1;}else if(b.kind==="text"){let x=b.text??"";if(p<=d+x.length){let P=p-d,y=J(b),H=g(x.slice(0,P),y);return {x:g$1+H.width,lineIndex:i}}let k=J(b),F=g(x,k);g$1+=F.width,d+=x.length;}return {x:g$1,lineIndex:i}}}return null}function Ce(e,t,a,o,n,r,s){let i=fe(e,t,a);if(!i)return null;let l=e.attrs?.alignment??"left",u=e.attrs?.indent,f=u?.left??0,c=u?.right??0,h=Math.max(0,r-f-c),p=t.lines[i.lineIndex];if(!p)return null;let m=0;l==="center"?m=Math.max(0,(h-p.width)/2):l==="right"&&(m=Math.max(0,h-p.width));let g=0;for(let d=s;d<i.lineIndex;d++)g+=t.lines[d]?.lineHeight??0;return {x:o+f+m+i.x,y:n+g,height:p.lineHeight}}function ge(e){return {fontFamily:e.fontFamily??"Arial",fontSize:e.fontSize??12,bold:e.bold,italic:e.italic,letterSpacing:e.letterSpacing}}function Q(e,t){return e.findIndex(a=>a.id===t)}function W(e,t){let o=(e.pmStart??0)+1,n=0,r;for(let l=0;l<e.runs.length&&l<=t.toRun;l++){let u=e.runs[l];if(u){if(l<t.fromRun)u.kind==="text"?n+=(u.text??"").length:n+=1;else if(l===t.fromRun){n+=t.fromChar,r=o+n;break}}}r===void 0&&(r=o);let s=0;for(let l=t.fromRun;l<=t.toRun&&l<e.runs.length;l++){let u=e.runs[l];if(u)if(u.kind==="text"){let f=u.text??"",c=l===t.fromRun?t.fromChar:0,h=l===t.toRun?t.toChar:f.length;s+=h-c;}else s+=1;}let i=r+s;return {pmStart:r,pmEnd:i}}function me(e,t,a,o){let n=[];for(let r=0;r<t.lines.length;r++){let s=t.lines[r],i=W(e,s);i.pmStart===void 0||i.pmEnd===void 0||i.pmEnd>a&&i.pmStart<o&&n.push({line:s,index:r});}return n}function N(e,t,a){let o=W(e,t);return o.pmStart===void 0?0:Math.max(0,a-o.pmStart)}function z(e,t,a,o){let n=0,r=0;for(let s=t.fromRun;s<=t.toRun&&s<e.runs.length;s++){let i=e.runs[s];if(i){if(i.kind==="tab"){let l=i.width??48;if(r+1>=a)return a<=r?n:n+l;n+=l,r+=1;continue}if(i.kind==="image"){let l=i.width;if(r+1>=a)return a<=r?n:n+l;n+=l,r+=1;continue}if(i.kind==="lineBreak"){if(a<=r)return n;r+=1;continue}if(i.kind==="text"){let l=i.text??"",u=s===t.fromRun,f=s===t.toRun,c=u?t.fromChar:0,h=f?t.toChar:l.length,p=l.slice(c,h);if(r+p.length>=a){let d=a-r,b=ge(i),x=g(p.slice(0,d),b);return n+x.width}let m=ge(i),g$1=g(p,m);n+=g$1.width,r+=p.length;}}}return n}function G(e,t){let a=0;for(let o=0;o<t&&o<e.lines.length;o++)a+=e.lines[o].lineHeight;return a}function De(e,t,a,o,n){if(o===n)return [];let r=Math.min(o,n),s=Math.max(o,n),i=[];for(let l=0;l<e.pages.length;l++){let u=e.pages[l],f=A(e,l);for(let c of u.fragments){if(c.kind==="paragraph"){let h=Q(t,c.blockId);if(h===-1)continue;let p=t[h],m=a[h];if(!p||p.kind!=="paragraph"||!m||m.kind!=="paragraph")continue;let g=p,d=m,b=c,x=me(g,d,r,s);for(let{line:k,index:F}of x){if(F<b.fromLine||F>=b.toLine)continue;let P=W(g,k);if(P.pmStart===void 0||P.pmEnd===void 0)continue;let y=Math.max(P.pmStart,r),H=Math.min(P.pmEnd,s);if(y>=H)continue;let w=N(g,k,y),R=N(g,k,H),I=g.attrs?.indent,B=I?.left??0,C=I?.right??0,S=Math.max(0,c.width-B-C),D=z(g,k,w),E=z(g,k,R),T=g.attrs?.alignment??"left",M=0;T==="center"?M=Math.max(0,(S-k.width)/2):T==="right"&&(M=Math.max(0,S-k.width));let L=G(d,F)-G(d,b.fromLine),_=c.x+B+M+Math.min(D,E),V=Math.max(1,Math.abs(E-D)),v=c.y+L;i.push({x:_,y:v+f,width:V,height:k.lineHeight,pageIndex:l});}}if(c.kind==="table"){let h=Q(t,c.blockId);if(h===-1)continue;let p=t[h],m=a[h];if(!p||p.kind!=="table"||!m||m.kind!=="table")continue;let g=p,d=m,b=c,x=b.headerRowCount??0,F=x>0&&b.continuesFromPrev?P(d,x):0;for(let P=b.fromRow;P<b.toRow&&P<g.rows.length;P++){let y=g.rows[P],H=d.rows[P];if(!y||!H)continue;let w=0;for(let R=0;R<y.cells.length;R++){let I=y.cells[R],B=H.cells[R];if(!(!I||!B)){for(let C=0;C<I.blocks.length;C++){let S=I.blocks[C],D=B.blocks[C];if(!S||S.kind!=="paragraph"||!D||D.kind!=="paragraph")continue;let E=S,T=D,M=me(E,T,r,s),L=0;for(let{line:_,index:V}of M){let v=W(E,_);if(v.pmStart===void 0||v.pmEnd===void 0)continue;let Z=Math.max(v.pmStart,r),ee=Math.min(v.pmEnd,s);if(Z>=ee)continue;let ke=N(E,_,Z),Fe=N(E,_,ee),te=z(E,_,ke,B.width),ne=z(E,_,Fe,B.width),Pe=G(T,V);i.push({x:b.x+w+Math.min(te,ne),y:b.y+F+L+Pe+f,width:Math.max(1,Math.abs(ne-te)),height:_.lineHeight,pageIndex:l});}L+=T.totalHeight;}w+=B.width;}}F+=H.height;}}if(c.kind==="image"){let h=c.pmStart??0;(c.pmEnd??h+1)>r&&h<s&&i.push({x:c.x,y:c.y+f,width:c.width,height:c.height,pageIndex:l});}}}return i}function _e(e,t,a,o){for(let n=0;n<e.pages.length;n++){let r=e.pages[n],s=A(e,n);for(let i of r.fragments){if(i.kind==="paragraph"){let l=Q(t,i.blockId);if(l===-1)continue;let u=t[l],f=a[l];if(!u||u.kind!=="paragraph"||!f||f.kind!=="paragraph")continue;let c=u,h=f,p=i,m=c.pmStart??0,g=c.pmEnd??m;if(o<m||o>g)continue;for(let d=p.fromLine;d<p.toLine;d++){let b=h.lines[d];if(!b)continue;let x=W(c,b);if(!(x.pmStart===void 0||x.pmEnd===void 0)&&o>=x.pmStart&&o<=x.pmEnd){let k=N(c,b,o),F=c.attrs?.indent,P=F?.left??0,y=F?.right??0,H=Math.max(0,i.width-P-y),w=z(c,b,k),R=c.attrs?.alignment??"left",I=0;R==="center"?I=Math.max(0,(H-b.width)/2):R==="right"&&(I=Math.max(0,H-b.width));let B=G(h,d)-G(h,p.fromLine);return {x:i.x+P+I+w,y:i.y+B+s,height:b.lineHeight,pageIndex:n}}}}if(i.kind==="image"){let l=i.pmStart??0,u=i.pmEnd??l+1;if(o>=l&&o<=u){let f=o===l?0:i.width;return {x:i.x+f,y:i.y+s,height:i.height,pageIndex:n}}}}}return null}function Ae(e){return e.length<=1?false:new Set(e.map(a=>a.pageIndex)).size>1}function Oe(e){let t=new Map;for(let a of e){let o=t.get(a.pageIndex)??[];o.push(a),t.set(a.pageIndex,o);}return t}function Xe(e){if(e.kind!=="paragraph")return false;let t=e.attrs;return t?!!(t.borders?.top||t.borders?.bottom||t.spacingExplicit?.before||t.spacingExplicit?.after):false}function de(e){return he(e)}function he(e){let t=new Set;for(let a=1;a<e.length;a++){let o=e[a-1],n=e[a];o.kind==="table"&&n.kind==="paragraph"&&(n.runs.length>0||Xe(n)||t.add(a));}return e.map((a,o)=>{if(a.kind==="table")return ve(a);if(a.kind!=="paragraph")return a;let n=t.has(o),r=a.attrs?.spacingExplicit,s=a.attrs?.spacing?.before!=null,i=a.attrs?.spacing?.after!=null,l=s&&!r?.before,u=i&&!r?.after,f=l||u;if(!f&&!n)return a;let c=a.attrs;return f&&c?.spacing&&(c={...c,spacing:{...c.spacing,before:r?.before?c.spacing.before:void 0,after:r?.after?c.spacing.after:void 0}}),n&&(c={...c??{},suppressEmptyParagraphHeight:true}),{...a,attrs:c}})}function ve(e){let t=false,a=e.rows.map(o=>{let n=false,r=o.cells.map(s=>{let i=he(s.blocks);return i.some((u,f)=>u!==s.blocks[f])?(n=true,{...s,blocks:i}):s});return n?(t=true,{...o,cells:r}):o});return t?{...e,rows:a}:e}function Ye(e){return e?.align??e?.alignment}function pe(e$1,t,a,o){let n=o.section==="header"?o.margins.header??48:o.pageSize.h-(o.margins.footer??48)-a,r=e$1.position?.vertical;if(!r)return t;let s=Ye(r),i=r.posOffset!==void 0?e(r.posOffset):void 0;if(r.relativeTo==="page"){if(i!==void 0)return i-n;if(s==="top")return -n;if(s==="bottom")return o.pageSize.h-e$1.height-n;if(s==="center")return (o.pageSize.h-e$1.height)/2-n}if(r.relativeTo==="margin"){let l=o.margins.top,u=o.pageSize.h-o.margins.top-o.margins.bottom;if(i!==void 0)return l+i-n;if(s==="top")return l-n;if(s==="bottom")return l+u-e$1.height-n;if(s==="center")return l+(u-e$1.height)/2-n}return i!==void 0?t+i:t}function be(e,t,a,o){let n=0,r=a,s=0;for(let i=0;i<e.length;i++){let l=e[i],u=t[i];if(!(!l||!u)){if(l.kind==="paragraph"&&u.kind==="paragraph"){let f=s,c=f+u.totalHeight;n=Math.min(n,f),r=Math.max(r,c);for(let h of l.runs){if(h.kind!=="image"||!h.position)continue;let p=pe(h,f,a,o);n=Math.min(n,p),r=Math.max(r,p+h.height);}s=c;}else if(l.kind==="table"&&u.kind==="table"){let f=s+u.totalHeight;n=Math.min(n,s),r=Math.max(r,f),s=f;}else if(l.kind==="image"&&u.kind==="image"){let f=s+u.height;n=Math.min(n,s),r=Math.max(r,f),s=f;}else if(l.kind==="textBox"&&u.kind==="textBox"){let f=s+u.height;n=Math.min(n,s),r=Math.max(r,f),s=f;}}}return {visualTop:n,visualBottom:r}}function Ne(e,t,a,o){if(!e||!e.content||e.content.length===0)return;let n=b(e.content,{styles:o.styles??void 0,theme:o.theme??null,defaultTabStopTwips:o.defaultTabStopTwips??null});return xe(n,t,a,o)}function xe(e,t,a,o){let n=c(e,{theme:o.theme??void 0});if(n.length===0)return;let r=de(n),s=o.measureBlocks(r,t),i=s.reduce((f,c)=>c.kind==="paragraph"||c.kind==="table"?f+c.totalHeight:c.kind==="image"||c.kind==="textBox"?f+c.height:f,0),{visualTop:l,visualBottom:u}=be(n,s,i,a);return {blocks:r,measures:s,height:i,visualTop:l,visualBottom:u}}var Y=null;function ze(){Y=null;}function Te(e){if(Y&&Y.host.isConnected)return Y;let t=e.querySelector(".layout-page-header, .layout-page-footer");if(!t)return null;let a=Array.from(t.querySelectorAll("span[data-pm-start][data-pm-end]")),o=Array.from(t.querySelectorAll("[data-pm-start][data-pm-end]"));return Y={host:t,spans:a,ranged:o},Y}function Ge(e,t=globalThis.document){let a=e.state.selection;if(!a.empty)return null;let o=a.head,n=Te(t);if(!n)return null;let{host:r,spans:s}=n;for(let m of s){let g=Number(m.dataset.pmStart),d=Number(m.dataset.pmEnd);if(!(!Number.isFinite(g)||!Number.isFinite(d))&&o>=g&&o<=d){let b=r.ownerDocument.createRange(),x=r.ownerDocument.createTreeWalker(m,NodeFilter.SHOW_TEXT),k=o-g,F=x.nextNode();for(;F;){let H=F.data.length;if(k<=H){try{b.setStart(F,k),b.setEnd(F,k);let w=b.getClientRects()[0]??b.getBoundingClientRect();if(w&&w.height>0)return {top:w.top,left:w.left,height:w.height}}catch{}break}k-=H,F=x.nextNode();}let P=m.getBoundingClientRect(),y=(o-g)/Math.max(1,d-g);return {top:P.top,left:P.left+P.width*y,height:P.height}}}let i=r.querySelector(`[data-pm-start="${o}"]`);if(i){let m=i.getBoundingClientRect();return {top:m.top,left:m.left+1,height:m.height||16}}let l=n.ranged,u=null,f=1/0;for(let m of l){let g=Number(m.dataset.pmStart),d=Number(m.dataset.pmEnd);if(!Number.isFinite(g)||!Number.isFinite(d)||o<g||o>d)continue;let b=d-g;b<f&&(f=b,u=m);}if(u){let m=u.getBoundingClientRect(),g=Number(u.dataset.pmEnd),d=o>=g;return {top:m.top,left:d?m.right:m.left+1,height:m.height||16}}let c=null,h=-1/0;for(let m of l){let g=Number(m.dataset.pmStart);Number.isFinite(g)&&(g>o||g>h&&(h=g,c=m));}if(c){let m=c.getBoundingClientRect();return {top:m.top,left:m.right,height:m.height||16}}let p=r.getBoundingClientRect();return {top:p.top+2,left:p.left+2,height:16}}function We(e,t=globalThis.document){let a=e.state.selection;if(a.empty)return [];let o=a.from,n=a.to,r=[],s=Te(t);if(!s)return r;let{host:i,spans:l}=s;for(let u of l){let f=Number(u.dataset.pmStart),c=Number(u.dataset.pmEnd);if(!Number.isFinite(f)||!Number.isFinite(c)||c<=o||f>=n)continue;if(u.classList.contains("layout-run-tab")){let d=u.getBoundingClientRect();r.push({top:d.top,left:d.left,width:d.width,height:d.height});continue}let h=null;if(u.firstChild?.nodeType===Node.TEXT_NODE?h=u.firstChild:u.firstChild?.nodeType===Node.ELEMENT_NODE&&u.firstChild.tagName==="A"&&u.firstChild.firstChild?.nodeType===Node.TEXT_NODE&&(h=u.firstChild.firstChild),!h)continue;let p=Math.max(0,o-f),m=Math.min(h.length,n-f);if(p>=m)continue;let g=i.ownerDocument.createRange();g.setStart(h,p),g.setEnd(h,m);for(let d of Array.from(g.getClientRects()))r.push({top:d.top,left:d.left,width:d.width,height:d.height});}return r}var Ue=816,Ve=1056,qe=96,je=48;function O(e){return Math.round(e/1440*96)}function $e(e){return {w:e?.pageWidth?O(e.pageWidth):816,h:e?.pageHeight?O(e.pageHeight):1056}}function Je(e){return {top:e?.marginTop?O(e.marginTop):96,right:e?.marginRight?O(e.marginRight):96,bottom:e?.marginBottom?O(e.marginBottom):96,left:e?.marginLeft?O(e.marginLeft):96,header:e?.headerDistance?O(e.headerDistance):48,footer:e?.footerDistance?O(e.footerDistance):48}}function Ke(e,t){let a={header:null,footer:null,firstHeader:null,firstFooter:null};if(!e?.package)return a;let o=e.package.headers,n=e.package.footers,r=null,s=null,i=null,l=null;if(o&&t?.headerReferences){let u=t.headerReferences.find(c=>c.type==="default");u?.rId&&(r=o.get(u.rId)??null);let f=t.headerReferences.find(c=>c.type==="first");f?.rId&&(i=o.get(f.rId)??null);}if(n&&t?.footerReferences){let u=t.footerReferences.find(c=>c.type==="default");u?.rId&&(s=n.get(u.rId)??null);let f=t.footerReferences.find(c=>c.type==="first");f?.rId&&(l=n.get(f.rId)??null);}return t?.titlePg||(!r&&i&&(r=i),!s&&l&&(s=l)),{header:r,footer:s,firstHeader:i,firstFooter:l}}export{We as A,Ue as B,Ve as C,qe as D,je as E,$e as F,Je as G,Ke as H,j as a,A as b,Me as c,ae as d,He as e,se as f,we as g,Re as h,Be as i,Ie as j,K as k,ue as l,Le as m,fe as n,Ce as o,De as p,_e as q,Ae as r,Oe as s,de as t,pe as u,be as v,Ne as w,xe as x,ze as y,Ge as z};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var chunkGM4USWKO_js=require('./chunk-GM4USWKO.js');var t=new chunkGM4USWKO_js.q(chunkGM4USWKO_js.p());t.buildSchema();t.initializeRuntime();var s=t,n=t.getSchema();exports.a=s;exports.b=n;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {c,i,j}from'./chunk-WLHNIXWC.mjs';var u={image:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",hyperlink:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",header:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/header",footer:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer",footnotes:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/footnotes",endnotes:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/endnotes",styles:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",numbering:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering",fontTable:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable",theme:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme",settings:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings",webSettings:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/webSettings",oleObject:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject",chart:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart",diagramData:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/diagramData",officeDocument:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",coreProperties:"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties",extendedProperties:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties",customProperties:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties",customXml:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXml",comments:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments",commentsExtended:"http://schemas.microsoft.com/office/2011/relationships/commentsExtended",commentsIds:"http://schemas.microsoft.com/office/2016/09/relationships/commentsIds",commentsExtensible:"http://schemas.microsoft.com/office/2018/08/relationships/commentsExtensible"};function x(e){let t=new Map;if(!e||e.trim().length===0)return t;let i$1=c(e);if(!i$1)return console.warn("Failed to parse relationships XML"),t;let f=i(i$1);for(let o of f){let l=o.name||"";if(!l.endsWith("Relationship")&&!l.includes(":Relationship"))continue;let n=j(o,null,"Id"),r=j(o,null,"Type"),a=j(o,null,"Target"),c=j(o,null,"TargetMode");if(!n||!r||!a){console.warn("Relationship missing required attributes:",{id:n,type:r,target:a});continue}let p={id:n,type:r,target:a};c==="External"?p.targetMode="External":c==="Internal"&&(p.targetMode="Internal"),t.set(n,p);}return t}function d(e){return e.type===u.hyperlink&&e.targetMode==="External"}function R(e,t){return e.get(t)?.target}
|
|
2
|
+
export{u as a,x as b,d as c,R as d};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import {h,g as g$1,a as a$1,i,k as k$1,l,m}from'./chunk-DLCDDB66.mjs';import {a}from'./chunk-OEXVWIHW.mjs';import y from'jszip';var j=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
2
|
+
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"></Relationships>`;function E(r){return r.startsWith("/")?r.slice(1):`word/${r}`}function P(r){let e=[{relsPath:"word/_rels/document.xml.rels",blocks:r.package.document.content}],t=r.package.relationships;if(!t)return e;let o=(n,i)=>{if(n)for(let[c,s]of n.entries()){let a=t.get(c);if(!a||a.type!==i||!a.target)continue;let l=E(a.target).replace(/^word\//,"");e.push({relsPath:`word/_rels/${l}.rels`,blocks:s.content});}};return o(r.package.headers,a.header),o(r.package.footers,a.footer),e}async function T(r,e){let t=r.file(e);return (t?await t.async("text"):j).replace(/<Relationships([^>]*)\/>/,"<Relationships$1></Relationships>")}function g(r){let e=0;for(let t of r.matchAll(/Id="rId(\d+)"/g)){let o=parseInt(t[1],10);o>e&&(e=o);}return e}function D(r,e){return e||{png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",bmp:"image/bmp",tif:"image/tiff",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp",wmf:"image/x-wmf",emf:"image/x-emf"}[r]||"application/octet-stream"}function k(r){let e=[],t=o=>{for(let n of o.content)n.type==="drawing"&&n.image?.src?.startsWith("data:")&&e.push(n.image);};for(let o of r)if(o.type==="paragraph"){for(let n of o.content)if(n.type==="run")t(n);else if(n.type==="insertion"||n.type==="deletion"||n.type==="moveFrom"||n.type==="moveTo")for(let i of n.content)i.type==="run"&&t(i);}else if(o.type==="table")for(let n of o.rows)for(let i of n.cells)e.push(...k(i.content));return e}var W={"image/png":"png","image/jpeg":"jpeg","image/gif":"gif","image/bmp":"bmp","image/tiff":"tiff","image/webp":"webp","image/svg+xml":"svg"};function z(r){let e=r.match(/^data:([^;]+);base64,(.+)$/);if(!e)throw new Error("Invalid data URL");let t=atob(e[2]),o=new Uint8Array(t.length);for(let n=0;n<t.length;n++)o[n]=t.charCodeAt(n);return {data:o.buffer,extension:W[e[1]]||"png"}}async function q(r,e,t){if(e.size===0)return;let o=r.file("[Content_Types].xml");if(!o)return;let n=await o.async("text"),i=false;for(let c of e)if(!n.includes(`Extension="${c}"`)){let s=D(c,"");n=n.replace("</Types>",`<Default Extension="${c}" ContentType="${s}"/></Types>`),i=true;}i&&r.file("[Content_Types].xml",n,{compression:"DEFLATE",compressionOptions:{level:t}});}function V(r){let e=0;return r.forEach(t=>{let o=t.match(/^word\/media\/image(\d+)\./);if(o){let n=parseInt(o[1],10);n>e&&(e=n);}}),e}async function A(r,e,t){let o=V(e),n=new Set;for(let{relsPath:i,blocks:c}of r){let s=k(c);if(s.length===0)continue;let a$1=await T(e,i),p=g(a$1),l=[];for(let d of s){let{data:u,extension:x}=z(d.src);o++,p++;let C=`image${o}.${x}`,R=`rId${p}`;e.file(`word/media/${C}`,u,{compression:"DEFLATE",compressionOptions:{level:t}}),l.push(`<Relationship Id="${R}" Type="${a.image}" Target="media/${C}"/>`),n.add(x),d.rId=R;}let m=a$1.replace("</Relationships>",l.join("")+"</Relationships>");e.file(i,m,{compression:"DEFLATE",compressionOptions:{level:t}});}await q(e,n,t);}function S(r){let e=[];for(let t of r)if(t.type==="paragraph")for(let o of t.content)o.type==="hyperlink"&&o.href&&!o.rId&&!o.anchor&&e.push(o);else if(t.type==="table")for(let o of t.rows)for(let n of o.cells)e.push(...S(n.content));return e}async function I(r,e,t){for(let{relsPath:o,blocks:n}of r){let i=S(n);if(i.length===0)continue;let c=await T(e,o),s=g(c),a$2=[];for(let l of i){s++;let m=`rId${s}`;a$2.push(`<Relationship Id="${m}" Type="${a.hyperlink}" Target="${a$1(l.href)}" TargetMode="External"/>`),l.rId=m;}let p=c.replace("</Relationships>",a$2.join("")+"</Relationships>");e.file(o,p,{compression:"DEFLATE",compressionOptions:{level:t}});}}var G="application/vnd.openxmlformats-officedocument.wordprocessingml.header+xml",K="application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml",L="application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml",X="application/vnd.openxmlformats-officedocument.wordprocessingml.commentsExtended+xml",Z="application/vnd.openxmlformats-officedocument.wordprocessingml.commentsIds+xml",H="application/vnd.openxmlformats-officedocument.wordprocessingml.commentsExtensible+xml";async function F(r,e,t){let o=r.package.relationships;if(!o)return;let n=[];for(let[p,l]of o){if(!l.target)continue;let m=l.type===a.header?G:l.type===a.footer?K:null;m&&n.push({rId:p,target:l.target.replace(/^(\/?word\/)/,""),contentType:m,relType:l.type});}if(n.length===0)return;let i=e.file("[Content_Types].xml");if(i){let p=await i.async("text"),l=false;for(let{target:m,contentType:d}of n){let u=`/word/${m}`;p.includes(`PartName="${u}"`)||(p=p.replace("</Types>",`<Override PartName="${u}" ContentType="${d}"/></Types>`),l=true);}l&&e.file("[Content_Types].xml",p,{compression:"DEFLATE",compressionOptions:{level:t}});}let c="word/_rels/document.xml.rels",s=await T(e,c),a$1=false;for(let{rId:p,relType:l,target:m}of n)s.includes(`Id="${p}"`)||(s=s.replace("</Relationships>",`<Relationship Id="${p}" Type="${l}" Target="${m}"/></Relationships>`),a$1=true);a$1&&e.file(c,s,{compression:"DEFLATE",compressionOptions:{level:t}});}async function Q(r,e){let t=[{partName:"/word/comments.xml",contentType:L,target:"comments.xml",relType:a.comments},{partName:"/word/commentsExtended.xml",contentType:X,target:"commentsExtended.xml",relType:a.commentsExtended},{partName:"/word/commentsIds.xml",contentType:Z,target:"commentsIds.xml",relType:a.commentsIds},{partName:"/word/commentsExtensible.xml",contentType:H,target:"commentsExtensible.xml",relType:a.commentsExtensible}],o=r.file("[Content_Types].xml");if(o){let c=await o.async("text"),s=false;for(let{partName:a,contentType:p}of t)c.includes(a)||(c=c.replace("</Types>",`<Override PartName="${a}" ContentType="${p}"/></Types>`),s=true);s&&r.file("[Content_Types].xml",c,{compression:"DEFLATE",compressionOptions:{level:e}});}let n="word/_rels/document.xml.rels",i=r.file(n);if(i){let c=await i.async("text"),s=false;for(let{target:a,relType:p}of t)if(!c.includes(a)){let l=`rId${g(c)+1}`;c=c.replace("</Relationships>",`<Relationship Id="${l}" Type="${p}" Target="${a}"/></Relationships>`),s=true;}s&&r.file(n,c,{compression:"DEFLATE",compressionOptions:{level:e}});}}async function b(r,e,t){let o=r.package.document.comments;if(!o||o.length===0)return;let{xml:n,paraInfos:i$1}=i(o);e.file("word/comments.xml",n,{compression:"DEFLATE",compressionOptions:{level:t}});let c=k$1(i$1);c&&e.file("word/commentsExtended.xml",c,{compression:"DEFLATE",compressionOptions:{level:t}});let s=l(i$1);s&&e.file("word/commentsIds.xml",s,{compression:"DEFLATE",compressionOptions:{level:t}});let a=m(i$1,o);a&&e.file("word/commentsExtensible.xml",a,{compression:"DEFLATE",compressionOptions:{level:t}}),await Q(e,t);}function U(r){let e=new Map,t=r.package.relationships;if(!t)return e;let o=[{map:r.package.headers,type:a.header},{map:r.package.footers,type:a.footer}];for(let{map:n,type:i}of o)if(n)for(let[c,s]of n.entries()){let a=t.get(c);a&&a.type===i&&a.target&&e.set(E(a.target),h(s));}return e}function O(r,e,t){let o={level:t};for(let[n,i]of U(r))e.file(n,i,{compression:"DEFLATE",compressionOptions:o});}async function v(){let r=new y;r.file("[Content_Types].xml",`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
3
|
+
<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">
|
|
4
|
+
<Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/>
|
|
5
|
+
<Default Extension="xml" ContentType="application/xml"/>
|
|
6
|
+
<Override PartName="/word/document.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml"/>
|
|
7
|
+
<Override PartName="/word/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml"/>
|
|
8
|
+
<Override PartName="/docProps/core.xml" ContentType="application/vnd.openxmlformats-package.core-properties+xml"/>
|
|
9
|
+
<Override PartName="/docProps/app.xml" ContentType="application/vnd.openxmlformats-officedocument.extended-properties+xml"/>
|
|
10
|
+
</Types>`),r.file("_rels/.rels",`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
11
|
+
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
|
|
12
|
+
<Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="word/document.xml"/>
|
|
13
|
+
<Relationship Id="rId2" Type="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties" Target="docProps/core.xml"/>
|
|
14
|
+
<Relationship Id="rId3" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties" Target="docProps/app.xml"/>
|
|
15
|
+
</Relationships>`),r.file("word/_rels/document.xml.rels",`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
16
|
+
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
|
|
17
|
+
<Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" Target="styles.xml"/>
|
|
18
|
+
</Relationships>`),r.file("word/document.xml",`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
19
|
+
<w:document xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships">
|
|
20
|
+
<w:body>
|
|
21
|
+
<w:p>
|
|
22
|
+
<w:r>
|
|
23
|
+
<w:t></w:t>
|
|
24
|
+
</w:r>
|
|
25
|
+
</w:p>
|
|
26
|
+
<w:sectPr>
|
|
27
|
+
<w:pgSz w:w="12240" w:h="15840"/>
|
|
28
|
+
<w:pgMar w:top="1440" w:right="1440" w:bottom="1440" w:left="1440" w:header="720" w:footer="720" w:gutter="0"/>
|
|
29
|
+
</w:sectPr>
|
|
30
|
+
</w:body>
|
|
31
|
+
</w:document>`),r.file("word/styles.xml",`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
32
|
+
<w:styles xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main">
|
|
33
|
+
<w:docDefaults>
|
|
34
|
+
<w:rPrDefault>
|
|
35
|
+
<w:rPr>
|
|
36
|
+
<w:rFonts w:ascii="Calibri" w:hAnsi="Calibri"/>
|
|
37
|
+
<w:sz w:val="22"/>
|
|
38
|
+
</w:rPr>
|
|
39
|
+
</w:rPrDefault>
|
|
40
|
+
<w:pPrDefault>
|
|
41
|
+
<w:pPr>
|
|
42
|
+
<w:spacing w:after="200" w:line="276" w:lineRule="auto"/>
|
|
43
|
+
</w:pPr>
|
|
44
|
+
</w:pPrDefault>
|
|
45
|
+
</w:docDefaults>
|
|
46
|
+
<w:style w:type="paragraph" w:default="1" w:styleId="Normal">
|
|
47
|
+
<w:name w:val="Normal"/>
|
|
48
|
+
</w:style>
|
|
49
|
+
</w:styles>`);let e=new Date().toISOString();return r.file("docProps/core.xml",`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
50
|
+
<cp:coreProperties xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
|
51
|
+
<dc:creator>EigenPal DOCX Editor</dc:creator>
|
|
52
|
+
<dcterms:created xsi:type="dcterms:W3CDTF">${e}</dcterms:created>
|
|
53
|
+
<dcterms:modified xsi:type="dcterms:W3CDTF">${e}</dcterms:modified>
|
|
54
|
+
</cp:coreProperties>`),r.file("docProps/app.xml",`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
55
|
+
<Properties xmlns="http://schemas.openxmlformats.org/officeDocument/2006/extended-properties">
|
|
56
|
+
<Application>EigenPal DOCX Editor</Application>
|
|
57
|
+
<AppVersion>1.0.0</AppVersion>
|
|
58
|
+
</Properties>`),r.generateAsync({type:"arraybuffer",compression:"DEFLATE",compressionOptions:{level:6}})}async function J(r,e={}){if(!r.originalBuffer)throw new Error("Cannot repack document: no original buffer for round-trip. Use createDocx() for new documents.");let{compressionLevel:t=6,updateModifiedDate:o=true,modifiedBy:n}=e,i=r,c=await y.loadAsync(r.originalBuffer),s=new y;for(let[m,d]of Object.entries(c.files)){if(d.dir){s.folder(m.replace(/\/$/,""));continue}let u=await d.async("arraybuffer");s.file(m,u,{compression:"DEFLATE",compressionOptions:{level:t}});}let a=P(i);await A(a,s,t),await I(a,s,t);let p=g$1(i);if(s.file("word/document.xml",p,{compression:"DEFLATE",compressionOptions:{level:t}}),O(i,s,t),await F(i,s,t),await b(i,s,t),o){let m="docProps/core.xml",d=c.file(m);if(d){let u=await d.async("text"),x=Y(u,{updateModifiedDate:o,modifiedBy:n});s.file(m,x,{compression:"DEFLATE",compressionOptions:{level:t}});}}return await s.generateAsync({type:"arraybuffer",compression:"DEFLATE",compressionOptions:{level:t}})}async function be(r,e,t={}){let{compressionLevel:o=6,updateModifiedDate:n=true,modifiedBy:i}=t,c=r,s=new y;for(let[m,d]of Object.entries(e.originalZip.files)){if(d.dir){s.folder(m.replace(/\/$/,""));continue}let u=await d.async("arraybuffer");s.file(m,u,{compression:"DEFLATE",compressionOptions:{level:o}});}let a=P(c);await A(a,s,o),await I(a,s,o);let p=g$1(c);if(s.file("word/document.xml",p,{compression:"DEFLATE",compressionOptions:{level:o}}),O(c,s,o),await F(c,s,o),await b(c,s,o),n&&e.corePropsXml){let m=Y(e.corePropsXml,{updateModifiedDate:n,modifiedBy:i});s.file("docProps/core.xml",m,{compression:"DEFLATE",compressionOptions:{level:o}});}return await s.generateAsync({type:"arraybuffer",compression:"DEFLATE",compressionOptions:{level:o}})}async function Oe(r,e,t={}){let{compressionLevel:o=6}=t,n=await y.loadAsync(r);return n.file("word/document.xml",e,{compression:"DEFLATE",compressionOptions:{level:o}}),n.generateAsync({type:"arraybuffer",compression:"DEFLATE",compressionOptions:{level:o}})}async function ve(r,e,t,o={}){let{compressionLevel:n=6}=o,i=await y.loadAsync(r);return i.file(e,t,{compression:"DEFLATE",compressionOptions:{level:n}}),i.generateAsync({type:"arraybuffer",compression:"DEFLATE",compressionOptions:{level:n}})}async function Ce(r,e,t={}){let o=await y.loadAsync(r);return te(o,e,t)}async function te(r,e,t={}){let{compressionLevel:o=6}=t;for(let[n,i]of e)r.file(n,i,{compression:"DEFLATE",compressionOptions:{level:o}});return r.generateAsync({type:"arraybuffer",compression:"DEFLATE",compressionOptions:{level:o}})}async function oe(r,e){let t=await y.loadAsync(r),o="word/_rels/document.xml.rels",n=t.file(o);if(!n)throw new Error("document.xml.rels not found in DOCX");let i=await n.async("text"),c=`rId${g(i)+1}`,s=e.targetMode==="External"?' TargetMode="External"':"",a=`<Relationship Id="${c}" Type="${e.type}" Target="${a$1(e.target)}"${s}/>`,p=i.replace("</Relationships>",`${a}</Relationships>`);return t.file(o,p),{buffer:await t.generateAsync({type:"arraybuffer",compression:"DEFLATE",compressionOptions:{level:6}}),rId:c}}async function Re(r,e,t,o){let n=await y.loadAsync(r),i=`word/media/${e}`;n.file(i,t);let c=await oe(await n.generateAsync({type:"arraybuffer"}),{type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",target:`media/${e}`}),s=n.file("[Content_Types].xml");if(s){let a=await s.async("text"),p=e.split(".").pop()?.toLowerCase()||"";if(!a.includes(`Extension="${p}"`)&&p){let m=D(p,o),d=`<Default Extension="${p}" ContentType="${m}"/>`,u=a.replace("</Types>",`${d}</Types>`),x=await y.loadAsync(c.buffer);return x.file("[Content_Types].xml",u),{buffer:await x.generateAsync({type:"arraybuffer",compression:"DEFLATE",compressionOptions:{level:6}}),rId:c.rId,path:i}}}return {buffer:c.buffer,rId:c.rId,path:i}}function Y(r,e){let t=r;if(e.updateModifiedDate){let o=new Date().toISOString();t.includes("<dcterms:modified")?t=t.replace(/<dcterms:modified[^>]*>[^<]*<\/dcterms:modified>/,`<dcterms:modified xsi:type="dcterms:W3CDTF">${o}</dcterms:modified>`):t=t.replace("</cp:coreProperties>",`<dcterms:modified xsi:type="dcterms:W3CDTF">${o}</dcterms:modified></cp:coreProperties>`);}return e.modifiedBy&&(t.includes("<cp:lastModifiedBy")?t=t.replace(/<cp:lastModifiedBy>[^<]*<\/cp:lastModifiedBy>/,`<cp:lastModifiedBy>${a$1(e.modifiedBy)}</cp:lastModifiedBy>`):t=t.replace("</cp:coreProperties>",`<cp:lastModifiedBy>${a$1(e.modifiedBy)}</cp:lastModifiedBy></cp:coreProperties>`)),t}async function Me(r){let e=[],t=[];try{let o=await y.loadAsync(r),n=["[Content_Types].xml","word/document.xml"];for(let a of n)o.file(a)||e.push(`Missing required file: ${a}`);let i=["_rels/.rels","word/_rels/document.xml.rels","word/styles.xml"];for(let a of i)o.file(a)||t.push(`Missing recommended file: ${a}`);let c=o.file("word/document.xml");if(c){let a=await c.async("text");a.includes("<?xml")||t.push("document.xml missing XML declaration"),a.includes("<w:document")||e.push("document.xml missing w:document element"),a.includes("<w:body>")||e.push("document.xml missing w:body element");}let s=o.file("[Content_Types].xml");if(s){let a=await s.async("text");!a.includes("word/document.xml")&&!a.includes("application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml")&&t.push("Content_Types.xml may be missing document.xml type declaration");}}catch(o){e.push(`Failed to read as ZIP: ${o instanceof Error?o.message:"Unknown error"}`);}return {valid:e.length===0,errors:e,warnings:t}}function Ne(r){if(r.byteLength<4)return false;let e=new Uint8Array(r);return e[0]===80&&e[1]===75}async function _e(r){let e=await v(),t={...r,originalBuffer:e};return J(t)}var $e=J;
|
|
59
|
+
export{g as a,L as b,X as c,Z as d,H as e,U as f,v as g,J as h,be as i,Oe as j,ve as k,Ce as l,te as m,oe as n,Re as o,Y as p,Me as q,Ne as r,_e as s,$e as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {t,z}from'./chunk-RFVFX5WK.mjs';var O=30,F=200,y=24,R=10,B=10,C=24;function N(_){let{mouseX:n,mouseY:l,pagesContainer:d,target:L,hfEditMode:m,edgeProximity:r=O}=_,T=`.${t.table}`,H=`.${t.row}`,p=`.${t.cell}`,h=`.${z.header}`,M=`.${z.footer}`,E=t=>{let o=!!t.closest(h),e=!!t.closest(M);return !o&&!e?!m:o?m==="header":m==="footer"},c=L.closest(T);if(c&&!E(c)&&(c=null),!c){let t=d.querySelectorAll(T);for(let o of Array.from(t)){if(!E(o))continue;let e=o.getBoundingClientRect(),s=n>=e.left-r&&n<e.left,A=l>=e.top-r&&l<e.top,P=n>=e.left-r&&n<=e.right,I=l>=e.top-r&&l<=e.bottom;if(s&&I||A&&P){c=o;break}}}if(!c)return null;let i=c.getBoundingClientRect(),b=n<i.left+r&&n>=i.left-r,g=l<i.top+r&&l>=i.top-r;if(!b&&!g)return null;let u=c.querySelectorAll(`:scope > ${H}`);if(u.length===0)return null;let S=t=>t&&Number(t.dataset.pmStart)||0;if(b)for(let t=0;t<u.length;t++){let o=u[t].getBoundingClientRect();if(l>=o.top&&l<=o.bottom){let e=u[t].querySelector(p),s=S(e);if(!s)break;return {type:"row",clientX:i.left-y,clientY:o.top+o.height/2-R,cellPmPos:s}}}if(g){let t=u[0].querySelectorAll(`:scope > ${p}`);for(let o=0;o<t.length;o++){let e=t[o].getBoundingClientRect();if(n>=e.left&&n<=e.right){let s=S(t[o]);if(!s)break;return {type:"column",clientX:e.left+e.width/2-B,clientY:i.top-C,cellPmPos:s}}}}return null}export{O as a,F as b,N as c};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {c}from'./chunk-
|
|
1
|
+
import {c}from'./chunk-IF4C25FN.mjs';import {a as a$1}from'./chunk-ARHPXIBJ.mjs';import {b,a as a$2}from'./chunk-CUY2THAO.mjs';import {h as h$1,s}from'./chunk-ONRBRDIC.mjs';import {f}from'./chunk-CTHHUJAB.mjs';import {a}from'./chunk-QYUPLKLP.mjs';var P=class o{constructor(t){a(this,"_document");a(this,"_pendingVariables");t instanceof ArrayBuffer||ArrayBuffer.isView(t)?this._document={package:{document:{content:[]}},originalBuffer:t instanceof ArrayBuffer?t:t.buffer}:this._document=t,this._pendingVariables={};}static async fromBuffer(t){let e=await f(t);return new o(e)}static fromDocument(t){return new o(t)}getDocument(){return this._document}getText(){let t=this._document.package.document;return this._getBodyText(t)}getFormattedText(){let t=[],e=this._document.package.document;for(let n of e.content)n.type==="paragraph"&&this._extractParagraphSegments(n,t);return t}getVariables(){return a$1(this._document)}getStyles(){let t=this._document.package.styles;if(!t?.styles)return [];let e=[];for(let[n,r]of Object.entries(t.styles))if(typeof r=="object"&&r!==null){let a=r;e.push({id:n,name:a.name||n,type:a.type==="numbering"?"paragraph":a.type||"paragraph",builtIn:a.default});}return e}getPageCount(){let t=this.getWordCount();return Math.max(1,Math.ceil(t/500))}getWordCount(){return this.getText().split(/\s+/).filter(n=>n.length>0).length}getCharacterCount(t=true){let e=this.getText();return t?e.length:e.replace(/\s/g,"").length}getParagraphCount(){return this._document.package.document.content.filter(t=>t.type==="paragraph").length}getTableCount(){return this._document.package.document.content.filter(t=>t.type==="table").length}getAgentContext(t=100){let e=this._document.package.document,n=e.content.filter(i=>i.type==="paragraph"),r=n.map((i,s)=>{let c=this._getParagraphText(i),p=i.formatting?.styleId;return {index:s,preview:c.slice(0,t),style:p,isHeading:p?.toLowerCase().includes("heading")||false,headingLevel:this._parseHeadingLevel(p),isListItem:!!i.listRendering,isEmpty:c.trim().length===0}}),a=(e.sections||[]).map((i,s)=>({index:s,paragraphCount:i.content?.length||0,pageSize:i.properties?.pageWidth&&i.properties?.pageHeight?{width:i.properties.pageWidth,height:i.properties.pageHeight}:void 0,isLandscape:i.properties?.orientation==="landscape",hasHeader:!!i.properties?.headerReferences?.length,hasFooter:!!i.properties?.footerReferences?.length}));return {paragraphCount:n.length,wordCount:this.getWordCount(),characterCount:this.getCharacterCount(),variables:this.getVariables(),variableCount:this.getVariables().length,availableStyles:this.getStyles(),outline:r,sections:a,hasTables:this.getTableCount()>0,hasImages:this._hasImages(),hasHyperlinks:this._hasHyperlinks()}}insertText(t,e,n={}){let r={type:"insertText",position:t,text:e,formatting:n.formatting};return this._executeCommand(r)}replaceRange(t,e,n={}){let r={type:"replaceText",range:t,text:e,formatting:n.formatting};return this._executeCommand(r)}deleteRange(t){let e={type:"deleteText",range:t};return this._executeCommand(e)}applyFormatting(t,e){let n={type:"formatText",range:t,formatting:e};return this._executeCommand(n)}applyStyle(t,e){let n={type:"applyStyle",paragraphIndex:t,styleId:e};return this._executeCommand(n)}applyParagraphFormatting(t,e){let n={type:"formatParagraph",paragraphIndex:t,formatting:e};return this._executeCommand(n)}insertTable(t,e,n,r={}){let a={type:"insertTable",position:t,rows:e,columns:n,data:r.data,hasHeader:r.hasHeader};return this._executeCommand(a)}insertImage(t,e,n={}){let r={type:"insertImage",position:t,src:e,width:n.width,height:n.height,alt:n.alt};return this._executeCommand(r)}insertHyperlink(t,e,n={}){let r={type:"insertHyperlink",range:t,url:e,displayText:n.displayText,tooltip:n.tooltip};return this._executeCommand(r)}removeHyperlink(t){let e={type:"removeHyperlink",range:t};return this._executeCommand(e)}insertParagraphBreak(t){let e={type:"insertParagraphBreak",position:t};return this._executeCommand(e)}mergeParagraphs(t,e){let n={type:"mergeParagraphs",paragraphIndex:t,count:e};return this._executeCommand(n)}setVariable(t,e){return this._pendingVariables[t]=e,this}setVariables(t){for(let[e,n]of Object.entries(t))this._pendingVariables[e]=n;return this}getPendingVariables(){return {...this._pendingVariables}}clearPendingVariables(){return this._pendingVariables={},this}async applyVariables(t){let e={...this._pendingVariables,...t};if(Object.keys(e).length===0)return this;let n=this._document.originalBuffer;if(!n)throw new Error("Cannot apply variables: no original buffer for processing");let{processTemplate:r}=await import('./processTemplate-GPFDLQMX.mjs'),a=r(n,e),i=await f(a),s=new o(i);return s._pendingVariables={},s}async toBuffer(t){if(this._document.originalBuffer){if(t?.selective){let n=await c(this._document,this._document.originalBuffer,t.selective);if(n)return this._document.originalBuffer=n,n}let e=await h$1(this._document);return this._document.originalBuffer=e,e}return s(this._document)}async toBlob(t="application/vnd.openxmlformats-officedocument.wordprocessingml.document"){let e=await this.toBuffer();return new Blob([e],{type:t})}executeCommands(t){return new o(b(this._document,t))}_executeCommand(t){let e=new o(a$2(this._document,t));return e._pendingVariables={...this._pendingVariables},e}_getBodyText(t){let e=[];for(let n of t.content)n.type==="paragraph"?e.push(this._getParagraphText(n)):n.type==="table"&&e.push(this._getTableText(n));return e.join(`
|
|
2
2
|
`)}_getParagraphText(t){let e=[];for(let n of t.content)n.type==="run"?e.push(this._getRunText(n)):n.type==="hyperlink"&&e.push(this._getHyperlinkText(n));return e.join("")}_getRunText(t){return t.content.filter(e=>e.type==="text").map(e=>e.text).join("")}_getHyperlinkText(t){let e=[];for(let n of t.children)n.type==="run"&&e.push(this._getRunText(n));return e.join("")}_getTableText(t){let e=[];for(let n of t.rows)for(let r of n.cells)for(let a of r.content)a.type==="paragraph"&&e.push(this._getParagraphText(a));return e.join(" ")}_extractParagraphSegments(t,e){for(let n of t.content)if(n.type==="run"){let r=this._getRunText(n);r&&e.push({text:r,formatting:n.formatting});}else if(n.type==="hyperlink"){let r=n.href||"";for(let a of n.children)if(a.type==="run"){let i=this._getRunText(a);i&&e.push({text:i,formatting:a.formatting,isHyperlink:true,hyperlinkUrl:r});}}}_parseHeadingLevel(t){if(!t)return;let e=t.match(/heading\s*(\d)/i);if(e)return parseInt(e[1],10)}_hasImages(){let t=this._document.package.document;for(let e of t.content)if(e.type==="paragraph"){for(let n of e.content)if(n.type==="run"){for(let r of n.content)if(r.type==="drawing")return true}}return false}_hasHyperlinks(){let t=this._document.package.document;for(let e of t.content)if(e.type==="paragraph"){for(let n of e.content)if(n.type==="hyperlink")return true}return false}};async function Ct(o){return P.fromBuffer(o)}function kt(o){return P.fromDocument(o)}function M(o,t={}){let{outlineMaxChars:e=100,maxOutlineParagraphs:n=50}=t,r=o.package.document,a=r.content.filter(y=>y.type==="paragraph"),i=z(a,e,n),s=a$1(o),c=W(o),p=$(r),u=U(r),d=G(r),f=r.content.some(y=>y.type==="table"),x=K(r),l=N(r);return {paragraphCount:a.length,wordCount:u,characterCount:d,variables:s,variableCount:s.length,availableStyles:c,outline:i,sections:p,hasTables:f,hasImages:x,hasHyperlinks:l}}function At(o,t,e={}){let{contextChars:n=200,includeSuggestions:r=true}=e,i=o.package.document.content.filter(m=>m.type==="paragraph"),s=i[t.start.paragraphIndex];if(!s)throw new Error(`Paragraph not found at index ${t.start.paragraphIndex}`);let c=g(s),p="";if(t.start.paragraphIndex===t.end.paragraphIndex)p=c.slice(t.start.offset,t.end.offset);else {let m=[];for(let b=t.start.paragraphIndex;b<=t.end.paragraphIndex;b++){let H=i[b];if(!H)continue;let _=g(H);b===t.start.paragraphIndex?m.push(_.slice(t.start.offset)):b===t.end.paragraphIndex?m.push(_.slice(0,t.end.offset)):m.push(_);}p=m.join(`
|
|
3
3
|
`);}let u=Y(i,t.start.paragraphIndex,t.start.offset,n),d=Z(i,t.end.paragraphIndex,t.end.offset,n),f=tt(s,t.start.offset),x=s.formatting||{},l={index:t.start.paragraphIndex,fullText:c,style:s.formatting?.styleId,wordCount:v(c)},y=false,A=et(s,t.start.offset),S=r?nt(p):[];return {selectedText:p,range:t,formatting:f,paragraphFormatting:x,textBefore:u,textAfter:d,paragraph:l,inTable:y,inHyperlink:A,suggestedActions:S}}function L(o){let t=M(o,{outlineMaxChars:50,maxOutlineParagraphs:10}),e=[`Document with ${t.paragraphCount} paragraphs, ${t.wordCount} words.`];t.hasTables&&e.push("Contains tables."),t.hasImages&&e.push("Contains images."),t.hasHyperlinks&&e.push("Contains hyperlinks."),t.variableCount>0&&e.push(`Has ${t.variableCount} template variables: ${t.variables.join(", ")}`);let n=t.outline.filter(r=>r.isHeading);if(n.length>0){e.push(`
|
|
4
4
|
Headings:`);for(let r of n.slice(0,5)){let a=r.headingLevel||1;e.push(`${" ".repeat(a-1)}- ${r.preview}`);}n.length>5&&e.push(` ... and ${n.length-5} more headings`);}return e.join(" ")}function z(o,t,e){let n=[];for(let r=0;r<Math.min(o.length,e);r++){let a=o[r],i=g(a),s=a.formatting?.styleId;n.push({index:r,preview:i.slice(0,t),style:s,isHeading:Q(s),headingLevel:X(s),isListItem:!!a.listRendering,isEmpty:i.trim().length===0});}return n}function W(o){let t=o.package.styles;if(!t?.styles)return [];let e=[];for(let[n,r]of Object.entries(t.styles))if(typeof r=="object"&&r!==null){let a=r;e.push({id:n,name:a.name||n,type:a.type==="numbering"?"paragraph":a.type||"paragraph",builtIn:a.default});}return e}function $(o){return o.sections?o.sections.map((t,e)=>({index:e,paragraphCount:t.content?.length||0,pageSize:t.properties?.pageWidth&&t.properties?.pageHeight?{width:t.properties.pageWidth,height:t.properties.pageHeight}:void 0,isLandscape:t.properties?.orientation==="landscape",hasHeader:!!t.properties?.headerReferences?.length,hasFooter:!!t.properties?.footerReferences?.length})):[]}function U(o){let t=0;for(let e of o.content)if(e.type==="paragraph"){let n=g(e);t+=v(n);}else e.type==="table"&&(t+=q(e));return t}function v(o){return o.split(/\s+/).filter(e=>e.length>0).length}function G(o){let t=0;for(let e of o.content)if(e.type==="paragraph"){let n=g(e);t+=n.length;}else e.type==="table"&&(t+=J(e));return t}function q(o){let t=0;for(let e of o.rows)for(let n of e.cells)for(let r of n.content)if(r.type==="paragraph"){let a=g(r);t+=v(a);}return t}function J(o){let t=0;for(let e of o.rows)for(let n of e.cells)for(let r of n.content)if(r.type==="paragraph"){let a=g(r);t+=a.length;}return t}function g(o){let t=[];for(let e of o.content)e.type==="run"?t.push(T(e)):e.type==="hyperlink"&&t.push(F(e));return t.join("")}function T(o){return o.content.filter(t=>t.type==="text").map(t=>t.text).join("")}function F(o){let t=[];for(let e of o.children)e.type==="run"&&t.push(T(e));return t.join("")}function K(o){for(let t of o.content)if(t.type==="paragraph"){for(let e of t.content)if(e.type==="run"){for(let n of e.content)if(n.type==="drawing")return true}}return false}function N(o){for(let t of o.content)if(t.type==="paragraph"){for(let e of t.content)if(e.type==="hyperlink")return true}return false}function Q(o){return o?o.toLowerCase().includes("heading"):false}function X(o){if(!o)return;let t=o.match(/heading\s*(\d)/i);if(t)return parseInt(t[1],10)}function Y(o,t,e,n){let r=[],a=0,i=o[t];if(i){let p=g(i).slice(0,e);r.unshift(p),a+=p.length;}for(let c=t-1;c>=0&&a<n;c--){let p=o[c];if(!p)continue;let u=g(p);r.unshift(u),a+=u.length;}let s=r.join(`
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {a,b as b$1}from'./chunk-CA2EYL6T.mjs';import {e}from'./chunk-VHUVPHPI.mjs';function y(e$1){return e(e$1,b$1)}var t=a.getCommands(),F=t.toggleBold(),f=t.toggleItalic(),S=t.toggleUnderline(),H=t.toggleStrike(),T=t.toggleSuperscript(),h=t.toggleSubscript();function M(e){return t.setTextColor(e)}var A=t.clearTextColor();function v(e){return t.setHighlight(e)}var z=t.clearHighlight();function U(e){return t.setFontSize(e)}var b=t.clearFontSize();function B(e){return t.setFontFamily(e)}var I=t.clearFontFamily();function R(e,o){return t.setUnderlineStyle(e,o)}function _(e,o){return t.setHyperlink(e,o)}var j=t.removeHyperlink();function q(e,o,i){return t.insertHyperlink(e,o,i)}export{y as a,F as b,f as c,S as d,H as e,T as f,h as g,M as h,A as i,v as j,z as k,U as l,b as m,B as n,I as o,R as p,_ as q,j as r,q as s};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var F={FFFF00:"yellow","00FF00":"green","00FFFF":"cyan",FF00FF:"magenta","0000FF":"blue",FF0000:"red","00008B":"darkBlue","008080":"darkCyan","008000":"darkGreen",800080:"darkMagenta","8B0000":"darkRed",808e3:"darkYellow",808080:"darkGray",C0C0C0:"lightGray","000000":"black",FFFFFF:"white"};function a(e){let r=e.replace(/^#/,"").toUpperCase();return F[r]||null}exports.a=F;exports.b=a;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import {h,j as j$2,k,g,z}from'./chunk-6ZXL3EIP.mjs';import {c as c$1}from'./chunk-OEXVWIHW.mjs';import {c,j as j$1,e,l,i,a,f,m,d,b,n,k as k$1}from'./chunk-WLHNIXWC.mjs';var He={dk1:"000000",lt1:"FFFFFF",dk2:"44546A",lt2:"E7E6E6",accent1:"4472C4",accent2:"ED7D31",accent3:"A5A5A5",accent4:"FFC000",accent5:"5B9BD5",accent6:"70AD47",hlink:"0563C1",folHlink:"954F72"},Q={majorFont:{latin:"Calibri Light",ea:"",cs:"",fonts:{}},minorFont:{latin:"Calibri",ea:"",cs:"",fonts:{}}},me={name:"Office Theme",colorScheme:He,fontScheme:Q},ft=["dk1","lt1","dk2","lt2","accent1","accent2","accent3","accent4","accent5","accent6","hlink","folHlink"];function ct(e){if(!e)return null;switch(d(e.name||"")){case "srgbClr":return j$1(e,"a","val")??j$1(e,null,"val")??null;case "sysClr":{let n=j$1(e,"a","lastClr")??j$1(e,null,"lastClr");if(n)return n;switch(j$1(e,"a","val")??j$1(e,null,"val")){case "windowText":case "menuText":case "captionText":case "btnText":return "000000";case "window":case "menu":case "btnFace":case "btnHighlight":return "FFFFFF";case "highlight":return "0078D7";case "highlightText":return "FFFFFF";case "grayText":return "808080";default:return null}}case "schemeClr":{j$1(e,"a","val")??j$1(e,null,"val");return null}default:return null}}function pt(e$1){let t={...He};if(!e$1)return t;for(let n of ft){let r=e(e$1,"a",n);if(r){let o=i(r);if(o.length>0){let a=ct(o[0]);a&&(t[n]=a);}}}return t}function Be(e$1){let t={latin:"",ea:"",cs:"",fonts:{}};if(!e$1)return t;let n=e(e$1,"a","latin");n&&(t.latin=j$1(n,"a","typeface")??j$1(n,null,"typeface")??"");let r=e(e$1,"a","ea");r&&(t.ea=j$1(r,"a","typeface")??j$1(r,null,"typeface")??"");let o=e(e$1,"a","cs");o&&(t.cs=j$1(o,"a","typeface")??j$1(o,null,"typeface")??"");let a=f(e$1,"a","font");for(let u of a){let l=j$1(u,"a","script")??j$1(u,null,"script"),f=j$1(u,"a","typeface")??j$1(u,null,"typeface");l&&f&&(t.fonts=t.fonts||{},t.fonts[l]=f);}return t}function dt(e$1){let t={...Q};if(!e$1)return t;let n=e(e$1,"a","majorFont");n&&(t.majorFont=Be(n));let r=e(e$1,"a","minorFont");return r&&(t.minorFont=Be(r)),t}function Sn(e$1){if(!e$1)return {...me};try{let t=c(e$1);if(!t)return {...me};let n=j$1(t,"a","name")??j$1(t,null,"name")??"Office Theme",r=e(t,"a","themeElements"),o=e(r,"a","clrScheme"),a=pt(o),u=e(r,"a","fontScheme"),l=dt(u);return {name:n,colorScheme:a,fontScheme:l}}catch(t){return console.warn("Failed to parse theme:",t),{...me}}}function mt(e,t="latin"){if(!e?.fontScheme?.majorFont)return Q.majorFont?.latin??"Calibri Light";let n=e.fontScheme.majorFont;return t==="latin"?n.latin||"Calibri Light":t==="ea"?n.ea||"":t==="cs"?n.cs||"":n.fonts?.[t]?n.fonts[t]:n.latin||"Calibri Light"}function ve(e,t="latin"){if(!e?.fontScheme?.minorFont)return Q.minorFont?.latin??"Calibri";let n=e.fontScheme.minorFont;return t==="latin"?n.latin||"Calibri":t==="ea"?n.ea||"":t==="cs"?n.cs||"":n.fonts?.[t]?n.fonts[t]:n.latin||"Calibri"}function _(e,t){if(!t)return "Calibri";let n=t.toLowerCase().includes("major"),r=t.toLowerCase().includes("minor"),o="latin",a=t.toLowerCase();return a.includes("eastasia")?o="ea":(a.includes("bidi")||a.includes("cs"))&&(o="cs"),n?mt(e,o):r?ve(e,o):ve(e,"latin")}function Ne(e){if(!e)return;let t=l(e,"w","w")??0,n=j$1(e,"w","type")??"dxa",r="dxa";return (n==="auto"||n==="dxa"||n==="nil"||n==="pct")&&(r=n),{value:t,type:r}}function X(e){return Ne(e)}function W(e){let t=j$1(e,"w","id"),n=t?parseInt(t,10):0,r=(j$1(e,"w","author")??"").trim(),o=(j$1(e,"w","date")??"").trim();return {id:Number.isInteger(n)&&n>=0?n:0,author:r.length>0?r:"Unknown",date:o.length>0?o:void 0}}function J(e){return W(e)}function D(e){if(!e)return;let r={style:j$1(e,"w","val")??"none"},o=l(e,"w","sz");o!==void 0&&(r.size=o);let a=l(e,"w","space");a!==void 0&&(r.space=a);let u=j$1(e,"w","color"),l$1=j$1(e,"w","themeColor"),f=j$1(e,"w","themeTint"),c=j$1(e,"w","themeShade");(u||l$1||f||c)&&(r.color={rgb:u??void 0,themeColor:l$1,themeTint:f??void 0,themeShade:c??void 0});let p=j$1(e,"w","shadow");(p==="1"||p==="true")&&(r.shadow=true);let d=j$1(e,"w","frame");return (d==="1"||d==="true")&&(r.frame=true),r}function ee(e$1){if(!e$1)return;let t={},n=D(e(e$1,"w","top"));n&&(t.top=n);let r=D(e(e$1,"w","bottom"));r&&(t.bottom=r);let o=D(e(e$1,"w","left")??e(e$1,"w","start"));o&&(t.left=o);let a=D(e(e$1,"w","right")??e(e$1,"w","end"));a&&(t.right=a);let u=D(e(e$1,"w","insideH"));u&&(t.insideH=u);let l=D(e(e$1,"w","insideV"));if(l&&(t.insideV=l),Object.keys(t).length!==0)return t}function te(e$1){if(!e$1)return;let t={},n=X(e(e$1,"w","top"));n&&(t.top=n);let r=X(e(e$1,"w","bottom"));r&&(t.bottom=r);let o=X(e(e$1,"w","left")??e(e$1,"w","start"));o&&(t.left=o);let a=X(e(e$1,"w","right")??e(e$1,"w","end"));if(a&&(t.right=a),Object.keys(t).length!==0)return t}function ne(e){if(!e)return;let t={},n=j$1(e,"w","fill");n&&n!=="auto"&&(t.fill={rgb:n});let r=j$1(e,"w","themeFill");if(r){t.fill={themeColor:r};let u=j$1(e,"w","themeFillTint");u&&t.fill&&(t.fill.themeTint=u);let l=j$1(e,"w","themeFillShade");l&&t.fill&&(t.fill.themeShade=l);}let o=j$1(e,"w","color");o&&o!=="auto"&&(t.color={rgb:o});let a=j$1(e,"w","val");if(a&&(t.pattern=a),Object.keys(t).length!==0)return t}function ge(e){if(!e)return;let t={},n=j$1(e,"w","firstRow");(n==="1"||n==="true")&&(t.firstRow=true);let r=j$1(e,"w","lastRow");(r==="1"||r==="true")&&(t.lastRow=true);let o=j$1(e,"w","firstColumn");(o==="1"||o==="true")&&(t.firstColumn=true);let a=j$1(e,"w","lastColumn");(a==="1"||a==="true")&&(t.lastColumn=true);let u=j$1(e,"w","noHBand");(u==="1"||u==="true")&&(t.noHBand=true);let l=j$1(e,"w","noVBand");(l==="1"||l==="true")&&(t.noVBand=true);let f=j$1(e,"w","val");if(f){let c=parseInt(f,16);isNaN(c)||(c&32&&(t.firstRow=true),c&64&&(t.lastRow=true),c&128&&(t.firstColumn=true),c&256&&(t.lastColumn=true),c&512&&(t.noHBand=true),c&1024&&(t.noVBand=true));}if(Object.keys(t).length!==0)return t}function he(e){if(!e)return;let t={},n=j$1(e,"w","horzAnchor");(n==="margin"||n==="page"||n==="text")&&(t.horzAnchor=n);let r=j$1(e,"w","vertAnchor");(r==="margin"||r==="page"||r==="text")&&(t.vertAnchor=r);let o=l(e,"w","tblpX");o!==void 0&&(t.tblpX=o);let a=j$1(e,"w","tblpXSpec");a&&(t.tblpXSpec=a);let u=l(e,"w","tblpY");u!==void 0&&(t.tblpY=u);let l$1=j$1(e,"w","tblpYSpec");l$1&&(t.tblpYSpec=l$1);let f=l(e,"w","topFromText");f!==void 0&&(t.topFromText=f);let c=l(e,"w","bottomFromText");c!==void 0&&(t.bottomFromText=c);let p=l(e,"w","leftFromText");p!==void 0&&(t.leftFromText=p);let d=l(e,"w","rightFromText");if(d!==void 0&&(t.rightFromText=d),Object.keys(t).length!==0)return t}function gt(e){return e.columnWidths&&e.columnWidths.length>0?e.columnWidths.length:e.rows.length===0?0:e.rows[0].cells.reduce((t,n)=>t+(n.formatting?.gridSpan??1),0)}function ht(e){return e.rows.length}function wt(e){return e.formatting?.vMerge==="continue"}function yt(e){return e.formatting?.vMerge==="restart"}function bt(e){return e.rows.length===0?false:e.rows[0].formatting?.header===true}var Ae={183:"\u2022",111:"\u25CB",167:"\u25A0",252:"\u2713",110:"\u25A0",113:"\u25CB",117:"\u25C6",118:"\u2756",168:"\u2713",251:"\u2713",254:"\u2713",61623:"\u2022",61550:"\u25A0",61551:"\u25CB",61607:"\u25A0",61692:"\u2713",8226:"\u2022",9679:"\u25CF",9675:"\u25CB",9632:"\u25A0",9633:"\u25A1",9670:"\u25C6",9671:"\u25C7",8211:"\u2013",8212:"\u2014",62:">",45:"-"};function Tt(e){if(!e||e.trim()==="")return "\u2022";let t=e.charCodeAt(0);return Ae[t]?Ae[t]:t>=57344&&t<=63743||t<32||t>=127&&t<160?"\u2022":e}function Ft(e){let t=e.listRendering;t&&t.isBullet&&(t.marker=Tt(t.marker||""));}function Ct(e,t,n$1,r,o,a,u){if(e.content.length===0)return;let l=i(t),f=0;function c(p){if(!h(p))return;let d=j$2(p);if(!d)return;let b=n(p,"wps","wsp");if(b){let F=k(b);F&&(d.content=g(F,V,null,n$1,r,o,a??void 0,u??void 0));}let T={type:"shape",shapeType:"rect",size:d.size,position:d.position,wrap:d.wrap,fill:d.fill,outline:d.outline,textBody:{content:d.content,margins:d.margins}};d.id&&(T.id=d.id);let w={type:"shape",shape:T},h$1=f;if(h$1>=e.content.length){h$1=-1;for(let F=e.content.length-1;F>=0;F--)if(e.content[F].type==="run"){h$1=F;break}}if(h$1>=0){let F=e.content[h$1];F.type==="run"&&F.content.push(w);}}for(let p of l){if(d(p.name??"")!=="r")continue;let d$1=i(p);for(let b of d$1){let T=d(b.name??"");if(T==="drawing")c(b);else if(T==="AlternateContent"){let w=i(b),F=w.find(B=>d(B.name??"")==="Choice")??w.find(B=>d(B.name??"")==="Fallback");if(F)for(let B of i(F))d(B.name??"")==="drawing"&&c(B);}}f++;}}function re(e,t,n,r,o,a,u){let l=[],f=i(e);for(let c of f){let p=c.name??"";if(p==="w:p"||p.endsWith(":p")){let d=V(c,t,n,r,o,a,u);Ct(d,c,t,n,r,o,a),Ft(d),l.push(d);}else if(p==="w:tbl"||p.endsWith(":tbl")){let d=Y(c,t,n,r,o,a,u);l.push(d);}else if(p==="w:sdt"||p.endsWith(":sdt")){let d=(c.elements??[]).find(b=>b.type==="element"&&(b.name==="w:sdtContent"||b.name?.endsWith(":sdtContent")));d&&l.push(...re(d,t,n,r,o,a,u));}}return l}function Ie(e){switch(e){case "first":return "first";case "even":return "even";default:return "default"}}function Le(e){let t=j$1(e,"w","type"),n=j$1(e,"r","id")??"";return {type:Ie(t),rId:n}}function Xe(e){let t=j$1(e,"w","type"),n=j$1(e,"r","id")??"";return {type:Ie(t),rId:n}}function Ln(e,t="default",n=null,r=null,o=null,a$1=null,u=null){let l={type:"header",hdrFtrType:t,content:[]};if(!e)return l;let f=a(e);if(!f)return l;let c=f.elements?.find(p=>p.type==="element"&&(p.name==="w:hdr"||p.name?.endsWith(":hdr")));return c&&(l.content=re(c,n,r,o,a$1,u,{inHeaderFooter:true})),l}function Xn(e,t="default",n=null,r=null,o=null,a$1=null,u=null){let l={type:"footer",hdrFtrType:t,content:[]};if(!e)return l;let f=a(e);if(!f)return l;let c=f.elements?.find(p=>p.type==="element"&&(p.name==="w:ftr"||p.name?.endsWith(":ftr")));return c&&(l.content=re(c,n,r,o,a$1,u,{inHeaderFooter:true})),l}function Oe(e){switch(e){case "separator":return "separator";case "continuationSeparator":return "continuationSeparator";case "continuationNotice":return "continuationNotice";default:return "normal"}}function De(e,t,n,r,o,a){let u=[];for(let l of i(e)){let f=l.name??"";f==="w:p"?u.push(V(l,t,n,r,o)):f==="w:tbl"&&u.push(Y(l,t,n,r,o,a));}return u}function xt(e,t,n,r,o,a){let u=l(e,"w","id")??0,l$1=j$1(e,"w","type"),f=Oe(l$1),c=De(e,t,n,r,o,a);return {type:"footnote",id:u,noteType:f,content:c}}function jn(e,t=null,n=null,r=null,o=null,a$1=null){let u=new Map,l=[];if(!e)return oe(u,l);let f$1=a(e);if(!f$1)return oe(u,l);let c=f$1.elements?.find(d=>d.type==="element"&&(d.name==="w:footnotes"||d.name?.endsWith(":footnotes")));if(!c)return oe(u,l);let p=f(c,"w","footnote");for(let d of p){let b=xt(d,t,n,r,o,a$1);u.set(b.id,b),l.push(b);}return oe(u,l)}function oe(e,t){return {byId:e,footnotes:t,getFootnote(n){return e.get(n)},hasFootnote(n){return e.has(n)},getNormalFootnotes(){return t.filter(n=>n.noteType==="normal")},getSeparator(){return t.find(n=>n.noteType==="separator")},getContinuationSeparator(){return t.find(n=>n.noteType==="continuationSeparator")}}}function St(e,t,n,r,o,a){let u=l(e,"w","id")??0,l$1=j$1(e,"w","type"),f=Oe(l$1),c=De(e,t,n,r,o,a);return {type:"endnote",id:u,noteType:f,content:c}}function zn(e,t=null,n=null,r=null,o=null,a$1=null){let u=new Map,l=[];if(!e)return ie(u,l);let f$1=a(e);if(!f$1)return ie(u,l);let c=f$1.elements?.find(d=>d.type==="element"&&(d.name==="w:endnotes"||d.name?.endsWith(":endnotes")));if(!c)return ie(u,l);let p=f(c,"w","endnote");for(let d of p){let b=St(d,t,n,r,o,a$1);u.set(b.id,b),l.push(b);}return ie(u,l)}function ie(e,t){return {byId:e,endnotes:t,getEndnote(n){return e.get(n)},hasEndnote(n){return e.has(n)},getNormalEndnotes(){return t.filter(n=>n.noteType==="normal")},getSeparator(){return t.find(n=>n.noteType==="separator")},getContinuationSeparator(){return t.find(n=>n.noteType==="continuationSeparator")}}}function We(e){return e?{decimal:"decimal",upperRoman:"upperRoman",lowerRoman:"lowerRoman",upperLetter:"upperLetter",lowerLetter:"lowerLetter",ordinal:"ordinal",cardinalText:"cardinalText",ordinalText:"ordinalText",bullet:"bullet",chicago:"chicago",none:"none"}[e]:void 0}function kt(e){switch(e){case "pageBottom":return "pageBottom";case "beneathText":return "beneathText";case "sectEnd":return "sectEnd";case "docEnd":return "docEnd";default:return}}function Mt(e){switch(e){case "sectEnd":return "sectEnd";case "docEnd":return "docEnd";default:return}}function Ve(e){switch(e){case "continuous":return "continuous";case "eachSect":return "eachSect";case "eachPage":return "eachPage";default:return}}function je(e$1){let t={};if(!e$1)return t;let n=e(e$1,"w","pos");if(n){let u=j$1(n,"w","val");t.position=kt(u);}let r=e(e$1,"w","numFmt");if(r){let u=j$1(r,"w","val");t.numFmt=We(u);}let o=e(e$1,"w","numStart");o&&(t.numStart=l(o,"w","val")??void 0);let a=e(e$1,"w","numRestart");if(a){let u=j$1(a,"w","val");t.numRestart=Ve(u);}return t}function ze(e$1){let t={};if(!e$1)return t;let n=e(e$1,"w","pos");if(n){let u=j$1(n,"w","val");t.position=Mt(u);}let r=e(e$1,"w","numFmt");if(r){let u=j$1(r,"w","val");t.numFmt=We(u);}let o=e(e$1,"w","numStart");o&&(t.numStart=l(o,"w","val")??void 0);let a=e(e$1,"w","numRestart");if(a){let u=j$1(a,"w","val");t.numRestart=Ve(u);}return t}function Un(e){let t=[];for(let n of e.content){if(n.type!=="paragraph")continue;let r=[];for(let o of n.content)if(o.type==="run")for(let a of o.content)a.type==="text"&&r.push(a.text);t.push(r.join(""));}return t.join(`
|
|
2
|
+
`)}function Gn(e){let t=[];for(let n of e.content){if(n.type!=="paragraph")continue;let r=[];for(let o of n.content)if(o.type==="run")for(let a of o.content)a.type==="text"&&r.push(a.text);t.push(r.join(""));}return t.join(`
|
|
3
|
+
`)}function qn(e){return e.noteType==="separator"||e.noteType==="continuationSeparator"||e.noteType==="continuationNotice"}function _n(e){return e.noteType==="separator"||e.noteType==="continuationSeparator"||e.noteType==="continuationNotice"}function Rt(e,t,n,r){if(!e&&!t)return;let o={};return e&&e!=="auto"?o.rgb=e:e==="auto"&&(o.auto=true),t&&(o.themeColor=t),n&&(o.themeTint=n),r&&(o.themeShade=r),Object.keys(o).length>0?o:void 0}function ae(e){if(!e)return;let r={style:j$1(e,"w","val")??"none"},o=l(e,"w","sz");o!==void 0&&(r.size=o);let a=l(e,"w","space");a!==void 0&&(r.space=a);let u=j$1(e,"w","color"),l$1=j$1(e,"w","themeColor"),f=j$1(e,"w","themeTint"),c=j$1(e,"w","themeShade"),p=Rt(u,l$1,f,c);p&&(r.color=p);let d=j$1(e,"w","shadow");(d==="1"||d==="true")&&(r.shadow=true);let b=j$1(e,"w","frame");return (b==="1"||b==="true")&&(r.frame=true),r}function Et(e){switch(e){case "landscape":return "landscape";case "portrait":return "portrait";default:return}}function Pt(e){switch(e){case "continuous":return "continuous";case "nextPage":return "nextPage";case "oddPage":return "oddPage";case "evenPage":return "evenPage";case "nextColumn":return "nextColumn";default:return}}function Bt(e){switch(e){case "top":return "top";case "center":return "center";case "both":return "both";case "bottom":return "bottom";default:return}}function vt(e){switch(e){case "continuous":return "continuous";case "newPage":return "newPage";case "newSection":return "newSection";default:return}}function Ge(e$1,t){let n={};if(!e$1)return n;let r=e(e$1,"w","pgSz");if(r){let m=l(r,"w","w");m!==void 0&&(n.pageWidth=m);let C=l(r,"w","h");C!==void 0&&(n.pageHeight=C);let E=j$1(r,"w","orient"),y=Et(E);y&&(n.orientation=y);}let o=e(e$1,"w","pgMar");if(o){let m=l(o,"w","top");m!==void 0&&(n.marginTop=m);let C=l(o,"w","bottom");C!==void 0&&(n.marginBottom=C);let E=l(o,"w","left");E!==void 0&&(n.marginLeft=E);let y=l(o,"w","right");y!==void 0&&(n.marginRight=y);let x=l(o,"w","header");x!==void 0&&(n.headerDistance=x);let P=l(o,"w","footer");P!==void 0&&(n.footerDistance=P);let v=l(o,"w","gutter");v!==void 0&&(n.gutter=v);}let a=e(e$1,"w","cols");if(a){let m=l(a,"w","num");m!==void 0&&(n.columnCount=m);let C=l(a,"w","space");C!==void 0&&(n.columnSpace=C);let E=j$1(a,"w","equalWidth");E==="1"||E==="true"?n.equalWidth=true:(E==="0"||E==="false")&&(n.equalWidth=false);let y=j$1(a,"w","sep");(y==="1"||y==="true")&&(n.separator=true);let x=f(a,"w","col");if(x.length>0){n.columns=[];for(let P of x){let v={},I=l(P,"w","w");I!==void 0&&(v.width=I);let A=l(P,"w","space");A!==void 0&&(v.space=A),n.columns.push(v);}n.columnCount===void 0&&(n.columnCount=x.length);}}let u=e(e$1,"w","type");if(u){let m=j$1(u,"w","val"),C=Pt(m);C&&(n.sectionStart=C);}let l$1=e(e$1,"w","vAlign");if(l$1){let m=j$1(l$1,"w","val"),C=Bt(m);C&&(n.verticalAlign=C);}let f$1=e(e$1,"w","bidi");f$1&&(n.bidi=m(f$1));let c=f(e$1,"w","headerReference");c.length>0&&(n.headerReferences=c.map(m=>Le(m)));let p=f(e$1,"w","footerReference");p.length>0&&(n.footerReferences=p.map(m=>Xe(m)));let d=e(e$1,"w","titlePg");d&&(n.titlePg=m(d));let b=e(e$1,"w","evenAndOddHeaders");b&&(n.evenAndOddHeaders=m(b));let T=e(e$1,"w","lnNumType");if(T){n.lineNumbers={};let m=l(T,"w","start");m!==void 0&&(n.lineNumbers.start=m);let C=l(T,"w","countBy");C!==void 0&&(n.lineNumbers.countBy=C);let E=l(T,"w","distance");E!==void 0&&(n.lineNumbers.distance=E);let y=j$1(T,"w","restart"),x=vt(y);x&&(n.lineNumbers.restart=x);}let w=e(e$1,"w","pgBorders");if(w){n.pageBorders={};let m=ae(e(w,"w","top"));m&&(n.pageBorders.top=m);let C=ae(e(w,"w","bottom"));C&&(n.pageBorders.bottom=C);let E=ae(e(w,"w","left"));E&&(n.pageBorders.left=E);let y=ae(e(w,"w","right"));y&&(n.pageBorders.right=y);let x=j$1(w,"w","display");(x==="allPages"||x==="firstPage"||x==="notFirstPage")&&(n.pageBorders.display=x);let P=j$1(w,"w","offsetFrom");(P==="page"||P==="text")&&(n.pageBorders.offsetFrom=P);let v=j$1(w,"w","zOrder");(v==="front"||v==="back")&&(n.pageBorders.zOrder=v);}let h=e(e$1,"w","background");if(h){n.background={};let m=j$1(h,"w","color");m&&m!=="auto"&&(n.background.color={rgb:m});let C=j$1(h,"w","themeColor");C&&(n.background.themeColor=C);let E=j$1(h,"w","themeTint");E&&(n.background.themeTint=E);let y=j$1(h,"w","themeShade");y&&(n.background.themeShade=y);}let F=e(e$1,"w","footnotePr");if(F){let m=je(F);Object.keys(m).length>0&&(n.footnotePr=m);}let B=e(e$1,"w","endnotePr");if(B){let m=ze(B);Object.keys(m).length>0&&(n.endnotePr=m);}let M=e(e$1,"w","docGrid");if(M){n.docGrid={};let m=j$1(M,"w","type");(m==="default"||m==="lines"||m==="linesAndChars"||m==="snapToChars")&&(n.docGrid.type=m);let C=l(M,"w","linePitch");C!==void 0&&(n.docGrid.linePitch=C);let E=l(M,"w","charSpace");E!==void 0&&(n.docGrid.charSpace=E);}let S=e(e$1,"w","paperSrc");if(S){let m=l(S,"w","first");m!==void 0&&(n.paperSrcFirst=m);let C=l(S,"w","other");C!==void 0&&(n.paperSrcOther=C);}return n}function Qn(){return {pageWidth:12240,pageHeight:15840,orientation:"portrait",marginTop:1440,marginBottom:1440,marginLeft:1440,marginRight:1440,headerDistance:720,footerDistance:720,gutter:0,columnCount:1,columnSpace:720,equalWidth:true,sectionStart:"nextPage",verticalAlign:"top"}}function Ue(e,t){if(!t||t.length===0)return e;let n=new Set((e??[]).map(o=>o.type)),r=t.filter(o=>!n.has(o.type));return r.length===0?e:[...e??[],...r]}function Jn(e){if(e.length<2)return e;let t=[e[0]];for(let n=1;n<e.length;n++){let r=t[n-1].properties,o=e[n].properties,a=Ue(o.headerReferences,r.headerReferences),u=Ue(o.footerReferences,r.footerReferences),l=o.titlePg!==void 0?o.titlePg:r.titlePg;if(a===o.headerReferences&&u===o.footerReferences&&l===o.titlePg){t.push(e[n]);continue}t.push({...e[n],properties:{...o,headerReferences:a,footerReferences:u,titlePg:l}});}return t}function Ht(e,t){return !e&&!t?true:!(!e||!t||e.bold!==t.bold||e.boldCs!==t.boldCs||e.italic!==t.italic||e.italicCs!==t.italicCs||e.strike!==t.strike||e.doubleStrike!==t.doubleStrike||e.smallCaps!==t.smallCaps||e.allCaps!==t.allCaps||e.hidden!==t.hidden||e.emboss!==t.emboss||e.imprint!==t.imprint||e.outline!==t.outline||e.shadow!==t.shadow||e.rtl!==t.rtl||e.cs!==t.cs||e.fontSize!==t.fontSize||e.fontSizeCs!==t.fontSizeCs||e.spacing!==t.spacing||e.position!==t.position||e.scale!==t.scale||e.kerning!==t.kerning||e.vertAlign!==t.vertAlign||e.highlight!==t.highlight||e.effect!==t.effect||e.emphasisMark!==t.emphasisMark||e.styleId!==t.styleId||!Nt(e.underline,t.underline)||!le(e.color,t.color)||!At(e.shading,t.shading)||!It(e.fontFamily,t.fontFamily))}function Nt(e,t){return !e&&!t?true:!e||!t||e.style!==t.style?false:le(e.color,t.color)}function le(e,t){return !e&&!t?true:!e||!t?false:e.rgb===t.rgb&&e.auto===t.auto&&e.themeColor===t.themeColor&&e.themeTint===t.themeTint&&e.themeShade===t.themeShade}function At(e,t){return !e&&!t?true:!(!e||!t||e.pattern!==t.pattern||!le(e.color,t.color)||!le(e.fill,t.fill))}function It(e,t){return !e&&!t?true:!e||!t?false:e.ascii===t.ascii&&e.hAnsi===t.hAnsi&&e.eastAsia===t.eastAsia&&e.cs===t.cs&&e.asciiTheme===t.asciiTheme&&e.hAnsiTheme===t.hAnsiTheme&&e.eastAsiaTheme===t.eastAsiaTheme&&e.csTheme===t.csTheme}function Lt(e){return e.type==="text"||e.type==="softHyphen"||e.type==="noBreakHyphen"}function qe(e){return e.content.length===0?true:e.content.every(Lt)}function Xt(e,t){let n=[];for(let r of e)n.push(r);if(n.length>0&&t.length>0&&n[n.length-1].type==="text"&&t[0].type==="text"){let r=n[n.length-1],o=t[0];n[n.length-1]={type:"text",text:r.text+o.text,preserveSpace:r.preserveSpace||o.preserveSpace||void 0};for(let a=1;a<t.length;a++)n.push(t[a]);}else for(let r of t)n.push(r);return n}function Ot(e){if(e.length<=1)return e;let t=[],n=null;for(let r of e)if(r.content.length!==0){if(n===null){n={...r,content:[...r.content]};continue}qe(n)&&qe(r)&&Ht(n.formatting,r.formatting)?n={type:"run",formatting:n.formatting,content:Xt(n.content,r.content)}:(t.push(n),n={...r,content:[...r.content]});}return n!==null&&t.push(n),t}function we(e){if(e.length<=1)return e;let t=[],n=[];function r(){if(n.length>0){let o=Ot(n);t.push(...o),n.length=0;}}for(let o of e)if(o.type==="run")n.push(o);else if(r(),o.type==="hyperlink"){let a={...o,children:we(o.children)};t.push(a);}else t.push(o);return r(),t}function _e(e,t,n,r){let o={};return e&&e!=="auto"?o.rgb=e:e==="auto"&&(o.auto=true),t&&(o.themeColor=t),n&&(o.themeTint=n),r&&(o.themeShade=r),o}function Dt(e){if(!e)return;let t={},n=j$1(e,"w","color");n&&n!=="auto"&&(t.color={rgb:n});let r=j$1(e,"w","fill");r&&r!=="auto"&&(t.fill={rgb:r});let o=j$1(e,"w","themeFill");o&&(t.fill=t.fill||{},t.fill.themeColor=o);let a=j$1(e,"w","themeFillTint");a&&t.fill&&(t.fill.themeTint=a);let u=j$1(e,"w","themeFillShade");u&&t.fill&&(t.fill.themeShade=u);let l=j$1(e,"w","val");return l&&(t.pattern=l),Object.keys(t).length>0?t:void 0}function ue(e$1,t,n){if(!e$1)return;let r={},o=e(e$1,"w","b");o&&(r.bold=m(o));let a=e(e$1,"w","bCs");a&&(r.boldCs=m(a));let u=e(e$1,"w","i");u&&(r.italic=m(u));let l$1=e(e$1,"w","iCs");l$1&&(r.italicCs=m(l$1));let f=e(e$1,"w","u");if(f){let k=j$1(f,"w","val");if(k){r.underline={style:k};let z=j$1(f,"w","color"),U=j$1(f,"w","themeColor");(z||U)&&(r.underline.color=_e(z,U,j$1(f,"w","themeTint"),j$1(f,"w","themeShade")));}}let c=e(e$1,"w","strike");c&&(r.strike=m(c));let p=e(e$1,"w","dstrike");p&&(r.doubleStrike=m(p));let d=e(e$1,"w","vertAlign");if(d){let k=j$1(d,"w","val");(k==="superscript"||k==="subscript"||k==="baseline")&&(r.vertAlign=k);}let b=e(e$1,"w","smallCaps");b&&(r.smallCaps=m(b));let T=e(e$1,"w","caps");T&&(r.allCaps=m(T));let w=e(e$1,"w","vanish");w&&(r.hidden=m(w));let h=e(e$1,"w","color");h&&(r.color=_e(j$1(h,"w","val"),j$1(h,"w","themeColor"),j$1(h,"w","themeTint"),j$1(h,"w","themeShade")));let F=e(e$1,"w","highlight");if(F){let k=j$1(F,"w","val");k&&(r.highlight=k);}let B=e(e$1,"w","shd");B&&(r.shading=Dt(B));let M=e(e$1,"w","sz");if(M){let k=l(M,"w","val");k!==void 0&&(r.fontSize=k);}let S=e(e$1,"w","szCs");if(S){let k=l(S,"w","val");k!==void 0&&(r.fontSizeCs=k);}let m$1=e(e$1,"w","rFonts");if(m$1){r.fontFamily={ascii:j$1(m$1,"w","ascii")??void 0,hAnsi:j$1(m$1,"w","hAnsi")??void 0,eastAsia:j$1(m$1,"w","eastAsia")??void 0,cs:j$1(m$1,"w","cs")??void 0};let k=j$1(m$1,"w","asciiTheme");k&&(r.fontFamily.asciiTheme=k,t&&!r.fontFamily.ascii&&(r.fontFamily.ascii=_(t,k)));let z=j$1(m$1,"w","hAnsiTheme");z&&(r.fontFamily.hAnsiTheme=z,t&&!r.fontFamily.hAnsi&&(r.fontFamily.hAnsi=_(t,z)));let U=j$1(m$1,"w","eastAsiaTheme");U&&(r.fontFamily.eastAsiaTheme=U,t&&!r.fontFamily.eastAsia&&(r.fontFamily.eastAsia=_(t,U)));let ce=j$1(m$1,"w","cstheme");ce&&(r.fontFamily.csTheme=ce,t&&!r.fontFamily.cs&&(r.fontFamily.cs=_(t,ce)));}let C=e(e$1,"w","spacing");if(C){let k=l(C,"w","val");k!==void 0&&(r.spacing=k);}let E=e(e$1,"w","position");if(E){let k=l(E,"w","val");k!==void 0&&(r.position=k);}let y=e(e$1,"w","w");if(y){let k=l(y,"w","val");k!==void 0&&(r.scale=k);}let x=e(e$1,"w","kern");if(x){let k=l(x,"w","val");k!==void 0&&(r.kerning=k);}let P=e(e$1,"w","effect");if(P){let k=j$1(P,"w","val");k&&(r.effect=k);}let v=e(e$1,"w","em");if(v){let k=j$1(v,"w","val");k&&(r.emphasisMark=k);}let I=e(e$1,"w","emboss");I&&(r.emboss=m(I));let A=e(e$1,"w","imprint");A&&(r.imprint=m(A));let L=e(e$1,"w","outline");L&&(r.outline=m(L));let ye=e(e$1,"w","shadow");ye&&(r.shadow=m(ye));let be=e(e$1,"w","rtl");be&&(r.rtl=m(be));let Te=e(e$1,"w","cs");Te&&(r.cs=m(Te));let Fe=e(e$1,"w","rStyle");if(Fe){let k=j$1(Fe,"w","val");k&&(r.styleId=k);}return Object.keys(r).length>0?r:void 0}function Wt(e){let t=j$1(e,"w","id"),n=t?parseInt(t,10):0,r=(j$1(e,"w","author")??"").trim(),o=(j$1(e,"w","date")??"").trim(),a=(j$1(e,"w","rsid")??"").trim();return {id:Number.isInteger(n)&&n>=0?n:0,author:r.length>0?r:"Unknown",date:o.length>0?o:void 0,rsid:a.length>0?a:void 0}}function Vt(e$1,t,n,r){if(!e$1)return;let o=f(e$1,"w","rPrChange").map(a=>{let u=e(a,"w","rPr");return {type:"runPropertyChange",info:Wt(a),previousFormatting:ue(u,t),currentFormatting:r}}).filter(a=>a.previousFormatting||a.currentFormatting);return o.length>0?o:void 0}function jt(e){let t=k$1(e),n=j$1(e,"xml","space")==="preserve";return {type:"text",text:t,preserveSpace:n||void 0}}function zt(){return {type:"tab"}}function Ut(e){let t=j$1(e,"w","type"),n=j$1(e,"w","clear"),r={type:"break"};return (t==="page"||t==="column"||t==="textWrapping")&&(r.breakType=t),(n==="none"||n==="left"||n==="right"||n==="all")&&(r.clear=n),r}function Gt(e){let t=j$1(e,"w","font")??"",n=j$1(e,"w","char")??"";return {type:"symbol",font:t,char:n}}function qt(e){return {type:"footnoteRef",id:l(e,"w","id")??0}}function _t(e){return {type:"endnoteRef",id:l(e,"w","id")??0}}function Yt(e){let t=j$1(e,"w","fldCharType"),n=j$1(e,"w","fldLock")==="true"||j$1(e,"w","fldLock")==="1",r=j$1(e,"w","dirty")==="true"||j$1(e,"w","dirty")==="1",o="begin";return t==="separate"?o="separate":t==="end"&&(o="end"),{type:"fieldChar",charType:o,fldLock:n||void 0,dirty:r||void 0}}function $t(e){return {type:"instrText",text:k$1(e)}}function Ye(e,t,n){let r=z(e,t??void 0,n??void 0);return r?{type:"drawing",image:r}:null}function se(e){if(!e)return "";let t=e.indexOf(":");return t>=0?e.substring(t+1):e}function Zt(e,t,n){let r=[],o=i(e);for(let a of o)switch(se(a.name)){case "t":r.push(jt(a));break;case "tab":r.push(zt());break;case "br":r.push(Ut(a));break;case "sym":r.push(Gt(a));break;case "footnoteReference":r.push(qt(a));break;case "endnoteReference":r.push(_t(a));break;case "fldChar":r.push(Yt(a));break;case "instrText":r.push($t(a));break;case "softHyphen":r.push({type:"softHyphen"});break;case "noBreakHyphen":r.push({type:"noBreakHyphen"});break;case "drawing":let l=Ye(a,t,n);l&&r.push(l);break;case "pict":case "object":break;case "rPr":break;case "lastRenderedPageBreak":break;case "cr":r.push({type:"break",breakType:"textWrapping"});break;case "AlternateContent":{let c=i(a).find(p=>se(p.name)==="Choice")??i(a).find(p=>se(p.name)==="Fallback");if(c){for(let p of i(c))if(se(p.name)==="drawing"){let b=Ye(p,t,n);b?.image?.src&&r.push(b);}}break}}return r}function $(e$1,t,n,r=null,o=null){let a={type:"run",content:[]},u=e(e$1,"w","rPr");return u&&(a.formatting=ue(u,n),a.propertyChanges=Vt(u,n,t,a.formatting)),a.content=Zt(e$1,r,o),a}function Kt(e,t,n,r){let o={};return e&&e!=="auto"?o.rgb=e:e==="auto"&&(o.auto=true),t&&(o.themeColor=t),n&&(o.themeTint=n),r&&(o.themeShade=r),o}function Qt(e){if(!e)return;let t={},n=j$1(e,"w","color");n&&n!=="auto"&&(t.color={rgb:n});let r=j$1(e,"w","fill");r&&r!=="auto"&&(t.fill={rgb:r});let o=j$1(e,"w","themeFill");o&&(t.fill=t.fill||{},t.fill.themeColor=o);let a=j$1(e,"w","themeFillTint");a&&t.fill&&(t.fill.themeTint=a);let u=j$1(e,"w","themeFillShade");u&&t.fill&&(t.fill.themeShade=u);let l=j$1(e,"w","val");return l&&(t.pattern=l),Object.keys(t).length>0?t:void 0}function q(e){if(!e)return;let t=j$1(e,"w","val");if(!t)return;let n={style:t},r=j$1(e,"w","color"),o=j$1(e,"w","themeColor");(r||o)&&(n.color=Kt(r,o,j$1(e,"w","themeTint"),j$1(e,"w","themeShade")));let a=l(e,"w","sz");a!==void 0&&(n.size=a);let u=l(e,"w","space");u!==void 0&&(n.space=u);let l$1=j$1(e,"w","shadow");l$1&&(n.shadow=l$1==="1"||l$1==="true");let f=j$1(e,"w","frame");return f&&(n.frame=f==="1"||f==="true"),n}function Jt(e){if(!e)return;let t=f(e,"w","tab");if(t.length===0)return;let n=[];for(let r of t){let o=l(r,"w","pos"),a=j$1(r,"w","val");if(o!==void 0&&a){let u={position:o,alignment:a},l=j$1(r,"w","leader");l&&(u.leader=l),n.push(u);}}return n.length>0?n:void 0}function en(e){if(!e)return;let t={},n=l(e,"w","w");n!==void 0&&(t.width=n);let r=l(e,"w","h");r!==void 0&&(t.height=r);let o=j$1(e,"w","hAnchor");(o==="text"||o==="margin"||o==="page")&&(t.hAnchor=o);let a=j$1(e,"w","vAnchor");(a==="text"||a==="margin"||a==="page")&&(t.vAnchor=a);let u=l(e,"w","x");u!==void 0&&(t.x=u);let l$1=l(e,"w","y");l$1!==void 0&&(t.y=l$1);let f=j$1(e,"w","xAlign");f&&(t.xAlign=f);let c=j$1(e,"w","yAlign");c&&(t.yAlign=c);let p=j$1(e,"w","wrap");return p&&(t.wrap=p),Object.keys(t).length>0?t:void 0}function fe(e$1,t,n){if(!e$1)return;let r={},o=e(e$1,"w","jc");if(o){let y=j$1(o,"w","val");y&&(r.alignment=y);}let a=e(e$1,"w","bidi");a&&(r.bidi=m(a));let u=e(e$1,"w","spacing");if(u){let y=l(u,"w","before");y!==void 0&&(r.spaceBefore=y);let x=l(u,"w","after");x!==void 0&&(r.spaceAfter=x);let P=l(u,"w","line");P!==void 0&&(r.lineSpacing=P);let v={};y!==void 0&&(v.before=true),x!==void 0&&(v.after=true),(v.before||v.after)&&(r.spacingExplicit=v);let I=j$1(u,"w","lineRule");I&&(r.lineSpacingRule=I);let A=j$1(u,"w","beforeAutospacing");A&&(r.beforeAutospacing=A==="1"||A==="true");let L=j$1(u,"w","afterAutospacing");L&&(r.afterAutospacing=L==="1"||L==="true");}let l$1=e(e$1,"w","ind");if(l$1){let y=l(l$1,"w","left");y!==void 0&&(r.indentLeft=y);let x=l(l$1,"w","right");x!==void 0&&(r.indentRight=x);let P=l(l$1,"w","firstLine");P!==void 0&&(r.indentFirstLine=P);let v=l(l$1,"w","hanging");v!==void 0&&(r.indentFirstLine=-v,r.hangingIndent=true);let I=l(l$1,"w","start");I!==void 0&&r.indentLeft===void 0&&(r.indentLeft=I);let A=l(l$1,"w","end");A!==void 0&&r.indentRight===void 0&&(r.indentRight=A);}let f=e(e$1,"w","pBdr");if(f){let y={},x=q(e(f,"w","top"));x&&(y.top=x);let P=q(e(f,"w","bottom"));P&&(y.bottom=P);let v=q(e(f,"w","left"));v&&(y.left=v);let I=q(e(f,"w","right"));I&&(y.right=I);let A=q(e(f,"w","between"));A&&(y.between=A);let L=q(e(f,"w","bar"));L&&(y.bar=L),Object.keys(y).length>0&&(r.borders=y);}let c=e(e$1,"w","shd");c&&(r.shading=Qt(c));let p=e(e$1,"w","tabs");p&&(r.tabs=Jt(p));let d=e(e$1,"w","keepNext");d&&(r.keepNext=m(d));let b=e(e$1,"w","keepLines");b&&(r.keepLines=m(b));let T=e(e$1,"w","widowControl");T&&(r.widowControl=m(T));let w=e(e$1,"w","pageBreakBefore");w&&(r.pageBreakBefore=m(w));let h=e(e$1,"w","contextualSpacing");h&&(r.contextualSpacing=m(h));let F=e(e$1,"w","numPr");if(F){let y=e(F,"w","numId"),x=e(F,"w","ilvl");if(y||x){if(r.numPr={},y){let P=l(y,"w","val");P!==void 0&&(r.numPr.numId=P);}if(x){let P=l(x,"w","val");P!==void 0&&(r.numPr.ilvl=P);}}}let B=e(e$1,"w","outlineLvl");if(B){let y=l(B,"w","val");y!==void 0&&(r.outlineLevel=y);}let M=e(e$1,"w","pStyle");if(M){let y=j$1(M,"w","val");y&&(r.styleId=y);}let S=e(e$1,"w","framePr");S&&(r.frame=en(S));let m$1=e(e$1,"w","suppressLineNumbers");m$1&&(r.suppressLineNumbers=m(m$1));let C=e(e$1,"w","suppressAutoHyphens");C&&(r.suppressAutoHyphens=m(C));let E=e(e$1,"w","rPr");return E&&(r.runProperties=ue(E,t)),Object.keys(r).length>0?r:void 0}function tn(e){if(!e)return "";let t=e.indexOf(":");return t>=0?e.substring(t+1):e}function nn(e){let t=l(e,"w","id")??0,n=j$1(e,"w","name")??"",r={type:"bookmarkStart",id:t,name:n},o=l(e,"w","colFirst");o!==void 0&&(r.colFirst=o);let a=l(e,"w","colLast");return a!==void 0&&(r.colLast=a),r}function rn(e){return {type:"bookmarkEnd",id:l(e,"w","id")??0}}function $e(e,t,n=null,r=null,o=null){let a={type:"hyperlink",children:[]},u=j$1(e,"r","id");if(u&&(a.rId=u,t)){let T=t.get(u);T&&(c$1(T),a.href=T.target);}let l=j$1(e,"w","anchor");l&&(a.anchor=l,a.href||(a.href=`#${l}`));let f=j$1(e,"w","tooltip");f&&(a.tooltip=f);let c=j$1(e,"w","tgtFrame");c&&(a.target=c);let p=j$1(e,"w","history");(p==="1"||p==="true")&&(a.history=true);let d=j$1(e,"w","docLocation");d&&(a.docLocation=d);let b=i(e);for(let T of b)switch(tn(T.name)){case "r":a.children.push($(T,n,r,t,o));break;case "bookmarkStart":a.children.push(nn(T));break;case "bookmarkEnd":a.children.push(rn(T));break}return a}function pr(e){let t="";for(let n of e.children)if(n.type==="run")for(let r of n.content)r.type==="text"?t+=r.text:r.type==="tab"&&(t+=" ");return t}function dr(e){return e.href?/^https?:\/\/|^mailto:|^tel:|^ftp:/i.test(e.href):!!e.rId&&!e.anchor}function mr(e){return !!e.anchor}function gr(e){return e.href}function hr(e){return e.children.some(t=>t.type==="run")}function wr(e){return e.children.filter(t=>t.type==="run")}function yr(e,t){if(e.rId){let n=t.get(e.rId);if(n)return c$1(n),e.href=n.target,e.href}return e.anchor&&!e.href&&(e.href=`#${e.anchor}`),e.href}function Ze(e){let t=l(e,"w","id")??0,n=j$1(e,"w","name")??"",r={type:"bookmarkStart",id:t,name:n},o=l(e,"w","colFirst");o!==void 0&&(r.colFirst=o);let a=l(e,"w","colLast");return a!==void 0&&(r.colLast=a),r}function Ke(e){return {type:"bookmarkEnd",id:l(e,"w","id")??0}}function on(e$1){let t={sdtType:"richText"};if(!e$1||!e$1.elements)return t;for(let n of e$1.elements){if(n.type!=="element")continue;switch(n.name?.replace(/^w:/,"")??""){case "alias":t.alias=j$1(n,"w","val")??void 0;break;case "tag":t.tag=j$1(n,"w","val")??void 0;break;case "lock":t.lock=j$1(n,"w","val")??"unlocked";break;case "placeholder":{let o=e(n,"w","docPart");if(o){let a=e(o,"w","val");t.placeholder=a?j$1(a,"w","val")??void 0:void 0;}break}case "showingPlcHdr":t.showingPlaceholder=true;break;case "text":t.sdtType="plainText";break;case "date":t.sdtType="date",t.dateFormat=j$1(n,"w","fullDate")??void 0;break;case "dropDownList":t.sdtType="dropdown",t.listItems=Qe(n);break;case "comboBox":t.sdtType="comboBox",t.listItems=Qe(n);break;case "checkbox":{t.sdtType="checkbox";let o=e(n,"w14","checked")??e(n,"w","checked");t.checked=o?j$1(o,"w14","val")==="1"||j$1(o,"w","val")==="1":false;break}case "picture":t.sdtType="picture";break;case "docPartObj":t.sdtType="buildingBlockGallery";break;case "group":t.sdtType="group";break}}return t}function Qe(e){let t=[];for(let n of e.elements??[])n.type==="element"&&(n.name==="w:listItem"||n.name?.endsWith(":listItem"))&&t.push({displayText:j$1(n,"w","displayText")??"",value:j$1(n,"w","value")??""});return t}function et(e){let t="";if(e.type==="text"&&typeof e.text=="string")return e.text;if(e.elements)for(let n of e.elements)if((n.name?.replace(/^.*:/,"")??"")==="t"&&n.elements)for(let o of n.elements)o.type==="text"&&typeof o.text=="string"&&(t+=o.text);else t+=et(n);return t}function K(e){if(!e)return "";let t=e.indexOf(":");return t>=0?e.substring(t+1):e}function tt(e){let t=new Set(["hyperlink","smartTag","sdt","sdtContent","fldSimple","customXml","ins","del","moveFrom","moveTo"]),n=new Set(["pPr","proofErr","bookmarkStart","bookmarkEnd","commentRangeStart","commentRangeEnd","commentReference","permStart","permEnd","rsidR"]),r=new Set(["t","tab","br","cr","sym","drawing","pict","object","softHyphen","noBreakHyphen","fldChar","instrText","pgNum","separator","continuationSeparator","footnoteRef","endnoteRef","footnoteReference","endnoteReference","ptab","monthShort","monthLong","yearShort","yearLong","dayShort","dayLong"]),o=false;function a(l){for(let f of i(l)){let c=K(f.name);if(!n.has(c)){if(c==="lastRenderedPageBreak"){o=true;continue}if(c==="r"){for(let p of i(f)){let d=K(p.name);if(d!=="rPr"){if(d==="lastRenderedPageBreak"){o=true;continue}if(d==="br"&&j$1(p,"w","type")==="page")return "forced";if(r.has(d))return "visible"}}continue}if(t.has(c)){let p=a(f);if(p!=="continue")return p;continue}return "continue"}}return "continue"}let u=a(e);return u==="forced"?true:u==="visible"?o:false}function Je(e,t){if(!e)return `w:${t}`;let n=e.indexOf(":");return n<0?t:`${e.substring(0,n+1)}${t}`}function nt(e){if(e.type!=="element")return e;let t=K(e.name),n=e.name;return t==="delText"?n=Je(e.name,"t"):t==="delInstrText"&&(n=Je(e.name,"instrText")),{...e,name:n,elements:e.elements?.map(nt)}}function Z(e){let t=j$1(e,"w","id"),n=t?parseInt(t,10):0,r=j$1(e,"w","author"),o=j$1(e,"w","date"),a=r?.trim()??"",u=o?.trim()??"";return {id:Number.isInteger(n)&&n>=0?n:0,author:a.length>0?a:"Unknown",date:u.length>0?u:void 0}}function an(e){return Z(e)}function rt(e$1,t,n,r){if(!e$1)return;let o=f(e$1,"w","pPrChange").map(a=>{let u=e(a,"w","pPr");return {type:"paragraphPropertyChange",info:an(a),previousFormatting:fe(u,t),currentFormatting:r}}).filter(a=>a.previousFormatting||a.currentFormatting);return o.length>0?o:void 0}function ln(e,t,n,r,o){return $e(e,t,n,r,o)}function sn(e){return Ze(e)}function un(e){return Ke(e)}function ot(e){let t=e.trim().match(/^\\?([A-Z]+)/i);if(!t)return "UNKNOWN";let n=t[1].toUpperCase();return ["PAGE","NUMPAGES","NUMWORDS","NUMCHARS","DATE","TIME","CREATEDATE","SAVEDATE","PRINTDATE","AUTHOR","TITLE","SUBJECT","KEYWORDS","COMMENTS","FILENAME","FILESIZE","TEMPLATE","DOCPROPERTY","DOCVARIABLE","REF","PAGEREF","NOTEREF","HYPERLINK","TOC","TOA","INDEX","SEQ","STYLEREF","AUTONUM","AUTONUMLGL","AUTONUMOUT","IF","MERGEFIELD","NEXT","NEXTIF","ASK","SET","QUOTE","INCLUDETEXT","INCLUDEPICTURE","SYMBOL","ADVANCE","EDITTIME","REVNUM","SECTION","SECTIONPAGES","USERADDRESS","USERNAME","USERINITIALS"].includes(n)?n:"UNKNOWN"}function fn(e,t,n,r,o){let a=j$1(e,"w","instr")??"",u=ot(a),l={type:"simpleField",instruction:a,fieldType:u,content:[]},f=j$1(e,"w","fldLock");(f==="1"||f==="true")&&(l.fldLock=true);let c=j$1(e,"w","dirty");(c==="1"||c==="true")&&(l.dirty=true);let p=i(e);for(let d of p)K(d.name)==="r"&&l.content.push($(d,t,n,r,o));return l}function j(e,t,n,r,o,a,u="default"){let l=[],f=i(e),c=false,p="",d=[],b$1=[],T=false,w=false,h=false;for(let F of f){let B=K(F.name);switch(B){case "r":{let M=u==="deletion"?nt(F):F,S=$(M,t,n,o,a),m=false,C=false,E=false,y="";for(let x of S.content)x.type==="fieldChar"?x.charType==="begin"?(m=true,x.fldLock&&(w=true),x.dirty&&(h=true)):x.charType==="separate"?C=true:x.charType==="end"&&(E=true):x.type==="instrText"&&(y+=x.text);if(m&&(c=true,T=false,p="",d=[],b$1=[],w=false,h=false),c){if(y&&(p+=y),C&&(T=true),T&&!E?C||b$1.push(S):!T&&!m&&d.push(S),E){let x={type:"complexField",instruction:p.trim(),fieldType:ot(p),fieldCode:d,fieldResult:b$1};w&&(x.fldLock=true),h&&(x.dirty=true),l.push(x),c=false;}}else l.push(S);break}case "hyperlink":l.push(ln(F,o,t,n,a));break;case "bookmarkStart":l.push(sn(F));break;case "bookmarkEnd":l.push(un(F));break;case "fldSimple":l.push(fn(F,t,n,o,a));break;case "pPr":break;case "proofErr":case "permStart":case "permEnd":case "customXml":break;case "sdt":{let M=(F.elements??[]).find(m=>m.type==="element"&&(m.name==="w:sdtPr"||m.name?.endsWith(":sdtPr"))),S=(F.elements??[]).find(m=>m.type==="element"&&(m.name==="w:sdtContent"||m.name?.endsWith(":sdtContent")));if(S){let m=j(S,t,n,null,o,a,u),E={type:"inlineSdt",properties:on(M??null),content:m.filter(y=>y.type==="run"||y.type==="hyperlink"||y.type==="simpleField"||y.type==="complexField"||y.type==="inlineSdt"||y.type==="mathEquation")};l.push(E);}break}case "ins":{let M=Z(F),S=j(F,t,n,null,o,a),m={type:"insertion",info:M,content:S.filter(C=>C.type==="run"||C.type==="hyperlink")};l.push(m);break}case "del":{let M=Z(F),S=j(F,t,n,null,o,a,"deletion"),m={type:"deletion",info:M,content:S.filter(C=>C.type==="run"||C.type==="hyperlink")};l.push(m);break}case "moveFrom":{let M=Z(F),S=j(F,t,n,null,o,a,"deletion"),m={type:"moveFrom",info:M,content:S.filter(C=>C.type==="run"||C.type==="hyperlink")};l.push(m);break}case "moveTo":{let M=Z(F),S=j(F,t,n,null,o,a),m={type:"moveTo",info:M,content:S.filter(C=>C.type==="run"||C.type==="hyperlink")};l.push(m);break}case "smartTag":break;case "moveFromRangeStart":{let M=parseInt(j$1(F,"w","id")??"0",10),S=j$1(F,"w","name")??"";l.push({type:"moveFromRangeStart",id:M,name:S});break}case "moveFromRangeEnd":{let M=parseInt(j$1(F,"w","id")??"0",10);l.push({type:"moveFromRangeEnd",id:M});break}case "moveToRangeStart":{let M=parseInt(j$1(F,"w","id")??"0",10),S=j$1(F,"w","name")??"";l.push({type:"moveToRangeStart",id:M,name:S});break}case "moveToRangeEnd":{let M=parseInt(j$1(F,"w","id")??"0",10);l.push({type:"moveToRangeEnd",id:M});break}case "commentRangeStart":{let M=parseInt(j$1(F,"w","id")??"0",10);l.push({type:"commentRangeStart",id:M});break}case "commentRangeEnd":{let M=parseInt(j$1(F,"w","id")??"0",10);l.push({type:"commentRangeEnd",id:M});break}case "oMath":case "oMathPara":{let M=B==="oMathPara",S=b(F),m=et(F),C={type:"mathEquation",display:M?"block":"inline",ommlXml:S,plainText:m||void 0};l.push(C);break}}}return l}function cn(e){let t="";for(let n of e.content)if(n.type==="run")for(let r of n.content)r.type==="text"?t+=r.text:r.type==="tab"?t+=" ":r.type==="break"&&(r.breakType==="page"?t+="\f":t+=`
|
|
4
|
+
`);else if(n.type==="hyperlink"){for(let r of n.children)if(r.type==="run")for(let o of r.content)o.type==="text"&&(t+=o.text);}else if(n.type==="simpleField"){for(let r of n.content)if(r.type==="run")for(let o of r.content)o.type==="text"&&(t+=o.text);}else if(n.type==="complexField")for(let r of n.fieldResult)for(let o of r.content)o.type==="text"&&(t+=o.text);return t}function it(e){let t=j$1(e,"w","id");if(t==null)return null;let n=parseInt(t,10);if(Number.isNaN(n))return null;let r=j$1(e,"w","author")??"",o=j$1(e,"w","date")??void 0,a={id:n,author:r};return o&&(a.date=o),a}function V(e$1,t,n,r,o=null,a=null,u){let l={type:"paragraph",content:[]},f=j$1(e$1,"w14","paraId")??j$1(e$1,"w","paraId");f&&(l.paraId=f);let c=j$1(e$1,"w14","textId")??j$1(e$1,"w","textId");c&&(l.textId=c),!u?.inHeaderFooter&&tt(e$1)&&(l.renderedPageBreakBefore=true);let p=e(e$1,"w","pPr");if(p){l.formatting=fe(p,n),l.propertyChanges=rt(p,n,t,l.formatting);let T=e(p,"w","rPr");if(T){let h=e(T,"w","ins");if(h){let B=it(h);B&&(l.pPrIns=B);}let F=e(T,"w","del");if(F){let B=it(F);B&&(l.pPrDel=B);}}let w=e(p,"w","sectPr");w&&(l.sectionProperties=Ge(w));}let d=j(e$1,t,n,r,o,a);l.content=we(d);let b=l.formatting?.numPr;if(!b&&l.formatting?.styleId&&t){let T=t.get(l.formatting.styleId);T?.pPr?.numPr&&(b=T.pPr.numPr,l.formatting||(l.formatting={}),l.formatting.numPr=b);}if(b&&r){let{numId:T,ilvl:w=0}=b;if(T!==void 0&&T!==0){let h=r.getLevel(T,w);if(h){let F=[];for(let S=0;S<=w;S+=1){let m=r.getLevel(T,S);F.push(m?.numFmt??"decimal");}let B=r.getInstance(T),M=B?.levelOverrides?.find(S=>S.ilvl===w);if(l.listRendering={level:w,numId:T,marker:h.lvlText,isBullet:h.numFmt==="bullet",numFmt:h.numFmt,markerHidden:h.rPr?.hidden||void 0,markerFontFamily:h.rPr?.fontFamily?.ascii||h.rPr?.fontFamily?.hAnsi||void 0,markerFontSize:h.rPr?.fontSize?h.rPr.fontSize/2:void 0,markerSuffix:h.suffix,levelNumFmts:F,abstractNumId:B?.abstractNumId,startOverride:M?.startOverride},h.pPr){l.formatting||(l.formatting={});let S=p?e(p,"w","ind"):null,m=S!=null&&(j$1(S,"w","left")!==null||j$1(S,"w","start")!==null),C=y=>{let x=S?j$1(S,"w",y):null;if(x===null)return false;let P=parseInt(x,10);return Number.isNaN(P)||P!==0},E=S!=null&&(C("firstLine")||C("hanging"));!m&&h.pPr.indentLeft!==void 0&&(l.formatting.indentLeft=h.pPr.indentLeft),E||(h.pPr.indentFirstLine!==void 0&&(l.formatting.indentFirstLine=h.pPr.indentFirstLine),h.pPr.hangingIndent!==void 0&&(l.formatting.hangingIndent=h.pPr.hangingIndent));}}}}return l}function at(e$1){if(!e$1)return;let t={},n=X(e(e$1,"w","tblW"));n&&(t.width=n);let r=e(e$1,"w","jc");if(r){let h=j$1(r,"w","val");(h==="left"||h==="center"||h==="right"||h==="start")&&(t.justification=h==="start"?"left":h);}let o=X(e(e$1,"w","tblCellSpacing"));o&&(t.cellSpacing=o);let a=X(e(e$1,"w","tblInd"));a&&(t.indent=a);let u=ee(e(e$1,"w","tblBorders"));u&&(t.borders=u);let l=te(e(e$1,"w","tblCellMar"));l&&(t.cellMargins=l);let f=e(e$1,"w","tblLayout");if(f){let h=j$1(f,"w","type");(h==="fixed"||h==="autofit")&&(t.layout=h);}let c=e(e$1,"w","tblStyle");if(c){let h=j$1(c,"w","val");h&&(t.styleId=h);}let p=ge(e(e$1,"w","tblLook"));p&&(t.look=p);let d=ne(e(e$1,"w","shd"));d&&(t.shading=d);let b=e(e$1,"w","tblOverlap");if(b){let h=j$1(b,"w","val");(h==="never"||h==="overlap")&&(t.overlap=h);}let T=he(e(e$1,"w","tblpPr"));if(T&&(t.floating=T),m(e(e$1,"w","bidiVisual"))&&(t.bidi=true),Object.keys(t).length!==0)return t}function pn(e$1,t){if(!e$1)return;let n=f(e$1,"w","tblPrChange").map(r=>{let o=e(r,"w","tblPr");return {type:"tablePropertyChange",info:J(r),previousFormatting:at(o),currentFormatting:t}}).filter(r=>r.previousFormatting||r.currentFormatting);return n.length>0?n:void 0}function dn(e$1,t){if(!e$1)return;let n=f(e$1,"w","trPrChange").map(r=>{let o=e(r,"w","trPr");return {type:"tableRowPropertyChange",info:J(r),previousFormatting:lt(o),currentFormatting:t}}).filter(r=>r.previousFormatting||r.currentFormatting);return n.length>0?n:void 0}function mn(e$1,t){if(!e$1)return;let n=f(e$1,"w","tcPrChange").map(r=>{let o=e(r,"w","tcPr");return {type:"tableCellPropertyChange",info:J(r),previousFormatting:ut(o),currentFormatting:t}}).filter(r=>r.previousFormatting||r.currentFormatting);return n.length>0?n:void 0}function gn(e$1){if(!e$1)return;let t=e(e$1,"w","ins");if(t)return {type:"tableRowInsertion",info:W(t)};let n=e(e$1,"w","del");if(n)return {type:"tableRowDeletion",info:W(n)}}function hn(e$1){if(!e$1)return;let t=e(e$1,"w","cellIns");if(t)return {type:"tableCellInsertion",info:W(t)};let n=e(e$1,"w","cellDel");if(n)return {type:"tableCellDeletion",info:W(n)};let r=e(e$1,"w","cellMerge");if(r){let o=j$1(r,"w","vMerge"),a=j$1(r,"w","vMergeOrig"),u=l=>l==="rest"||l==="cont";return {type:"tableCellMerge",info:W(r),...u(o)?{vMerge:o}:{},...u(a)?{vMergeOrig:a}:{}}}}function lt(e$1){if(!e$1)return;let t={},n=e(e$1,"w","trHeight");if(n){let f=l(n,"w","val");f!==void 0&&f>0&&(t.height={value:f,type:"dxa"});let c=j$1(n,"w","hRule");(c==="auto"||c==="atLeast"||c==="exact")&&(t.heightRule=c);}m(e(e$1,"w","tblHeader"))&&(t.header=true),m(e(e$1,"w","cantSplit"))&&(t.cantSplit=true);let a=e(e$1,"w","jc");if(a){let f=j$1(a,"w","val");(f==="left"||f==="center"||f==="right")&&(t.justification=f);}m(e(e$1,"w","hidden"))&&(t.hidden=true);let l$1=st(e(e$1,"w","cnfStyle"));if(l$1&&(t.conditionalFormat=l$1),Object.keys(t).length!==0)return t}function st(e){if(!e)return;let t={},n=j$1(e,"w","firstRow");(n==="1"||n==="true")&&(t.firstRow=true);let r=j$1(e,"w","lastRow");(r==="1"||r==="true")&&(t.lastRow=true);let o=j$1(e,"w","firstColumn");(o==="1"||o==="true")&&(t.firstColumn=true);let a=j$1(e,"w","lastColumn");(a==="1"||a==="true")&&(t.lastColumn=true);let u=j$1(e,"w","oddHBand");(u==="1"||u==="true")&&(t.oddHBand=true);let l=j$1(e,"w","evenHBand");(l==="1"||l==="true")&&(t.evenHBand=true);let f=j$1(e,"w","oddVBand");(f==="1"||f==="true")&&(t.oddVBand=true);let c=j$1(e,"w","evenVBand");(c==="1"||c==="true")&&(t.evenVBand=true);let p=j$1(e,"w","firstRowFirstColumn");(p==="1"||p==="true")&&(t.nwCell=true);let d=j$1(e,"w","firstRowLastColumn");(d==="1"||d==="true")&&(t.neCell=true);let b=j$1(e,"w","lastRowFirstColumn");(b==="1"||b==="true")&&(t.swCell=true);let T=j$1(e,"w","lastRowLastColumn");(T==="1"||T==="true")&&(t.seCell=true);let w=j$1(e,"w","val");if(w&&w.length===12&&(w[0]==="1"&&(t.firstRow=true),w[1]==="1"&&(t.lastRow=true),w[2]==="1"&&(t.firstColumn=true),w[3]==="1"&&(t.lastColumn=true),w[4]==="1"&&(t.oddVBand=true),w[5]==="1"&&(t.evenVBand=true),w[6]==="1"&&(t.oddHBand=true),w[7]==="1"&&(t.evenHBand=true),w[8]==="1"&&(t.nwCell=true),w[9]==="1"&&(t.neCell=true),w[10]==="1"&&(t.swCell=true),w[11]==="1"&&(t.seCell=true)),Object.keys(t).length!==0)return t}function ut(e$1){if(!e$1)return;let t={},n=X(e(e$1,"w","tcW"));n&&(t.width=n);let r=ee(e(e$1,"w","tcBorders"));r&&(t.borders=r);let o=te(e(e$1,"w","tcMar"));o&&(t.margins=o);let a=ne(e(e$1,"w","shd"));a&&(t.shading=a);let u=e(e$1,"w","vAlign");if(u){let w=j$1(u,"w","val");(w==="top"||w==="center"||w==="bottom")&&(t.verticalAlign=w);}let l$1=e(e$1,"w","textDirection");if(l$1){let w=j$1(l$1,"w","val");w&&(t.textDirection=w);}let f=e(e$1,"w","gridSpan");if(f){let w=l(f,"w","val");w!==void 0&&w>1&&(t.gridSpan=w);}let c=e(e$1,"w","vMerge");c&&(j$1(c,"w","val")==="restart"?t.vMerge="restart":t.vMerge="continue"),m(e(e$1,"w","tcFitText"))&&(t.fitText=true),m(e(e$1,"w","noWrap"))&&(t.noWrap=true),m(e(e$1,"w","hideMark"))&&(t.hideMark=true);let T=st(e(e$1,"w","cnfStyle"));if(T&&(t.conditionalFormat=T),Object.keys(t).length!==0)return t}function wn(e,t,n,r,o,a,u){let l=[],f=e.elements||[];for(let c of f){if(!c.name)continue;let p=c.name.split(":").pop();if(p==="p"){let d=V(c,t,n,r,o,a,u);l.push(d);}else if(p==="tbl"){let d=Y(c,t,n,r,o,a,u);l.push(d);}}return l.length===0&&l.push({type:"paragraph",content:[]}),l}function yn(e$1,t,n,r,o,a,u){let l={type:"tableCell",content:[]},f=e(e$1,"w","tcPr"),c=ut(f);return c&&(l.formatting=c),l.propertyChanges=mn(f,c),l.structuralChange=hn(f),l.content=wn(e$1,t,n,r,o,a,u),l}function bn(e$1,t,n,r,o,a,u){let l={type:"tableRow",cells:[]},f$1=e(e$1,"w","trPr"),c=lt(f$1);c&&(l.formatting=c),l.propertyChanges=dn(f$1,c),l.structuralChange=gn(f$1);let p=f(e$1,"w","tc");for(let d of p){let b=yn(d,t,n,r,o,a,u);l.cells.push(b);}return l}function Tn(e){if(!e)return;let t=[],n=f(e,"w","gridCol");for(let r of n){let o=l(r,"w","w")??0;t.push(o);}if(!(t.length>0&&t.every(r=>r<=0)))return t.length>0?t:void 0}function Fn(e){return e.cells.reduce((t,n)=>t+(n.formatting?.gridSpan??1),0)}function Cn(e){let t=Math.max(e.columnWidths?.length??0,...e.rows.map(n=>Fn(n)));if(!(t<=1))for(let n of e.rows){if(n.cells.length!==1)continue;let r=n.cells[0];(r.formatting?.gridSpan??1)>=t||r.formatting?.vMerge||r.formatting?.gridSpan==null&&(r.formatting={...r.formatting??{},gridSpan:t});}}function Y(e$1,t,n,r,o,a,u){let l={type:"table",rows:[]},f$1=e(e$1,"w","tblPr"),c=at(f$1);c&&(l.formatting=c),l.propertyChanges=pn(f$1,c);let p=Tn(e(e$1,"w","tblGrid"));p&&(l.columnWidths=p);let d=f(e$1,"w","tr");for(let b of d){let T=bn(b,t,n,r,o,a,u);l.rows.push(T);}return Cn(l),l}export{_n as A,Ge as B,Qn as C,Jn as D,$ as E,$e as F,pr as G,dr as H,mr as I,gr as J,hr as K,wr as L,yr as M,cn as N,V as O,Sn as a,_ as b,Ne as c,D as d,ee as e,te as f,ne as g,ge as h,he as i,gt as j,ht as k,wt as l,yt as m,bt as n,at as o,Tt as p,re as q,Ln as r,Xn as s,jn as t,zn as u,je as v,ze as w,Un as x,Gn as y,qn as z};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {c as c$1}from'./chunk-V5VDCQDN.mjs';import {f,d,e,h}from'./chunk-MP4QSEO2.mjs';import {r,s,t,O as O$1,E,F,p,v}from'./chunk-6Y6LON6Y.mjs';import {a as a$1,c as c$2}from'./chunk-7E5VBRDL.mjs';import {x}from'./chunk-RFC2SXZ6.mjs';import {c}from'./chunk-FEWCI2E5.mjs';import {c as c$3}from'./chunk-MOKKS75W.mjs';import {a}from'./chunk-AMENZY5F.mjs';import {i,e as e$1}from'./chunk-VW22RZ6C.mjs';var Y={fragment:"layout-fragment",paragraph:"layout-fragment-paragraph",table:"layout-fragment-table",image:"layout-fragment-image",line:"layout-line",run:"layout-run"};function ft(e){return e.kind==="paragraph"}function gt(e){return e.kind==="table"}function mt(e){return e.kind==="image"}function le(e){e.style.position="absolute",e.style.overflow="hidden";}function ht(e,t,n){let o=n.createElement("div");return o.className=`${Y.fragment} ${Y.paragraph}`,le(o),o.dataset.blockId=String(e.blockId),o.dataset.fromLine=String(e.fromLine),o.dataset.toLine=String(e.toLine),e.pmStart!==void 0&&(o.dataset.pmStart=String(e.pmStart)),e.pmEnd!==void 0&&(o.dataset.pmEnd=String(e.pmEnd)),e.continuesFromPrev&&(o.dataset.continuesFromPrev="true"),e.continuesOnNext&&(o.dataset.continuesOnNext="true"),o}function ut(e,t,n){let o=n.createElement("div");return o.className=`${Y.fragment} ${Y.table}`,le(o),o.dataset.blockId=String(e.blockId),o.dataset.fromRow=String(e.fromRow),o.dataset.toRow=String(e.toRow),e.pmStart!==void 0&&(o.dataset.pmStart=String(e.pmStart)),e.pmEnd!==void 0&&(o.dataset.pmEnd=String(e.pmEnd)),o}function yt(e,t,n){let o=n.createElement("div");return o.className=`${Y.fragment} ${Y.image}`,le(o),o.dataset.blockId=String(e.blockId),e.pmStart!==void 0&&(o.dataset.pmStart=String(e.pmStart)),e.pmEnd!==void 0&&(o.dataset.pmEnd=String(e.pmEnd)),e.isAnchored&&(o.dataset.anchored="true"),e.zIndex!==void 0&&(o.style.zIndex=String(e.zIndex)),o}function Te(e,t,n={}){let o=n.document??document;if(ft(e))return ht(e,t,o);if(gt(e))return ut(e,t,o);if(mt(e))return yt(e,t,o);let r=o.createElement("div");r.className=Y.fragment,le(r);let a=e;return a.blockId!==void 0&&(r.dataset.blockId=String(a.blockId)),a.kind&&(r.dataset.kind=a.kind),r}var L={fragment:"layout-paragraph",line:"layout-line",run:"layout-run",text:"layout-run-text",tab:"layout-run-tab",image:"layout-run-image",lineBreak:"layout-run-linebreak"};function z(e){return e.kind==="text"}function O(e){return e.kind==="tab"}function G(e){return e.kind==="image"}function j(e){return e.kind==="lineBreak"}function U(e){return e.kind==="field"}var Ke={image:"layout-image",imageAnchored:"layout-image-anchored"};function te(e){return !!(e.cropTop||e.cropRight||e.cropBottom||e.cropLeft||e.opacity!=null&&e.opacity<1)}function ne(e,t){let n=t.cropTop??0,o=t.cropRight??0,r=t.cropBottom??0,a=t.cropLeft??0;(n||o||r||a)&&(e.style.clipPath=`inset(${n*100}% ${o*100}% ${r*100}% ${a*100}%)`),t.opacity!=null&&t.opacity<1&&(e.style.opacity=String(Math.max(0,t.opacity)));}function Z(e,t,n,o,r={}){let a=r.document??document,i=a.createElement("div");i.className=Ke.image,e.isAnchored&&i.classList.add(Ke.imageAnchored),i.style.position="absolute",i.style.width=`${e.width}px`,i.style.height=`${e.height}px`,i.style.overflow="hidden",e.zIndex!==void 0&&(i.style.zIndex=String(e.zIndex)),t.anchor?.behindDoc&&(i.style.zIndex="-1"),i.dataset.blockId=String(e.blockId),e.pmStart!==void 0&&(i.dataset.pmStart=String(e.pmStart)),e.pmEnd!==void 0&&(i.dataset.pmEnd=String(e.pmEnd));let c=a.createElement("img");if(c.src=t.src,c.alt=t.alt??"",c.style.width="100%",c.style.height="100%",c.style.objectFit="contain",c.style.display="block",t.transform&&(c.style.transform=t.transform),c.draggable=false,t.hlinkHref){let s=a.createElement("a");s.href=t.hlinkHref,s.target="_blank",s.rel="noopener noreferrer",s.style.display="block",s.style.width="100%",s.style.height="100%",s.appendChild(c),i.appendChild(s);}else i.appendChild(c);return i}function bt(e,t,n){if(t.fontFamily&&(e.style.fontFamily=a(t.fontFamily).cssFallback),t.fontSize){let r=t.fontSize*96/72;e.style.fontSize=`${r}px`;}if(t.bold&&(e.style.fontWeight="bold"),t.italic&&(e.style.fontStyle="italic"),t.color&&(e.style.color=t.color),t.letterSpacing&&(e.style.letterSpacing=`${t.letterSpacing}px`),t.allCaps&&(e.style.textTransform="uppercase"),t.smallCaps&&(e.style.fontVariant="small-caps"),t.positionPx&&(e.style.verticalAlign=`${t.positionPx}px`),t.horizontalScale&&t.horizontalScale!==100&&(e.style.display="inline-block",e.style.transform=`scaleX(${t.horizontalScale/100})`,e.style.transformOrigin="left center"),t.kerningMinPt&&t.kerningMinPt>0&&(t.fontSize??11)>=t.kerningMinPt&&(e.style.fontKerning="normal"),t.emboss&&(e.style.textShadow="1px 1px 1px rgba(255,255,255,0.5), -1px -1px 1px rgba(0,0,0,0.3)"),t.imprint&&(e.style.textShadow="-1px -1px 1px rgba(255,255,255,0.5), 1px 1px 1px rgba(0,0,0,0.3)"),t.textShadow&&!t.emboss&&!t.imprint&&(e.style.textShadow="1px 1px 2px rgba(0,0,0,0.3)"),t.textOutline&&(e.style.webkitTextStroke="1px currentColor",e.style.webkitTextFillColor="transparent"),t.emphasisMark){let r=t.emphasisMark==="comma"?"filled sesame":t.emphasisMark==="circle"?"filled circle":"filled dot",a=t.emphasisMark==="underDot"?"under right":"over right";e.style.textEmphasis=`${r}`,e.style.textEmphasisPosition=a,e.style.webkitTextEmphasis=r,e.style.webkitTextEmphasisPosition=a;}t.highlight&&(e.style.backgroundColor=t.highlight);let o=[];if(t.underline&&(o.push("underline"),typeof t.underline=="object"&&(t.underline.style&&(e.style.textDecorationStyle=t.underline.style),t.underline.color&&(e.style.textDecorationColor=t.underline.color))),t.strike&&o.push("line-through"),t.commentIds&&t.commentIds.length>0){let r=t.commentIds.find(a=>!n||!n.has(a));r!=null&&(e.style.backgroundColor="rgba(255, 212, 0, 0.15)",e.style.borderBottom="1px solid rgba(255, 212, 0, 0.4)",e.dataset.commentId=String(r));}t.isInsertion&&(e.style.backgroundColor="rgba(52, 168, 83, 0.08)",e.style.borderBottom="2px dashed #2e7d32",e.style.paddingBottom="1px",e.classList.add("docx-insertion"),t.changeAuthor&&(e.dataset.changeAuthor=t.changeAuthor),t.changeDate&&(e.dataset.changeDate=t.changeDate),t.changeRevisionId!=null&&(e.dataset.revisionId=String(t.changeRevisionId))),t.isDeletion&&(e.style.backgroundColor="rgba(211, 47, 47, 0.08)",e.style.color="#c62828",o.includes("line-through")||o.push("line-through"),e.style.textDecorationColor="#c62828",e.classList.add("docx-deletion"),t.changeAuthor&&(e.dataset.changeAuthor=t.changeAuthor),t.changeDate&&(e.dataset.changeDate=t.changeDate),t.changeRevisionId!=null&&(e.dataset.revisionId=String(t.changeRevisionId))),o.length>0&&(e.style.textDecorationLine=o.join(" ")),t.superscript&&(e.style.verticalAlign="super",e.style.fontSize="0.75em"),t.subscript&&(e.style.verticalAlign="sub",e.style.fontSize="0.75em"),t.hidden&&(e.classList.add("docx-hidden"),e.style.opacity="0.4",e.style.textDecoration="underline dotted"),t.rtl&&e.setAttribute("dir","rtl"),t.textEffect&&(e.classList.add("docx-text-effect",`docx-text-effect-${t.textEffect}`),e.dataset.effect=t.textEffect);}function V(e,t,n){t!==void 0&&(e.dataset.pmStart=String(t)),n!==void 0&&(e.dataset.pmEnd=String(n));}function oe(e,t,n){let o=t.createElement("span");if(o.className=`${L.run} ${L.text}`,bt(o,e,n),V(o,e.pmStart,e.pmEnd),e.hyperlink){let r=t.createElement("a");r.href=e.hyperlink.href,e.hyperlink.href.startsWith("#")||(r.target="_blank",r.rel="noopener noreferrer"),e.hyperlink.tooltip&&(r.title=e.hyperlink.tooltip),r.textContent=e.text,r.style.color="inherit",r.style.textDecoration="inherit",e.hyperlink.noDefaultStyle||(e.color||(r.style.color="#0563c1",o.style.color="#0563c1"),e.underline||(r.style.textDecoration="underline")),o.appendChild(r);}else o.textContent=e.text;return o}var xt=1e3;function de(e,t,n,o){let r=t.createElement("span");r.className=`${L.run} ${L.tab}`,r.style.display="inline-block",r.style.width=`${n}px`,V(r,e.pmStart,e.pmEnd);let a=o&&o!=="none"?St(o):null;if(a){r.style.position="relative",r.textContent="\u200B";let i=t.createElement("span");i.style.position="absolute",i.style.left="0",i.style.right="0",i.style.top="0",i.style.bottom="0",i.style.overflow="hidden",i.style.whiteSpace="nowrap",i.textContent=a.repeat(xt),r.appendChild(i);}else r.textContent="\xA0";return r}function St(e){switch(e){case "dot":return ".";case "hyphen":return "-";case "underscore":return "_";case "middleDot":return "\xB7";case "heavy":return "_";default:return null}}function Xe(e){if(!e)return 0;let t=e.match(/rotate\(([-\d.]+)deg\)/);return t?(parseFloat(t[1])%360+360)%360:0}function Ze(e,t,n){if(n===0||n===180)return {w:e,h:t};if(n===90||n===270)return {w:t,h:e};let o=n*Math.PI/180,r=Math.abs(Math.sin(o)),a=Math.abs(Math.cos(o));return {w:e*a+t*r,h:e*r+t*a}}function Ye(e,t){t.distTop&&(e.style.marginTop=`${t.distTop}px`),t.distBottom&&(e.style.marginBottom=`${t.distBottom}px`);}function kt(e,t){let n=t.createElement("img");n.className=`${L.run} ${L.image}`,n.src=e.src,n.width=e.width,n.height=e.height,n.style.width=`${e.width}px`,n.style.height=`${e.height}px`,e.alt&&(n.alt=e.alt),e.transform&&(n.style.transform=e.transform,n.style.transformOrigin="center center"),te(e)&&ne(n,e);let o=Xe(e.transform);if(o!==0){let r=Ze(e.width,e.height,o),a=t.createElement("span");return a.style.display="inline-block",a.style.position="relative",a.style.width=`${r.w}px`,a.style.height=`${r.h}px`,a.style.verticalAlign="middle",n.style.position="absolute",n.style.left=`${(r.w-e.width)/2}px`,n.style.top=`${(r.h-e.height)/2}px`,Ye(a,e),V(a,e.pmStart,e.pmEnd),a.appendChild(n),a}return n.style.display="inline-block",n.style.verticalAlign="middle",Ye(n,e),V(n,e.pmStart,e.pmEnd),n}function Ue(e,t){let n=t.createElement("div");n.className="layout-block-image",n.style.display="block",n.style.textAlign="center",n.style.marginTop=`${e.distTop??6}px`,n.style.marginBottom=`${e.distBottom??6}px`;let o=t.createElement("img");o.src=e.src,o.width=e.width,o.height=e.height,o.style.marginLeft="auto",o.style.marginRight="auto",e.alt&&(o.alt=e.alt),e.transform&&(o.style.transform=e.transform,o.style.transformOrigin="center center"),te(e)&&ne(o,e);let r=Xe(e.transform);if(r!==0){let a=Ze(e.width,e.height,r);n.style.height=`${a.h}px`,n.style.position="relative",o.style.position="absolute",o.style.left="50%",o.style.top="50%",o.style.marginLeft=`${-e.width/2}px`,o.style.marginRight="0",o.style.marginTop=`${-e.height/2}px`;}return V(n,e.pmStart,e.pmEnd),n.appendChild(o),n}function pe(e,t){let n;return f(e)||e.displayMode==="block"||e.wrapType==="topAndBottom"?n=Ue(e,t):n=kt(e,t),Tt(n,e),n}function Tt(e,t){if(t.isInsertion)e.style.outline="2px solid #2e7d32",e.style.outlineOffset="1px",e.classList.add("docx-insertion");else if(t.isDeletion)e.style.outline="2px solid #c62828",e.style.outlineOffset="1px",e.style.opacity="0.6",e.classList.add("docx-deletion");else return;t.changeAuthor&&(e.dataset.changeAuthor=t.changeAuthor),t.changeDate&&(e.dataset.changeDate=t.changeDate),t.changeRevisionId!=null&&(e.dataset.revisionId=String(t.changeRevisionId));}function we(e,t){let n=t.createElement("br");return n.className=`${L.run} ${L.lineBreak}`,V(n,e.pmStart,e.pmEnd),n}function ce(e,t,n){let o=e.fallback??"";switch(e.fieldType){case "PAGE":o=String(n.pageNumber);break;case "NUMPAGES":o=String(n.totalPages);break;case "DATE":o=new Date().toLocaleDateString();break;case "TIME":o=new Date().toLocaleTimeString();break}let r={...e,text:o};return oe(r,t,n?.resolvedCommentIds)}function Fe(e,t,n){if(z(e))return oe(e,t,n?.resolvedCommentIds);if(O(e))return de(e,t,48,void 0);if(G(e))return pe(e,t);if(j(e))return we(e,t);if(U(e)&&n)return ce(e,t,n);let o=t.createElement("span");return o.className=L.run,o}function Qe(e,t){let n=[],o=e.runs;for(let r=t.fromRun;r<=t.toRun;r++){let a=o[r];if(a)if(z(a)){let i=r===t.fromRun?t.fromChar:0,c=r===t.toRun?t.toChar:a.text.length;if(i>0||c<a.text.length){let s=a.text.slice(i,c);n.push({...a,text:s,pmStart:a.pmStart!==void 0?a.pmStart+i:void 0,pmEnd:a.pmStart!==void 0?a.pmStart+c:void 0});}else n.push(a);}else n.push(a);}return n}function qe(e){return e==="center"?"center":e==="right"?"flex-end":"flex-start"}function Je(e){return [e.pmStart??"no-start",e.pmEnd??"no-end",e.src,e.width,e.height,e.displayMode??"inline",e.wrapType??"none"].join("|")}function wt(e){return {val:e.val,pos:e.pos,leader:e.leader}}function Ft(e,t,n){let o="";for(let r=t+1;r<e.length;r++){let a=e[r];if(z(a))o+=a.text;else if(U(a))a.fieldType==="PAGE"&&n?o+=String(n.pageNumber):a.fieldType==="NUMPAGES"&&n?o+=String(n.totalPages):o+=a.fallback??"";else if(O(a)||j(a))break}return o}var It=.5;function Ct(e,t,n,o){let r=0;for(let a=t+1;a<e.length;a++){let i=e[a];if(O(i)||j(i))break;if(z(i))r+=n(i.text||"",i.fontSize,i.fontFamily,i.bold,i.italic);else if(U(i)){let c;i.fieldType==="PAGE"&&o?c=String(o.pageNumber):i.fieldType==="NUMPAGES"&&o?c=String(o.totalPages):c=i.fallback??"",r+=n(c,i.fontSize,i.fontFamily,i.bold,i.italic);}else G(i)&&!f(i)&&(r+=i.width||0);}return r}function Rt(e){let n=e.createElement("canvas").getContext("2d");return (o,r=11,a$1="Calibri",i=false,c=false)=>{if(!n)return o.length*7;let s=a(a$1).cssFallback,m=r*96/72,l=[];return c&&l.push("italic"),i&&l.push("bold"),l.push(`${m}px`,s),n.font=l.join(" "),n.measureText(o).width}}function fe(e,t,n,o,r$1){let a=o.createElement("div");a.className=L.line,a.style.height=`${t.lineHeight}px`,a.style.lineHeight=`${t.lineHeight}px`;let i=Qe(e,t);if(i.length===1&&G(i[0])){let p=i[0].position?.horizontal?.align??n;a.style.display="flex",a.style.alignItems="center",a.style.justifyContent=qe(p),a.dataset.flexLine="true";}else i.some(G)&&(a.style.display="flex",a.style.alignItems="baseline",a.style.justifyContent=qe(n),a.style.lineHeight="normal",a.dataset.flexLine="true");if(i.length===0){let u=o.createElement("span");return u.className=`${L.run} layout-empty-run`,u.innerHTML=" ",a.appendChild(u),a}let c=n==="justify",s=false;c&&r$1&&(s=!r$1.isLastLine||r$1.paragraphEndsWithLineBreak,s&&(a.style.textAlign="justify",a.style.textAlignLast="justify",a.style.width=`${r$1.availableWidth}px`)),a.style.whiteSpace="pre";let m=i.some(u=>z(u)&&u.highlight);a.style.overflow=m?"hidden":"visible";let l=i.some(O),x,h=Rt(o);if(l){let u=r$1?.tabStops?.map(wt),g=r$1?.leftIndentPx?Math.round(r$1.leftIndentPx*15):0;x={explicitStops:u,leftIndent:g};}let y=0,k=r$1?.leftIndentPx??0;if(r$1?.isFirstLine){let u=r$1?.firstLineIndentPx??0;y=k+u;}else y=k;for(let u=0;u<i.length;u++){let g=i[u];if(O(g)&&x){let p=Ct(i,u,h,r$1?.context),b=Ft(i,u,r$1?.context),d=b.indexOf("."),f$1=d>=0?h(b.slice(0,d)):0,w=r(y,x,{followingWidth:p,decimalPrefixWidth:f$1}),S=r$1?.lineRightEdgePx,T=p,P=false;for(let R=u+1;R<i.length&&!j(i[R]);R++)if(O(i[R])){P=true;break}if(S!==void 0&&w.alignment==="end"&&!P&&y+w.width+T>=S-It){a.style.display="flex",a.style.alignItems="baseline",a.style.whiteSpace="nowrap",a.style.textIndent="0",a.dataset.flexLine="true",r$1?.isFirstLine&&r$1.firstLineIndentPx&&r$1.firstLineIndentPx<0&&a.firstElementChild instanceof HTMLElement&&(a.firstElementChild.style.marginLeft=`${r$1.firstLineIndentPx}px`);let R=de(g,o,0,w.leader);R.style.flex="1 1 0",R.style.minWidth="0",R.style.width="auto",a.appendChild(R);for(let A=u+1;A<i.length;A++){let E=i[A];if(O(E)||j(E))break;if(z(E))a.appendChild(oe(E,o,r$1?.context?.resolvedCommentIds));else if(U(E)&&r$1?.context)a.appendChild(ce(E,o,r$1.context));else if(G(E)){if(f(E))continue;let Q=Je(E);r$1?.renderedInlineImageKeys?.has(Q)||(r$1?.renderedInlineImageKeys?.add(Q),a.appendChild(pe(E,o)));}else a.appendChild(Fe(E,o,r$1?.context));}break}let I=w.width;S!==void 0&&y+I+T>S&&(I=Math.max(1,S-y-T));let C=de(g,o,I,w.leader);a.appendChild(C),y+=I;}else if(z(g)){let p=oe(g,o,r$1?.context?.resolvedCommentIds);if(g.highlight){let w=(g.fontSize?g.fontSize*96/72:14.67)*1.2,S=Math.max(0,t.lineHeight-w);if(S>0){let T=S/2;p.style.paddingTop=`${T}px`,p.style.paddingBottom=`${T}px`;}}a.appendChild(p);let b=g.fontSize||11,d=g.fontFamily||"Calibri";y+=h(g.text,b,d,g.bold,g.italic);}else if(G(g)){if(f(g))continue;let p=Je(g);if(r$1?.renderedInlineImageKeys?.has(p))continue;r$1?.renderedInlineImageKeys?.add(p);let b=pe(g,o);a.appendChild(b),g.displayMode!=="block"&&g.wrapType!=="topAndBottom"&&(y+=g.width);}else if(j(g)){let p=we(g,o);a.appendChild(p);}else if(U(g)&&r$1?.context){let p=ce(g,o,r$1.context);a.appendChild(p);let b=g.fallback??"";g.fieldType==="PAGE"?b=String(r$1.context.pageNumber):g.fieldType==="NUMPAGES"&&(b=String(r$1.context.totalPages));let d=g.fontSize||11,f=g.fontFamily||"Calibri";y+=h(b,d,f,g.bold,g.italic);}else {let p=Fe(g,o,r$1?.context);a.appendChild(p);}}return a}function re(e,t){return !e&&!t?true:!e||!t?false:e.style===t.style&&e.width===t.width&&e.color===t.color}function et(e,t){return !e&&!t||!e||!t?false:re(e.top,t.top)&&re(e.bottom,t.bottom)&&re(e.left,t.left)&&re(e.right,t.right)&&re(e.between,t.between)}function H(e,t$1,n,o,r={}){let a=r.document??document,i=a.createElement("div");i.className=L.fragment,i.style.position=o.positioning==="absolute"?"absolute":"relative",i.dataset.blockId=String(e.blockId),i.dataset.fromLine=String(e.fromLine),i.dataset.toLine=String(e.toLine),V(i,e.pmStart,e.pmEnd),e.continuesFromPrev&&(i.dataset.continuesFromPrev="true"),e.continuesOnNext&&(i.dataset.continuesOnNext="true");let c=t$1.attrs?.pPrIns,s$1=t$1.attrs?.pPrDel;if(c||s$1){let S=c??s$1;i.classList.add("layout-revision-pmark"),i.classList.add(c?"layout-revision-ins":"layout-revision-del"),i.dataset.revisionId=String(S.revisionId),i.dataset.revisionAuthor=S.author,S.date&&(i.dataset.revisionDate=S.date);}let m=n.lines.slice(e.fromLine,e.toLine),l=t$1.attrs?.alignment;t$1.attrs?.styleId&&(i.dataset.styleId=t$1.attrs.styleId);let x=t$1.attrs?.bidi;x&&(i.dir="rtl"),l?l==="center"?i.style.textAlign="center":l==="right"?i.style.textAlign="right":l==="left"?i.style.textAlign="left":i.style.textAlign=x?"right":"left":x&&(i.style.textAlign="right");let h=t$1.attrs?.indent,y=0,k=0;h&&(x?(h.left&&h.left>0&&(k=h.left),h.right&&h.right>0&&(y=h.right)):(h.left&&h.left>0&&(y=h.left),h.right&&h.right>0&&(k=h.right)));let u=t$1.attrs?.borders;if(u){let S=E=>{switch(E){case "single":return "solid";case "double":return "double";case "dotted":return "dotted";case "dashed":return "dashed";case "thick":return "solid";case "wave":return "wavy";case "dashSmallGap":return "dashed";case "nil":case "none":return "none";default:return "solid"}};i.style.boxSizing="border-box";let T=E=>`${E.width}px ${S(E.style)} ${E.color}`,P=et(r.prevBorders,u),F=et(u,r.nextBorders),I=P?u.between:u.top,C=F?void 0:u.bottom,R=a.createElement("div");if(R.className="layout-paragraph-border",R.style.position="absolute",R.style.pointerEvents="none",R.style.boxSizing="border-box",R.style.left=`${y-(u.left?.space??0)}px`,R.style.right=`${k-(u.right?.space??0)}px`,R.style.top=`${-(I?.space??0)}px`,R.style.bottom=`${-(C?.space??0)}px`,I&&(R.style.borderTop=T(I)),C&&(R.style.borderBottom=T(C)),u.left&&(R.style.borderLeft=T(u.left)),u.right&&(R.style.borderRight=T(u.right)),(I||C||u.left||u.right)&&i.appendChild(R),u.bar){let E=a.createElement("div");E.style.position="absolute",E.style.left="-8px",E.style.top="0",E.style.bottom="0",E.style.borderLeft=T(u.bar),i.style.position="relative",i.appendChild(E);}}t$1.attrs?.shading&&(i.style.backgroundColor=t$1.attrs.shading);let g=e.width-y-k,b=t$1.runs[t$1.runs.length-1]?.kind==="lineBreak",d=n.lines.length,f=0;h?.hanging&&h.hanging>0?f=-h.hanging:h?.firstLine&&h.firstLine>0&&(f=h.firstLine);let w=r.renderedInlineImageKeys??new Set;for(let S=0;S<m.length;S++){let T=m[S],P=e.fromLine+S,F=P===d-1,I=P===0&&!e.continuesFromPrev,C=T.leftOffset??0,R=T.rightOffset??0,A=g;if(I){let v=h?.hanging&&h.hanging>0,B=h?.firstLine&&h.firstLine>0;v&&h?.hanging?A=g+h.hanging:B&&h?.firstLine&&(A=g-h.firstLine);}if(Et(T,t$1)){let v=a.createElement("div");v.className=`${L.line} layout-line-split`,v.style.position="relative",v.style.height=`${T.lineHeight}px`,v.style.lineHeight=`${T.lineHeight}px`;for(let B of T.segments){let Se={fromRun:B.fromRun,fromChar:B.fromChar,toRun:B.toRun,toChar:B.toChar,width:B.width,ascent:T.ascent,descent:T.descent,lineHeight:T.lineHeight},_=fe(t$1,Se,l,a,{availableWidth:B.availableWidth,isLastLine:F,isFirstLine:I,paragraphEndsWithLineBreak:b,tabStops:t$1.attrs?.tabs,leftIndentPx:y,firstLineIndentPx:I?f:0,context:o,renderedInlineImageKeys:w});_.className+=" layout-line-segment",_.style.position="absolute",_.style.left=`${B.leftOffset}px`,_.style.top="0",_.style.width=`${B.availableWidth}px`,v.appendChild(_);}i.appendChild(v);continue}let E=fe(t$1,T,l,a,{availableWidth:A-C-R,isLastLine:F,isFirstLine:I,paragraphEndsWithLineBreak:b,tabStops:t$1.attrs?.tabs,leftIndentPx:y,firstLineIndentPx:I?f:0,context:o,renderedInlineImageKeys:w,lineRightEdgePx:e.width-k-R});if(C>0||R>0){C>0&&(E.style.marginLeft=`${C}px`),R>0&&(E.style.marginRight=`${R}px`);let v=A-C-R;v>0&&(E.style.width=`${v}px`);}T.floatSkipBefore&&T.floatSkipBefore>0&&(E.style.marginTop=`${T.floatSkipBefore}px`);let Q=h?.hanging&&h.hanging>0,Be=h?.firstLine&&h.firstLine>0,dt=E.dataset.flexLine==="true";if(I?y>0&&Q?(E.style.paddingLeft=`${y}px`,dt||(E.style.textIndent=`-${h.hanging}px`)):y>0&&Be?(E.style.paddingLeft=`${y}px`,E.style.textIndent=`${h.firstLine}px`):y>0?E.style.paddingLeft=`${y}px`:Be&&(E.style.textIndent=`${h.firstLine}px`):y>0?E.style.paddingLeft=`${y}px`:Q&&(E.style.paddingLeft=`${h.hanging}px`),k>0&&(E.style.paddingRight=`${k}px`),I&&t$1.attrs?.listMarker&&!t$1.attrs?.listMarkerHidden){let v=h?.hanging??0,B=h?.firstLine??0,Se=v>0?Math.max(0,y-v):y+B;E.style.paddingLeft=`${Se}px`,E.style.textIndent="0";let{fontFamily:_,fontSize:pt}=s(t$1),ct=Pt(t$1.attrs.listMarker,t(t$1),a,_,pt,t$1.attrs.listMarkerRevision);E.insertBefore(ct,E.firstChild);}i.appendChild(E);}if((c||s$1)&&!e.continuesOnNext){let S=i.lastElementChild;if(S){let T=a.createElement("span");T.className="layout-revision-pmark-glyph",c?T.classList.add("layout-revision-ins"):T.classList.add("layout-revision-del"),T.textContent="\xB6",T.setAttribute("aria-hidden","true"),S.appendChild(T);}}return i}function Et(e,t){return (e.segments?.length??0)>1&&!t.attrs?.listMarker}function Pt(e,t,n,o,r,a$1){let i=n.createElement("span");return i.className="layout-list-marker",i.style.fontFamily=a(o).cssFallback,i.style.fontSize=`${r*96/72}px`,i.style.textAlign="left",i.style.boxSizing="border-box",i.style.display="inline-block",i.style.minWidth=`${t}px`,i.textContent=e,a$1==="ins"?i.style.color="#2e7d32":a$1==="del"&&(i.style.color="#c62828",i.style.textDecoration="line-through"),i}function X(e,t,n){let o=t.createElement("div");o.className=n.layerClass,o.style.position="absolute",o.style.top="0",o.style.left="0",n.sizing==="inset0"?(o.style.right="0",o.style.bottom="0"):(o.style.width="100%",o.style.height="100%",o.style.overflow="hidden"),o.style.pointerEvents="none",n.layerMode==="front"&&(o.style.zIndex="10");for(let r of e){let a=t.createElement("div");a.className=n.itemClass,a.style.position="absolute",a.style.pointerEvents="auto",a.style.top=`${r.y}px`,a.style.left=`${r.x}px`,r.pmStart!==void 0&&(a.dataset.pmStart=String(r.pmStart)),r.pmEnd!==void 0&&(a.dataset.pmEnd=String(r.pmEnd));let i=t.createElement("img");i.src=r.src,i.style.width=`${r.width}px`,i.style.height=`${r.height}px`,i.style.display="block",r.alt&&(i.alt=r.alt),r.transform&&(i.style.transform=r.transform,i.style.transformOrigin="center center"),te(r)&&ne(i,r),a.appendChild(i),o.appendChild(a);}return o}function Ie(e,t,n,o){e.classList.add(`ep-revision-${t}`,`ep-revision-${n}`),e.dataset.revisionId=String(o.revisionId),e.dataset.revisionAuthor=o.author,o.date&&(e.dataset.revisionDate=o.date);}var D={table:"layout-table",row:"layout-table-row",cell:"layout-table-cell",cellContent:"layout-table-cell-content",resizeHandle:"layout-table-resize-handle",rowResizeHandle:"layout-table-row-resize-handle",tableEdgeHandleBottom:"layout-table-edge-handle-bottom",tableEdgeHandleRight:"layout-table-edge-handle-right"};function Lt(e,t,n){let o=[],r=0;for(let a=0;a<e.blocks.length;a++){let i=e.blocks[a];if(i?.kind!=="paragraph"){let m=t.blocks[a];m&&m.kind==="table"&&(r+=m.totalHeight??0);continue}let c=i;for(let m of c.runs){if(m.kind!=="image")continue;let l=m;if(!f(l))continue;let x=l.position,h$1=l.distTop??0,y=l.distBottom??0,k=l.distLeft??12,u=l.distRight??12,g="left",p=0;if(x?.horizontal){let d=x.horizontal;d.align==="right"?(g="right",p=n-l.width):d.align==="left"?p=0:d.align==="center"?p=(n-l.width)/2:d.posOffset!==void 0&&(p=e$1(d.posOffset),g=p>n/2?"right":"left");}else l.cssFloat==="right"&&(g="right",p=n-l.width);let b=r;if(x?.vertical){let d=x.vertical;d.posOffset!==void 0?b=r+e$1(d.posOffset):d.align==="top"&&(b=0);}p=Math.max(0,Math.min(p,n-l.width)),o.push({src:l.src,width:l.width,height:l.height,alt:l.alt,transform:l.transform,x:p,y:b,side:g,distTop:h$1,distBottom:y,distLeft:k,distRight:u,wrapText:h(l.cssFloat),wrapType:l.wrapType,pmStart:l.pmStart,pmEnd:l.pmEnd});}let s=t.blocks[a];s&&s.kind==="paragraph"&&(r+=s.totalHeight);}return o}function vt(e$1,t,n,o){let r=o.createElement("div");r.className=D.cellContent,r.style.position="relative";let a=e$1.padding?.left??7,i=e$1.padding?.right??7,c=Math.max(0,t.width-a-i);r.style.width=`${c}px`;let s=Lt(e$1,t,c),m;if(s.length>0){m=s.filter(d).map(k=>{let u=k.x+k.width+k.distRight,g=k.y-k.distTop,p=k.y+k.height+k.distBottom,b=0,d=0,f=k.wrapText??"bothSides";return f==="right"?b=u:f==="left"?d=c-(k.x-k.distLeft):k.side==="left"?b=u:d=c-(k.x-k.distLeft),{leftMargin:b,rightMargin:d,topY:g,bottomY:p}});let y=s.filter(e);y.length>0&&r.appendChild(X(y,o,{layerClass:"layout-cell-floating-images-layer",itemClass:"layout-cell-floating-image",sizing:"fullSize",layerMode:"behind"}));}let l=0,x=0;for(let y=0;y<e$1.blocks.length;y++){let k=e$1.blocks[y],u=t.blocks[y];if(k?.kind==="paragraph"&&u?.kind==="paragraph"){let g=k,p=u,b=g.attrs?.spacing,d=Math.max(x,b?.before??0);l+=d,m&&m.length>0&&(p=v(g,c,{floatingZones:m,paragraphYOffset:l}));let f={blockId:g.id,width:c,height:p.totalHeight,fromLine:0,toLine:p.lines.length,pmStart:g.pmStart,pmEnd:g.pmEnd},w={...n,insideTableCell:true},S=H(f,g,p,w,{document:o});S.style.position="relative",d>0&&(S.style.marginTop=`${d}px`),r.appendChild(S),l+=p.totalHeight,x=b?.after??0;}else if(k?.kind==="table"&&u?.kind==="table"){let g=k,p=u,b=x,d=Bt(g,p,n,o);d.style.position="relative",b>0&&(d.style.marginTop=`${b}px`),r.appendChild(d),l+=b+(u.totalHeight??0),x=0;}}x>0&&(r.style.paddingBottom=`${x}px`);let h=s.filter(y=>!e(y));return h.length>0&&r.appendChild(X(h,o,{layerClass:"layout-cell-floating-images-layer",itemClass:"layout-cell-floating-image",sizing:"fullSize",layerMode:"front"})),r}function Bt(e,t,n,o){let r=o.createElement("div");r.className=`${D.table} layout-nested-table`,r.style.position="relative",r.style.width=`${t.totalWidth}px`,r.style.display="block",e.justification==="center"?(r.style.marginLeft="auto",r.style.marginRight="auto"):e.justification==="right"?r.style.marginLeft="auto":e.indent&&(r.style.marginLeft=`${e.indent}px`),r.dataset.blockId=String(e.id),e.pmStart!==void 0&&(r.dataset.pmStart=String(e.pmStart)),e.pmEnd!==void 0&&(r.dataset.pmEnd=String(e.pmEnd));let a=e.rows[0],i=a?.trackedIns,c=a?.trackedDel,s=(k,u)=>!!k&&!!u&&(k.author??"")===(u.author??"")&&(k.date??null)===(u.date??null),m=e.rows.length>0&&e.rows.every(k=>i?s(k.trackedIns,i):c?s(k.trackedDel,c):false);if(m){let k=i??c,u=i?"ins":"del";r.classList.add("ep-revision-table",`ep-revision-${u}`),r.dataset.revisionId=String(k.revisionId),r.dataset.revisionAuthor=k.author,k.date&&(r.dataset.revisionDate=k.date);}let l=[],x=0;for(let k=0;k<t.rows.length;k++)l.push(x),x+=t.rows[k]?.height??0;l.push(x);let h=new Map,y=0;for(let k=0;k<e.rows.length;k++){let u=e.rows[k],g=t.rows[k];if(!u||!g)continue;let p=Ce(u,g,k,y,t.columnWidths,e.rows.length,n,o,h,l,void 0,m);r.appendChild(p),y+=g.height;}return r.style.height=`${y}px`,r}function ge(e,t,n){let o=`border${t.charAt(0).toUpperCase()+t.slice(1)}`;if(!n||n.style==="none"||n.style==="nil"||n.width===0)e.style[o]="none";else {let r=n.width??1,a=n.color??"#000000",i=n.style??"solid";e.style[o]=`${r}px ${i} ${a}`;}}function Mt(e,t,n,o,r,a,i,c){let s=i.createElement("div");s.className=D.cell,e.trackedMarker&&e.trackedMarker.info.revisionId!==c&&Ie(s,"cell",e.trackedMarker.kind,e.trackedMarker.info),s.style.position="absolute",s.style.left=`${n}px`,s.style.top="0",s.style.width=`${t.width}px`,s.style.height=`${o}px`,s.style.overflow="hidden",s.style.boxSizing="border-box";let m=e.padding?.top??1,l=e.padding?.right??7,x=e.padding?.bottom??1,h=e.padding?.left??7;if(s.style.padding=`${m}px ${l}px ${x}px ${h}px`,e.borders&&(r.isFirstRow&&ge(s,"top",e.borders.top),ge(s,"right",e.borders.right),ge(s,"bottom",e.borders.bottom),r.isFirstCol&&ge(s,"left",e.borders.left)),e.background&&(s.style.backgroundColor=e.background),e.noWrap&&(s.style.whiteSpace="nowrap"),e.verticalAlign)switch(s.style.display="flex",s.style.flexDirection="column",e.verticalAlign){case "top":s.style.justifyContent="flex-start";break;case "center":s.style.justifyContent="center";break;case "bottom":s.style.justifyContent="flex-end";break}let y=vt(e,t,a,i);if(s.appendChild(y),e.blocks.length>0){let k=e.blocks[0],u=e.blocks[e.blocks.length-1];k&&"pmStart"in k&&k.pmStart!==void 0&&(s.dataset.pmStart=String(k.pmStart)),u&&"pmEnd"in u&&u.pmEnd!==void 0&&(s.dataset.pmEnd=String(u.pmEnd));}return s}function Ce(e,t,n,o,r,a,i,c,s,m,l,x){let h=c.createElement("div");h.className=D.row,x||(e.trackedDel?Ie(h,"row","del",e.trackedDel):e.trackedIns&&Ie(h,"row","ins",e.trackedIns)),h.style.position="absolute",h.style.left="0",h.style.top=`${o}px`,h.style.width="100%",h.style.height=`${t.height}px`,h.dataset.rowIndex=String(n);let y=new Set;if(s){for(let[,g]of s)if(g.startRow<n&&g.startRow+g.rowSpan>n)for(let p=0;p<g.colSpan;p++)y.add(g.columnIndex+p);}let k=0,u=0;for(;y.has(u);)k+=r[u]??0,u++;for(let g=0;g<e.cells.length;g++){let p=e.cells[g],b=t.cells[g];if(!p||!b)continue;let d=p.colSpan??1,f=p.rowSpan??1,w=t.height;if(f>1&&m){w=0;for(let C=n;C<n+f&&C<m.length-1;C++)w+=(m[C+1]??0)-(m[C]??0);w===0&&(w=t.height*f);}let S=n===0||l===true,P=u===0;u+d>=r.length;let I=Mt(p,b,k,w,{isFirstRow:S,isFirstCol:P},i,c,e.trackedIns?.revisionId??e.trackedDel?.revisionId);if(I.dataset.cellIndex=String(g),I.dataset.columnIndex=String(u),f>1&&(I.dataset.rowSpan=String(f)),h.appendChild(I),f>1&&s){let C=`${n}-${u}`;s.set(C,{cell:p,cellMeasure:b,columnIndex:u,startRow:n,rowSpan:f,colSpan:d,x:k,totalHeight:w});}for(let C=0;C<d&&u+C<r.length;C++)k+=r[u+C]??0;for(u+=d;y.has(u);)k+=r[u]??0,u++;}return h}function q(e,t,n,o,r={}){let a=r.document??document,i=a.createElement("div");i.className=D.table,i.style.position=o.positioning==="flow"?"relative":"absolute",i.style.width=`${e.width}px`,i.style.height=`${e.height}px`,i.style.overflow="hidden",i.dataset.blockId=String(e.blockId),i.dataset.fromRow=String(e.fromRow),i.dataset.toRow=String(e.toRow),e.pmStart!==void 0&&(i.dataset.pmStart=String(e.pmStart)),e.pmEnd!==void 0&&(i.dataset.pmEnd=String(e.pmEnd));let c=t.rows[0],s=c?.trackedIns,m=c?.trackedDel,l=(d,f)=>!!d&&!!f&&(d.author??"")===(f.author??"")&&(d.date??null)===(f.date??null),x=t.rows.length>0&&t.rows.every(d=>s?l(d.trackedIns,s):m?l(d.trackedDel,m):false);if(x){let d=s??m,f=s?"ins":"del";i.classList.add("ep-revision-table",`ep-revision-${f}`),i.dataset.revisionId=String(d.revisionId),i.dataset.revisionAuthor=d.author,d.date&&(i.dataset.revisionDate=d.date),i.style.overflow="visible";}let h=0;for(let d=0;d<n.columnWidths.length-1;d++){h+=n.columnWidths[d]??0;let f=a.createElement("div");f.className=D.resizeHandle,f.style.position="absolute",f.style.left=`${h-3}px`,f.style.top="0",f.style.width="6px",f.style.height="100%",f.style.cursor="col-resize",f.style.zIndex="10",f.dataset.columnIndex=String(d),f.dataset.tableBlockId=String(e.blockId),e.pmStart!==void 0&&(f.dataset.tablePmStart=String(e.pmStart)),i.appendChild(f);}let y=[],k=0;for(let d=0;d<n.rows.length;d++)y.push(k),k+=n.rows[d]?.height??0;y.push(k);let u=new Map,g=e.headerRowCount??0,p=0;if(g>0&&e.continuesFromPrev)for(let d=0;d<g;d++){let f=t.rows[d],w=n.rows[d];if(!f||!w)continue;let S=Ce(f,w,d,p,n.columnWidths,t.rows.length,o,a,u,y,d===0,x);S.dataset.repeatedHeader="true",i.appendChild(S),p+=w.height;}for(let d=e.fromRow;d<e.toRow;d++){let f=t.rows[d],w=n.rows[d];if(!f||!w)continue;let S=g>0&&e.continuesFromPrev?false:e.continuesFromPrev&&d===e.fromRow,T=Ce(f,w,d,p,n.columnWidths,t.rows.length,o,a,u,y,S,x);i.appendChild(T),p+=w.height;}let b=0;for(let d=e.fromRow;d<e.toRow;d++)if(b+=n.rows[d]?.height??0,d<e.toRow-1){let f=a.createElement("div");f.className=D.rowResizeHandle,f.style.position="absolute",f.style.left="0",f.style.top=`${b-3}px`,f.style.width="100%",f.style.height="6px",f.style.cursor="row-resize",f.style.zIndex="10",f.dataset.rowIndex=String(d),f.dataset.tableBlockId=String(e.blockId),e.pmStart!==void 0&&(f.dataset.tablePmStart=String(e.pmStart)),i.appendChild(f);}if(e.toRow===t.rows.length){let d=a.createElement("div");d.className=D.tableEdgeHandleBottom,d.style.position="absolute",d.style.left="0",d.style.top=`${b-3}px`,d.style.width="100%",d.style.height="6px",d.style.cursor="row-resize",d.style.zIndex="10",d.dataset.rowIndex=String(t.rows.length-1),d.dataset.tableBlockId=String(e.blockId),d.dataset.isEdge="bottom",e.pmStart!==void 0&&(d.dataset.tablePmStart=String(e.pmStart)),i.appendChild(d);}if(e.toRow===t.rows.length){let d=n.columnWidths.reduce((w,S)=>w+S,0),f=a.createElement("div");f.className=D.tableEdgeHandleRight,f.style.position="absolute",f.style.left=`${d-3}px`,f.style.top="0",f.style.width="6px",f.style.height="100%",f.style.cursor="col-resize",f.style.zIndex="10",f.dataset.columnIndex=String(n.columnWidths.length-1),f.dataset.tableBlockId=String(e.blockId),f.dataset.isEdge="right",e.pmStart!==void 0&&(f.dataset.tablePmStart=String(e.pmStart)),i.appendChild(f);}return i}var $t={textBox:"layout-textbox"};function J(e,t,n,o,r={}){let a=r.document??document,i=a.createElement("div");if(i.className=$t.textBox,i.style.position="absolute",i.style.width=`${e.width}px`,i.style.height=`${e.height}px`,i.style.overflow="hidden",i.style.boxSizing="border-box",Ht(i,e),t.fillColor&&(i.style.backgroundColor=t.fillColor),t.outlineWidth&&t.outlineWidth>0){let l=t.outlineStyle||"solid",x=t.outlineColor||"#000000";i.style.border=`${t.outlineWidth}px ${l} ${x}`;}let c=t.margins??a$1;i.style.padding=`${c.top}px ${c.right}px ${c.bottom}px ${c.left}px`,i.dataset.blockId=String(e.blockId),e.pmStart!==void 0&&(i.dataset.pmStart=String(e.pmStart)),e.pmEnd!==void 0&&(i.dataset.pmEnd=String(e.pmEnd));let s=e.width-c.left-c.right,m=0;for(let l=0;l<t.content.length;l++){let x=t.content[l],h=n.innerMeasures[l];if(!h)continue;let y={blockId:x.id,width:s,height:h.totalHeight,pmStart:x.pmStart,pmEnd:x.pmEnd,fromLine:0,toLine:h.lines.length},k=H(y,x,h,{...o,positioning:"flow"},{document:a});i.appendChild(k),m+=h.totalHeight;}return i}function Ht(e,t){!t.isFloating&&t.zIndex===void 0||(e.style.zIndex=String(t.zIndex??10));}function tt(e){return {pageWidth:e.size.w,pageHeight:e.size.h,marginLeft:e.margins.left,marginTop:e.margins.top,contentWidth:e.size.w-e.margins.left-e.margins.right,contentHeight:e.size.h-e.margins.top-e.margins.bottom}}function Re(e,t,n,o){let{x:r,side:a}=At(e,n,o),i=Ot(e,t,o);return {x:r,y:i,side:a}}function At(e,t,n){let o=e.position?.horizontal;if(!o)return e.cssFloat==="right"?{x:t-e.width,side:"right"}:{x:0,side:"left"};let r=zt(o.relativeTo,t,n);if(o.align==="right")return {x:r.size?r.base+r.size-e.width:0,side:"right"};if(o.align==="left")return {x:r.base,side:"left"};if(o.align==="center")return {x:r.size?r.base+(r.size-e.width)/2:0,side:"left"};if(o.posOffset!==void 0){let a=r.base+e$1(o.posOffset);return {x:a,side:a>t/2?"right":"left"}}return {x:r.base,side:"left"}}function zt(e,t,n){let o=n?.pageWidth??0,r=n?.marginLeft??0;switch(e){case "page":return {base:-r,size:o};case "leftMargin":return {base:-r,size:r};case "rightMargin":return {base:t,size:r};case "character":return {base:0,size:0};default:return {base:0,size:t}}}function Ot(e,t,n){let o=e.position?.vertical;if(!o)return t;let r=Dt(o.relativeTo,t,n);return o.align==="top"?r.base:o.align==="center"?r.size?r.base+(r.size-e.height)/2:t:o.align==="bottom"?r.size?r.base+r.size-e.height:t:o.posOffset!==void 0?r.base+e$1(o.posOffset):o.relativeTo==="paragraph"||o.relativeTo==="line"?t:r.base}function Dt(e,t,n){let o=n?.pageHeight??0,r=n?.marginTop??0,a=n?.contentHeight??0;switch(e){case "paragraph":case "line":return {base:t,size:0};case "page":return {base:-r,size:o};case "topMargin":return {base:-r,size:r};case "bottomMargin":return {base:a,size:r};default:return {base:0,size:a}}}function nt(e){return e?.align??e?.alignment}function Nt(e,t){let n=e.position.vertical;if(!n)return e.paragraphY;let o=nt(n),r=n.posOffset!==void 0?e$1(n.posOffset):void 0;if(n.relativeTo==="page"){if(r!==void 0)return r-t.flowTop;if(o==="top")return -t.flowTop;if(o==="bottom")return t.pageHeight-e.height-t.flowTop;if(o==="center")return (t.pageHeight-e.height)/2-t.flowTop}if(n.relativeTo==="margin"){let a=t.margins.top,i=t.pageHeight-t.margins.top-t.margins.bottom;if(r!==void 0)return a+r-t.flowTop;if(o==="top")return a-t.flowTop;if(o==="bottom")return a+i-e.height-t.flowTop;if(o==="center")return a+(i-e.height)/2-t.flowTop}return r!==void 0?e.paragraphY+r:e.paragraphY}function _t(e,t,n){let o=t.position.horizontal;if(!o){e.style.left="0";return}let r=nt(o);if(o.relativeTo==="page"){if(o.posOffset!==void 0){e.style.left=`${e$1(o.posOffset)-n.flowLeft}px`;return}if(r==="right"){e.style.left=`${n.pageWidth-t.width-n.flowLeft}px`;return}if(r==="center"){e.style.left=`${(n.pageWidth-t.width)/2-n.flowLeft}px`;return}if(r==="left"){e.style.left=`${-n.flowLeft}px`;return}}if(o.posOffset!==void 0){e.style.left=`${e$1(o.posOffset)}px`;return}if(r==="right"){e.style.left=`${n.contentWidth-t.width}px`;return}if(r==="center"){e.style.left=`${(n.contentWidth-t.width)/2}px`;return}e.style.left="0";}function ot(e,t){let n=e.tblpY??0;e.vertAnchor==="page"?n-=t.flowTop:e.vertAnchor==="margin"&&(n+=t.margins.top-t.flowTop);let o=e.tblpX??0;return e.horzAnchor==="page"?o-=t.flowLeft:e.horzAnchor==="margin"&&(o+=t.margins.left-t.flowLeft),{left:o,top:n}}function Ee(e,t,n,o){let r=n.document??document,a=r.createElement("div");a.style.position="relative";let i=t.contentWidth??600,c=[],s=0;for(let m=0;m<e.blocks.length;m++){let l=e.blocks[m],x=e.measures[m];if(!(!l||!x))if(l.kind==="paragraph"){if(x.kind!=="paragraph")continue;let h=l,y=x,k=h.attrs?.spacing?.before??0,u=s,g=[];for(let f of h.runs)if(f.kind==="image"&&"position"in f&&f.position){let w=f;c.push({src:w.src,width:w.width,height:w.height,alt:w.alt,paragraphY:u,position:w.position});}else g.push(f);let p={...h,runs:g},b={blockId:h.id,width:i,height:y.totalHeight,fromLine:0,toLine:y.lines.length,pmStart:h.pmStart,pmEnd:h.pmEnd},d=H(b,p,y,{...t,positioning:"absolute"},{document:r});d.style.top=`${s+k}px`,d.style.left="0",d.style.width=`${i}px`,a.appendChild(d),s+=y.totalHeight;}else if(l.kind==="table"){if(x.kind!=="table")continue;let h={blockId:l.id,width:x.totalWidth,height:x.totalHeight,fromRow:0,toRow:x.rows.length,pmStart:l.pmStart,pmEnd:l.pmEnd},y=q(h,l,x,{...t,positioning:"absolute"},{document:r});if(l.floating){let{left:k,top:u}=ot(l.floating,o);y.style.top=`${u}px`,y.style.left=`${k}px`,a.appendChild(y);}else y.style.top=`${s}px`,y.style.left="0",a.appendChild(y),s+=x.totalHeight;}else if(l.kind==="image"){if(x.kind!=="image")continue;let h={blockId:l.id,width:x.width,height:x.height,pmStart:l.pmStart,pmEnd:l.pmEnd},y=Z(h,l,x,{...t},{document:r});y.style.top=`${s}px`,y.style.left="0",a.appendChild(y),s+=x.height;}else if(l.kind==="textBox"){if(x.kind!=="textBox")continue;let h={blockId:l.id,width:x.width,height:x.height,pmStart:l.pmStart,pmEnd:l.pmEnd},y=J(h,l,x,{...t,positioning:"absolute"},{document:r});y.style.top=`${s}px`,y.style.left="0",a.appendChild(y),s+=x.height;}else l.kind==="sectionBreak"||l.kind==="pageBreak"||l.kind==="columnBreak"||c$2(l,"renderHeaderFooterContent");}for(let m of c){let l=r.createElement("img");l.src=m.src,l.width=m.width,l.height=m.height,m.alt&&(l.alt=m.alt),l.style.position="absolute",l.style.display="block",l.style.width=`${m.width}px`,l.style.height=`${m.height}px`,l.style.maxWidth="none",l.style.maxHeight="none",_t(l,m,o),l.style.top=`${Nt(m,o)}px`,a.appendChild(l);}return a}var me=12,rt=6;function Wt(e,t){if(e.size!==t.size)return false;for(let[n,o]of e)if(t.get(n)!==o)return false;return true}var Pe=8;function Zn(e){let t=[],n=o=>{for(let r of o)if(r.kind==="paragraph")for(let a of r.runs)a.kind==="text"&&a.footnoteRefId!=null&&t.push({footnoteId:a.footnoteRefId,pmPos:a.pmStart??0});else if(r.kind==="table")for(let a of r.rows)for(let i of a.cells)n(i.blocks);else r.kind==="textBox"&&n(r.content);};return n(e),t}function Le(e,t){let n=new Map;if(t.length===0)return n;for(let o of t)for(let r of e){let a=false;for(let i of r.fragments){let c=i.pmStart??-1,s=i.pmEnd??-1;if(c>=0&&s>=0&&o.pmPos>=c&&o.pmPos<s){let m=n.get(r.number)??[];m.includes(o.footnoteId)||m.push(o.footnoteId),n.set(r.number,m),a=true;break}}if(a)break}return n}function Gt(e,t){if(e.length===0)return [{kind:"paragraph",id:`fn-empty-${t}`,runs:[{kind:"text",text:`${t} `,fontSize:Pe,superscript:true}]}];let n=e.map(r=>{if(r.kind!=="paragraph")return r;let a=r;return {...a,runs:a.runs.map(i=>(i.kind==="text"||i.kind==="tab")&&i.fontSize==null?{...i,fontSize:Pe}:i)}}),o=n[0];if(o.kind==="paragraph"){let r={kind:"text",text:`${t} `,fontSize:Pe,superscript:true};n[0]={...o,runs:[r,...o.runs]};}return n}function jt(e,t,n,o){let r=c(e.content,{styles:o.styles??void 0,theme:o.theme??null,defaultTabStopTwips:o.defaultTabStopTwips??null}),a=c$1(r,{theme:o.theme??void 0}),i=Gt(a,t),c$2=o.measureBlocks(i,n),s=c$2.reduce((m,l)=>l.kind==="paragraph"||l.kind==="table"?m+l.totalHeight:l.kind==="image"||l.kind==="textBox"?m+l.height:m,0);return {id:e.id,displayNumber:t,blocks:i,measures:c$2,height:s}}function qn(e,t,n,o){let r=new Map,a=new Map;for(let s of e)(s.noteType==="normal"||s.noteType==null)&&a.set(s.id,s);let i=1,c=new Set;for(let s of t){if(c.has(s.footnoteId))continue;c.add(s.footnoteId);let m=a.get(s.footnoteId);m&&(r.set(s.footnoteId,jt(m,i,n,o)),i++);}return r}function it(e,t){let n=new Map;for(let[o,r]of e){let a=0;for(let i of r){let c=t.get(i);c&&(a+=c.height);}a>0&&(a+=me,n.set(o,a));}return n}function Jn(e){let{blocks:t,measures:n,layoutOpts:o,footnoteRefs:r,footnoteContentMap:a,initialLayout:i}=e,c=Le(i.pages,r),s=it(c,a);if(s.size===0)return {layout:i,pageFootnoteMap:c,converged:true};let m=i,l=false;for(let x=0;x<rt;x++){m=O$1(t,n,{...o,footnoteReservedHeights:s});let h=Le(m.pages,r),y=it(h,a);if(c=h,Wt(s,y)){s=y,l=true;break}s=y;}l||(m=O$1(t,n,{...o,footnoteReservedHeights:s}),c=Le(m.pages,r),console.warn(`[docx-editor] footnote layout did not stabilize within ${rt} passes; settling with best-effort reservation. If footnotes appear misplaced, please file a bug with the document.`));for(let[x,h]of c){let y=m.pages.find(k=>k.number===x);y&&(y.footnoteIds=h);}return {layout:m,pageFootnoteMap:c,converged:l}}function Qn(e,t,n){let o=new Map;if(!n?.package?.footnotes)return o;let r=new Map;for(let a of n.package.footnotes)a.noteType&&a.noteType!=="normal"||r.set(a.id,a);for(let[a,i]of e){let c=[];for(let s of i){let m=r.get(s);if(!m)continue;let l=t.get(s),x$1=l?.displayNumber??0;c.push({displayNumber:String(x$1),text:x(m),content:l});}c.length>0&&o.set(a,c);}return o}function Vt(e,t,n,o){let r=o.createElement("div");r.className="layout-footnote-content",r.style.position="relative",r.style.width=`${t}px`,r.style.height=`${e.height}px`;let a=0;for(let i=0;i<e.blocks.length;i++){let c=e.blocks[i],s=e.measures[i];if(!(!c||!s)){if(c.kind==="paragraph"&&s.kind==="paragraph"){let m=c.attrs?.spacing?.before??0,l={blockId:c.id,width:t,height:s.totalHeight,pmStart:c.pmStart,pmEnd:c.pmEnd,fromLine:0,toLine:s.lines.length},x=H(l,c,s,{...n,section:"body",contentWidth:t,positioning:"absolute"},{document:o});x.style.top=`${a+m}px`,x.style.left="0",x.style.width=`${t}px`,x.style.height=`${s.totalHeight}px`,r.appendChild(x),a+=s.totalHeight;}else if(c.kind==="table"&&s.kind==="table"){let m={blockId:c.id,width:s.totalWidth,height:s.totalHeight,pmStart:c.pmStart,pmEnd:c.pmEnd,fromRow:0,toRow:s.rows.length},l=q(m,c,s,{...n,section:"body",contentWidth:t,positioning:"absolute"},{document:o});l.style.top=`${a}px`,l.style.left="0",r.appendChild(l),a+=s.totalHeight;}else if(c.kind==="image"&&s.kind==="image"){let m={blockId:c.id,width:s.width,height:s.height,pmStart:c.pmStart,pmEnd:c.pmEnd},l=Z(m,c,s,{...n},{document:o});l.style.top=`${a}px`,l.style.left="0",r.appendChild(l),a+=s.height;}else if(c.kind==="textBox"&&s.kind==="textBox"){let m={blockId:c.id,width:s.width,height:s.height,pmStart:c.pmStart,pmEnd:c.pmEnd},l=J(m,c,s,{...n,section:"body",contentWidth:t,positioning:"absolute"},{document:o});l.style.top=`${a}px`,l.style.left="0",r.appendChild(l),a+=s.height;}}}return r}function Kt(e,t){let n=t.createElement("div");n.style.fontSize="10px",n.style.lineHeight="1.3",n.style.marginBottom="4px",n.style.color="#000";let o=t.createElement("sup");o.textContent=e.displayNumber,o.style.fontSize="7px",o.style.marginRight="2px",n.appendChild(o);let r=t.createTextNode(" "+e.text);return n.appendChild(r),n}function at(e){let t=me;for(let n of e)n.content&&(t+=n.content.height);return t}function st(e,t,n,o){let r=o.createElement("div");r.className="layout-footnote-area",r.style.width=`${t}px`;let a=o.createElement("div"),i=.5,c=(me-i)/2;a.style.width="33%",a.style.height=`${i}px`,a.style.backgroundColor="#000",a.style.marginBottom=`${c}px`,a.style.marginTop=`${c}px`,r.appendChild(a);for(let s of e)r.appendChild(s.content?Vt(s.content,t,n,o):Kt(s,o));return r}function ve(e,t,n){let o={pageNumber:e.number,totalPages:t,section:"body",resolvedCommentIds:n.resolvedCommentIds},r={...n};if(n.titlePg&&e.number===1&&(r.headerContent=n.firstPageHeaderContent,r.footerContent=n.firstPageFooterContent),n.footnotesByPage){let a=n.footnotesByPage.get(e.number);a&&a.length>0&&(r.footnoteArea=a);}return {context:o,pageOptions:r}}function lt(e){let t=[];t.push(`s:${e.size.w},${e.size.h}`),t.push(`m:${e.margins.top},${e.margins.right},${e.margins.bottom},${e.margins.left}`),t.push(`n:${e.number}`),e.footnoteReservedHeight&&t.push(`fn:${e.footnoteReservedHeight}`);for(let n of e.fragments){let o=`${n.kind}:${n.blockId},${n.x},${n.y},${n.width},${n.height}`;n.pmStart!==void 0&&(o+=`,ps:${n.pmStart}`),n.pmEnd!==void 0&&(o+=`,pe:${n.pmEnd}`),n.kind==="paragraph"?o+=`,fl:${n.fromLine},tl:${n.toLine}`:n.kind==="table"&&(o+=`,fr:${n.fromRow},tr:${n.toRow}`),t.push(o);}return t.join("|")}function Yt(e){let t=[];return e.headerContent&&t.push(`hdr:${e.headerContent.blocks.length},${e.headerContent.height},${e.headerContent.visualTop??0},${e.headerContent.visualBottom??e.headerContent.height}`),e.footerContent&&t.push(`ftr:${e.footerContent.blocks.length},${e.footerContent.height},${e.footerContent.visualTop??0},${e.footerContent.visualBottom??e.footerContent.height}`),e.firstPageHeaderContent&&t.push(`fp-hdr:${e.firstPageHeaderContent.blocks.length},${e.firstPageHeaderContent.height}`),e.firstPageFooterContent&&t.push(`fp-ftr:${e.firstPageFooterContent.blocks.length},${e.firstPageFooterContent.height}`),e.titlePg&&t.push("titlePg"),e.theme&&t.push(`thm:${e.theme.name??"default"}`),e.pageBorders&&t.push(`pb:${JSON.stringify(e.pageBorders)}`),e.headerDistance!==void 0&&t.push(`hd:${e.headerDistance}`),e.footerDistance!==void 0&&t.push(`fd:${e.footerDistance}`),t.join("|")}function Ut(e,t){e.style.display="flex",e.style.flexDirection="column",e.style.alignItems="center",e.style.gap=`${t}px`,e.style.padding=`${t}px`,e.style.backgroundColor="var(--doc-bg, #f8f9fa)";}var he=2,Xt=8;function Zt(e,t,n={}){let o=e.length,r=n.pageGap??24,a=t,i=a.__pageRenderState,c=Yt(n),s=o>=Xt;if(i&&i.optionsHash===c&&s){let g=i.pageStates,p=i.pageDataMap,b=a.__pageObserver,d=[];for(let S of e)d.push(lt(S));let f=i.totalPages!==o,w=Math.min(g.length,e.length);for(let S=0;S<w;S++){let T=g[S],P=d[S];if(T.fingerprint===P&&!f){let C=p.get(T.element);C&&(C.page=e[S]);continue}let F=T.element,I=p.get(F);I&&(I.page=e[S],I.rendered&&qt(F,p,o,n)),T.fingerprint=P,ie(F,e[S].size.w,e[S].size.h,n),F.dataset.pageNumber=String(e[S].number);}if(e.length>g.length){let S=n.document??document;for(let T=g.length;T<e.length;T++){let P=e[T],F=S.createElement("div");F.className=n.pageClassName??N.page,F.dataset.pageNumber=String(P.number),F.dataset.pageIndex=String(T),ie(F,P.size.w,P.size.h,n),t.appendChild(F),g.push({element:F,fingerprint:d[T]}),p.set(F,{page:P,index:T,rendered:false}),b&&b.observe(F);}}if(e.length<g.length){for(let S=g.length-1;S>=e.length;S--){let T=g[S].element;b&&b.unobserve(T),p.delete(T),t.removeChild(T);}g.length=e.length;}for(let S=0;S<g.length;S++){let T=p.get(g[S].element);T&&(T.index=S);}return i.totalPages=o,i.currentOptions=n,"incremental"}let l=a.__pageObserver;l&&(l.disconnect(),a.__pageObserver=void 0),t.innerHTML="",a.__pageRenderState=void 0,Ut(t,r);let x=[],h=[];for(let g=0;g<e.length;g++){let p=e[g];if(h.push(lt(p)),s){let d=(n.document??document).createElement("div");d.className=n.pageClassName??N.page,d.dataset.pageNumber=String(p.number),d.dataset.pageIndex=String(g),ie(d,p.size.w,p.size.h,n),t.appendChild(d),x.push(d);}else {let{context:b,pageOptions:d}=ve(p,o,n),f=ye(p,b,d);t.appendChild(f),x.push(f);}}if(!s)return "full";let y=new Map;for(let g=0;g<e.length;g++)y.set(x[g],{page:e[g],index:g,rendered:false});let k=new IntersectionObserver(g=>{let p=a.__pageRenderState;if(!p)return;let{currentOptions:b,totalPages:d,pageDataMap:f}=p;for(let P of g){let F=P.target,I=f.get(F);if(I&&P.isIntersecting){ue(F,f,d,b);for(let C=-he;C<=he;C++){let R=I.index+C;R>=0&&R<p.pageStates.length&&R!==I.index&&ue(p.pageStates[R].element,f,d,b);}}}let w=window.innerHeight,S=w*3,T=new Set;for(let[P,F]of f){if(!F.rendered)continue;let I=P.getBoundingClientRect();I.bottom>-S&&I.top<w+S&&T.add(F.index);}for(let[P,F]of f){if(!F.rendered)continue;let I=false;for(let C of T)if(Math.abs(F.index-C)<=he+1){I=true;break}!I&&T.size>0&&Jt(P,f);}},{root:null,rootMargin:"1500px 0px 1500px 0px"});for(let g of x)k.observe(g);a.__pageObserver=k,a.__pageRenderState={pageStates:x.map((g,p)=>({element:g,fingerprint:h[p]})),totalPages:o,optionsHash:c,pageDataMap:y,currentOptions:n};let u=Math.min(e.length,he+3);for(let g=0;g<u;g++)ue(x[g],y,o,n);return "full"}function ue(e,t,n,o){let r=t.get(e);if(!r||r.rendered)return;let{context:a,pageOptions:i}=ve(r.page,n,o),c=ye(r.page,a,i);for(;c.firstChild;)e.appendChild(c.firstChild);r.rendered=true;}function qt(e,t,n,o){let r=t.get(e);if(!r)return;let{context:a,pageOptions:i}=ve(r.page,n,o),s=ye(r.page,a,i).querySelector(`.${N.content}`),m=e.querySelector(`.${N.content}`);s&&m?e.replaceChild(s,m):(e.innerHTML="",r.rendered=false,ue(e,t,n,o));}function Jt(e,t){let n=t.get(e);!n||!n.rendered||(e.innerHTML="",n.rendered=false);}var N={page:"layout-page",content:"layout-page-content",header:"layout-page-header",footer:"layout-page-footer"};function ie(e,t,n,o){e.style.position="relative",e.style.width=`${t}px`,e.style.height=`${n}px`,e.style.backgroundColor=o.backgroundColor??"#ffffff",e.style.overflow="hidden",e.style.fontFamily=a("Calibri").cssFallback,e.style.fontSize=`${1056/72}px`,e.style.color="#000000",o.showBorders&&(e.style.border="1px solid #ccc"),o.showShadow&&(e.style.boxShadow="0 2px 8px rgba(0, 0, 0, 0.15)");}function Qt(e,t){switch(t??"allPages"){case "firstPage":return e===1;case "notFirstPage":return e!==1;default:return true}}function be(e){return e?.space!==void 0?i(e.space):0}function xe(e,t,n,o){if(!t||t.style==="none"||t.style==="nil")return;let r=c$3(t,n,o);for(let[s,m]of Object.entries(r))e.style[s]=String(m);let a=`border${n}Style`,i=`border${n}Width`;if(e.style[a]==="double"){let s=parseFloat(e.style[i]);(!Number.isFinite(s)||s<3)&&(e.style[i]="3px");}}function en(e,t,n){let o=t.pageBorders;if(!o||!Qt(e.number,o.display)||![o.top,o.bottom,o.left,o.right].some(x=>x&&x.style!=="none"&&x.style!=="nil"))return null;let a=o.offsetFrom??"text",i=be(o.top),c=be(o.right),s=be(o.bottom),m=be(o.left),l=n.createElement("div");return l.className="layout-page-border",l.style.position="absolute",l.style.pointerEvents="none",l.style.boxSizing="border-box",l.style.zIndex=o.zOrder==="back"?"0":"20",a==="page"?(l.style.top=`${i}px`,l.style.right=`${c}px`,l.style.bottom=`${s}px`,l.style.left=`${m}px`):(l.style.top=`${Math.max(0,e.margins.top-i)}px`,l.style.right=`${Math.max(0,e.margins.right-c)}px`,l.style.bottom=`${Math.max(0,e.margins.bottom-s)}px`,l.style.left=`${Math.max(0,e.margins.left-m)}px`),xe(l,o.top,"Top",t.theme),xe(l,o.bottom,"Bottom",t.theme),xe(l,o.left,"Left",t.theme),xe(l,o.right,"Right",t.theme),l}function tn(e,t){let n=t.margins;e.style.position="absolute",e.style.top=`${n.top}px`,e.style.left=`${n.left}px`,e.style.right=`${n.right}px`,e.style.bottom=`${n.bottom}px`,e.style.overflow="visible";}function nn(e,t,n){e.style.position="absolute",e.style.left=`${t.x-n.left}px`,e.style.top=`${t.y-n.top}px`,e.style.width=`${t.width}px`,"height"in t&&(e.style.height=`${t.height}px`);}function on(e,t,n,o){let r=[];for(let a of e.runs){if(a.kind!=="image")continue;let i=a;if(!f(i))continue;let c=i.distTop??0,s=i.distBottom??0,m=i.distLeft??12,l=i.distRight??12,{x,y:h$1,side:y}=Re(i,t,n,o);r.push({src:i.src,width:i.width,height:i.height,alt:i.alt,transform:i.transform,side:y,x,y:h$1,distTop:c,distBottom:s,distLeft:m,distRight:l,pmStart:i.pmStart,pmEnd:i.pmEnd,wrapText:h(i.cssFloat),wrapType:i.wrapType,cropTop:i.cropTop,cropRight:i.cropRight,cropBottom:i.cropBottom,cropLeft:i.cropLeft,opacity:i.opacity});}return r}function ye(e$1,t,n={}){let o=n.document??document,r=o.createElement("div");r.className=n.pageClassName??N.page,r.dataset.pageNumber=String(e$1.number),ie(r,e$1.size.w,e$1.size.h,n);let a=en(e$1,n,o);a&&n.pageBorders?.zOrder==="back"&&r.appendChild(a);let i=o.createElement("div");i.className=N.content,tn(i,e$1);let c=tt(e$1),s=c.contentWidth,m=[],l=[];for(let p of e$1.fragments)if(p.kind==="paragraph"&&n.blockLookup){let b=n.blockLookup.get(String(p.blockId));if(b?.block.kind==="paragraph"){let d=b.block,f=p.y-e$1.margins.top,w=on(d,f,s,c);m.push(...w);}}for(let p of m)d(p)&&l.push({side:p.side,x:p.x,y:p.y,width:p.width,height:p.height,distTop:p.distTop,distBottom:p.distBottom,distLeft:p.distLeft,distRight:p.distRight,wrapText:p.wrapText,wrapType:p.wrapType});if(n.blockLookup)for(let p of e$1.fragments){if(p.kind!=="table")continue;let b=n.blockLookup.get(String(p.blockId));if(b?.block.kind!=="table")continue;let f=b.block.floating;if(!f)continue;let w=p.x-e$1.margins.left,S=p.y-e$1.margins.top,T=f.topFromText??0,P=f.bottomFromText??0,F=f.leftFromText??12,I=f.rightFromText??12,C=w<s/2?"left":"right";l.push({side:C,x:w,y:S,width:p.width,height:p.height,distTop:T,distBottom:P,distLeft:F,distRight:I});}if(n.blockLookup)for(let p of e$1.fragments){if(p.kind!=="textBox")continue;let b=n.blockLookup.get(String(p.blockId));if(b?.block.kind!=="textBox")continue;let d=b.block;if(!E(d))continue;let f=p.y-e$1.margins.top,w=Re({width:p.width,height:p.height,position:d.position,cssFloat:d.cssFloat},f,s,c);p.x=e$1.margins.left+w.x,p.y=e$1.margins.top+w.y,F(d)&&l.push({side:w.side,x:w.x,y:w.y,width:p.width,height:p.height,distTop:d.distTop??0,distBottom:d.distBottom??0,distLeft:d.distLeft??12,distRight:d.distRight??12,wrapText:d.wrapText,wrapType:d.wrapType});}let x=l.length>0?p(l,s):[],h=m.filter(e),y=m.filter(p=>!e(p));if(h.length>0){let p=X(h,o,{layerClass:"layout-floating-images-layer",itemClass:"layout-page-floating-image",sizing:"inset0",layerMode:"behind"});i.appendChild(p);}let k=p=>{if(p.kind!=="paragraph"||!n.blockLookup||!p.blockId)return;let b=n.blockLookup.get(String(p.blockId));if(b?.block.kind==="paragraph")return b.block.attrs?.borders},u,g=new Map;for(let p=0;p<e$1.fragments.length;p++){let b=e$1.fragments[p],d,f={...t,section:"body",contentWidth:s},w=b.y-e$1.margins.top;if(n.blockLookup&&b.blockId){let S=n.blockLookup.get(String(b.blockId));if(b.kind==="paragraph"&&S?.block.kind==="paragraph"&&S?.measure.kind==="paragraph"){let T=S.block,P=p+1<e$1.fragments.length?k(e$1.fragments[p+1]):void 0,F=String(b.blockId),I=g.get(F);I||(I=new Set,g.set(F,I));let C=S.measure;x.length>0&&(C=v(T,s,{floatingZones:x,paragraphYOffset:w})),d=H(b,T,C,f,{document:o,prevBorders:u,nextBorders:P,renderedInlineImageKeys:I}),u=T.attrs?.borders;}else b.kind==="table"&&S?.block.kind==="table"&&S?.measure.kind==="table"?(d=q(b,S.block,S.measure,f,{document:o}),u=void 0):b.kind==="image"&&S?.block.kind==="image"&&S?.measure.kind==="image"?(d=Z(b,S.block,S.measure,f,{document:o}),u=void 0):b.kind==="textBox"&&S?.block.kind==="textBox"&&S?.measure.kind==="textBox"?(d=J(b,S.block,S.measure,f,{document:o}),u=void 0):(d=Te(b,f,{document:o}),u=void 0);}else d=Te(b,f,{document:o}),u=void 0;nn(d,b,{left:e$1.margins.left,top:e$1.margins.top}),i.appendChild(d);}if(y.length>0){let p=X(y,o,{layerClass:"layout-floating-images-layer",itemClass:"layout-page-floating-image",sizing:"inset0",layerMode:"front"});i.appendChild(p);}if(e$1.columns&&e$1.columns.separator&&e$1.columns.count>1){let p=e$1.columns.count,b=e$1.columns.gap,d=(s-(p-1)*b)/p,f=e$1.size.h-e$1.margins.top-e$1.margins.bottom;for(let w=0;w<p-1;w++){let S=(w+1)*d+w*b+b/2,T=o.createElement("div");T.style.position="absolute",T.style.left=`${S}px`,T.style.top="0",T.style.height=`${f}px`,T.style.width="0.5px",T.style.backgroundColor="#000",T.style.pointerEvents="none",i.appendChild(T);}}if(n.footnoteArea&&n.footnoteArea.length>0){let p=st(n.footnoteArea,s,t,o);p.style.position="absolute";let b=Math.max(e$1.footnoteReservedHeight??0,at(n.footnoteArea)),d=e$1.size.h-e$1.margins.bottom-e$1.margins.top;p.style.top=`${Math.max(-e$1.margins.top,d-b)}px`,p.style.left="0",p.style.right="0",i.appendChild(p);}r.appendChild(i);{let b=n.headerDistance??e$1.margins.header??48,d=e$1.size.w-e$1.margins.left-e$1.margins.right,f=Math.max(e$1.margins.top-b,48),w=n.headerContent?.visualTop??0,S=n.headerContent?.visualBottom??n.headerContent?.height??0,T=Math.max(S-w,24),P=S>f,F=o.createElement("div");F.className=N.header,F.style.position="absolute",F.style.top=`${b+w}px`,F.style.left=`${e$1.margins.left}px`,F.style.right=`${e$1.margins.right}px`,F.style.width=`${d}px`,F.style.height=`${T}px`,F.style.minHeight=`${T}px`;let I=!P;if(n.headerContent&&n.headerContent.blocks.length>0){let C={flowTop:b,flowLeft:e$1.margins.left,contentWidth:d,pageWidth:e$1.size.w,pageHeight:e$1.size.h,margins:e$1.margins},R=Ee(n.headerContent,{...t,section:"header",contentWidth:d},n,C);R.style.top=`${-w}px`,R.querySelector("img")&&(I=false),F.appendChild(R);}I&&(F.style.maxHeight=`${f}px`,F.style.overflow="hidden"),r.appendChild(F);}{let b=n.footerDistance??e$1.margins.footer??48,d=e$1.size.w-e$1.margins.left-e$1.margins.right,f=Math.max(e$1.margins.bottom-b,48),w=n.footerContent?.visualTop??0,S=n.footerContent?.visualBottom??n.footerContent?.height??0,T=Math.max(S-w,24),P=T>f,F=o.createElement("div");F.className=N.footer,F.style.position="absolute",F.style.top=`${e$1.size.h-b-T}px`,F.style.left=`${e$1.margins.left}px`,F.style.right=`${e$1.margins.right}px`,F.style.width=`${d}px`,F.style.height=`${T}px`,F.style.minHeight=`${T}px`;let I=!P;if(n.footerContent&&n.footerContent.blocks.length>0){let C={flowTop:e$1.size.h-b-(n.footerContent?.height??0),flowLeft:e$1.margins.left,contentWidth:d,pageWidth:e$1.size.w,pageHeight:e$1.size.h,margins:e$1.margins},R=Ee(n.footerContent,{...t,section:"footer",contentWidth:d},n,C);R.style.top=`${-w}px`,R.querySelector("img")&&(I=false),F.appendChild(R);}I&&(F.style.maxHeight=`${f}px`,F.style.overflow="hidden"),r.appendChild(F);}return a&&n.pageBorders?.zOrder!=="back"&&r.appendChild(a),r}export{ie as A,ye as B,me as a,rt as b,Wt as c,Zn as d,Le as e,Gt as f,jt as g,qn as h,it as i,Jn as j,Qn as k,Y as l,Te as m,Ke as n,Z as o,Qe as p,fe as q,H as r,X as s,D as t,q as u,$t as v,J as w,ot as x,Zt as y,N as z};
|