@eigenpal/docx-editor-core 1.5.0 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent/index.d.mts +4 -4
- package/dist/agent/index.d.ts +4 -4
- package/dist/agent/index.js +1 -1
- package/dist/agent/index.mjs +1 -1
- package/dist/chunk-2KPOGFFR.js +1 -0
- package/dist/{chunk-NPFFCPZ6.js → chunk-2KUOYHXX.js} +1 -1
- package/dist/{chunk-WXSGCEBZ.js → chunk-2ZTKTE7P.js} +1 -1
- package/dist/{chunk-C45EFOVP.js → chunk-34DJT72K.js} +1 -1
- package/dist/chunk-3HLRRK6N.mjs +2 -0
- package/dist/{chunk-COV4LHQ7.js → chunk-4272FQ2E.js} +1 -1
- package/dist/chunk-4DCTKHS5.js +1 -0
- package/dist/chunk-4QJEMD23.mjs +4 -0
- package/dist/chunk-4QSFBX26.mjs +1 -0
- package/dist/chunk-4SZAFWLV.mjs +1 -0
- package/dist/{chunk-WYFK4QOF.mjs → chunk-5JULVEYK.mjs} +1 -1
- package/dist/chunk-6AGU57TL.mjs +1 -0
- package/dist/{chunk-T4O4PFJD.mjs → chunk-6ENZQGYR.mjs} +1 -1
- package/dist/chunk-6KYOT4E7.js +4 -0
- package/dist/chunk-77X765ZO.js +1 -0
- package/dist/chunk-7UMOUKSF.js +1 -0
- package/dist/chunk-AXVWVIIN.js +1 -0
- package/dist/chunk-B6FA4MJ5.mjs +1 -0
- package/dist/chunk-BBJMUBTD.mjs +1 -0
- package/dist/chunk-BJSG6TEG.js +1 -0
- package/dist/chunk-BKP5QMTS.js +1 -0
- package/dist/{chunk-3HENAL6V.mjs → chunk-C57BOE7B.mjs} +1 -1
- package/dist/{chunk-3SJQRYO7.js → chunk-CDGV7CLS.js} +1 -1
- package/dist/{chunk-TV6JLFY5.js → chunk-CWPIXUU2.js} +1 -1
- package/dist/chunk-DX5XU6JN.js +1 -0
- package/dist/chunk-E7UN3PVC.mjs +1 -0
- package/dist/chunk-EJ2JAYRI.js +1 -0
- package/dist/{chunk-TDYWEVAE.js → chunk-F44XU6G5.js} +1 -1
- package/dist/{chunk-TE2AF7FM.js → chunk-FETIBXTH.js} +1 -1
- package/dist/chunk-GLPOVLZD.mjs +1 -0
- package/dist/{chunk-M7KTKPGO.mjs → chunk-HEJJXAXN.mjs} +1 -1
- package/dist/{chunk-5WINQXA3.js → chunk-ILPNMG7Q.js} +1 -1
- package/dist/chunk-IM56AITE.mjs +1 -0
- package/dist/chunk-KK673XRZ.mjs +1 -0
- package/dist/chunk-KNY7SXPJ.mjs +1 -0
- package/dist/{chunk-M3UL6EUU.mjs → chunk-KSW6W2EK.mjs} +2 -2
- package/dist/chunk-LVUL7O27.js +1 -0
- package/dist/{chunk-O2643IUW.js → chunk-LW5OFHSW.js} +2 -2
- package/dist/chunk-M65C4SQJ.mjs +2 -0
- package/dist/chunk-MWOHCSZE.js +1 -0
- package/dist/chunk-NO6PIL32.mjs +1 -0
- package/dist/chunk-NTYJIOUE.js +2 -0
- package/dist/{chunk-WWVIVYX6.mjs → chunk-NY36MZ55.mjs} +1 -1
- package/dist/chunk-PJEB3ZWG.mjs +3 -0
- package/dist/chunk-Q2VALXEU.js +3 -0
- package/dist/{chunk-6KM4VW4L.js → chunk-RGHRXIIZ.js} +3 -3
- package/dist/chunk-RRJKF2XI.mjs +1 -0
- package/dist/{chunk-GB7RICH6.js → chunk-T3UP6LF5.js} +1 -1
- package/dist/chunk-UC7JW66O.mjs +1 -0
- package/dist/{chunk-P7HWOJC5.js → chunk-V3NE7Q22.js} +1 -1
- package/dist/chunk-WCB25ESG.mjs +1 -0
- package/dist/{chunk-SKBHY5MK.mjs → chunk-WEQA5PPW.mjs} +1 -1
- package/dist/{chunk-CBKJOPOW.mjs → chunk-WQJWT4RB.mjs} +1 -1
- package/dist/chunk-WWG6PUWU.js +1 -0
- package/dist/{chunk-PYDX4MOT.mjs → chunk-XTPT4TNP.mjs} +1 -1
- package/dist/{chunk-QUM4DFRE.mjs → chunk-YMXWLXVF.mjs} +1 -1
- package/dist/{content-eG_Rtl0l.d.ts → content-BebvPfXc.d.ts} +1 -1
- package/dist/{content-BlWiORm-.d.mts → content-CbBCrsr0.d.mts} +1 -1
- package/dist/{contentControlValues-CO7pUqOf.d.ts → contentControlValues-Com1GnZS.d.ts} +1 -1
- package/dist/{contentControlValues-DfYN9BZ8.d.mts → contentControlValues-DVJyudKU.d.mts} +1 -1
- package/dist/core-plugins.d.mts +2 -2
- package/dist/core-plugins.d.ts +2 -2
- package/dist/core-plugins.js +1 -1
- package/dist/core-plugins.mjs +1 -1
- package/dist/core.d.mts +7 -7
- package/dist/core.d.ts +7 -7
- package/dist/core.js +1 -1
- package/dist/core.mjs +1 -1
- package/dist/docx/index.d.mts +2 -2
- package/dist/docx/index.d.ts +2 -2
- package/dist/docx/index.js +1 -1
- package/dist/docx/index.mjs +1 -1
- package/dist/docx/parser.d.mts +2 -2
- package/dist/docx/parser.d.ts +2 -2
- package/dist/docx/parser.js +1 -1
- package/dist/docx/parser.mjs +1 -1
- package/dist/docx/rezip.d.mts +2 -2
- package/dist/docx/rezip.d.ts +2 -2
- package/dist/docx/serializer/index.d.mts +3 -3
- package/dist/docx/serializer/index.d.ts +3 -3
- package/dist/editor/index.d.mts +2 -2
- package/dist/editor/index.d.ts +2 -2
- package/dist/editor/index.js +1 -1
- package/dist/editor/index.mjs +1 -1
- package/dist/executor-FHL5D4CB.js +1 -0
- package/dist/executor-FL6XGVP3.mjs +1 -0
- package/dist/{fontLoader-3MFD_Hj2.d.mts → fontLoader-B4uFKpAy.d.mts} +1 -1
- package/dist/{fontLoader-C6VvBUVB.d.ts → fontLoader-D9SBYuZZ.d.ts} +1 -1
- package/dist/{headerFooterLayout-bdHWlU6g.d.ts → headerFooterLayout-CtVsfqxQ.d.ts} +1 -1
- package/dist/{headerFooterLayout-DJb-dV7X.d.mts → headerFooterLayout-D2LZLkDC.d.mts} +1 -1
- package/dist/headless.d.mts +5 -5
- package/dist/headless.d.ts +5 -5
- package/dist/headless.js +1 -1
- package/dist/headless.mjs +1 -1
- package/dist/layout-bridge/clickToPositionDom.js +1 -1
- package/dist/layout-bridge/clickToPositionDom.mjs +1 -1
- package/dist/layout-bridge/index.d.mts +67 -5
- package/dist/layout-bridge/index.d.ts +67 -5
- package/dist/layout-bridge/index.js +1 -1
- package/dist/layout-bridge/index.mjs +1 -1
- package/dist/layout-bridge/measuring/index.d.mts +2 -2
- package/dist/layout-bridge/measuring/index.d.ts +2 -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 +2 -2
- package/dist/layout-bridge/toFlowBlocks.d.ts +2 -2
- package/dist/layout-bridge/toFlowBlocks.js +1 -1
- package/dist/layout-bridge/toFlowBlocks.mjs +1 -1
- package/dist/layout-engine/index.d.mts +2 -2
- package/dist/layout-engine/index.d.ts +2 -2
- package/dist/layout-engine/index.js +1 -1
- package/dist/layout-engine/index.mjs +1 -1
- package/dist/layout-engine/types.d.mts +2 -2
- package/dist/layout-engine/types.d.ts +2 -2
- package/dist/layout-painter/index.d.mts +3 -3
- package/dist/layout-painter/index.d.ts +3 -3
- package/dist/layout-painter/index.js +1 -1
- package/dist/layout-painter/index.mjs +1 -1
- package/dist/layout-painter/renderPage.d.mts +3 -3
- package/dist/layout-painter/renderPage.d.ts +3 -3
- package/dist/layout-painter/renderPage.js +1 -1
- package/dist/layout-painter/renderPage.mjs +1 -1
- package/dist/managers/AutoSaveManager.d.mts +2 -2
- package/dist/managers/AutoSaveManager.d.ts +2 -2
- package/dist/managers/TableSelectionManager.d.mts +2 -2
- package/dist/managers/TableSelectionManager.d.ts +2 -2
- package/dist/managers/types.d.mts +2 -2
- package/dist/managers/types.d.ts +2 -2
- package/dist/mcp-cli.mjs +23 -23
- package/dist/mcp.d.mts +2 -2
- package/dist/mcp.d.ts +2 -2
- package/dist/mcp.js +7 -7
- package/dist/mcp.mjs +1 -1
- package/dist/{nodes-BJef4KFW.d.ts → nodes-Bd6tTkp0.d.ts} +1 -1
- package/dist/{nodes-RfTS-NSv.d.mts → nodes-BvO8GGD4.d.mts} +1 -1
- package/dist/prosemirror/applyFormatting.d.mts +34 -4
- package/dist/prosemirror/applyFormatting.d.ts +34 -4
- package/dist/prosemirror/applyFormatting.js +1 -1
- package/dist/prosemirror/applyFormatting.mjs +1 -1
- package/dist/prosemirror/commands/formatting.js +1 -1
- package/dist/prosemirror/commands/formatting.mjs +1 -1
- package/dist/prosemirror/commands/index.d.mts +2 -1
- package/dist/prosemirror/commands/index.d.ts +2 -1
- package/dist/prosemirror/commands/index.js +1 -1
- package/dist/prosemirror/commands/index.mjs +1 -1
- package/dist/prosemirror/commands/paragraph.js +1 -1
- package/dist/prosemirror/commands/paragraph.mjs +1 -1
- package/dist/prosemirror/commands/sectionBreak.d.mts +25 -0
- package/dist/prosemirror/commands/sectionBreak.d.ts +25 -0
- package/dist/prosemirror/commands/sectionBreak.js +1 -0
- package/dist/prosemirror/commands/sectionBreak.mjs +1 -0
- package/dist/prosemirror/commentIdAllocator.d.mts +2 -2
- package/dist/prosemirror/commentIdAllocator.d.ts +2 -2
- package/dist/prosemirror/commentOps.d.mts +2 -2
- package/dist/prosemirror/commentOps.d.ts +2 -2
- package/dist/prosemirror/conversion/fromProseDoc.d.mts +2 -2
- package/dist/prosemirror/conversion/fromProseDoc.d.ts +2 -2
- package/dist/prosemirror/conversion/fromProseDoc.js +1 -1
- package/dist/prosemirror/conversion/fromProseDoc.mjs +1 -1
- package/dist/prosemirror/conversion/index.d.mts +2 -2
- package/dist/prosemirror/conversion/index.d.ts +2 -2
- package/dist/prosemirror/conversion/index.js +1 -1
- package/dist/prosemirror/conversion/index.mjs +1 -1
- package/dist/prosemirror/extensions/index.js +1 -1
- package/dist/prosemirror/extensions/index.mjs +1 -1
- package/dist/prosemirror/index.d.mts +4 -4
- package/dist/prosemirror/index.d.ts +4 -4
- package/dist/prosemirror/index.js +2 -2
- package/dist/prosemirror/index.mjs +1 -1
- package/dist/prosemirror/plugins/index.d.mts +2 -2
- package/dist/prosemirror/plugins/index.d.ts +2 -2
- package/dist/prosemirror/plugins/index.js +1 -1
- package/dist/prosemirror/plugins/index.mjs +1 -1
- package/dist/prosemirror/queries.d.mts +2 -2
- package/dist/prosemirror/queries.d.ts +2 -2
- package/dist/prosemirror/schema/index.d.mts +3 -3
- package/dist/prosemirror/schema/index.d.ts +3 -3
- package/dist/prosemirror/schema/index.js +1 -1
- package/dist/prosemirror/schema/index.mjs +1 -1
- package/dist/prosemirror/utils/extractTrackedChanges.d.mts +2 -2
- package/dist/prosemirror/utils/extractTrackedChanges.d.ts +2 -2
- package/dist/{sectionPropertiesSerializer-S8J1V9mb.d.ts → sectionPropertiesSerializer-CzgskSoA.d.ts} +1 -1
- package/dist/{sectionPropertiesSerializer-C8XCmzE4.d.mts → sectionPropertiesSerializer-D3yI82iZ.d.mts} +1 -1
- package/dist/types/content.d.mts +2 -2
- package/dist/types/content.d.ts +2 -2
- package/dist/types/content.js +1 -1
- package/dist/types/content.mjs +1 -1
- package/dist/types/document.d.mts +3 -3
- package/dist/types/document.d.ts +3 -3
- package/dist/types/document.js +1 -1
- package/dist/types/document.mjs +1 -1
- package/dist/utils/cardStyles.js +1 -1
- package/dist/utils/cardStyles.mjs +1 -1
- package/dist/utils/comments.d.mts +2 -2
- package/dist/utils/comments.d.ts +2 -2
- package/dist/utils/index.d.mts +37 -4
- package/dist/utils/index.d.ts +37 -4
- package/dist/utils/index.js +3 -3
- package/dist/utils/index.mjs +3 -3
- package/dist/utils/stylePreview.d.mts +83 -0
- package/dist/utils/stylePreview.d.ts +83 -0
- package/dist/utils/stylePreview.js +1 -0
- package/dist/utils/stylePreview.mjs +1 -0
- package/dist/utils/units.d.mts +7 -1
- package/dist/utils/units.d.ts +7 -1
- package/dist/utils/units.js +1 -1
- package/dist/utils/units.mjs +1 -1
- package/dist/{variableDetector-CN9_pUR_.d.mts → variableDetector-D2-xDa2O.d.mts} +1 -1
- package/dist/{variableDetector-o4Rb2Csy.d.ts → variableDetector-d-PpDlNV.d.ts} +1 -1
- package/dist/{watermark-DAcnAs_J.d.mts → watermark-D90356ZM.d.mts} +7 -1
- package/dist/{watermark-DAcnAs_J.d.ts → watermark-D90356ZM.d.ts} +7 -1
- package/package.json +17 -1
- package/dist/chunk-4Q2IP5FW.js +0 -1
- package/dist/chunk-4RQAAKQI.mjs +0 -1
- package/dist/chunk-5HA66FH4.mjs +0 -1
- package/dist/chunk-7OW3VCZE.mjs +0 -1
- package/dist/chunk-AA6D2C6R.js +0 -4
- package/dist/chunk-AMJNIGO2.mjs +0 -2
- package/dist/chunk-BHBOAP6Z.js +0 -3
- package/dist/chunk-BTSL4AYY.js +0 -1
- package/dist/chunk-CUY2THAO.mjs +0 -1
- package/dist/chunk-DKKTY56Q.js +0 -1
- package/dist/chunk-DZ3FN3JI.js +0 -2
- package/dist/chunk-ENIWJBS7.mjs +0 -2
- package/dist/chunk-EZNVVB63.mjs +0 -1
- package/dist/chunk-GKAXYZCE.mjs +0 -1
- package/dist/chunk-IGYHDSM7.mjs +0 -1
- package/dist/chunk-L6ZRNW7Y.mjs +0 -1
- package/dist/chunk-LJ2TB6CY.js +0 -1
- package/dist/chunk-MOKKS75W.mjs +0 -3
- package/dist/chunk-ND33YQGU.js +0 -1
- package/dist/chunk-QXSDGNJ4.js +0 -1
- package/dist/chunk-RT52EYG3.mjs +0 -4
- package/dist/chunk-SHYNWAW6.mjs +0 -1
- package/dist/chunk-SNTAAXXA.mjs +0 -1
- package/dist/chunk-TAQTZAVZ.js +0 -1
- package/dist/chunk-UKMKGIME.js +0 -1
- package/dist/chunk-UXPY65AC.js +0 -1
- package/dist/chunk-VOCHZNOF.mjs +0 -1
- package/dist/chunk-VW22RZ6C.mjs +0 -1
- package/dist/chunk-WQRWRWSK.js +0 -1
- package/dist/chunk-YHXVNJK5.mjs +0 -1
- package/dist/chunk-ZETEPB7I.js +0 -1
- package/dist/executor-DZAMMQ35.js +0 -1
- package/dist/executor-ZCJRLT3Z.mjs +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var chunk2KPOGFFR_js=require('./chunk-2KPOGFFR.js'),chunkDX5XU6JN_js=require('./chunk-DX5XU6JN.js'),chunkEJ2JAYRI_js=require('./chunk-EJ2JAYRI.js'),chunkDROCYKAR_js=require('./chunk-DROCYKAR.js'),chunk6KYOT4E7_js=require('./chunk-6KYOT4E7.js'),chunkBKP5QMTS_js=require('./chunk-BKP5QMTS.js'),chunkQ2VALXEU_js=require('./chunk-Q2VALXEU.js'),chunkN3Y5BUKV_js=require('./chunk-N3Y5BUKV.js'),chunkBJSG6TEG_js=require('./chunk-BJSG6TEG.js');function tt(e,t,n,o,r){let a=new Map,i=[];for(let m of e.fragments){let s=o(m);if(s.length===0||!("height"in m))continue;let b=m.y-e.margins.top,g=b+m.height;s.forEach((u,E)=>{let y=`${E}:${u.id}`,p=a.get(y);p?(p.top=Math.min(p.top,b),p.bottom=Math.max(p.bottom,g)):(a.set(y,{group:u,depth:E,top:b,bottom:g}),i.push(y));});}let d=2,l=[];for(let m of i){let{group:s,depth:b,top:g,bottom:u}=a.get(m),E=b*(d+1),y=r.createElement("div");y.className="layout-block-sdt-box",y.dataset.sdtGroupId=s.id,y.dataset.sdtType=s.sdtType,y.dataset.sdtDepth=String(b+1),s.tag!=null&&(y.dataset.sdtTag=s.tag),s.alias!=null&&(y.dataset.sdtAlias=s.alias),s.lock!=null&&(y.dataset.sdtLock=s.lock),y.style.position="absolute",y.style.left=`${E}px`,y.style.top=`${g-d}px`,y.style.width=`${n-E*2}px`,y.style.height=`${u-g+d*2}px`;let p=s.alias||s.tag||s.sdtType;if(p){let F=r.createElement("span");F.className="layout-block-sdt-label",F.textContent=p,y.appendChild(F);}let w=wt(s.sdtType);if(w&&s.tag!=null&&!s.bound&&s.lock!=="contentLocked"&&s.lock!=="sdtContentLocked"){let F=r.createElement("button");F.type="button",F.className="layout-sdt-widget",F.dataset.sdtWidget=w,F.dataset.sdtTag=s.tag,F.dataset.sdtGroupId=s.id,F.setAttribute("aria-label",`${w} control ${s.alias||s.tag}`),w==="dropdown"?F.setAttribute("aria-haspopup","listbox"):w==="date"&&F.setAttribute("aria-haspopup","dialog"),F.textContent=w==="dropdown"?"\u25BE":w==="date"?"\u{1F4C5}":s.checked?"\u2612":"\u2610",y.appendChild(F);}if(s.repeatingItem&&!s.bound){let F=r.createElement("div");F.className="layout-sdt-repeat-controls";for(let c of ["add","remove"]){let x=r.createElement("button");x.type="button",x.className="layout-sdt-repeat-btn",x.dataset.sdtRepeat=c,x.dataset.sdtGroupId=s.id,x.setAttribute("aria-label",c==="add"?"Add item":"Remove item"),x.textContent=c==="add"?"\uFF0B":"\u2715",F.appendChild(x);}y.appendChild(F);}t.appendChild(y),l.push(y);}Tt(t,l);}function wt(e){return e==="checkbox"?"checkbox":e==="dropDownList"||e==="comboBox"?"dropdown":e==="date"?"date":null}function Tt(e,t){if(t.length===0||typeof e.addEventListener!="function")return;let n=(d,l)=>{for(let m of t){let s=m.getBoundingClientRect(),b=d>=s.left&&d<=s.right&&l>=s.top&&l<=s.bottom;b!==m.classList.contains("is-active")&&m.classList.toggle("is-active",b);}},o=typeof requestAnimationFrame=="function"?requestAnimationFrame:d=>d(),r=false,a=0,i=0;e.addEventListener("mousemove",d=>{a=d.clientX,i=d.clientY,!r&&(r=true,o(()=>{r=false,n(a,i);}));}),e.addEventListener("mouseleave",()=>{for(let d of t)d.classList.remove("is-active");});}function Fn(e,t,n){let o=new Set,r=e.content.size,a=i=>{let d=e.resolve(Math.max(0,Math.min(i,r)));for(let l=1;l<=d.depth;l++)d.node(l).type.name==="blockSdt"&&o.add(`sdt@${d.before(l)}`);};return a(t),n!==t&&a(n),o}function Cn(e,t){let n=e.querySelectorAll(".layout-block-sdt-box");for(let o of n){let r=o.dataset.sdtGroupId,a=r!=null&&t.has(r);a!==o.classList.contains("is-focused")&&o.classList.toggle("is-focused",a);}}var U={fragment:"layout-fragment",paragraph:"layout-fragment-paragraph",table:"layout-fragment-table",image:"layout-fragment-image",line:"layout-line",run:"layout-run"};function It(e){return e.kind==="paragraph"}function Ft(e){return e.kind==="table"}function Ct(e){return e.kind==="image"}function fe(e){e.style.position="absolute",e.style.overflow="hidden";}function Rt(e,t,n){let o=n.createElement("div");return o.className=`${U.fragment} ${U.paragraph}`,fe(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 Et(e,t,n){let o=n.createElement("div");return o.className=`${U.fragment} ${U.table}`,fe(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 Lt(e,t,n){let o=n.createElement("div");return o.className=`${U.fragment} ${U.image}`,fe(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 Ie(e,t,n={}){let o=n.document??document;if(It(e))return Rt(e,t,o);if(Ft(e))return Et(e,t,o);if(Ct(e))return Lt(e,t,o);let r=o.createElement("div");r.className=U.fragment,fe(r);let a=e;return a.blockId!==void 0&&(r.dataset.blockId=String(a.blockId)),a.kind&&(r.dataset.kind=a.kind),r}var P={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 A(e){return e.kind==="text"}function N(e){return e.kind==="tab"}function j(e){return e.kind==="image"}function W(e){return e.kind==="lineBreak"}function X(e){return e.kind==="field"}var nt={image:"layout-image",imageAnchored:"layout-image-anchored"};function oe(e){return !!(e.cropTop||e.cropRight||e.cropBottom||e.cropLeft||e.opacity!=null&&e.opacity<1)}function re(e,t){t.opacity!=null&&t.opacity<1&&(e.style.opacity=String(Math.max(0,t.opacity))),vt(e,t);}function vt(e,t){let n=t.cropTop??0,o=t.cropRight??0,r=t.cropBottom??0,a=t.cropLeft??0;if(!(n||o||r||a))return;let i=a+o>0?a/(a+o)*100:50,d=n+r>0?n/(n+r)*100:50;e.style.objectFit="cover",e.style.objectPosition=`${i}% ${d}%`;}function Z(e,t,n,o,r={}){let a=r.document??document,i=a.createElement("div");i.className=nt.image,e.isAnchored&&i.classList.add(nt.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 d=a.createElement("img");if(d.src=t.src,d.alt=t.alt??"",d.style.width="100%",d.style.height="100%",d.style.objectFit="contain",d.style.display="block",t.transform&&(d.style.transform=t.transform),d.draggable=false,t.hlinkHref){let l=a.createElement("a");l.href=t.hlinkHref,l.target="_blank",l.rel="noopener noreferrer",l.style.display="block",l.style.width="100%",l.style.height="100%",l.appendChild(d),i.appendChild(l);}else i.appendChild(d);return i}function Pt(e,t,n){if(t.fontFamily&&(e.style.fontFamily=chunkN3Y5BUKV_js.a(t.fontFamily).cssFallback),t.fontSize){let r=t.fontSize*96/72;e.style.fontSize=`${r}px`;}if(t.bold&&(e.style.fontWeight="bold"),t.italic&&(e.style.fontStyle="italic"),t.color&&(e.style.color=t.color),t.letterSpacing&&(e.style.letterSpacing=`${t.letterSpacing}px`),t.allCaps&&(e.style.textTransform="uppercase"),t.smallCaps&&(e.style.fontVariant="small-caps"),t.positionPx&&(e.style.verticalAlign=`${t.positionPx}px`),t.horizontalScale&&t.horizontalScale!==100&&(e.style.display="inline-block",e.style.transform=`scaleX(${t.horizontalScale/100})`,e.style.transformOrigin="left center"),t.kerningMinPt&&t.kerningMinPt>0&&(t.fontSize??11)>=t.kerningMinPt&&(e.style.fontKerning="normal"),t.emboss&&(e.style.textShadow="1px 1px 1px rgba(255,255,255,0.5), -1px -1px 1px rgba(0,0,0,0.3)"),t.imprint&&(e.style.textShadow="-1px -1px 1px rgba(255,255,255,0.5), 1px 1px 1px rgba(0,0,0,0.3)"),t.textShadow&&!t.emboss&&!t.imprint&&(e.style.textShadow="1px 1px 2px rgba(0,0,0,0.3)"),t.textOutline&&(e.style.webkitTextStroke="1px currentColor",e.style.webkitTextFillColor="transparent"),t.emphasisMark){let r=t.emphasisMark==="comma"?"filled sesame":t.emphasisMark==="circle"?"filled circle":"filled dot",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.style.cursor="pointer",e.style.transition="background-color 0.15s ease",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 z(e,t,n){t!==void 0&&(e.dataset.pmStart=String(t)),n!==void 0&&(e.dataset.pmEnd=String(n));}function Bt(e,t){let n=t.inlineSdtWidget;n&&(e.classList.add("layout-inline-sdt-widget"),e.dataset.sdtWidget=n.kind,e.dataset.sdtGroupId=n.groupId,e.dataset.sdtPos=String(n.pos),n.tag&&(e.dataset.sdtTag=n.tag),n.alias&&(e.dataset.sdtAlias=n.alias),typeof n.checked=="boolean"&&(e.dataset.sdtChecked=String(n.checked),e.setAttribute("aria-checked",String(n.checked))),e.setAttribute("role","checkbox"),e.setAttribute("tabindex","0"),e.setAttribute("aria-label",n.alias||n.tag||"Checkbox content control"));}function ie(e,t,n){let o=t.createElement("span");if(o.className=`${P.run} ${P.text}`,Pt(o,e,n),z(o,e.pmStart,e.pmEnd),Bt(o,e),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 Mt=1e3;function ge(e,t,n,o){let r=t.createElement("span");r.className=`${P.run} ${P.tab}`,r.style.display="inline-block",r.style.width=`${n}px`,z(r,e.pmStart,e.pmEnd);let a=o&&o!=="none"?$t(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(Mt),r.appendChild(i);}else r.textContent="\xA0";return r}function $t(e){switch(e){case "dot":return ".";case "hyphen":return "-";case "underscore":return "_";case "middleDot":return "\xB7";case "heavy":return "_";default:return null}}function it(e){if(!e)return 0;let t=e.match(/rotate\(([-\d.]+)deg\)/);return t?(parseFloat(t[1])%360+360)%360:0}function at(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 ot(e,t){t.distTop&&(e.style.marginTop=`${t.distTop}px`),t.distBottom&&(e.style.marginBottom=`${t.distBottom}px`);}function Ht(e,t){let n=t.createElement("img");n.className=`${P.run} ${P.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"),oe(e)&&re(n,e);let o=it(e.transform);if(o!==0){let r=at(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`,ot(a,e),z(a,e.pmStart,e.pmEnd),a.appendChild(n),a}return n.style.display="inline-block",n.style.verticalAlign="middle",e.width>0&&e.height>0&&(n.style.height="auto",n.style.aspectRatio=`${e.width} / ${e.height}`,n.style.maxWidth="100%"),ot(n,e),z(n,e.pmStart,e.pmEnd),n}function rt(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"),oe(e)&&re(o,e);let r=it(e.transform);if(r!==0){let a=at(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 z(n,e.pmStart,e.pmEnd),n.appendChild(o),n}function me(e,t){let n;return chunkDX5XU6JN_js.c(e)||e.displayMode==="block"||e.wrapType==="topAndBottom"?n=rt(e,t):n=Ht(e,t),At(n,e),n}function At(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 Fe(e,t){let n=t.createElement("br");return n.className=`${P.run} ${P.lineBreak}`,z(n,e.pmStart,e.pmEnd),n}function ue(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 ie(r,t,n?.resolvedCommentIds)}function Ce(e,t,n){if(A(e))return ie(e,t,n?.resolvedCommentIds);if(N(e))return ge(e,t,48,void 0);if(j(e))return me(e,t);if(W(e))return Fe(e,t);if(X(e)&&n)return ue(e,t,n);let o=t.createElement("span");return o.className=P.run,o}function dt(e,t){let n=[],o=e.runs;for(let r=t.fromRun;r<=t.toRun;r++){let a=o[r];if(a)if(A(a)){let i=r===t.fromRun?t.fromChar:0,d=r===t.toRun?t.toChar:a.text.length;if(i>0||d<a.text.length){let l=a.text.slice(i,d);n.push({...a,text:l,pmStart:a.pmStart!==void 0?a.pmStart+i:void 0,pmEnd:a.pmStart!==void 0?a.pmStart+d:void 0});}else n.push(a);}else n.push(a);}return n}function st(e){return e==="center"?"center":e==="right"?"flex-end":"flex-start"}function Ot(e,t){let n=e.position?.horizontal;return n?n.align??"left":t}function lt(e){return [e.pmStart??"no-start",e.pmEnd??"no-end",e.src,e.width,e.height,e.displayMode??"inline",e.wrapType??"none"].join("|")}function zt(e){return {val:e.val,pos:e.pos,leader:e.leader}}function Dt(e,t,n){let o="";for(let r=t+1;r<e.length;r++){let a=e[r];if(A(a))o+=a.text;else if(X(a))a.fieldType==="PAGE"&&n?o+=String(n.pageNumber):a.fieldType==="NUMPAGES"&&n?o+=String(n.totalPages):o+=a.fallback??"";else if(N(a)||W(a))break}return o}var Nt=.5;function Wt(e,t,n,o){let r=0;for(let a=t+1;a<e.length;a++){let i=e[a];if(N(i)||W(i))break;if(A(i))r+=n(i.text||"",i.fontSize,i.fontFamily,i.bold,i.italic);else if(X(i)){let d;i.fieldType==="PAGE"&&o?d=String(o.pageNumber):i.fieldType==="NUMPAGES"&&o?d=String(o.totalPages):d=i.fallback??"",r+=n(d,i.fontSize,i.fontFamily,i.bold,i.italic);}else j(i)&&!chunkDX5XU6JN_js.c(i)&&(r+=i.width||0);}return r}function _t(e){let n=e.createElement("canvas").getContext("2d");return (o,r=11,a="Calibri",i=false,d=false)=>{if(!n)return o.length*7;let l=chunkN3Y5BUKV_js.a(a).cssFallback,m=r*96/72,s=[];return d&&s.push("italic"),i&&s.push("bold"),s.push(`${m}px`,l),n.font=s.join(" "),n.measureText(o).width}}function he(e,t,n,o,r){let a=o.createElement("div");a.className=P.line,a.style.height=`${t.lineHeight}px`,a.style.lineHeight=`${t.lineHeight}px`;let i=dt(e,t);if(i.length===1&&j(i[0])){let y=i[0],p=Ot(y,n);a.style.display="flex",a.style.alignItems="center",a.style.justifyContent=st(p),a.dataset.flexLine="true";}else i.some(j)&&(a.style.display="flex",a.style.alignItems="baseline",a.style.justifyContent=st(n),a.style.lineHeight="normal",a.dataset.flexLine="true");if(i.length===0){let y=o.createElement("span");return y.className=`${P.run} layout-empty-run`,y.innerHTML=" ",a.appendChild(y),a}let d=n==="justify",l=false;d&&r&&(l=!r.isLastLine||r.paragraphEndsWithLineBreak,l&&(a.style.textAlign="justify",a.style.textAlignLast="justify",a.style.width=`${r.availableWidth}px`)),a.style.whiteSpace="pre";let m=i.some(y=>A(y)&&y.highlight);a.style.overflow=m?"hidden":"visible";let s=i.some(N),b,g=_t(o);if(s){let y=r?.tabStops?.map(zt),p=r?.leftIndentPx?Math.round(r.leftIndentPx*15):0;b={explicitStops:y,leftIndent:p};}let u=0,E=r?.leftIndentPx??0;if(r?.isFirstLine){let y=r?.firstLineIndentPx??0;u=E+y;}else u=E;for(let y=0;y<i.length;y++){let p=i[y];if(N(p)&&b){let w=Wt(i,y,g,r?.context),F=Dt(i,y,r?.context),c=F.indexOf("."),x=c>=0?g(F.slice(0,c)):0,T=chunkEJ2JAYRI_js.v(u,b,{followingWidth:w,decimalPrefixWidth:x}),S=r?.lineRightEdgePx,k=w,f=false;for(let I=y+1;I<i.length&&!W(i[I]);I++)if(N(i[I])){f=true;break}if(S!==void 0&&T.alignment==="end"&&!f&&u+T.width+k>=S-Nt){a.style.display="flex",a.style.alignItems="baseline",a.style.whiteSpace="nowrap",a.style.textIndent="0",a.dataset.flexLine="true",r?.isFirstLine&&r.firstLineIndentPx&&r.firstLineIndentPx<0&&a.firstElementChild instanceof HTMLElement&&(a.firstElementChild.style.marginLeft=`${r.firstLineIndentPx}px`);let I=ge(p,o,0,T.leader);I.style.flex="1 1 0",I.style.minWidth="0",I.style.width="auto",a.appendChild(I);for(let v=y+1;v<i.length;v++){let L=i[v];if(N(L)||W(L))break;if(A(L))a.appendChild(ie(L,o,r?.context?.resolvedCommentIds));else if(X(L)&&r?.context)a.appendChild(ue(L,o,r.context));else if(j(L)){if(chunkDX5XU6JN_js.c(L))continue;let B=lt(L);r?.renderedInlineImageKeys?.has(B)||(r?.renderedInlineImageKeys?.add(B),a.appendChild(me(L,o)));}else a.appendChild(Ce(L,o,r?.context));}break}let R=T.width;S!==void 0&&u+R+k>S&&(R=Math.max(1,S-u-k));let C=ge(p,o,R,T.leader);a.appendChild(C),u+=R;}else if(A(p)){let w=ie(p,o,r?.context?.resolvedCommentIds);if(p.highlight){let T=(p.fontSize?p.fontSize*96/72:14.67)*1.2,S=Math.max(0,t.lineHeight-T);if(S>0){let k=S/2;w.style.paddingTop=`${k}px`,w.style.paddingBottom=`${k}px`;}}a.appendChild(w);let F=p.fontSize||11,c=p.fontFamily||"Calibri";u+=g(p.text,F,c,p.bold,p.italic);}else if(j(p)){if(chunkDX5XU6JN_js.c(p))continue;let w=lt(p);if(r?.renderedInlineImageKeys?.has(w))continue;r?.renderedInlineImageKeys?.add(w);let F=me(p,o);a.appendChild(F),p.displayMode!=="block"&&p.wrapType!=="topAndBottom"&&(u+=p.width);}else if(W(p)){let w=Fe(p,o);a.appendChild(w);}else if(X(p)&&r?.context){let w=ue(p,o,r.context);a.appendChild(w);let F=p.fallback??"";p.fieldType==="PAGE"?F=String(r.context.pageNumber):p.fieldType==="NUMPAGES"&&(F=String(r.context.totalPages));let c=p.fontSize||11,x=p.fontFamily||"Calibri";u+=g(F,c,x,p.bold,p.italic);}else {let w=Ce(p,o,r?.context);a.appendChild(w);}}if(!a.querySelector("span[data-pm-start][data-pm-end]")){let y=i.find(W);if(y?.pmStart!==void 0){let p=o.createElement("span");p.className=P.run,z(p,y.pmStart,y.pmStart),p.textContent="\u200B",a.insertBefore(p,a.firstChild);}}return a}function ae(e,t){return !e&&!t?true:!e||!t?false:e.style===t.style&&e.width===t.width&&e.color===t.color}function ct(e,t){return !e&&!t||!e||!t?false:ae(e.top,t.top)&&ae(e.bottom,t.bottom)&&ae(e.left,t.left)&&ae(e.right,t.right)&&ae(e.between,t.between)}var Gt=/[\u0590-\u085F\u08A0-\u08FF\uFB1D-\uFDFF\uFE70-\uFEFF]/,Yt=/[\u0041-\u005A\u0061-\u007A\u00C0-\u02B8\u0370-\u0589\u10A0-\u10FF\u1E00-\u1FFF]/;function jt(e){let t=(e.runs??[]).filter(A);if(!t.some(n=>n.rtl))return false;for(let n of t)for(let o of n.text){if(Gt.test(o))return true;if(Yt.test(o))return false}return true}function D(e,t,n,o,r={}){let a=r.document??document,i=a.createElement("div");i.className=P.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),z(i,e.pmStart,e.pmEnd),e.continuesFromPrev&&(i.dataset.continuesFromPrev="true"),e.continuesOnNext&&(i.dataset.continuesOnNext="true");let d=t.attrs?.pPrIns,l=t.attrs?.pPrDel;if(d||l){let S=d??l;i.classList.add("layout-revision-pmark"),i.classList.add(d?"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),s=t.attrs?.alignment;t.attrs?.styleId&&(i.dataset.styleId=t.attrs.styleId);let b=!!t.attrs?.bidi||jt(t);b&&(i.dir="rtl"),s?s==="center"?i.style.textAlign="center":s==="right"?i.style.textAlign="right":s==="left"?i.style.textAlign="left":i.style.textAlign=b?"right":"left":b&&(i.style.textAlign="right");let g=t.attrs?.indent,u=0,E=0;g&&(b?(g.left&&g.left>0&&(E=g.left),g.right&&g.right>0&&(u=g.right)):(g.left&&g.left>0&&(u=g.left),g.right&&g.right>0&&(E=g.right)));let y=t.attrs?.borders;if(y){let S=L=>{switch(L){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 k=L=>`${L.width}px ${S(L.style)} ${L.color}`,f=ct(r.prevBorders,y),h=ct(y,r.nextBorders),R=f?y.between:y.top,C=h?void 0:y.bottom,I=a.createElement("div");if(I.className="layout-paragraph-border",I.style.position="absolute",I.style.pointerEvents="none",I.style.boxSizing="border-box",I.style.left=`${u-(y.left?.space??0)}px`,I.style.right=`${E-(y.right?.space??0)}px`,I.style.top=`${-(R?.space??0)}px`,I.style.bottom=`${-(C?.space??0)}px`,R&&(I.style.borderTop=k(R)),C&&(I.style.borderBottom=k(C)),y.left&&(I.style.borderLeft=k(y.left)),y.right&&(I.style.borderRight=k(y.right)),(R||C||y.left||y.right)&&i.appendChild(I),y.bar){let L=a.createElement("div");L.style.position="absolute",L.style.left="-8px",L.style.top="0",L.style.bottom="0",L.style.borderLeft=k(y.bar),i.style.position="relative",i.appendChild(L);}}t.attrs?.shading&&(i.style.backgroundColor=t.attrs.shading);let p=e.width-u-E,F=t.runs[t.runs.length-1]?.kind==="lineBreak",c=n.lines.length,x=0;g?.hanging&&g.hanging>0?x=-g.hanging:g?.firstLine&&g.firstLine>0&&(x=g.firstLine);let T=r.renderedInlineImageKeys??new Set;for(let S=0;S<m.length;S++){let k=m[S],f=e.fromLine+S,h=f===c-1,R=f===0&&!e.continuesFromPrev,C=k.leftOffset??0,I=k.rightOffset??0,v=p;if(R){let M=g?.hanging&&g.hanging>0,$=g?.firstLine&&g.firstLine>0;M&&g?.hanging?v=p+g.hanging:$&&g?.firstLine&&(v=p-g.firstLine);}if(Vt(k,t)){let M=a.createElement("div");M.className=`${P.line} layout-line-split`,M.style.position="relative",M.style.height=`${k.lineHeight}px`,M.style.lineHeight=`${k.lineHeight}px`;for(let $ of k.segments){let te={fromRun:$.fromRun,fromChar:$.fromChar,toRun:$.toRun,toChar:$.toChar,width:$.width,ascent:k.ascent,descent:k.descent,lineHeight:k.lineHeight},Y=he(t,te,s,a,{availableWidth:$.availableWidth,isLastLine:h,isFirstLine:R,paragraphEndsWithLineBreak:F,tabStops:t.attrs?.tabs,leftIndentPx:u,firstLineIndentPx:R?x:0,context:o,renderedInlineImageKeys:T});Y.className+=" layout-line-segment",Y.style.position="absolute",Y.style.left=`${$.leftOffset}px`,Y.style.top="0",Y.style.width=`${$.availableWidth}px`,M.appendChild(Y);}i.appendChild(M);continue}let L=he(t,k,s,a,{availableWidth:v-C-I,isLastLine:h,isFirstLine:R,paragraphEndsWithLineBreak:F,tabStops:t.attrs?.tabs,leftIndentPx:u,firstLineIndentPx:R?x:0,context:o,renderedInlineImageKeys:T,lineRightEdgePx:e.width-E-I});if(C>0||I>0){C>0&&(L.style.marginLeft=`${C}px`),I>0&&(L.style.marginRight=`${I}px`);let M=v-C-I;M>0&&(L.style.width=`${M}px`);}k.floatSkipBefore&&k.floatSkipBefore>0&&(L.style.marginTop=`${k.floatSkipBefore}px`);let B=g?.hanging&&g.hanging>0,Oe=g?.firstLine&&g.firstLine>0,St=L.dataset.flexLine==="true";if(R?u>0&&B?(L.style.paddingLeft=`${u}px`,St||(L.style.textIndent=`-${g.hanging}px`)):u>0&&Oe?(L.style.paddingLeft=`${u}px`,L.style.textIndent=`${g.firstLine}px`):u>0?L.style.paddingLeft=`${u}px`:Oe&&(L.style.textIndent=`${g.firstLine}px`):u>0?L.style.paddingLeft=`${u}px`:B&&(L.style.paddingLeft=`${g.hanging}px`),E>0&&(L.style.paddingRight=`${E}px`),R&&t.attrs?.listMarker&&!t.attrs?.listMarkerHidden){let M=g?.hanging??0,$=g?.firstLine??0,te=M>0?u-M:u+$;L.style.paddingLeft=`${Math.max(0,te)}px`,L.style.textIndent="0";let{fontFamily:Y,fontSize:kt}=chunkEJ2JAYRI_js.w(t),ze=Kt(t.attrs.listMarker,chunkEJ2JAYRI_js.x(t),a,Y,kt,t.attrs.listMarkerRevision);te<0&&u>0&&(ze.style.marginLeft=`${te}px`),L.insertBefore(ze,L.firstChild);}i.appendChild(L);}if((d||l)&&!e.continuesOnNext){let S=i.lastElementChild;if(S){let k=a.createElement("span");k.className="layout-revision-pmark-glyph",d?k.classList.add("layout-revision-ins"):k.classList.add("layout-revision-del"),k.textContent="\xB6",k.setAttribute("aria-hidden","true"),S.appendChild(k);}}return i}function Vt(e,t){return (e.segments?.length??0)>1&&!t.attrs?.listMarker}function Kt(e,t,n,o,r,a){let i=n.createElement("span");return i.className="layout-list-marker",i.style.fontFamily=chunkN3Y5BUKV_js.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==="ins"?i.style.color="#2e7d32":a==="del"&&(i.style.color="#c62828",i.style.textDecoration="line-through"),i}function q(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",i.style.maxWidth="none",i.style.maxHeight="none",r.alt&&(i.alt=r.alt),r.transform&&(i.style.transform=r.transform,i.style.transformOrigin="center center"),oe(r)&&re(i,r),a.appendChild(i),o.appendChild(a);}return o}function pt(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 d=i;for(let m of d.runs){if(m.kind!=="image")continue;let s=m;if(!chunkDX5XU6JN_js.c(s))continue;let b=s.position,g=s.distTop??0,u=s.distBottom??0,E=s.distLeft??12,y=s.distRight??12,p="left",w=0;if(b?.horizontal){let c=b.horizontal;c.align==="right"?(p="right",w=n-s.width):c.align==="left"?w=0:c.align==="center"?w=(n-s.width)/2:c.posOffset!==void 0&&(w=chunkBJSG6TEG_js.f(c.posOffset),p=w>n/2?"right":"left");}else s.cssFloat==="right"&&(p="right",w=n-s.width);let F=r;if(b?.vertical){let c=b.vertical;c.posOffset!==void 0?F=r+chunkBJSG6TEG_js.f(c.posOffset):c.align==="top"&&(F=0);}w=Math.max(0,Math.min(w,n-s.width)),o.push({src:s.src,width:s.width,height:s.height,alt:s.alt,transform:s.transform,x:w,y:F,side:p,distTop:g,distBottom:u,distLeft:E,distRight:y,wrapText:chunkDX5XU6JN_js.e(s.cssFloat),wrapType:s.wrapType,pmStart:s.pmStart,pmEnd:s.pmEnd});}let l=t.blocks[a];l&&l.kind==="paragraph"&&(r+=l.totalHeight);}return o}function Re(e){return !!e&&e.style!=="none"&&e.style!=="nil"&&e.width!==0}function J(e,t,n){let o=`border${t.charAt(0).toUpperCase()+t.slice(1)}`;if(!Re(n))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 Ee(e){let t=[],n=0;for(let o of e)t.push(Math.round(n)),n+=o?.height??0;return t.push(Math.round(n)),t}function ft(e,t){let n=e.createElement("div");n.className="layout-table-cut-border",n.style.position="absolute",n.style.left=`${t.x}px`,n.style.width=`${t.width}px`;let o=t.border.width??1;return n.style.top=`${t.edge==="bottom"?t.topY-o:t.topY}px`,J(n,"top",t.border),n}function Le(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 _={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 Ut(e,t,n,o){let r=o.createElement("div");r.className=_.cellContent,r.style.position="relative";let a=e.padding?.left??7,i=e.padding?.right??7,d=Math.max(0,t.width-a-i);r.style.width=`${d}px`;let l=pt(e,t,d),m;if(l.length>0){m=l.filter(chunkDX5XU6JN_js.a).map(E=>{let y=E.x+E.width+E.distRight,p=E.y-E.distTop,w=E.y+E.height+E.distBottom,F=0,c=0,x=E.wrapText??"bothSides";return x==="right"?F=y:x==="left"?c=d-(E.x-E.distLeft):E.side==="left"?F=y:c=d-(E.x-E.distLeft),{leftMargin:F,rightMargin:c,topY:p,bottomY:w}});let u=l.filter(chunkDX5XU6JN_js.b);u.length>0&&r.appendChild(q(u,o,{layerClass:"layout-cell-floating-images-layer",itemClass:"layout-cell-floating-image",sizing:"fullSize",layerMode:"behind"}));}let s=0,b=0;for(let u=0;u<e.blocks.length;u++){let E=e.blocks[u],y=t.blocks[u];if(E?.kind==="paragraph"&&y?.kind==="paragraph"){let p=E,w=y,F=p.attrs?.spacing,c=Math.max(b,F?.before??0);s+=c,m&&m.length>0&&(w=chunkEJ2JAYRI_js.z(p,d,{floatingZones:m,paragraphYOffset:s}));let x={blockId:p.id,width:d,height:w.totalHeight,fromLine:0,toLine:w.lines.length,pmStart:p.pmStart,pmEnd:p.pmEnd},T={...n,insideTableCell:true},S=D(x,p,w,T,{document:o});S.style.position="relative",c>0&&(S.style.marginTop=`${c}px`),r.appendChild(S),s+=w.totalHeight,b=F?.after??0;}else if(E?.kind==="table"&&y?.kind==="table"){let p=E,w=y,F=b,c=Xt(p,w,n,o);c.style.position="relative",F>0&&(c.style.marginTop=`${F}px`),r.appendChild(c),s+=F+(y.totalHeight??0),b=0;}}b>0&&(r.style.paddingBottom=`${b}px`);let g=l.filter(u=>!chunkDX5XU6JN_js.b(u));return g.length>0&&r.appendChild(q(g,o,{layerClass:"layout-cell-floating-images-layer",itemClass:"layout-cell-floating-image",sizing:"fullSize",layerMode:"front"})),r}function Xt(e,t,n,o){let r=o.createElement("div");r.className=`${_.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,d=a?.trackedDel,l=(g,u)=>!!g&&!!u&&(g.author??"")===(u.author??"")&&(g.date??null)===(u.date??null),m=e.rows.length>0&&e.rows.every(g=>i?l(g.trackedIns,i):d?l(g.trackedDel,d):false);if(m){let g=i??d,u=i?"ins":"del";r.classList.add("ep-revision-table",`ep-revision-${u}`),r.dataset.revisionId=String(g.revisionId),r.dataset.revisionAuthor=g.author,g.date&&(r.dataset.revisionDate=g.date);}let s=Ee(t.rows),b=new Map;for(let g=0;g<e.rows.length;g++){let u=e.rows[g],E=t.rows[g];if(!u||!E)continue;let y=ve(u,E,g,s[g]??0,t.columnWidths,e.rows.length,n,o,b,s,void 0,m);r.appendChild(y);}return r.style.height=`${s[e.rows.length]??0}px`,r}function gt(e,t,n,o,r,a,i,d){let l=i.createElement("div");l.className=_.cell,e.trackedMarker&&e.trackedMarker.info.revisionId!==d&&Le(l,"cell",e.trackedMarker.kind,e.trackedMarker.info),l.style.position="absolute",l.style.left=`${n}px`,l.style.top="0",l.style.width=`${t.width}px`,l.style.height=`${o}px`,l.style.overflow="hidden",l.style.boxSizing="border-box";let m=e.padding?.top??1,s=e.padding?.right??7,b=e.padding?.bottom??1,g=e.padding?.left??7;l.style.padding=`${m}px ${s}px ${b}px ${g}px`,e.borders&&(r.isFirstRow&&J(l,"top",e.borders.top),J(l,"right",e.borders.right),J(l,"bottom",e.borders.bottom),r.isFirstCol&&J(l,"left",e.borders.left)),e.background&&(l.style.backgroundColor=e.background),e.noWrap&&(l.style.whiteSpace="nowrap");let u=(t.height??0)>=o-.5;if(e.verticalAlign&&!u)switch(l.style.display="flex",l.style.flexDirection="column",e.verticalAlign){case "top":l.style.justifyContent="flex-start";break;case "center":l.style.justifyContent="center";break;case "bottom":l.style.justifyContent="flex-end";break}let E=Ut(e,t,a,i);if(l.appendChild(E),e.blocks.length>0){let y=e.blocks[0],p=e.blocks[e.blocks.length-1];y&&"pmStart"in y&&y.pmStart!==void 0&&(l.dataset.pmStart=String(y.pmStart)),p&&"pmEnd"in p&&p.pmEnd!==void 0&&(l.dataset.pmEnd=String(p.pmEnd));}return l}function qt(e,t){return chunkEJ2JAYRI_js.b(e).map(n=>{let o=0;for(let r=0;r<n.columnIndex;r++)o+=t[r]??0;return {rowIndex:n.rowIndex,cellIndex:n.cellIndex,columnIndex:n.columnIndex,x:o,colSpan:n.colSpan,rowSpan:n.rowSpan,cell:e.rows[n.rowIndex].cells[n.cellIndex]}})}function ve(e,t,n,o,r,a,i,d,l,m,s,b){let g=d.createElement("div");g.className=_.row,b||(e.trackedDel?Le(g,"row","del",e.trackedDel):e.trackedIns&&Le(g,"row","ins",e.trackedIns));let u=m&&m.length>n+1?(m[n+1]??0)-(m[n]??0):t.height;g.style.position="absolute",g.style.left="0",g.style.top=`${o}px`,g.style.width="100%",g.style.height=`${u}px`,g.dataset.rowIndex=String(n);let E=new Set;if(l){for(let[,w]of l)if(w.startRow<n&&w.startRow+w.rowSpan>n)for(let F=0;F<w.colSpan;F++)E.add(w.columnIndex+F);}let y=0,p=0;for(;E.has(p);)y+=r[p]??0,p++;for(let w=0;w<e.cells.length;w++){let F=e.cells[w],c=t.cells[w];if(!F||!c)continue;let x=F.colSpan??1,T=F.rowSpan??1,S=u;if(T>1&&m){S=0;for(let I=n;I<n+T&&I<m.length-1;I++)S+=(m[I+1]??0)-(m[I]??0);S===0&&(S=t.height*T);}let k=n===0||s===true,h=p===0;p+x>=r.length;let C=gt(F,c,y,S,{isFirstRow:k,isFirstCol:h},i,d,e.trackedIns?.revisionId??e.trackedDel?.revisionId);if(C.dataset.cellIndex=String(w),C.dataset.columnIndex=String(p),T>1&&(C.dataset.rowSpan=String(T)),g.appendChild(C),T>1&&l){let I=`${n}-${p}`;l.set(I,{cell:F,cellMeasure:c,columnIndex:p,startRow:n,rowSpan:T,colSpan:x,x:y,totalHeight:S});}for(let I=0;I<x&&p+I<r.length;I++)y+=r[p+I]??0;for(p+=x;E.has(p);)y+=r[p]??0,p++;}return g}function Q(e,t,n,o,r={}){let a=r.document??document,i=a.createElement("div");i.className=_.table,i.style.position=o.positioning==="flow"?"relative":"absolute",i.style.width=`${e.width}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 d=t.rows[0],l=d?.trackedIns,m=d?.trackedDel,s=(f,h)=>!!f&&!!h&&(f.author??"")===(h.author??"")&&(f.date??null)===(h.date??null),b=t.rows.length>0&&t.rows.every(f=>l?s(f.trackedIns,l):m?s(f.trackedDel,m):false);if(b){let f=l??m,h=l?"ins":"del";i.classList.add("ep-revision-table",`ep-revision-${h}`),i.dataset.revisionId=String(f.revisionId),i.dataset.revisionAuthor=f.author,f.date&&(i.dataset.revisionDate=f.date),i.style.overflowX="visible",i.style.overflowY="hidden";}let g=0;for(let f=0;f<n.columnWidths.length-1;f++){g+=n.columnWidths[f]??0;let h=a.createElement("div");h.className=_.resizeHandle,h.style.position="absolute",h.style.left=`${g-3}px`,h.style.top="0",h.style.width="6px",h.style.height="100%",h.style.cursor="col-resize",h.style.zIndex="10",h.dataset.columnIndex=String(f),h.dataset.tableBlockId=String(e.blockId),e.pmStart!==void 0&&(h.dataset.tablePmStart=String(e.pmStart)),i.appendChild(h);}let u=Ee(n.rows),E=qt(t,n.columnWidths),y=e.headerRowCount??0,p=0;if(y>0&&e.continuesFromPrev){let f=new Map;for(let h=0;h<y;h++){let R=t.rows[h],C=n.rows[h];if(!R||!C)continue;let I=ve(R,C,h,p,n.columnWidths,t.rows.length,o,a,f,u,h===0,b);I.dataset.repeatedHeader="true",i.appendChild(I),p+=C.height;}}let w=(u[e.fromRow]??0)+(e.topClip??0),F=f=>p+(f-w),c=e.bottomClip!==void 0?Math.round(e.height):F(u[e.toRow]??0);i.style.height=`${c}px`;let x=new Map,T=y>0&&e.continuesFromPrev;for(let f of E){if(f.rowSpan<=1||f.rowIndex>=e.fromRow||f.rowIndex+f.rowSpan<=e.fromRow||T&&f.rowIndex<y)continue;let h=n.rows[f.rowIndex]?.cells?.[f.cellIndex];if(!h)continue;let R=0;for(let B=f.rowIndex;B<f.rowIndex+f.rowSpan&&B<u.length-1;B++)R+=(u[B+1]??0)-(u[B]??0);x.set(`${f.rowIndex}-${f.columnIndex}`,{cell:f.cell,cellMeasure:h,columnIndex:f.columnIndex,startRow:f.rowIndex,rowSpan:f.rowSpan,colSpan:f.colSpan,x:f.x,totalHeight:R});f.rowIndex+f.rowSpan>=t.rows.length;let I=f.columnIndex===0;f.columnIndex+f.colSpan>=n.columnWidths.length;let L=gt(f.cell,h,f.x,R,{isFirstRow:false,isFirstCol:I},o,a);L.style.top=`${F(u[f.rowIndex]??0)}px`,L.dataset.columnIndex=String(f.columnIndex),L.dataset.vmergeContinuation="true",delete L.dataset.pmStart,delete L.dataset.pmEnd,i.appendChild(L);}for(let f=e.fromRow;f<e.toRow;f++){let h=t.rows[f],R=n.rows[f];if(!h||!R)continue;let C=y>0&&e.continuesFromPrev?false:e.continuesFromPrev&&f===e.fromRow&&!e.topClip,I=ve(h,R,f,F(u[f]??0),n.columnWidths,t.rows.length,o,a,x,u,C,b);i.appendChild(I);}let S=(f,h,R,C)=>{for(let I of E){if(I.rowIndex>f||I.rowIndex+I.rowSpan-1<f||C&&!(h==="bottom"?I.rowIndex+I.rowSpan-1>f:I.rowIndex<f))continue;let v=I.cell.borders?.[h];if(!Re(v))continue;let L=0;for(let B=0;B<I.colSpan;B++)L+=n.columnWidths[I.columnIndex+B]??0;i.appendChild(ft(a,{x:I.x,topY:R,width:L,edge:h,border:v}));}};e.topClip?S(e.fromRow,"top",p,false):e.continuesFromPrev&&S(e.fromRow,"top",p,true),e.bottomClip!==void 0?S(e.toRow-1,"bottom",c,false):e.continuesOnNext&&S(e.toRow-1,"bottom",c,true);for(let f=e.fromRow;f<e.toRow-1;f++){let h=F(u[f+1]??0);if(h<=p||h>=e.height)continue;let R=a.createElement("div");R.className=_.rowResizeHandle,R.style.position="absolute",R.style.left="0",R.style.top=`${h-3}px`,R.style.width="100%",R.style.height="6px",R.style.cursor="row-resize",R.style.zIndex="10",R.dataset.rowIndex=String(f),R.dataset.tableBlockId=String(e.blockId),e.pmStart!==void 0&&(R.dataset.tablePmStart=String(e.pmStart)),i.appendChild(R);}let k=e.toRow===t.rows.length&&e.bottomClip===void 0;if(k){let f=a.createElement("div");f.className=_.tableEdgeHandleBottom,f.style.position="absolute",f.style.left="0",f.style.top=`${F(u[e.toRow]??0)-3}px`,f.style.width="100%",f.style.height="6px",f.style.cursor="row-resize",f.style.zIndex="10",f.dataset.rowIndex=String(t.rows.length-1),f.dataset.tableBlockId=String(e.blockId),f.dataset.isEdge="bottom",e.pmStart!==void 0&&(f.dataset.tablePmStart=String(e.pmStart)),i.appendChild(f);}if(k){let f=n.columnWidths.reduce((R,C)=>R+C,0),h=a.createElement("div");h.className=_.tableEdgeHandleRight,h.style.position="absolute",h.style.left=`${f-3}px`,h.style.top="0",h.style.width="6px",h.style.height="100%",h.style.cursor="col-resize",h.style.zIndex="10",h.dataset.columnIndex=String(n.columnWidths.length-1),h.dataset.tableBlockId=String(e.blockId),h.dataset.isEdge="right",e.pmStart!==void 0&&(h.dataset.tablePmStart=String(e.pmStart)),i.appendChild(h);}return i}var Zt={textBox:"layout-textbox"};function ee(e,t,n,o,r={}){let a=r.document??document,i=a.createElement("div");if(i.className=Zt.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",Jt(i,e),t.fillColor&&(i.style.backgroundColor=t.fillColor),t.outlineWidth&&t.outlineWidth>0){let s=t.outlineStyle||"solid",b=t.outlineColor||"#000000";i.style.border=`${t.outlineWidth}px ${s} ${b}`;}let d=t.margins??chunkDROCYKAR_js.a;i.style.padding=`${d.top}px ${d.right}px ${d.bottom}px ${d.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 l=e.width-d.left-d.right,m=0;for(let s=0;s<t.content.length;s++){let b=t.content[s],g=n.innerMeasures[s];if(!g)continue;let u={blockId:b.id,width:l,height:g.totalHeight,pmStart:b.pmStart,pmEnd:b.pmEnd,fromLine:0,toLine:g.lines.length},E=D(u,b,g,{...o,positioning:"flow"},{document:a});i.appendChild(E),m+=g.totalHeight;}return i}function Jt(e,t){!t.isFloating&&t.zIndex===void 0||(e.style.zIndex=String(t.zIndex??10));}var Qt="layout-watermark-layer";function en(e,t){let n=Math.max(e.trim().length,1),o=t/(n*.62);return Math.max(24,Math.min(o,180))}function tn(e,t,n){let o=n.createElement("div");o.style.position="absolute",o.style.top="50%",o.style.left="50%",o.style.whiteSpace="nowrap",o.style.fontWeight="bold",o.style.color=e.color,o.style.fontFamily=chunkN3Y5BUKV_js.a(e.font).cssFallback,o.style.userSelect="none";let r=t.size.w-t.margins.left-t.margins.right,a=e.layout==="diagonal"?r*1.3:r,i=e.fontSize!==void 0?e.fontSize*96/72:en(e.text,a);o.style.fontSize=`${i}px`,o.style.lineHeight="1",o.style.opacity=e.semitransparent?"0.5":"0.85";let d=e.layout==="diagonal"?-45:0;return o.style.transform=`translate(-50%, -50%) rotate(${d}deg)`,o.style.transformOrigin="center center",o.textContent=e.text,o}function nn(e,t,n){if(!e.dataUrl)return null;let o=n.createElement("img");o.src=e.dataUrl,o.alt="",o.style.position="absolute",o.style.top="50%",o.style.left="50%",o.style.transform="translate(-50%, -50%)";let r=t.size.w-t.margins.left-t.margins.right,a=e.widthEmu!==void 0?e.widthEmu/(914400/96):r*.75;return o.style.width=`${a*(e.scale||1)}px`,o.style.height="auto",e.washout&&(o.style.opacity="0.5",o.style.filter="brightness(1.4) contrast(0.4)"),o}function mt(e,t,n=document){let o=e.kind==="text"?tn(e,t,n):nn(e,t,n);if(!o)return null;let r=n.createElement("div");return r.className=Qt,r.setAttribute("aria-hidden","true"),r.style.position="absolute",r.style.inset="0",r.style.overflow="hidden",r.style.pointerEvents="none",r.style.zIndex="0",r.appendChild(o),r}function ut(e){return e?.align??e?.alignment}function on(e,t){let n=e.position.vertical;if(!n)return e.paragraphY;let o=ut(n),r=n.posOffset!==void 0?chunkBJSG6TEG_js.f(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 Pe(e,t,n){if(!t)return "0";let o=ut(t);if(t.relativeTo==="page"){if(t.posOffset!==void 0)return `${chunkBJSG6TEG_js.f(t.posOffset)-n.flowLeft}px`;if(o==="right")return `${n.pageWidth-e-n.flowLeft}px`;if(o==="center")return `${(n.pageWidth-e)/2-n.flowLeft}px`;if(o==="left")return `${-n.flowLeft}px`}return t.posOffset!==void 0?`${chunkBJSG6TEG_js.f(t.posOffset)}px`:o==="right"?`${n.contentWidth-e}px`:o==="center"?`${(n.contentWidth-e)/2}px`:"0"}function rn(e,t,n){e.style.left=Pe(t.width,t.position.horizontal,n);}function ht(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 Be(e,t,n,o){let r=n.document??document,a=r.createElement("div");a.style.position="relative";let i=t.contentWidth??600,d=[],l=0;for(let m=0;m<e.blocks.length;m++){let s=e.blocks[m],b=e.measures[m];if(!(!s||!b))if(s.kind==="paragraph"){if(b.kind!=="paragraph")continue;let g=s,u=b,E=g.attrs?.spacing?.before??0,y=l,p=[];for(let x of g.runs)if(x.kind==="image"&&"position"in x&&x.position){let T=x;d.push({src:T.src,width:T.width,height:T.height,alt:T.alt,paragraphY:y,position:T.position});}else p.push(x);let w={...g,runs:p},F={blockId:g.id,width:i,height:u.totalHeight,fromLine:0,toLine:u.lines.length,pmStart:g.pmStart,pmEnd:g.pmEnd},c=D(F,w,u,{...t,positioning:"absolute"},{document:r});c.style.top=`${l+E}px`,c.style.left="0",c.style.width=`${i}px`,a.appendChild(c),l+=u.totalHeight;}else if(s.kind==="table"){if(b.kind!=="table")continue;let g={blockId:s.id,width:b.totalWidth,height:b.totalHeight,fromRow:0,toRow:b.rows.length,pmStart:s.pmStart,pmEnd:s.pmEnd},u=Q(g,s,b,{...t,positioning:"absolute"},{document:r});if(s.floating){let{left:E,top:y}=ht(s.floating,o);u.style.top=`${y}px`,u.style.left=`${E}px`,a.appendChild(u);}else u.style.top=`${l}px`,u.style.left="0",a.appendChild(u),l+=b.totalHeight;}else if(s.kind==="image"){if(b.kind!=="image")continue;let g={blockId:s.id,width:b.width,height:b.height,pmStart:s.pmStart,pmEnd:s.pmEnd},u=Z(g,s,b,{...t},{document:r});u.style.top=`${l}px`,u.style.left="0",a.appendChild(u),l+=b.height;}else if(s.kind==="textBox"){if(b.kind!=="textBox")continue;let g={blockId:s.id,width:b.width,height:b.height,pmStart:s.pmStart,pmEnd:s.pmEnd},u=ee(g,s,b,{...t,positioning:"absolute"},{document:r});u.style.top=`${l}px`,u.style.left=Pe(b.width,s.position?.horizontal,o),a.appendChild(u),s.displayMode!=="float"&&(l+=b.height);}else s.kind==="sectionBreak"||s.kind==="pageBreak"||s.kind==="columnBreak"||chunkDROCYKAR_js.c(s,"renderHeaderFooterContent");}for(let m of d){let s=r.createElement("img");s.src=m.src,s.width=m.width,s.height=m.height,m.alt&&(s.alt=m.alt),s.style.position="absolute",s.style.display="block",s.style.width=`${m.width}px`,s.style.height=`${m.height}px`,s.style.maxWidth="none",s.style.maxHeight="none",rn(s,m,o),s.style.top=`${on(m,o)}px`,a.appendChild(s);}return a}var be=12,Me=6;function an(e,t){if(e.size!==t.size)return false;for(let[n,o]of e)if(t.get(n)!==o)return false;return true}function sn(e,t){for(let[n,o]of t)if((e.get(n)??0)<o)return false;return true}function ln(e,t){let n=new Map(e);for(let[o,r]of t)n.set(o,Math.max(n.get(o)??0,r));return n}var $e=8;function Co(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 ye(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 d=i.pmStart??-1,l=i.pmEnd??-1;if(d>=0&&l>=0&&o.pmPos>=d&&o.pmPos<l){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 dn(e,t){if(e.length===0)return [{kind:"paragraph",id:`fn-empty-${t}`,runs:[{kind:"text",text:`${t} `,fontSize:$e,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:$e}:i)}}),o=n[0];if(o.kind==="paragraph"){let r={kind:"text",text:`${t} `,fontSize:$e,superscript:true};n[0]={...o,runs:[r,...o.runs]};}return n}function cn(e,t,n,o){let r=chunkBKP5QMTS_js.c(e.content,{styles:o.styles??void 0,theme:o.theme??null,defaultTabStopTwips:o.defaultTabStopTwips??null}),a=chunk2KPOGFFR_js.c(r,{theme:o.theme??void 0}),i=dn(a,t),d=o.measureBlocks(i,n),l=d.reduce((m,s)=>s.kind==="paragraph"||s.kind==="table"?m+s.totalHeight:s.kind==="image"||s.kind==="textBox"?m+s.height:m,0);return {id:e.id,displayNumber:t,blocks:i,measures:d,height:l}}function Ro(e,t,n,o){let r=new Map,a=new Map;for(let l of e)(l.noteType==="normal"||l.noteType==null)&&a.set(l.id,l);let i=1,d=new Set;for(let l of t){if(d.has(l.footnoteId))continue;d.add(l.footnoteId);let m=a.get(l.footnoteId);m&&(r.set(l.footnoteId,cn(m,i,n,o)),i++);}return r}function He(e,t){let n=new Map;for(let[o,r]of e){let a=0;for(let i of r){let d=t.get(i);d&&(a+=d.height);}a>0&&(a+=be,n.set(o,a));}return n}function Eo(e){let{blocks:t,measures:n,layoutOpts:o,footnoteRefs:r,footnoteContentMap:a,initialLayout:i}=e,d=ye(i.pages,r),l=He(d,a);if(l.size===0)return {layout:i,pageFootnoteMap:d,converged:true};let m=i,s=false;for(let b=0;b<Me;b++){m=chunkEJ2JAYRI_js.X(t,n,{...o,footnoteReservedHeights:l});let g=ye(m.pages,r),u=He(g,a);if(d=g,an(l,u)){l=u,s=true;break}l=u;}if(!s){let b=l,g=false;for(let u=0;u<Me;u++){m=chunkEJ2JAYRI_js.X(t,n,{...o,footnoteReservedHeights:b}),d=ye(m.pages,r);let E=He(d,a);if(sn(b,E)){g=true;break}b=ln(b,E);}g||(m=chunkEJ2JAYRI_js.X(t,n,{...o,footnoteReservedHeights:b}),d=ye(m.pages,r)),console.warn(`[docx-editor] footnote layout did not stabilize within ${Me} passes; settling with conservative page reservations. If footnotes appear misplaced, please file a bug with the document.`);}for(let[b,g]of d){let u=m.pages.find(E=>E.number===b);u&&(u.footnoteIds=g);}return {layout:m,pageFootnoteMap:d,converged:s}}function Lo(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 d=[];for(let l of i){let m=r.get(l);if(!m)continue;let s=t.get(l),b=s?.displayNumber??0;d.push({displayNumber:String(b),text:chunk6KYOT4E7_js.x(m),content:s});}d.length>0&&o.set(a,d);}return o}function pn(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 d=e.blocks[i],l=e.measures[i];if(!(!d||!l)){if(d.kind==="paragraph"&&l.kind==="paragraph"){let m=d.attrs?.spacing?.before??0,s={blockId:d.id,width:t,height:l.totalHeight,pmStart:d.pmStart,pmEnd:d.pmEnd,fromLine:0,toLine:l.lines.length},b=D(s,d,l,{...n,section:"body",contentWidth:t,positioning:"absolute"},{document:o});b.style.top=`${a+m}px`,b.style.left="0",b.style.width=`${t}px`,b.style.height=`${l.totalHeight}px`,r.appendChild(b),a+=l.totalHeight;}else if(d.kind==="table"&&l.kind==="table"){let m={blockId:d.id,width:l.totalWidth,height:l.totalHeight,pmStart:d.pmStart,pmEnd:d.pmEnd,fromRow:0,toRow:l.rows.length},s=Q(m,d,l,{...n,section:"body",contentWidth:t,positioning:"absolute"},{document:o});s.style.top=`${a}px`,s.style.left="0",r.appendChild(s),a+=l.totalHeight;}else if(d.kind==="image"&&l.kind==="image"){let m={blockId:d.id,width:l.width,height:l.height,pmStart:d.pmStart,pmEnd:d.pmEnd},s=Z(m,d,l,{...n},{document:o});s.style.top=`${a}px`,s.style.left="0",r.appendChild(s),a+=l.height;}else if(d.kind==="textBox"&&l.kind==="textBox"){let m={blockId:d.id,width:l.width,height:l.height,pmStart:d.pmStart,pmEnd:d.pmEnd},s=ee(m,d,l,{...n,section:"body",contentWidth:t,positioning:"absolute"},{document:o});s.style.top=`${a}px`,s.style.left="0",r.appendChild(s),a+=l.height;}}}return r}function fn(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 yt(e){let t=be;for(let n of e)n.content&&(t+=n.content.height);return t}function bt(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,d=(be-i)/2;a.style.width="33%",a.style.height=`${i}px`,a.style.backgroundColor="#000",a.style.marginBottom=`${d}px`,a.style.marginTop=`${d}px`,r.appendChild(a);for(let l of e)r.appendChild(l.content?pn(l.content,t,n,o):fn(l,o));return r}function Ae(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 xt(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 gn(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 mn(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 xe=2,un=8;function hn(e,t,n={}){let o=e.length,r=n.pageGap??24,a=t,i=a.__pageRenderState,d=gn(n),l=o>=un;if(i&&i.optionsHash===d&&l){let p=i.pageStates,w=i.pageDataMap,F=a.__pageObserver,c=[];for(let S of e)c.push(xt(S));let x=i.totalPages!==o,T=Math.min(p.length,e.length);for(let S=0;S<T;S++){let k=p[S],f=c[S];if(k.fingerprint===f&&!x){let C=w.get(k.element);C&&(C.page=e[S]);continue}let h=k.element,R=w.get(h);R&&(R.page=e[S],R.rendered&&yn(h,w,o,n)),k.fingerprint=f,le(h,e[S].size.w,e[S].size.h,n),h.dataset.pageNumber=String(e[S].number);}if(e.length>p.length){let S=n.document??document;for(let k=p.length;k<e.length;k++){let f=e[k],h=S.createElement("div");h.className=n.pageClassName??G.page,h.dataset.pageNumber=String(f.number),h.dataset.pageIndex=String(k),le(h,f.size.w,f.size.h,n),t.appendChild(h),p.push({element:h,fingerprint:c[k]}),w.set(h,{page:f,index:k,rendered:false}),F&&F.observe(h);}}if(e.length<p.length){for(let S=p.length-1;S>=e.length;S--){let k=p[S].element;F&&F.unobserve(k),w.delete(k),t.removeChild(k);}p.length=e.length;}for(let S=0;S<p.length;S++){let k=w.get(p[S].element);k&&(k.index=S);}return i.totalPages=o,i.currentOptions=n,"incremental"}let s=a.__pageObserver;s&&(s.disconnect(),a.__pageObserver=void 0),t.innerHTML="",a.__pageRenderState=void 0,mn(t,r);let b=[],g=[];for(let p=0;p<e.length;p++){let w=e[p];if(g.push(xt(w)),l){let c=(n.document??document).createElement("div");c.className=n.pageClassName??G.page,c.dataset.pageNumber=String(w.number),c.dataset.pageIndex=String(p),le(c,w.size.w,w.size.h,n),t.appendChild(c),b.push(c);}else {let{context:F,pageOptions:c}=Ae(w,o,n),x=Se(w,F,c);t.appendChild(x),b.push(x);}}if(!l)return "full";let u=new Map;for(let p=0;p<e.length;p++)u.set(b[p],{page:e[p],index:p,rendered:false});let E=new IntersectionObserver(p=>{let w=a.__pageRenderState;if(!w)return;let{currentOptions:F,totalPages:c,pageDataMap:x}=w;for(let f of p){let h=f.target,R=x.get(h);if(R&&f.isIntersecting){se(h,x,c,F);for(let C=-xe;C<=xe;C++){let I=R.index+C;I>=0&&I<w.pageStates.length&&I!==R.index&&se(w.pageStates[I].element,x,c,F);}}}let T=window.innerHeight,S=T*3,k=new Set;for(let[f,h]of x){if(!h.rendered)continue;let R=f.getBoundingClientRect();R.bottom>-S&&R.top<T+S&&k.add(h.index);}for(let[f,h]of x){if(!h.rendered)continue;let R=false;for(let C of k)if(Math.abs(h.index-C)<=xe+1){R=true;break}!R&&k.size>0&&bn(f,x);}},{root:null,rootMargin:"1500px 0px 1500px 0px"});for(let p of b)E.observe(p);a.__pageObserver=E,a.__pageRenderState={pageStates:b.map((p,w)=>({element:p,fingerprint:g[w]})),totalPages:o,optionsHash:d,pageDataMap:u,currentOptions:n};let y=Math.min(e.length,xe+3);for(let p=0;p<y;p++)se(b[p],u,o,n);return "full"}function se(e,t,n,o){let r=t.get(e);if(!r||r.rendered)return;let{context:a,pageOptions:i}=Ae(r.page,n,o),d=Se(r.page,a,i);for(;d.firstChild;)e.appendChild(d.firstChild);r.rendered=true;}function yn(e,t,n,o){let r=t.get(e);if(!r)return;let{context:a,pageOptions:i}=Ae(r.page,n,o),l=Se(r.page,a,i).querySelector(`.${G.content}`),m=e.querySelector(`.${G.content}`);l&&m?e.replaceChild(l,m):(e.innerHTML="",r.rendered=false,se(e,t,n,o));}function bn(e,t){let n=t.get(e);!n||!n.rendered||(e.innerHTML="",n.rendered=false);}function xn(e){let n=e.__pageRenderState;if(!n)return 0;let{pageStates:o,totalPages:r,currentOptions:a,pageDataMap:i}=n,d=0;for(let{element:l}of o){let m=i.get(l);!m||m.rendered||(se(l,i,r,a),d++);}return d}var G={page:"layout-page",content:"layout-page-content",header:"layout-page-header",footer:"layout-page-footer"};function le(e,t,n,o){e.style.position="relative",e.style.width=`${t}px`,e.style.height=`${n}px`,e.style.backgroundColor=o.backgroundColor??"var(--doc-page-bg, #ffffff)",e.style.overflow="hidden",e.style.fontFamily=chunkN3Y5BUKV_js.a("Calibri").cssFallback,e.style.fontSize=`${1056/72}px`,e.style.color="var(--doc-page-text, #000000)",o.showBorders&&(e.style.border="1px solid #ccc"),o.showShadow&&(e.style.boxShadow="0 2px 8px rgba(0, 0, 0, 0.15)");}function Sn(e,t){switch(t??"allPages"){case "firstPage":return e===1;case "notFirstPage":return e!==1;default:return true}}function ke(e){return e?.space!==void 0?chunkBJSG6TEG_js.j(e.space):0}function we(e,t,n,o){if(!t||t.style==="none"||t.style==="nil")return;let r=chunkQ2VALXEU_js.c(t,n,o);for(let[l,m]of Object.entries(r))e.style[l]=String(m);let a=`border${n}Style`,i=`border${n}Width`;if(e.style[a]==="double"){let l=parseFloat(e.style[i]);(!Number.isFinite(l)||l<3)&&(e.style[i]="3px");}}function kn(e,t,n){let o=t.pageBorders;if(!o||!Sn(e.number,o.display)||![o.top,o.bottom,o.left,o.right].some(b=>b&&b.style!=="none"&&b.style!=="nil"))return null;let a=o.offsetFrom??"text",i=ke(o.top),d=ke(o.right),l=ke(o.bottom),m=ke(o.left),s=n.createElement("div");return s.className="layout-page-border",s.style.position="absolute",s.style.pointerEvents="none",s.style.boxSizing="border-box",s.style.zIndex=o.zOrder==="back"?"0":"20",a==="page"?(s.style.top=`${i}px`,s.style.right=`${d}px`,s.style.bottom=`${l}px`,s.style.left=`${m}px`):(s.style.top=`${Math.max(0,e.margins.top-i)}px`,s.style.right=`${Math.max(0,e.margins.right-d)}px`,s.style.bottom=`${Math.max(0,e.margins.bottom-l)}px`,s.style.left=`${Math.max(0,e.margins.left-m)}px`),we(s,o.top,"Top",t.theme),we(s,o.bottom,"Bottom",t.theme),we(s,o.left,"Left",t.theme),we(s,o.right,"Right",t.theme),s}function wn(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 Tn(e,t,n){e.style.position="absolute",e.style.left=`${t.x-n.left}px`;let o=t.y-n.top;e.style.top=`${t.kind==="table"?Math.round(o):o}px`,e.style.width=`${t.width}px`,"height"in t&&t.kind!=="table"&&(e.style.height=`${t.height}px`);}function In(e,t,n,o){let r=[];for(let a of e.runs){if(a.kind!=="image")continue;let i=a;if(!chunkDX5XU6JN_js.c(i))continue;let d=i.distTop??0,l=i.distBottom??0,m=i.distLeft??12,s=i.distRight??12,{x:b,y:g,side:u}=chunkDX5XU6JN_js.g(i,t,n,o);r.push({src:i.src,width:i.width,height:i.height,alt:i.alt,transform:i.transform,side:u,x:b,y:g,distTop:d,distBottom:l,distLeft:m,distRight:s,pmStart:i.pmStart,pmEnd:i.pmEnd,wrapText:chunkDX5XU6JN_js.e(i.cssFloat),wrapType:i.wrapType,cropTop:i.cropTop,cropRight:i.cropRight,cropBottom:i.cropBottom,cropLeft:i.cropLeft,opacity:i.opacity});}return r}function Se(e,t,n={}){let o=n.document??document,r=o.createElement("div");if(r.className=n.pageClassName??G.page,r.dataset.pageNumber=String(e.number),le(r,e.size.w,e.size.h,n),n.watermark){let c=mt(n.watermark,e,o);c&&r.appendChild(c);}let a=kn(e,n,o);a&&n.pageBorders?.zOrder==="back"&&r.appendChild(a);let i=o.createElement("div");i.className=G.content,wn(i,e);let d=chunkDX5XU6JN_js.f(e),l=d.contentWidth,m=[],s=[];for(let c of e.fragments)if(c.kind==="paragraph"&&n.blockLookup){let x=n.blockLookup.get(String(c.blockId));if(x?.block.kind==="paragraph"){let T=x.block,S=c.y-e.margins.top,k=In(T,S,l,d);m.push(...k);}}for(let c of m)chunkDX5XU6JN_js.a(c)&&s.push({side:c.side,x:c.x,y:c.y,width:c.width,height:c.height,distTop:c.distTop,distBottom:c.distBottom,distLeft:c.distLeft,distRight:c.distRight,wrapText:c.wrapText,wrapType:c.wrapType});if(n.blockLookup)for(let c of e.fragments){if(c.kind!=="table")continue;let x=n.blockLookup.get(String(c.blockId));if(x?.block.kind!=="table")continue;let S=x.block.floating;if(!S)continue;let k=c.x-e.margins.left,f=c.y-e.margins.top,h=S.topFromText??0,R=S.bottomFromText??0,C=S.leftFromText??12,I=S.rightFromText??12,v=k<l/2?"left":"right";s.push({side:v,x:k,y:f,width:c.width,height:c.height,distTop:h,distBottom:R,distLeft:C,distRight:I});}if(n.blockLookup)for(let c of e.fragments){if(c.kind!=="textBox")continue;let x=n.blockLookup.get(String(c.blockId));if(x?.block.kind!=="textBox")continue;let T=x.block;if(!chunkEJ2JAYRI_js.L(T))continue;let S=c.y-e.margins.top,k=chunkDX5XU6JN_js.g({width:c.width,height:c.height,position:T.position,cssFloat:T.cssFloat},S,l,d);c.x=e.margins.left+k.x,c.y=e.margins.top+k.y,!(!chunkEJ2JAYRI_js.M(T)&&!chunkEJ2JAYRI_js.N(T))&&s.push({side:k.side,x:k.x,y:k.y,width:c.width,height:c.height,distTop:T.distTop??0,distBottom:T.distBottom??0,distLeft:T.distLeft??12,distRight:T.distRight??12,wrapText:T.wrapText,wrapType:T.wrapType});}let b=s.length>0?chunkEJ2JAYRI_js.C(s,l):[],g=m.filter(chunkDX5XU6JN_js.b),u=m.filter(c=>!chunkDX5XU6JN_js.b(c));if(g.length>0){let c=q(g,o,{layerClass:"layout-floating-images-layer",itemClass:"layout-page-floating-image",sizing:"inset0",layerMode:"behind"});i.appendChild(c);}let E=c=>{if(c.kind!=="paragraph"||!n.blockLookup||!c.blockId)return;let x=n.blockLookup.get(String(c.blockId));if(x?.block.kind==="paragraph")return x.block.attrs?.borders},y,p=new Map,w=c=>!n.blockLookup||!c.blockId?[]:n.blockLookup.get(String(c.blockId))?.block.sdtGroups??[],F=(c,x)=>{if(x.length===0)return;let T=x[x.length-1];c.classList.add("layout-block-sdt"),c.dataset.sdtGroupId=T.id,c.dataset.sdtType=T.sdtType,c.dataset.sdtDepth=String(x.length),T.tag!=null&&(c.dataset.sdtTag=T.tag),T.alias!=null&&(c.dataset.sdtAlias=T.alias),T.lock!=null&&(c.dataset.sdtLock=T.lock);};for(let c=0;c<e.fragments.length;c++){let x=e.fragments[c],T,S={...t,section:"body",contentWidth:l},k=x.y-e.margins.top;if(n.blockLookup&&x.blockId){let f=n.blockLookup.get(String(x.blockId));if(x.kind==="paragraph"&&f?.block.kind==="paragraph"&&f?.measure.kind==="paragraph"){let h=f.block,R=c+1<e.fragments.length?E(e.fragments[c+1]):void 0,C=String(x.blockId),I=p.get(C);I||(I=new Set,p.set(C,I));let v=f.measure;b.length>0&&(v=chunkEJ2JAYRI_js.z(h,l,{floatingZones:b,paragraphYOffset:k})),T=D(x,h,v,S,{document:o,prevBorders:y,nextBorders:R,renderedInlineImageKeys:I}),y=h.attrs?.borders;}else x.kind==="table"&&f?.block.kind==="table"&&f?.measure.kind==="table"?(T=Q(x,f.block,f.measure,S,{document:o}),y=void 0):x.kind==="image"&&f?.block.kind==="image"&&f?.measure.kind==="image"?(T=Z(x,f.block,f.measure,S,{document:o}),y=void 0):x.kind==="textBox"&&f?.block.kind==="textBox"&&f?.measure.kind==="textBox"?(T=ee(x,f.block,f.measure,S,{document:o}),y=void 0):(T=Ie(x,S,{document:o}),y=void 0);}else T=Ie(x,S,{document:o}),y=void 0;Tn(T,x,{left:e.margins.left,top:e.margins.top}),F(T,w(x)),i.appendChild(T);}if(tt(e,i,l,w,o),u.length>0){let c=q(u,o,{layerClass:"layout-floating-images-layer",itemClass:"layout-page-floating-image",sizing:"inset0",layerMode:"front"});i.appendChild(c);}if(e.columns&&e.columns.separator&&e.columns.count>1){let c=e.columns.count,x=e.columns.gap,T=(l-(c-1)*x)/c,S=e.size.h-e.margins.top-e.margins.bottom;for(let k=0;k<c-1;k++){let f=(k+1)*T+k*x+x/2,h=o.createElement("div");h.style.position="absolute",h.style.left=`${f}px`,h.style.top="0",h.style.height=`${S}px`,h.style.width="0.5px",h.style.backgroundColor="#000",h.style.pointerEvents="none",i.appendChild(h);}}if(n.footnoteArea&&n.footnoteArea.length>0){let c=bt(n.footnoteArea,l,t,o);c.style.position="absolute";let x=Math.max(e.footnoteReservedHeight??0,yt(n.footnoteArea)),T=e.size.h-e.margins.bottom-e.margins.top;c.style.top=`${Math.max(-e.margins.top,T-x)}px`,c.style.left="0",c.style.right="0",i.appendChild(c);}r.appendChild(i);{let x=n.headerDistance??e.margins.header??48,T=e.size.w-e.margins.left-e.margins.right,S=Math.max(e.margins.top-x,48),k=n.headerContent?.visualTop??0,f=n.headerContent?.visualBottom??n.headerContent?.height??0,h=Math.max(f-k,24),R=f>S,C=o.createElement("div");C.className=G.header,C.style.position="absolute",C.style.top=`${x+k}px`,C.style.left=`${e.margins.left}px`,C.style.right=`${e.margins.right}px`,C.style.width=`${T}px`,C.style.height=`${h}px`,C.style.minHeight=`${h}px`;let I=!R;if(n.headerContent&&n.headerContent.blocks.length>0){let v={flowTop:x,flowLeft:e.margins.left,contentWidth:T,pageWidth:e.size.w,pageHeight:e.size.h,margins:e.margins},L=Be(n.headerContent,{...t,section:"header",contentWidth:T},n,v);L.style.top=`${-k}px`,L.querySelector("img")&&(I=false),C.appendChild(L);}I&&(C.style.maxHeight=`${S}px`,C.style.overflow="hidden"),r.appendChild(C);}{let x=n.footerDistance??e.margins.footer??48,T=e.size.w-e.margins.left-e.margins.right,S=Math.max(e.margins.bottom-x,48),k=n.footerContent?.visualTop??0,f=n.footerContent?.visualBottom??n.footerContent?.height??0,h=Math.max(f-k,24),R=h>S,C=o.createElement("div");C.className=G.footer,C.style.position="absolute",C.style.top=`${e.size.h-x-h}px`,C.style.left=`${e.margins.left}px`,C.style.right=`${e.margins.right}px`,C.style.width=`${T}px`,C.style.height=`${h}px`,C.style.minHeight=`${h}px`;let I=!R;if(n.footerContent&&n.footerContent.blocks.length>0){let v={flowTop:e.size.h-x-(n.footerContent?.height??0),flowLeft:e.margins.left,contentWidth:T,pageWidth:e.size.w,pageHeight:e.size.h,margins:e.margins},L=Be(n.footerContent,{...t,section:"footer",contentWidth:T},n,v);L.style.top=`${-k}px`,L.querySelector("img")&&(I=false),C.appendChild(L);}I&&(C.style.maxHeight=`${S}px`,C.style.overflow="hidden"),r.appendChild(C);}return a&&n.pageBorders?.zOrder!=="back"&&r.appendChild(a),r}exports.A=ht;exports.B=hn;exports.C=xn;exports.D=G;exports.E=le;exports.F=Se;exports.a=be;exports.b=Me;exports.c=an;exports.d=Co;exports.e=ye;exports.f=dn;exports.g=cn;exports.h=Ro;exports.i=He;exports.j=Eo;exports.k=Lo;exports.l=Fn;exports.m=Cn;exports.n=U;exports.o=Ie;exports.p=nt;exports.q=Z;exports.r=dt;exports.s=he;exports.t=D;exports.u=q;exports.v=_;exports.w=Q;exports.x=Zt;exports.y=ee;exports.z=Pe;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var chunk2KPOGFFR_js=require('./chunk-2KPOGFFR.js'),chunkEJ2JAYRI_js=require('./chunk-EJ2JAYRI.js'),chunkBKP5QMTS_js=require('./chunk-BKP5QMTS.js'),chunkBJSG6TEG_js=require('./chunk-BJSG6TEG.js');function be(e,n){let i=e.floating;if(!i)return false;let r=chunkEJ2JAYRI_js.f(e,n),t=0;i.tblpX!==void 0?t=i.tblpX:i.tblpXSpec?i.tblpXSpec==="left"||i.tblpXSpec==="inside"?t=0:i.tblpXSpec==="right"||i.tblpXSpec==="outside"?t=n-r:i.tblpXSpec==="center"&&(t=(n-r)/2):e.justification==="center"?t=(n-r)/2:e.justification==="right"&&(t=n-r);let o=i.leftFromText??0,l=i.rightFromText??0,a=t-o,s=n-(t+r)-l;return a<chunkEJ2JAYRI_js.E&&s<chunkEJ2JAYRI_js.E}function We(e,n,i){for(let r=0;r<e.length;r++){let t=e[r];t.kind==="table"&&t.floating&&be(t,n[r]??i)&&(e[r]={...t,floating:void 0});}}function ne(e,n){if(e.pages.length===0)return null;let i=e.pageGap??0,r=0,t=null,o=1/0;for(let l=0;l<e.pages.length;l++){let a=e.pages[l],s=a.size?.h??e.pageSize.h,f=r,u=f+s;if(n.y>=f&&n.y<u)return {pageIndex:l,page:a,pageY:n.y-f};let c=f+s/2,g=Math.abs(n.y-c);g<o&&(o=g,t=l),r=u+i;}if(t!==null){let l=e.pages[t],a=A(e,t);return {pageIndex:t,page:l,pageY:Math.max(0,Math.min(n.y-a,l.size?.h??e.pageSize.h))}}return null}function A(e,n){let i=e.pageGap??0,r=0;for(let t=0;t<n&&t<e.pages.length;t++){let l=e.pages[t].size?.h??e.pageSize.h;r+=l+i;}return r}function Ge(e,n){return ne(e,{y:n})?.pageIndex??null}function oe(e,n){return e.findIndex(i=>i.id===n)}function Ve(e,n){let i=0;for(let r=e.fromLine;r<e.toLine&&r<n.lines.length;r++)i+=n.lines[r].lineHeight;return i}function xe(e,n,i,r){let t=[...e.page.fragments].sort((o,l)=>{let a=o.y-l.y;return Math.abs(a)>.5?a:o.x-l.x});for(let o of t){let l=oe(n,o.blockId);if(l===-1)continue;let a=n[l],s=i[l];if(!a||!s)continue;let f;if(o.kind==="paragraph"){if(a.kind!=="paragraph"||s.kind!=="paragraph")continue;f=Ve(o,s);}else if(o.kind==="table")f=o.height;else if(o.kind==="image")f=o.height;else continue;let u=r.x>=o.x&&r.x<=o.x+o.width,c=r.y>=o.y&&r.y<=o.y+f;if(u&&c)return {fragment:o,block:a,measure:s,pageIndex:e.pageIndex,localX:r.x-o.x,localY:r.y-o.y}}return null}function Ue(e,n,i,r){for(let t of e.page.fragments){if(t.kind!=="image")continue;let o=oe(n,t.blockId);if(o===-1)continue;let l=n[o],a=i[o];if(!l||!a)continue;let s=r.x>=t.x&&r.x<=t.x+t.width,f=r.y>=t.y&&r.y<=t.y+t.height;if(s&&f)return {fragment:t,block:l,measure:a,pageIndex:e.pageIndex,localX:r.x-t.x,localY:r.y-t.y}}return null}function Te(e,n,i,r){for(let t of e.page.fragments){if(t.kind!=="table")continue;let o=t,l=r.x>=o.x&&r.x<=o.x+o.width,a=r.y>=o.y&&r.y<=o.y+o.height;if(!l||!a)continue;let s=oe(n,o.blockId);if(s===-1)continue;let f=n[s],u=i[s];if(!f||f.kind!=="table"||!u||u.kind!=="table")continue;let c=f,g=u,h=r.x-o.x,x=r.y-o.y,d=o.headerRowCount??0,m=d>0&&o.continuesFromPrev?chunkEJ2JAYRI_js.Y(g,d):0,p=0,b=-1;if(g.rows.length===0||c.rows.length===0)continue;if(m>0&&x<m){let F=0;for(let w=0;w<d&&w<g.rows.length;w++){let L=g.rows[w];if(x>=F&&x<F+L.height){b=w;break}F+=L.height;}b===-1&&(b=0);}else {let F=x-m;for(let w=o.fromRow;w<o.toRow&&w<g.rows.length;w++){let L=g.rows[w];if(F>=p&&F<p+L.height){b=w;break}p+=L.height;}}if(b===-1&&(b=Math.min(o.toRow-1,g.rows.length-1),b<o.fromRow))continue;let k=g.rows[b],H=c.rows[b];if(!k||!H)continue;let M=0,T=-1;if(k.cells.length===0||H.cells.length===0)continue;for(let F=0;F<k.cells.length;F++){let w=k.cells[F];if(h>=M&&h<M+w.width){T=F;break}M+=w.width;}if(T===-1&&(T=k.cells.length-1,T<0))continue;let P=k.cells[T],S=H.cells[T];if(!P||!S)continue;let y=0;if(m>0&&b<d)for(let F=0;F<b;F++)y+=g.rows[F]?.height??0;else {y=m;for(let F=o.fromRow;F<b;F++)y+=g.rows[F]?.height??0;}let R=0;for(let F=0;F<T;F++)R+=k.cells[F]?.width??0;let X,I;if(S.blocks&&S.blocks.length>0){let F=S.blocks[0],w=P.blocks[0];F.kind==="paragraph"&&w?.kind==="paragraph"&&(X=F,I=w);}let E=h-R,C=x-y;return {fragment:o,block:c,measure:g,pageIndex:e.pageIndex,rowIndex:b,colIndex:T,cellBlock:X,cellMeasure:I,cellLocalX:Math.max(0,E),cellLocalY:Math.max(0,C)}}return null}function $e(e,n,i,r){let t={pageHit:null,fragmentHit:null,tableCellHit:null};if(t.pageHit=ne(e,r),!t.pageHit)return t;let o=A(e,t.pageHit.pageIndex),l={x:r.x,y:r.y-o};return t.fragmentHit=xe(t.pageHit,n,i,l),t.fragmentHit?.fragment.kind==="table"&&(t.tableCellHit=Te(t.pageHit,n,i,l)),t}function qe(e){if(e.pages.length===0)return 0;let n=e.pageGap??0,i=0;for(let r=0;r<e.pages.length;r++){let t=e.pages[r];i+=t.size?.h??e.pageSize.h,r<e.pages.length-1&&(i+=n);}return i}function je(e,n){return A(e,n)}function Je(e,n){if(n<0||n>=e.pages.length)return null;let i=A(e,n),t=e.pages[n].size?.h??e.pageSize.h;return {top:i,bottom:i+t}}function re(e){return {fontFamily:e.fontFamily??"Arial",fontSize:e.fontSize??12,bold:e.bold,italic:e.italic,letterSpacing:e.letterSpacing}}function ke(e,n){let i=[];for(let r=n.fromRun;r<=n.toRun&&r<e.runs.length;r++){let t=e.runs[r];if(t){if(t.kind==="tab"||t.kind==="image"||t.kind==="lineBreak"){i.push(t);continue}if(t.kind==="text"){let o=t.text??"",l=r===n.fromRun,a=r===n.toRun;if(l||a){let s=l?n.fromChar:0,f=a?n.toChar:o.length,u=o.slice(s,f);u.length>0&&i.push({...t,text:u});}else i.push(t);}}}return i}function Fe(e,n){let i,r,t=e.pmStart??0,o=0;for(let l=0;l<e.runs.length&&l<=n.toRun;l++){let a=e.runs[l];a&&(l<n.fromRun?a.kind==="text"?o+=(a.text??"").length:(a.kind==="tab"||a.kind==="lineBreak"||a.kind==="image")&&(o+=1):l===n.fromRun&&(o+=n.fromChar,i=t+o,a.kind==="text"&&(o=n.fromChar)));}if(i!==void 0){let l=0;for(let a=n.fromRun;a<=n.toRun&&a<e.runs.length;a++){let s=e.runs[a];if(s)if(s.kind==="text"){let f=s.text??"",u=a===n.fromRun?n.fromChar:0,c=a===n.toRun?n.toChar:f.length;l+=c-u;}else (s.kind==="tab"||s.kind==="lineBreak"||s.kind==="image")&&(l+=1);}r=i+l;}return {pmStart:i,pmEnd:r}}function Ke(e,n,i,r){let t=0;for(let o=i;o<r&&o<e.lines.length;o++){let a=e.lines[o].lineHeight;if(n>=t&&n<t+a)return o;t+=a;}return r>i?Math.min(r-1,e.lines.length-1):null}function Qe(e,n,i,r){let{pmStart:t,pmEnd:o}=Fe(e,n);if(t===void 0||o===void 0)return {charOffset:0,pmPosition:e.pmStart??0};let l=e.attrs?.alignment??"left",a=0;l==="center"?a=Math.max(0,(r-n.width)/2):l==="right"&&(a=Math.max(0,r-n.width));let s=Math.max(0,i-a);if(s<=0)return {charOffset:0,pmPosition:t};let f=ke(e,n);if(f.length===0)return {charOffset:0,pmPosition:t};let u=0,c=0;for(let h of f){if(h.kind==="tab"){let x=h.width??48,d=u+x;if(s<=d){let m=u+x/2;return s<m?{charOffset:c,pmPosition:t+c}:{charOffset:c+1,pmPosition:t+c+1}}u=d,c+=1;continue}if(h.kind==="image"){let x=h.width,d=u+x;if(s<=d){let m=u+x/2;return s<m?{charOffset:c,pmPosition:t+c}:{charOffset:c+1,pmPosition:t+c+1}}u=d,c+=1;continue}if(h.kind==="lineBreak"){if(s>=u)return {charOffset:c,pmPosition:t+c};c+=1;continue}if(h.kind==="text"){let x=h.text??"";if(x.length===0)continue;let d=re(h),m=chunkEJ2JAYRI_js.m(x,d),p=u+m.width;if(s<=p){let b=s-u,k=chunkEJ2JAYRI_js.n(b,m.charWidths),H=c+k;return {charOffset:H,pmPosition:t+H}}u=p,c+=x.length;}}return {charOffset:o-t,pmPosition:o}}function ie(e){let{fragment:n,block:i,measure:r,localX:t,localY:o}=e;if(n.kind!=="paragraph"||i.kind!=="paragraph"||r.kind!=="paragraph")return null;let l=n,a=i,s=r,f=Ke(s,o,l.fromLine,l.toLine);if(f===null)return null;let u=s.lines[f];if(!u)return null;let c=0;for(let k=l.fromLine;k<f;k++)c+=s.lines[k]?.lineHeight??0;let g=a.attrs?.indent,h=g?.left??0,x=g?.right??0,d=Math.max(0,n.width-h-x),m=t-h,{charOffset:p,pmPosition:b}=Qe(a,u,m,d);return {pmPosition:b,charOffset:p,lineIndex:f}}function Me(e){let{cellBlock:n,cellMeasure:i,cellLocalX:r,cellLocalY:t}=e;if(!n||!i)return null;let o={fragment:{kind:"paragraph",blockId:n.id,x:0,y:0,width:i.lines.reduce((a,s)=>Math.max(a,s.width),100),fromLine:0,toLine:i.lines.length,height:i.totalHeight},block:n,measure:i,pageIndex:e.pageIndex,localX:r,localY:t};return ie(o)?.pmPosition??null}function Ze(e,n){if(n)return Me(n);if(!e)return null;let{fragment:i}=e;return i.kind==="paragraph"?ie(e)?.pmPosition??null:i.kind==="image"?i.pmStart??null:null}function ye(e,n,i,r){let t=e.pmStart??0,o=e.pmEnd??t;if(i<t||i>o)return null;let l=i-t;for(let a=0;a<n.lines.length;a++){let s=n.lines[a],{pmStart:f,pmEnd:u}=Fe(e,s);if(f===void 0||u===void 0)continue;let c=f-t,g=u-t;if(l>=c&&l<=g){let h=l-c,x=ke(e,s),d=0,m=0;for(let p of x)if(p.kind==="tab"){if(h<=m+1)return h<=m?{x:d,lineIndex:a}:{x:d+(p.width??48),lineIndex:a};d+=p.width??48,m+=1;}else if(p.kind==="image"){if(h<=m+1)return h<=m?{x:d,lineIndex:a}:{x:d+p.width,lineIndex:a};d+=p.width,m+=1;}else if(p.kind==="lineBreak"){if(h<=m)return {x:d,lineIndex:a};m+=1;}else if(p.kind==="text"){let b=p.text??"";if(h<=m+b.length){let M=h-m,T=re(p),P=chunkEJ2JAYRI_js.m(b.slice(0,M),T);return {x:d+P.width,lineIndex:a}}let k=re(p),H=chunkEJ2JAYRI_js.m(b,k);d+=H.width,m+=b.length;}return {x:d,lineIndex:a}}}return null}function et(e,n,i,r,t,o,l){let a=ye(e,n,i);if(!a)return null;let s=e.attrs?.alignment??"left",f=e.attrs?.indent,u=f?.left??0,c=f?.right??0,g=Math.max(0,o-u-c),h=n.lines[a.lineIndex];if(!h)return null;let x=0;s==="center"?x=Math.max(0,(g-h.width)/2):s==="right"&&(x=Math.max(0,g-h.width));let d=0;for(let m=l;m<a.lineIndex;m++)d+=n.lines[m]?.lineHeight??0;return {x:r+u+x+a.x,y:t+d,height:h.lineHeight}}function tt(e,n,i={}){let r=i.scope??"body",t=r==="body"?"layout-page-content":`layout-page-${r}`,o=`.${t} .layout-table-cell`,l=e.querySelectorAll(`.${t} .layout-table-cell-selected`);for(let c of Array.from(l))c.classList.remove("layout-table-cell-selected");let a=n.selection;if(!("$anchorCell"in a&&typeof a.forEachCell=="function")||!a.forEachCell)return;let f=[];a.forEachCell((c,g)=>{f.push([g,g+c.nodeSize]);});let u=e.querySelectorAll(o);for(let c of Array.from(u)){let g=c,h=g.dataset.pmStart;if(h===void 0)continue;let x=Number(h);for(let[d,m]of f)if(x>=d&&x<m){g.classList.add("layout-table-cell-selected");break}}}function He(e){return {fontFamily:e.fontFamily??"Arial",fontSize:e.fontSize??12,bold:e.bold,italic:e.italic,letterSpacing:e.letterSpacing}}function ae(e,n){return e.findIndex(i=>i.id===n)}function V(e,n){let r=(e.pmStart??0)+1,t=0,o;for(let s=0;s<e.runs.length&&s<=n.toRun;s++){let f=e.runs[s];if(f){if(s<n.fromRun)f.kind==="text"?t+=(f.text??"").length:t+=1;else if(s===n.fromRun){t+=n.fromChar,o=r+t;break}}}o===void 0&&(o=r);let l=0;for(let s=n.fromRun;s<=n.toRun&&s<e.runs.length;s++){let f=e.runs[s];if(f)if(f.kind==="text"){let u=f.text??"",c=s===n.fromRun?n.fromChar:0,g=s===n.toRun?n.toChar:u.length;l+=g-c;}else l+=1;}let a=o+l;return {pmStart:o,pmEnd:a}}function we(e,n,i,r){let t=[];for(let o=0;o<n.lines.length;o++){let l=n.lines[o],a=V(e,l);a.pmStart===void 0||a.pmEnd===void 0||a.pmEnd>i&&a.pmStart<r&&t.push({line:l,index:o});}return t}function W(e,n,i){let r=V(e,n);return r.pmStart===void 0?0:Math.max(0,i-r.pmStart)}function G(e,n,i,r){let t=0,o=0;for(let l=n.fromRun;l<=n.toRun&&l<e.runs.length;l++){let a=e.runs[l];if(a){if(a.kind==="tab"){let s=a.width??48;if(o+1>=i)return i<=o?t:t+s;t+=s,o+=1;continue}if(a.kind==="image"){let s=a.width;if(o+1>=i)return i<=o?t:t+s;t+=s,o+=1;continue}if(a.kind==="lineBreak"){if(i<=o)return t;o+=1;continue}if(a.kind==="text"){let s=a.text??"",f=l===n.fromRun,u=l===n.toRun,c=f?n.fromChar:0,g=u?n.toChar:s.length,h=s.slice(c,g);if(o+h.length>=i){let m=i-o,p=He(a),b=chunkEJ2JAYRI_js.m(h.slice(0,m),p);return t+b.width}let x=He(a),d=chunkEJ2JAYRI_js.m(h,x);t+=d.width,o+=h.length;}}}return t}function J(e,n){let i=0;for(let r=0;r<n&&r<e.lines.length;r++)i+=e.lines[r].lineHeight;return i}function nt(e,n,i,r,t){if(r===t)return [];let o=Math.min(r,t),l=Math.max(r,t),a=[];for(let s=0;s<e.pages.length;s++){let f=e.pages[s],u=A(e,s);for(let c of f.fragments){if(c.kind==="paragraph"){let g=ae(n,c.blockId);if(g===-1)continue;let h=n[g],x=i[g];if(!h||h.kind!=="paragraph"||!x||x.kind!=="paragraph")continue;let d=h,m=x,p=c,b=we(d,m,o,l);for(let{line:k,index:H}of b){if(H<p.fromLine||H>=p.toLine)continue;let M=V(d,k);if(M.pmStart===void 0||M.pmEnd===void 0)continue;let T=Math.max(M.pmStart,o),P=Math.min(M.pmEnd,l);if(T>=P)continue;let S=W(d,k,T),y=W(d,k,P),B=d.attrs?.indent,R=B?.left??0,X=B?.right??0,I=Math.max(0,c.width-R-X),E=G(d,k,S),C=G(d,k,y),F=d.attrs?.alignment??"left",w=0;F==="center"?w=Math.max(0,(I-k.width)/2):F==="right"&&(w=Math.max(0,I-k.width));let L=J(m,H)-J(m,p.fromLine),D=c.x+R+w+Math.min(E,C),Y=Math.max(1,Math.abs(C-E)),z=c.y+L;a.push({x:D,y:z+u,width:Y,height:k.lineHeight,pageIndex:s});}}if(c.kind==="table"){let g=ae(n,c.blockId);if(g===-1)continue;let h=n[g],x=i[g];if(!h||h.kind!=="table"||!x||x.kind!=="table")continue;let d=h,m=x,p=c,b=[],k=0;for(let y=0;y<m.rows.length;y++)b.push(Math.round(k)),k+=m.rows[y]?.height??0;b.push(Math.round(k));let H=p.headerRowCount??0,M=H>0&&p.continuesFromPrev?chunkEJ2JAYRI_js.Y(m,H):0,T=(b[p.fromRow]??0)+(p.topClip??0),P=p.bottomClip!==void 0?Math.round(p.height):M+((b[p.toRow]??0)-T),S=y=>M+(y-T);for(let y=p.fromRow;y<p.toRow&&y<d.rows.length;y++){let B=d.rows[y],R=m.rows[y];if(!B||!R)continue;let X=b[y]??0,I=0;for(let E=0;E<B.cells.length;E++){let C=B.cells[E],F=R.cells[E];if(!C||!F)continue;let w=C.padding?.top??0,L=chunkEJ2JAYRI_js.O(C.blocks,F.blocks,w);for(let D=0;D<C.blocks.length;D++){let Y=C.blocks[D],z=F.blocks[D];if(!Y||Y.kind!=="paragraph"||!z||z.kind!=="paragraph")continue;let O=Y,_e=z,Xe=L.lineTops[D]??[],Oe=we(O,_e,o,l);for(let{line:v,index:Ne}of Oe){let q=V(O,v);if(q.pmStart===void 0||q.pmEnd===void 0)continue;let se=Math.max(q.pmStart,o),ce=Math.min(q.pmEnd,l);if(se>=ce)continue;let Q=S(X+(Xe[Ne]??0));if(Q+v.lineHeight<=M||Q>=P)continue;let Ye=W(O,v,se),ze=W(O,v,ce),ue=G(O,v,Ye,F.width),fe=G(O,v,ze,F.width);a.push({x:p.x+I+Math.min(ue,fe),y:p.y+Q+u,width:Math.max(1,Math.abs(fe-ue)),height:v.lineHeight,pageIndex:s});}}I+=F.width;}}}if(c.kind==="image"){let g=c.pmStart??0;(c.pmEnd??g+1)>o&&g<l&&a.push({x:c.x,y:c.y+u,width:c.width,height:c.height,pageIndex:s});}}}return a}function ot(e,n,i,r){for(let t=0;t<e.pages.length;t++){let o=e.pages[t],l=A(e,t);for(let a of o.fragments){if(a.kind==="paragraph"){let s=ae(n,a.blockId);if(s===-1)continue;let f=n[s],u=i[s];if(!f||f.kind!=="paragraph"||!u||u.kind!=="paragraph")continue;let c=f,g=u,h=a,x=c.pmStart??0,d=c.pmEnd??x;if(r<x||r>d)continue;for(let m=h.fromLine;m<h.toLine;m++){let p=g.lines[m];if(!p)continue;let b=V(c,p);if(!(b.pmStart===void 0||b.pmEnd===void 0)&&r>=b.pmStart&&r<=b.pmEnd){let k=W(c,p,r),H=c.attrs?.indent,M=H?.left??0,T=H?.right??0,P=Math.max(0,a.width-M-T),S=G(c,p,k),y=c.attrs?.alignment??"left",B=0;y==="center"?B=Math.max(0,(P-p.width)/2):y==="right"&&(B=Math.max(0,P-p.width));let R=J(g,m)-J(g,h.fromLine);return {x:a.x+M+B+S,y:a.y+R+l,height:p.lineHeight,pageIndex:t}}}}if(a.kind==="image"){let s=a.pmStart??0,f=a.pmEnd??s+1;if(r>=s&&r<=f){let u=r===s?0:a.width;return {x:a.x+u,y:a.y+l,height:a.height,pageIndex:t}}}}}return null}function rt(e){return e.length<=1?false:new Set(e.map(i=>i.pageIndex)).size>1}function it(e){let n=new Map;for(let i of e){let r=n.get(i.pageIndex)??[];r.push(i),n.set(i.pageIndex,r);}return n}function at(e){if(e.kind!=="paragraph")return false;let n=e.attrs;return n?!!(n.borders?.top||n.borders?.bottom||n.spacingExplicit?.before||n.spacingExplicit?.after):false}function Pe(e){return Se(e)}function Se(e){let n=new Set;for(let i=1;i<e.length;i++){let r=e[i-1],t=e[i];r.kind==="table"&&t.kind==="paragraph"&&(t.runs.length>0||at(t)||n.add(i));}return e.map((i,r)=>{if(i.kind==="table")return lt(i);if(i.kind!=="paragraph")return i;let t=n.has(r),o=i.attrs?.spacingExplicit,l=i.attrs?.spacing?.before!=null,a=i.attrs?.spacing?.after!=null,s=l&&!o?.before,f=a&&!o?.after,u=s||f;if(!u&&!t)return i;let c=i.attrs;return u&&c?.spacing&&(c={...c,spacing:{...c.spacing,before:o?.before?c.spacing.before:void 0,after:o?.after?c.spacing.after:void 0}}),t&&(c={...c??{},suppressEmptyParagraphHeight:true}),{...i,attrs:c}})}function lt(e){let n=false,i=e.rows.map(r=>{let t=false,o=r.cells.map(l=>{let a=Se(l.blocks);return a.some((f,u)=>f!==l.blocks[u])?(t=true,{...l,blocks:a}):l});return t?(n=true,{...r,cells:o}):r});return n?{...e,rows:i}:e}function st(e){return e?.align??e?.alignment}function Be(e,n,i,r){let t=r.section==="header"?r.margins.header??48:r.pageSize.h-(r.margins.footer??48)-i,o=e.position?.vertical;if(!o)return n;let l=st(o),a=o.posOffset!==void 0?chunkBJSG6TEG_js.f(o.posOffset):void 0;if(o.relativeTo==="page"){if(a!==void 0)return a-t;if(l==="top")return -t;if(l==="bottom")return r.pageSize.h-e.height-t;if(l==="center")return (r.pageSize.h-e.height)/2-t}if(o.relativeTo==="margin"){let s=r.margins.top,f=r.pageSize.h-r.margins.top-r.margins.bottom;if(a!==void 0)return s+a-t;if(l==="top")return s-t;if(l==="bottom")return s+f-e.height-t;if(l==="center")return s+(f-e.height)/2-t}return a!==void 0?n+a:n}function Re(e){switch(e.kind){case "paragraph":case "table":return true;case "image":return !e.anchor?.isAnchored;case "textBox":return e.displayMode===void 0||e.displayMode==="inline";default:return false}}function ct(e){return e?e.kind==="paragraph"||e.kind==="table"?e.totalHeight:e.kind==="image"||e.kind==="textBox"?e.height:0:0}function Ie(e,n,i,r){let t=0,o=0,l=0;for(let a=0;a<e.length;a++){let s=e[a],f=n[a];if(!(!s||!f)){if(s.kind==="paragraph"&&f.kind==="paragraph"){let u=l,c=u+f.totalHeight;t=Math.min(t,u),o=Math.max(o,c);for(let g of s.runs){if(g.kind!=="image"||!g.position)continue;let h=Be(g,u,i,r);t=Math.min(t,h),o=Math.max(o,h+g.height);}l=c;}else if(s.kind==="table"&&f.kind==="table"){let u=l+f.totalHeight;t=Math.min(t,l),o=Math.max(o,u),l=u;}else if(s.kind==="image"&&f.kind==="image"){let u=l+f.height;t=Math.min(t,l),o=Math.max(o,u),l=u;}else if(s.kind==="textBox"&&f.kind==="textBox"){let u=l+f.height;t=Math.min(t,l),o=Math.max(o,u),s.displayMode!=="float"&&(l=u);}}}return {visualTop:t,visualBottom:o}}function ut(e,n,i,r){if(!e||!e.content||e.content.length===0)return;let t=chunkBKP5QMTS_js.b(e.content,{styles:r.styles??void 0,theme:r.theme??null,defaultTabStopTwips:r.defaultTabStopTwips??null});return Ce(t,n,i,r)}function Ce(e,n,i,r){let t=chunk2KPOGFFR_js.c(e,{theme:r.theme??void 0});if(t.length===0)return;let o=Pe(t),l=r.measureBlocks(o,n),a=0,s=0;for(let c=0;c<o.length;c++){let g=ct(l[c]);a+=g,Re(o[c])&&(s+=g);}let{visualTop:f,visualBottom:u}=Ie(o,l,a,i);return {blocks:o,measures:l,height:a,flowHeight:s,visualTop:f,visualBottom:u}}var K={header:null,footer:null};function ft(){K.header=null,K.footer=null;}function Ee(e,n){let i=n.querySelectorAll(`.layout-page-${e}`);if(i.length===0)return null;let r=n.defaultView,t=r?r.innerHeight/2:0,o=i[0],l=1/0;for(let c of Array.from(i)){let g=c.getBoundingClientRect(),h=Math.abs((g.top+g.bottom)/2-t);h<l&&(l=h,o=c);}let a=K[e];if(a&&a.host===o&&a.host.isConnected)return a;let s=Array.from(o.querySelectorAll("span[data-pm-start][data-pm-end]")),f=Array.from(o.querySelectorAll("[data-pm-start][data-pm-end]")),u={host:o,spans:s,ranged:f};return K[e]=u,u}function dt(e,n,i=globalThis.document){let r=e.state.selection;if(!r.empty)return null;let t=r.head,o=Ee(n,i);if(!o)return null;let{host:l,spans:a}=o;for(let d of a){let m=Number(d.dataset.pmStart),p=Number(d.dataset.pmEnd);if(!(!Number.isFinite(m)||!Number.isFinite(p))&&t>=m&&t<=p){let b=l.ownerDocument.createRange(),k=l.ownerDocument.createTreeWalker(d,NodeFilter.SHOW_TEXT),H=t-m,M=k.nextNode();for(;M;){let S=M.data.length;if(H<=S){try{b.setStart(M,H),b.setEnd(M,H);let y=b.getClientRects()[0]??b.getBoundingClientRect();if(y&&y.height>0)return {top:y.top,left:y.left,height:y.height}}catch{}break}H-=S,M=k.nextNode();}let T=d.getBoundingClientRect(),P=(t-m)/Math.max(1,p-m);return {top:T.top,left:T.left+T.width*P,height:T.height}}}let s=l.querySelector(`[data-pm-start="${t}"]`);if(s){let d=s.getBoundingClientRect();return {top:d.top,left:d.left+1,height:d.height||16}}let f=o.ranged,u=null,c=1/0;for(let d of f){let m=Number(d.dataset.pmStart),p=Number(d.dataset.pmEnd);if(!Number.isFinite(m)||!Number.isFinite(p)||t<m||t>p)continue;let b=p-m;b<c&&(c=b,u=d);}if(u){let d=u.getBoundingClientRect(),m=Number(u.dataset.pmEnd),p=t>=m;return {top:d.top,left:p?d.right:d.left+1,height:d.height||16}}let g=null,h=-1/0;for(let d of f){let m=Number(d.dataset.pmStart);Number.isFinite(m)&&(m>t||m>h&&(h=m,g=d));}if(g){let d=g.getBoundingClientRect();return {top:d.top,left:d.right,height:d.height||16}}let x=l.getBoundingClientRect();return {top:x.top+2,left:x.left+2,height:16}}function mt(e,n,i=globalThis.document){let r=e.state.selection;if(r.empty)return [];let t=r.from,o=r.to,l=[],a=Ee(n,i);if(!a)return l;let{host:s,spans:f}=a;for(let u of f){let c=Number(u.dataset.pmStart),g=Number(u.dataset.pmEnd);if(!Number.isFinite(c)||!Number.isFinite(g)||g<=t||c>=o)continue;if(u.classList.contains("layout-run-tab")){let p=u.getBoundingClientRect();l.push({top:p.top,left:p.left,width:p.width,height:p.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 x=Math.max(0,t-c),d=Math.min(h.length,o-c);if(x>=d)continue;let m=s.ownerDocument.createRange();m.setStart(h,x),m.setEnd(h,d);for(let p of Array.from(m.getClientRects()))l.push({top:p.top,left:p.left,width:p.width,height:p.height});}return l}function Le(e){return e?e.flowHeight??e.height:0}function gt(e){let{pageSize:n,margins:i,finalMargins:r,bodyBlocks:t,headers:o,footers:l,warn:a}=e,s=i.header??48,f=i.footer??48,u=i.top-s,c=i.bottom-f,g=Math.max(0,...(o??[]).map(Le)),h=Math.max(0,...(l??[]).map(Le)),x=g>u,d=h>c;if(!x&&!d)return {margins:i,finalMargins:r};let m=Math.max(0,n.h-24),p=false,b=M=>{let T={...M};return x&&(T.top=Math.max(M.top,s+g)),d&&(T.bottom=Math.max(M.bottom,f+h)),T.top+T.bottom>m&&(p=true,T.bottom=Math.max(0,Math.min(T.bottom,m-T.top)),T.top+T.bottom>m&&(T.top=Math.max(0,m-T.bottom))),T},k=b(i),H=b(r);if(t)for(let M of t){if(M.kind!=="sectionBreak")continue;let T=M;T.margins&&(T.margins=b(T.margins));}return p&&a&&a(`[layout] header/footer content exceeds page height; clamping margins to preserve a content area. pageHeight=${Math.round(n.h)} headerBand=${Math.round(g)} footerBand=${Math.round(h)} top=${Math.round(k.top)} bottom=${Math.round(k.bottom)}`),{margins:k,finalMargins:H}}var Ae=816,De=1056,U=96,le=48;function $(e){return Math.round(e/1440*96)}function N(e,n){return e!=null?$(e):n}function ht(e){return {w:e?.pageWidth?$(e.pageWidth):Ae,h:e?.pageHeight?$(e.pageHeight):De}}function pt(e){return {top:N(e?.marginTop,U),right:N(e?.marginRight,U),bottom:N(e?.marginBottom,U),left:N(e?.marginLeft,U),header:N(e?.headerDistance,le),footer:N(e?.footerDistance,le)}}function bt(e,n){let i={header:null,footer:null,firstHeader:null,firstFooter:null};if(!e?.package)return i;let r=e.package.headers,t=e.package.footers,o=null,l=null,a=null,s=null;if(r&&n?.headerReferences){let f=n.headerReferences.find(c=>c.type==="default");f?.rId&&(o=r.get(f.rId)??null);let u=n.headerReferences.find(c=>c.type==="first");u?.rId&&(a=r.get(u.rId)??null);}if(t&&n?.footerReferences){let f=n.footerReferences.find(c=>c.type==="default");f?.rId&&(l=t.get(f.rId)??null);let u=n.footerReferences.find(c=>c.type==="first");u?.rId&&(s=t.get(u.rId)??null);}return n?.titlePg||(!o&&a&&(o=a),!l&&s&&(l=s)),{header:o,footer:l,firstHeader:a,firstFooter:s}}function xt(e){let n=e?.columnCount??1;if(n<=1)return;let i=$(e?.columnSpace??720);return {count:n,gap:i,equalWidth:e?.equalWidth??true,separator:e?.separator}}function ve(e){let n=e.pageSize.w-e.margins.left-e.margins.right,i=e.columns;return !i||i.count<=1?n:Math.floor((n-(i.count-1)*i.gap)/i.count)}function Tt(e,n,i){let{configs:r,breakIndices:t}=chunkEJ2JAYRI_js.W(e,n,i),o=0,l=[];for(let a=0;a<e.length;a++)l.push(ve(r[o]??n)),o<t.length&&a===t[o]&&o++;return l}exports.A=ut;exports.B=Ce;exports.C=ft;exports.D=dt;exports.E=mt;exports.F=gt;exports.G=Ae;exports.H=De;exports.I=U;exports.J=le;exports.K=$;exports.L=ht;exports.M=pt;exports.N=bt;exports.O=xt;exports.P=ve;exports.Q=Tt;exports.a=be;exports.b=We;exports.c=ne;exports.d=A;exports.e=Ge;exports.f=xe;exports.g=Ue;exports.h=Te;exports.i=$e;exports.j=qe;exports.k=je;exports.l=Je;exports.m=ie;exports.n=Me;exports.o=Ze;exports.p=ye;exports.q=et;exports.r=tt;exports.s=nt;exports.t=ot;exports.u=rt;exports.v=it;exports.w=Pe;exports.x=Be;exports.y=Re;exports.z=Ie;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var chunkNTYJIOUE_js=require('./chunk-NTYJIOUE.js');var t=new chunkNTYJIOUE_js.r(chunkNTYJIOUE_js.q());t.buildSchema();t.initializeRuntime();var s=t,n=t.getSchema();exports.a=s;exports.b=n;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {b as b$1}from'./chunk-3NRMSZX2.mjs';import {g as g$1}from'./chunk-KNY7SXPJ.mjs';function h(c){return JSON.parse(JSON.stringify(c))}function g(c,t){let a=0;for(let r=0;r<c.content.length;r++)if(c.content[r].type==="paragraph"){if(a===t)return r;a++;}return -1}function I(c){let t="";for(let a of c.content)if(a.type==="run")for(let r of a.content)r.type==="text"&&(t+=r.text);else if(a.type==="hyperlink"){for(let r of a.children)if(r.type==="run")for(let e of r.content)e.type==="text"&&(t+=e.text);}return t}function b(c,t){return {type:"run",formatting:t,content:[{type:"text",text:c}]}}function P(c,t,a,r){let e=[],o=0,p=false;for(let n of c.content)if(n.type==="run"){let s=n.content.filter(l=>l.type==="text").map(l=>l.text).join(""),i=o,u=o+s.length;if(!p&&t>=i&&t<=u){let l=t-i;l>0&&e.push({...n,content:[{type:"text",text:s.slice(0,l)}]}),e.push(b(a,r||n.formatting)),l<s.length&&e.push({...n,content:[{type:"text",text:s.slice(l)}]}),p=true;}else e.push(n);o=u;}else e.push(n);return p||e.push(b(a,r)),e}function m(c,t,a){let r=[],e=0;for(let o of c.content)if(o.type==="run"){let p=o.content.filter(i=>i.type==="text").map(i=>i.text).join(""),n=e,s=e+p.length;if(s<=t||n>=a)r.push(o);else {let i="";n<t&&(i+=p.slice(0,t-n)),s>a&&(i+=p.slice(a-n)),i.length>0&&r.push({...o,content:[{type:"text",text:i}]});}e=s;}else r.push(o);return r}function C(c,t,a,r){let e=[],o=0;for(let p of c.content)if(p.type==="run"){let n=p.content.filter(u=>u.type==="text").map(u=>u.text).join(""),s=o,i=o+n.length;if(i<=t||s>=a)e.push(p);else if(s>=t&&i<=a)e.push({...p,formatting:{...p.formatting,...r}});else {let u=Math.max(t,s),l=Math.min(a,i);s<u&&e.push({...p,content:[{type:"text",text:n.slice(0,u-s)}]}),e.push({...p,formatting:{...p.formatting,...r},content:[{type:"text",text:n.slice(u-s,l-s)}]}),i>l&&e.push({...p,content:[{type:"text",text:n.slice(l-s)}]});}o=i;}else e.push(p);return e}function v(c,t){let a=h(c),r=a.package.document,e=g(r,t.position.paragraphIndex);if(e===-1)throw new Error(`Paragraph index ${t.position.paragraphIndex} not found`);let o=r.content[e];return o.content=P(o,t.position.offset,t.text,t.formatting),a}function B(c,t){let a=h(c),r=a.package.document,{start:e,end:o}=t.range;if(e.paragraphIndex===o.paragraphIndex){let p=g(r,e.paragraphIndex);if(p===-1)throw new Error(`Paragraph index ${e.paragraphIndex} not found`);let n=r.content[p];n.content=m(n,e.offset,o.offset),n.content=P(n,e.offset,t.text,t.formatting);}else {let p=g(r,e.paragraphIndex),n=r.content[p],s=I(n);n.content=m(n,e.offset,s.length),n.content=P(n,e.offset,t.text,t.formatting);let i=[];for(let u=e.paragraphIndex+1;u<=o.paragraphIndex;u++)i.push(g(r,u));for(let u=i.length-1;u>=0;u--)i[u]!==-1&&r.content.splice(i[u],1);}return a}function A(c,t){let a=h(c),r=a.package.document,{start:e,end:o}=t.range;if(e.paragraphIndex===o.paragraphIndex){let p=g(r,e.paragraphIndex);if(p===-1)throw new Error(`Paragraph index ${e.paragraphIndex} not found`);let n=r.content[p];n.content=m(n,e.offset,o.offset);}else {let p=g(r,e.paragraphIndex),n=r.content[p],s=I(n);n.content=m(n,e.offset,s.length);let i=g(r,o.paragraphIndex),u=r.content[i];u.content=m(u,0,o.offset),n.content.push(...u.content);let l=[];for(let f=e.paragraphIndex+1;f<=o.paragraphIndex;f++)l.push(g(r,f));for(let f=l.length-1;f>=0;f--)l[f]!==-1&&r.content.splice(l[f],1);}return a}function E(c,t){let a=h(c),r=a.package.document,{start:e,end:o}=t.range;if(e.paragraphIndex===o.paragraphIndex){let p=g(r,e.paragraphIndex);if(p===-1)throw new Error(`Paragraph index ${e.paragraphIndex} not found`);let n=r.content[p];n.content=C(n,e.offset,o.offset,t.formatting);}else for(let p=e.paragraphIndex;p<=o.paragraphIndex;p++){let n=g(r,p);if(n===-1)continue;let s=r.content[n],i=I(s),u=0,l=i.length;p===e.paragraphIndex&&(u=e.offset),p===o.paragraphIndex&&(l=o.offset),s.content=C(s,u,l,t.formatting);}return a}function S(c,t){let a=h(c),r=a.package.document,e=g(r,t.paragraphIndex);if(e===-1)throw new Error(`Paragraph index ${t.paragraphIndex} not found`);let o=r.content[e];if(o.formatting={...o.formatting,...t.formatting},"numPr"in t.formatting){let p=t.formatting.numPr;if(p&&p.numId!==void 0&&p.numId!==0){let n=p.ilvl??0,s=p.numId===1,i=s?"\u2022":"1.";if(a.package.numbering){let u=a.package.numbering.nums.find(l=>l.numId===p.numId);if(u){let l=a.package.numbering.abstractNums.find(f=>f.abstractNumId===u.abstractNumId);if(l){let f=l.levels.find(x=>x.ilvl===n);f&&(i=f.lvlText||i);}}}o.listRendering={level:n,numId:p.numId,marker:i,isBullet:s};}else delete o.listRendering;}return a}function F(c,t){let a=h(c),r=a.package.document,e=g(r,t.paragraphIndex);if(e===-1)throw new Error(`Paragraph index ${t.paragraphIndex} not found`);let o=r.content[e];return o.formatting={...o.formatting,styleId:t.styleId},a}function V(c,t){let a=h(c),r=a.package.document,e=[];for(let n=0;n<t.rows;n++){let s=[];for(let i=0;i<t.columns;i++){let u=t.data?.[n]?.[i]||"";s.push({type:"tableCell",content:[{type:"paragraph",content:u?[b(u)]:[]}]});}e.push({type:"tableRow",formatting:n===0&&t.hasHeader?{header:true}:void 0,cells:s});}let o={type:"table",rows:e},p=g(r,t.position.paragraphIndex);return p===-1?r.content.push(o):r.content.splice(p+1,0,o),a}function H(c,t){let a=h(c),r=a.package.document,e=g(r,t.position.paragraphIndex);if(e===-1)throw new Error(`Paragraph index ${t.position.paragraphIndex} not found`);let o=r.content[e],n={type:"run",content:[{type:"drawing",image:{type:"image",rId:`rId_img_${Date.now()}`,src:t.src,alt:t.alt,size:{width:g$1(t.width||100),height:g$1(t.height||100)},wrap:{type:"inline"}}}]},s=P(o,t.position.offset,"",void 0),i=false,u=0;for(let l=0;l<s.length;l++){let f=s[l];if(f.type==="run"){let x=f.content.filter(d=>d.type==="text").map(d=>d.text).join("");if(u+=x.length,!i&&u>=t.position.offset){s.splice(l+1,0,n),i=true;break}}}return i||s.push(n),o.content=s,a}function $(c,t){let a=h(c),r=a.package.document,{start:e,end:o}=t.range;if(e.paragraphIndex!==o.paragraphIndex)throw new Error("Hyperlinks cannot span multiple paragraphs");let p=g(r,e.paragraphIndex);if(p===-1)throw new Error(`Paragraph index ${e.paragraphIndex} not found`);let n=r.content[p],s=I(n),i=t.displayText||s.slice(e.offset,o.offset);n.content=m(n,e.offset,o.offset);let u={type:"hyperlink",href:t.url,tooltip:t.tooltip,children:[b(i)]},l=false,f=0,x=[];for(let d of n.content)if(d.type==="run"){let T=d.content.filter(y=>y.type==="text").map(y=>y.text).join(""),w=f+T.length;if(!l&&f<=e.offset&&e.offset<=w){let y=e.offset-f;y>0&&x.push({...d,content:[{type:"text",text:T.slice(0,y)}]}),x.push(u),y<T.length&&x.push({...d,content:[{type:"text",text:T.slice(y)}]}),l=true;}else x.push(d);f=w;}else x.push(d);return l||x.push(u),n.content=x,a}function j(c,t){let a=h(c),r=a.package.document,{start:e}=t.range,o=g(r,e.paragraphIndex);if(o===-1)throw new Error(`Paragraph index ${e.paragraphIndex} not found`);let p=r.content[o],n=[];for(let s of p.content)if(s.type==="hyperlink")for(let i of s.children)i.type==="run"&&n.push(i);else n.push(s);return p.content=n,a}function D(c,t){let a=h(c),r=a.package.document,e=g(r,t.position.paragraphIndex);if(e===-1)throw new Error(`Paragraph index ${t.position.paragraphIndex} not found`);let o=r.content[e],p=I(o),n=m({...o,content:[...o.content]},t.position.offset,p.length),s=m({...o,content:[...o.content]},0,t.position.offset);o.content=n;let i={type:"paragraph",formatting:o.formatting,content:s};return r.content.splice(e+1,0,i),a}function M(c,t){let a=h(c),r=a.package.document,e=g(r,t.paragraphIndex);if(e===-1)throw new Error(`Paragraph index ${t.paragraphIndex} not found`);let o=r.content[e],p=[];for(let n=1;n<=t.count;n++){let s=g(r,t.paragraphIndex+n);if(s!==-1){let i=r.content[s];o.content.push(...i.content),p.push(s);}}for(let n=p.length-1;n>=0;n--)r.content.splice(p[n],1);return a}function N(c,t){return D(c,{position:t.position})}function O(c,t){let a=h(c);return a.templateVariables||(a.templateVariables=[]),a.templateVariables.includes(t.name)||a.templateVariables.push(t.name),a}function _(c,t){let a=h(c),r=a.package.document;function e(n){for(let s of n.content)if(s.type==="text")for(let[i,u]of Object.entries(t.values)){let l=new RegExp(`\\{${i}\\}`,"g");s.text=s.text.replace(l,u);}}function o(n){for(let s of n.content)if(s.type==="run")e(s);else if(s.type==="hyperlink")for(let i of s.children)i.type==="run"&&e(i);}function p(n){if(n.type==="paragraph")o(n);else if(n.type==="table")for(let s of n.rows)for(let i of s.cells)for(let u of i.content)p(u);}for(let n of r.content)p(n);return a}function J(c,t){let a=b$1.getCommandHandler(t.type);if(a)return a(c,t);switch(t.type){case "insertText":return v(c,t);case "replaceText":return B(c,t);case "deleteText":return A(c,t);case "formatText":return E(c,t);case "formatParagraph":return S(c,t);case "applyStyle":return F(c,t);case "insertTable":return V(c,t);case "insertImage":return H(c,t);case "insertHyperlink":return $(c,t);case "removeHyperlink":return j(c,t);case "insertParagraphBreak":return D(c,t);case "mergeParagraphs":return M(c,t);case "splitParagraph":return N(c,t);case "setVariable":return O(c,t);case "applyVariables":return _(c,t);default:{let r=t;throw new Error(`Unknown command type: ${r.type}`)}}}function at(c,t){return t.reduce((a,r)=>J(a,r),c)}export{J as a,at as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {a as a$1}from'./chunk-FCJWLEKT.mjs';import {c as c$1}from'./chunk-7E5VBRDL.mjs';import {a as a$2}from'./chunk-MOCGHQ4A.mjs';import {a,b,c}from'./chunk-QPFJJPIC.mjs';import {a as a$3}from'./chunk-AMENZY5F.mjs';import {d}from'./chunk-KNY7SXPJ.mjs';function ee(e,t,n,r){let o=e-t-n,i=(r.count-1)*r.gap;return (o-i)/r.count}function me(e){let t={...e.pageSize},n={...e.margins},r=e.columns??{count:1,gap:0},o=false,i,s,a=[],l=[];function u(){return t.h-n.bottom}function c(){return u()-n.top}function g(){return t.w-n.left-n.right}if(c()<=0)throw new Error(`Paginator: page size and margins yield no content area (pageSize=${Math.round(t.w)}x${Math.round(t.h)} margins top=${Math.round(n.top)} bottom=${Math.round(n.bottom)} left=${Math.round(n.left)} right=${Math.round(n.right)})`);let d=ee(t.w,n.left,n.right,r),S=n.top;function P(h){return n.left+h*(d+r.gap)}function T(){(i||s)&&(i&&(t=i),s&&(n=s),i=void 0,s=void 0,d=ee(t.w,n.left,n.right,r));let h=a.length+1,F=n.top,v=u(),m=e.footnoteReservedHeights?.get(h)??0,p=v-m,x={number:h,fragments:[],margins:{...n},size:{...t},footnoteReservedHeight:m>0?m:void 0,columns:r.count>1?{...r}:void 0},b={page:x,cursorY:F,columnIndex:0,topMargin:F,contentBottom:p,trailingSpacing:0};return a.push(x),l.push(b),S=F,e.onNewPage&&e.onNewPage(b),b}function B(){return l.length===0?T():l[l.length-1]}function M(h){return h.contentBottom-h.cursorY}function I(h,F){let v=F||B();return M(v)>=h}function w(h){return h.columnIndex<r.count-1?(h.columnIndex+=1,h.cursorY=S,h.trailingSpacing=0,h):T()}function C(h){let F=B(),v=Number.isFinite(h)&&h>0?h:0;for(;!I(v,F);){let m=F.contentBottom-F.topMargin;if(v>m)return o||(o=true,console.warn(`Paginator: fragment height ${v.toFixed(0)}px exceeds page content height ${m.toFixed(0)}px; placing with overflow.`)),F.cursorY!==F.topMargin&&(F=w(F)),F;F=w(F);}return F}function R(h,F,v=0,m=0){let p=Math.max(v,B().trailingSpacing),x=p+F,b=C(x),y=p,z=P(b.columnIndex),k=b.cursorY+y;return h.x=z,h.y=k,b.page.fragments.push(h),b.cursorY=k+F,b.trailingSpacing=m,{state:b,x:z,y:k}}function f(){if(l.length>0){let h=l[l.length-1];if(h.page.fragments.length===0&&h.cursorY===h.topMargin)return h}return T()}function L(){let h=B();return w(h)}function W(h){r=h,d=ee(t.w,n.left,n.right,r);let F=B();F.page.columns=r.count>1?{...r}:void 0,S=F.cursorY,F.columnIndex=0;}function H(h,F,v=true){if(!v){i=h?{...h}:i,s=F?{...F}:s;return}if(h&&(t={...h}),F&&(n={...F}),c()<=0)throw new Error("Paginator: section page size and margins yield no content area");d=ee(t.w,n.left,n.right,r),i=void 0,s=void 0;}return {pages:a,states:l,get columnWidth(){return d},get columns(){return {...r}},getCurrentState:B,getAvailableHeight:()=>M(B()),getContentWidth:g,fits:h=>I(h),ensureFits:C,addFragment:R,forcePageBreak:f,forceColumnBreak:L,getColumnX:P,updateColumns:W,updatePageLayout:H}}function pe(e){let t=new Map,n=new Set;for(let r=0;r<e.length;r++){if(n.has(r))continue;let o=e[r];if(o.kind!=="paragraph"||!o.attrs?.keepNext)continue;let s=[r],a=r;for(let c=r+1;c<e.length;c++){let g=e[c];if(g.kind==="sectionBreak"||g.kind==="pageBreak"||g.kind==="columnBreak"||g.kind!=="paragraph")break;if(g.attrs?.keepNext)s.push(c),a=c,n.add(c);else break}let l=a+1,u=-1;if(l<e.length){let c=e[l];c.kind!=="sectionBreak"&&c.kind!=="pageBreak"&&c.kind!=="columnBreak"&&(u=l);}t.set(r,{startIndex:r,endIndex:a,memberIndices:s,anchorIndex:u});}return t}function de(e,t,n){let r=0;for(let o of e.memberIndices){let i=t[o],s=n[o];if(i.kind!=="paragraph"||s.kind!=="paragraph")continue;let a=i,l=s,u=a.attrs?.spacing?.before??0;r+=u,r+=l.totalHeight;let c=a.attrs?.spacing?.after??0;r+=c;}if(e.anchorIndex!==-1){let o=n[e.anchorIndex];if(o?.kind==="paragraph"){let i=o;i.lines.length>0&&(r+=i.lines[0].lineHeight);}}return r}function he(e){let t=new Set;for(let n of e.values())for(let r=1;r<n.memberIndices.length;r++)t.add(n.memberIndices[r]);return t}function at(e){return e.kind!=="paragraph"?false:e.attrs?.keepLines===true}function be(e){return e.kind!=="paragraph"?false:e.attrs?.pageBreakBefore===true}function $(e){return e.displayMode==="float"||a(e.wrapType)||e.wrapType==="topAndBottom"}function st(e){return $(e)&&e.wrapType==="topAndBottom"}function lt(e){return $(e)&&!b(e.wrapType)&&e.wrapType!=="topAndBottom"}function Le(e,t,n){if(!(!e||e<=0)){if(t==="pct")return n*e/5e3;if(!t||t==="dxa"||t==="auto")return d(e)}}function ke(e){let t=new Map,n=[];for(let r=0;r<e.rows.length;r++){let o=e.rows[r]?.cells??[],i=t.get(r)??new Set,s=0;for(;i.has(s);)s++;for(let a=0;a<o.length;a++){let l=o[a];if(!l)continue;let u=l.colSpan??1,c=l.rowSpan??1;if(n.push({rowIndex:r,cellIndex:a,columnIndex:s,colSpan:u,rowSpan:c}),c>1)for(let g=r+1;g<r+c;g++){t.has(g)||t.set(g,new Set);let d=t.get(g);for(let S=0;S<u;S++)d.add(s+S);}for(s+=u;i.has(s);)s++;}}return n}function ut(e){return Math.max(1,...e.rows.map(t=>t.cells.reduce((n,r)=>n+Math.max(1,r.colSpan??1),0)))}function ct(e,t,n){if(t<=0)return [];let r=n>0?n/t:0;if(e.length===0)return Array(t).fill(r);let o=e.slice(0,t),i=t-o.length;if(i>0){let c=o.filter(d=>d>0),g=c.length>0?c.reduce((d,S)=>d+S,0)/c.length:r;o=o.concat(Array(i).fill(g));}let s=o.reduce((c,g)=>c+(g>0?g:0),0),a=o.filter(c=>c<=0).length;if(s<=0)return Array(t).fill(r);if(a===0)return o;let l=Math.max(0,n-s),u=l>0?l/a:s/Math.max(1,t-a);return o.map(c=>c>0?c:u)}function ft(e,t){let n=e.columnWidths??[],r=Le(e.width,e.widthType,t),o=ut(e),i=r??t;if(e.rows.length>0&&(n=ct(n,o,i)),n.length>0&&r){let s=n.reduce((a,l)=>a+l,0);if(s>0&&Math.abs(s-r)>1){let a=r/s;n=n.map(l=>l*a);}}return n}function on(e,t){let n=ft(e,t),r=Le(e.width,e.widthType,t);return n.reduce((o,i)=>o+i,0)||r||t}function Ie(e,t,n){let r=[],o=[],i=n,s=0,a=t?.length??0;for(let l=0;l<a;l++){let u=t[l],c=e?.[l];if(c?.kind==="paragraph"&&u?.kind==="paragraph"){let g=c.attrs?.spacing;i+=Math.max(s,g?.before??0);let d=[];for(let S of u.lines)i+=S.floatSkipBefore??0,d.push(i),i+=S.lineHeight,o.push(i);r.push(d),s=g?.after??0;}else u&&"totalHeight"in u&&typeof u.totalHeight=="number"?(i+=s+u.totalHeight,r.push([]),o.push(i),s=0):r.push([]);}return {lineTops:r,flatBottoms:o,contentHeight:i-n+s}}function ve(e,t){let n=t.rows.length,r=[],o=0;for(let a=0;a<n;a++)r.push(o),o+=t.rows[a]?.height??0;r.push(o);let i=ke(e),s=[];for(let a=0;a<n;a++){let l=t.rows[a]?.height??0,u=new Set;u.add(l);for(let c of i){if(c.rowIndex>a||c.rowIndex+c.rowSpan-1<a)continue;let g=e.rows[c.rowIndex]?.cells?.[c.cellIndex],d=t.rows[c.rowIndex]?.cells?.[c.cellIndex];if(!g||!d)continue;let S=g.padding?.top??0,{flatBottoms:P}=Ie(g.blocks,d.blocks,S),T=r[a]-r[c.rowIndex];for(let B of P){let M=B-T;M>0&&M<l&&u.add(M);}}s.push([...u].sort((c,g)=>c-g));}return {rowTops:r,breakOffsets:s}}function Ee(e,t,n,r){let o=e.breakOffsets[t];if(!o||o.length===0)return 0;let i=n+r,s=0;for(let a of o)if(!(a<=n))if(a<=i)s=a-n;else break;return s}var gt=1440,xe=96,He=gt/xe,Ae=11,Oe="Calibri",mt=1,pt=.8,dt=.2,j=null;function Se(){if(!j){let e=typeof document<"u"?document.createElement("canvas"):null;if(!e)throw new Error("Canvas not available. Ensure this runs in a DOM environment.");if(j=e.getContext("2d"),!j)throw new Error("Failed to get 2D context from canvas")}return j}function gn(){j=null;}var We=new Map;function _e(e){let t=We.get(e);if(t===void 0){let n=a$3(e);t={cssFallback:n.cssFallback,singleLineRatio:n.singleLineRatio},We.set(e,t);}return t}function ht(e){return _e(e).cssFallback}function Te(e){let t=[];e.italic&&t.push("italic"),e.bold&&t.push("bold");let n=e.fontSize??Ae,r=Y(n);t.push(`${r}px`);let o=e.fontFamily??Oe;return t.push(ht(o)),t.join(" ")}function V(e){let t=e.fontSize??Ae,n=e.fontFamily??Oe,r=Y(t),o=r*pt,i=r*dt,s=r*mt;try{let l=Se();l.font=Te(e);let u=l.measureText("Hg");typeof u.actualBoundingBoxAscent=="number"&&typeof u.actualBoundingBoxDescent=="number"&&(o=u.actualBoundingBoxAscent,i=u.actualBoundingBoxDescent);}catch{}s=Math.max(s,o+i);let a=_e(n).singleLineRatio;return {fontSize:t,ascent:o,descent:i,lineHeight:s,fontFamily:n,singleLineRatio:a}}function O(e,t){if(!e)return 0;let n=Se();n.font=Te(t);let o=n.measureText(e).width;return t.letterSpacing&&e.length>1&&(o+=t.letterSpacing*(e.length-1)),o}function mn(e,t){let n=O(e,t),r=V(t);return {width:n,height:r.ascent+r.descent,ascent:r.ascent,descent:r.descent}}function ze(e,t){let n=V(t);if(!e)return {width:0,charWidths:[],metrics:n};let r=Se();r.font=Te(t);let o=t.letterSpacing??0,i=[],s=0;for(let a=0;a<e.length;a++){let l=e[a],c=r.measureText(l).width;o&&a<e.length-1&&(c+=o),i.push(c),s+=c;}return {width:s,charWidths:i,metrics:n}}function pn(e,t){if(t.length===0||e<=0)return 0;let n=0;for(let r=0;r<t.length;r++){let o=t[r],i=n+o/2;if(e<=i)return r;n+=o;}return t.length}function dn(e,t){if(e<=0||t.length===0)return 0;let n=Math.min(e,t.length),r=0;for(let o=0;o<n;o++)r+=t[o];return r}function hn(e){return e/He}function bn(e){return Math.round(e*He)}function Y(e){return e*xe/72}function bt(e){return e*72/xe}function xn(e){return Y(e/2)}function Sn(e){return bt(e)*2}function Me(e){return e/1440*96}function ye(e){return e/96*1440}function xt(e){let{explicitStops:t=[],defaultTabInterval:n=720,leftIndent:r=0}=e,o=t.filter(g=>g.val!=="clear").filter(g=>g.pos>=r),i=t.filter(g=>g.val==="clear").map(g=>g.pos),s=o.reduce((g,d)=>Math.max(g,d.pos),0),a=[...o];r>0&&!o.some(g=>g.pos<=r)&&(i.some(d=>Math.abs(d-r)<20)||a.push({val:"start",pos:r,leader:"none"}));let u=s>0?Math.max(s,r):r,c=r+14400;for(;u<c;){u+=n;let g=o.some(P=>Math.abs(P.pos-u)<20),d=i.some(P=>Math.abs(P-u)<20),S=r>0&&Math.abs(u-r)<20;!g&&!d&&!S&&a.push({val:"start",pos:u,leader:"none"});}return a.sort((g,d)=>g.pos-d.pos)}function Ne(e,t,n={}){let{defaultTabInterval:r=720}=t,o=ye(e),s=xt(t).find(u=>u.pos>o);if(!s){let u=Me(r),c=u-e%u;return c<=0&&(c=u),{width:c,alignment:"default"}}let l=Me(s.pos)-e;if(s.val==="center")l-=(n.followingWidth??0)/2;else if(s.val==="end")l-=n.followingWidth??0;else if(s.val==="decimal")l-=n.decimalPrefixWidth??0;else if(s.val==="bar")return {width:0,leader:s.leader,alignment:"bar"};if(l<1){let u=Me(r),c=u-e%u;return c<=0&&(c=u),{width:c,alignment:"default"}}return {width:l,leader:s.leader,alignment:s.val}}var St="Calibri",Tt=11;function Mt(e){let t=e.attrs,n=e.runs?.find(i=>i.kind==="text"),r=t?.listMarkerFontFamily??n?.fontFamily??t?.defaultFontFamily??St,o=t?.listMarkerFontSize??n?.fontSize??t?.defaultFontSize??Tt;return {fontFamily:r,fontSize:o}}function Ye(e){let t=e.attrs;if(!t?.listMarker||t.listMarkerHidden)return 0;let n=t.indent,r=n?.hanging??0;if(r>0)return r;let{fontFamily:o,fontSize:i}=Mt(e),s={fontFamily:o,fontSize:i},a=O(t.listMarker,s),l=t.listMarkerSuffix??"tab";if(l==="nothing")return a;if(l==="space")return a+O(" ",s);let u=n?.left??0,c=n?.firstLine??0,g=u+c,d=g+a,S=(t.tabs??[]).filter(M=>M.val!=="clear"&&M.val!=="bar").map(M=>a$1(M.pos)).filter(M=>M>=d).sort((M,I)=>M-I)[0],P=a$1(t.defaultTabStopTwips??a$2),T=P>0?(Math.floor(d/P)+1)*P:void 0,B;return S!==void 0&&T!==void 0?B=Math.min(S,T):B=S??T,B===void 0?a+Y(i)*.5:B-g}var D=11,X="Calibri",yt=1.15,ne=1,Z=.5;function De(e,t,n,r=false){let o=1,i=e.length,s=0;for(;o<=i;){let a=o+i>>>1;O(e.slice(0,a),t)<=n?(s=a,o=a+1):i=a-1;}return r&&s===0?1:s}function q(e){return {fontFamily:e.fontFamily??X,fontSize:e.fontSize??D,bold:e.bold,italic:e.italic,letterSpacing:e.letterSpacing}}function Ue(e,t,n){let r=Y(e),o=n?.ascent??r*.8,i=n?.descent??r*.2,s=n?.singleLineRatio??1.15,a=r*s,l;if(t?.lineRule==="exact"&&t.line!==void 0)l=t.line;else if(t?.lineRule==="atLeast"&&t.line!==void 0){let u=a*ne;l=Math.max(t.line,u);}else t?.line!==void 0&&t?.lineUnit==="multiplier"?l=a*t.line:t?.line!==void 0&&t?.lineUnit==="px"?l=t.line:l=a*ne;return {ascent:o,descent:i,lineHeight:l}}function Ze(e,t,n){let r=V({fontSize:e,fontFamily:n??X}),o=Ue(e,t,r),i=t?.lineRule??"auto";if(i==="auto"||i==="atLeast"){let s=Y(e),a=Math.max(o.lineHeight,s*yt);if(a!==o.lineHeight)return {...o,lineHeight:a}}return o}function te(e){return e.kind==="text"}function Xe(e){return e.kind==="tab"}function Ge(e){return e.kind==="image"}function Ke(e){return e.kind==="lineBreak"}function $e(e){return e.kind==="field"}function Pt(e){return !e.text||e.text.replace(/\u00a0/g," ").trim().length===0}function Ft(e,t){let n=0;for(let r=t+1;r<e.length;r++){let o=e[r];if(Xe(o)||Ke(o))break;if(te(o))n+=O(o.text||"",q(o));else if($e(o)){let i={fontFamily:o.fontFamily??X,fontSize:o.fontSize??D,bold:o.bold,italic:o.italic};n+=O(o.fallback||"1",i);}else Ge(o)&&(n+=o.width||0);}return n}function Bt(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n];(r===" "||r==="-"||r===" ")&&t.push(n+1);}return t}function je(e,t,n){let r=Math.max(1,n),o=Math.max(0,e),i=Math.max(0,t);return o>=r||i>=r||o+i>=r?{leftMargin:0,rightMargin:0}:{leftMargin:o,rightMargin:i}}function wt(e,t,n){let r=e.runs,o=e.attrs,i=o?.spacing,s=n?.floatingZones,a=n?.paragraphYOffset??0,l=o?.indent,u=l?.left??0,c$1=l?.right??0,g=(l?.firstLine??0)-(l?.hanging??0),d=Math.max(1,t-u-c$1),S=(l?.hanging??0)===0?Ye(e):0,P=Math.max(1,d-g-S),T=0,B=0,M=Y(D)*ne,I=(m,p)=>{if(!s||s.length===0)return;let x=a+T,b=Ve(x,m,s,p,U)-x;b>0&&(T+=b,B+=b);};I(M,P);let w=oe(T,M,s,a),C=Math.max(1,re(w,P)),R=[];if(r.length===0){if(o?.suppressEmptyParagraphHeight)return R.push({fromRun:0,fromChar:0,toRun:0,toChar:0,width:0,ascent:0,descent:0,lineHeight:0}),{kind:"paragraph",lines:R,totalHeight:0};let m=o?.defaultFontSize??D,p=o?.defaultFontFamily??X,x=Ze(m,i,p);R.push({fromRun:0,fromChar:0,toRun:0,toChar:0,width:0,...x});let b=x.lineHeight;return i?.before&&(b+=i.before),i?.after&&(b+=i.after),{kind:"paragraph",lines:R,totalHeight:b}}if(r.length===1&&te(r[0])&&Pt(r[0])){let m=r[0],p=m.fontSize??o?.defaultFontSize??D,x=m.fontFamily??o?.defaultFontFamily??X,b=Ze(p,i,x);R.push({fromRun:0,fromChar:0,toRun:0,toChar:0,width:0,...b});let y=b.lineHeight;return i?.before&&(y+=i.before),i?.after&&(y+=i.after),{kind:"paragraph",lines:R,totalHeight:y}}let f={fromRun:0,fromChar:0,toRun:0,toChar:0,width:0,maxFontSize:D,maxFontMetrics:null,maxImageHeightPx:0,availableWidth:C,leftOffset:w.leftMargin,rightOffset:w.rightMargin,segmentZones:w.segments},L=()=>{let m=Ue(f.maxFontSize,i,f.maxFontMetrics),p={...m};if(f.maxImageHeightPx>p.lineHeight){let b=f.maxImageHeightPx,y=p.descent;f.fromRun===f.toRun?(p.lineHeight=b+y*2,p.ascent=b+y):(p.lineHeight=b+y,p.ascent=b);}let x={fromRun:f.fromRun,fromChar:f.fromChar,toRun:f.toRun,toChar:f.toChar,width:f.width,...p};f.leftOffset>0&&(x.leftOffset=f.leftOffset),f.rightOffset>0&&(x.rightOffset=f.rightOffset),f.segmentZones?.length&&(x.segments=W(x,f.segmentZones)),B>0&&(x.floatSkipBefore=B,B=0),R.push(x),T+=m.lineHeight;},W=(m,p)=>{let x=p[0],b=p[1];if(!x)return;if(!b||m.width<=x.availableWidth+Z)return [{fromRun:m.fromRun,fromChar:m.fromChar,toRun:m.toRun,toChar:m.toChar,width:m.width,leftOffset:x.leftOffset,availableWidth:x.availableWidth}];if(m.fromRun!==m.toRun)return;let y=r[m.fromRun];if(!y||!te(y))return;let z=y,k=z.text.slice(m.fromChar,m.toChar),_=q(z),E=De(k,_,x.availableWidth);if(E<=0||E>=k.length)return;let N=m.fromChar+E,A=k.slice(0,E),K=k.slice(E);return [{fromRun:m.fromRun,fromChar:m.fromChar,toRun:m.toRun,toChar:N,width:O(A,_),leftOffset:x.leftOffset,availableWidth:x.availableWidth},{fromRun:m.fromRun,fromChar:N,toRun:m.toRun,toChar:m.toChar,width:O(K,_),leftOffset:b.leftOffset,availableWidth:b.availableWidth}]},H=(m,p)=>{L();let x=Y(D)*ne;I(x,d);let b=oe(T,x,s,a),y=Math.max(1,re(b,d));f={fromRun:m,fromChar:p,toRun:m,toChar:p,width:0,maxFontSize:D,maxFontMetrics:null,maxImageHeightPx:0,availableWidth:y,leftOffset:b.leftMargin,rightOffset:b.rightMargin,segmentZones:b.segments};},h=m=>{let p=m.fontSize??D;(!f.maxFontMetrics||p>f.maxFontSize)&&(f.maxFontSize=p,f.maxFontMetrics=V(m));};for(let m=0;m<r.length;m++){let p=r[m];if(Ke(p)){f.toRun=m,f.toChar=0,H(m+1,0);continue}if(Xe(p)){let x=q(p);h(x);let b=Ft(r,m),y=f.width+(f.leftOffset??0),z=R.length===0,k=u+(z?g:0)+y,_={explicitStops:o?.tabs,leftIndent:ye(u)},E=Ne(k,_,{followingWidth:b}).width;if(y+E>f.availableWidth+Z){let N=f.availableWidth-y-b;N>1&&(E=N);}f.width+E>f.availableWidth+Z&&(H(m,0),h(x)),f.width+=E,f.toRun=m,f.toChar=1;continue}if(Ge(p)){let x=p.wrapType,b=p.displayMode==="float"||c(x);if(p.position&&b){f.toRun=m,f.toChar=1;continue}if(x==="topAndBottom"||p.displayMode==="block"){f.width>0&&H(m,0);let N=p.height,A=p.distTop??6,K=p.distBottom??6;f.toRun=m,f.toChar=1,f.maxImageHeightPx=N+A+K,H(m+1,0);continue}let y=p.width,z=p.height;f.width+y>f.availableWidth+Z&&H(m,0);let k=y>0&&y>f.availableWidth?f.availableWidth/y:1,E=z*k+(p.distTop??0)+(p.distBottom??0);E>f.maxImageHeightPx&&(f.maxImageHeightPx=E),f.width+=y,f.toRun=m,f.toChar=1;continue}if($e(p)){let x=p.fallback||"1",b={fontFamily:p.fontFamily??X,fontSize:p.fontSize??D,bold:p.bold,italic:p.italic};h(b);let y=O(x,b);f.width>0&&f.width+y>f.availableWidth+Z&&(H(m,0),h(b)),f.width+=y,f.toRun=m,f.toChar=1;continue}if(te(p)){let x=p,b=x.text,y=q(x);if(h(y),!b||b.length===0){f.toRun=m,f.toChar=0;continue}let z=Bt(b),k=0;for(;k<b.length;){let _=b.length;for(let A of z)if(A>k){_=A;break}let E=b.slice(k,_),N=O(E,y);if(N>f.availableWidth+Z){let A=0;for(;A<E.length;){let K=f.availableWidth-f.width+Z,rt=E.slice(A),se=De(rt,y,K);if(se===0){if(f.width>0){H(m,k+A),h(y);continue}se=1;}let le=A+se,ot=E.slice(A,le),it=O(ot,y);f.width+=it,f.toRun=m,f.toChar=k+le,A=le,A<E.length&&(H(m,k+A),h(y));}k=_;continue}f.width>0&&f.width+N>f.availableWidth+Z&&(H(m,k),h(y)),f.width+=N,f.toRun=m,f.toChar=_,k=_;}}}L();let v=R.reduce((m,p)=>m+p.lineHeight+(p.floatSkipBefore??0),0);return i?.before&&(v+=i.before),i?.after&&(v+=i.after),{kind:"paragraph",lines:R,totalHeight:v}}function vn(e,t){return e.map(n=>wt(n,t))}function En(e){let t=q(e);return ze(e.text,t).charWidths}function An(e,t){return e.map(n=>{let r=n.x-n.distLeft,o=n.x+n.width+n.distRight,i=n.y-n.distTop,s=n.y+n.height+n.distBottom;if(n.wrapType==="topAndBottom")return {leftMargin:0,rightMargin:0,topY:i,bottomY:s,fullWidthBlock:true};let a=0,l=0,u,c=n.wrapText??"bothSides";c==="right"?a=Pe(o):c==="left"?l=Fe(r,t):c==="largest"?{leftMargin:a,rightMargin:l}=kt(r,o,t):Rt(r,o,t)?u=Lt(r,o,t):n.side==="left"?a=Pe(o):l=Fe(r,t);let g=je(a,l,t);return {leftMargin:g.leftMargin,rightMargin:g.rightMargin,topY:i,bottomY:s,segments:u}})}function re(e,t){return e.segments?.reduce((r,o)=>r+o.availableWidth,0)??t-e.leftMargin-e.rightMargin}function oe(e,t,n,r){if(!n||n.length===0)return {leftMargin:0,rightMargin:0};let o=0,i=0,s,a=r+e,l=a+t;for(let u of n)if(!(l<=u.topY||a>=u.bottomY)){if(u.fullWidthBlock)return {leftMargin:0,rightMargin:0,segments:[{leftOffset:0,availableWidth:0}]};if(u.segments?.length){s=s?Ct(s,u.segments):u.segments;continue}o=Math.max(o,u.leftMargin),i=Math.max(i,u.rightMargin);}return {leftMargin:o,rightMargin:i,segments:s}}function Ve(e,t,n,r,o){if(!n||n.length===0)return e;let i=e;for(let s=0;s<n.length+2;s++){let a=oe(i,t,n,0);if(re(a,r)>=o)return i;let u=i+t,c=1/0;for(let g of n)u<=g.topY||i>=g.bottomY||g.bottomY>i&&g.bottomY<c&&(c=g.bottomY);if(!Number.isFinite(c)||c<=i)return i;i=c;}return i}function Ct(e,t){let n=[];for(let r of e)for(let o of t){let i=Math.max(r.leftOffset,o.leftOffset),s=Math.min(r.leftOffset+r.availableWidth,o.leftOffset+o.availableWidth);s>i&&n.push({leftOffset:i,availableWidth:s-i});}return n}var U=24;function Rt(e,t,n){return e>U&&t+U<n}function Lt(e,t,n){return [{leftOffset:0,availableWidth:Math.max(0,e)},{leftOffset:Math.max(0,t),availableWidth:Math.max(0,n-t)}].filter(r=>r.availableWidth>1)}function kt(e,t,n){let r=Math.max(0,e);return Math.max(0,n-t)>=r?{leftMargin:Pe(t),rightMargin:0}:{leftMargin:0,rightMargin:Fe(e,n)}}function Pe(e){return Math.max(0,e)}function Fe(e,t){return Math.max(0,t-e)}function It(e,t){return e==null||!Number.isFinite(e)?0:Math.max(0,Math.min(t,e))}function ie(e,t,n){if(e)return e.kind==="text"?typeof e.pmStart=="number"?e.pmStart+It(t,e.text.length):n==="end"?e.pmEnd:void 0:n==="end"?typeof e.pmEnd=="number"?e.pmEnd:typeof e.pmStart=="number"?e.pmStart+1:void 0:e.pmStart}function qe(e,t,n,r){if(t.lines.length===0||n>=r)return {pmStart:e.pmStart,pmEnd:e.pmEnd};let o=t.lines[n],i=t.lines[r-1],s=o?e.runs[o.fromRun]:void 0,a=i?e.runs[i.toRun]:void 0,l=n===0?e.pmStart??ie(s,o?.fromChar??0,"start"):ie(s,o?.fromChar??0,"start"),u=r>=t.lines.length?e.pmEnd??ie(a,i?.toChar??0,"end"):ie(a,i?.toChar??0,"end");return l==null&&(l=e.pmStart),u==null&&(u=e.pmEnd),l!=null&&u!=null&&u<=l&&(u=l+1),{pmStart:l,pmEnd:u}}function Je(e){if(e.runs.length===0)return true;if(e.runs.length!==1)return false;let t=e.runs[0];return t.kind==="text"&&(t.text??"")===""}function J(e){let t=e.attrs?.spacing?.before??0;return Je(e)&&!e.attrs?.spacingExplicit?.before?0:t}function Q(e){let t=e.attrs?.spacing?.after??0;return Je(e)&&!e.attrs?.spacingExplicit?.after?0:t}function vt(e,t,n,r){let o=0,i=false;for(let s=n;s<r;s++){let a=e[s],l=t[s];if(a.kind==="paragraph"&&l.kind==="paragraph"){o+=J(a)+l.totalHeight+Q(a),i=i||l.lines.length>0;continue}if(a.kind!=="sectionBreak")return null}return i?o:null}function Et(e,t){let n=e.columns;if(n.count<=1||!Number.isFinite(t)||t<=0)return;let r=e.getCurrentState(),o=r.cursorY,i=r.contentBottom-o;if(i<=0||t>i*n.count)return;let s=Math.ceil(t/n.count);s<=0||s>=i||(r.contentBottom=o+s);}function Qe({blocks:e,measures:t,paginator:n,start:r,end:o}){let i=vt(e,t,r,o);i!==null&&Et(n,i);}var et={count:1,gap:0};function Wt(e,t,n){return {activeTopMargin:e.top,activeBottomMargin:e.bottom,activeLeftMargin:e.left,activeRightMargin:e.right,pendingTopMargin:null,pendingBottomMargin:null,pendingLeftMargin:null,pendingRightMargin:null,activePageSize:{...t},pendingPageSize:null,activeColumns:n?{...n}:{...et},pendingColumns:null,activeOrientation:null,pendingOrientation:null,hasAnyPages:false}}function Ht(e,t){return t.count>1}function ae(e){return e?{count:e.count,gap:e.gap}:{...et}}function At(e,t,n){let r={...t},o=e.type??"continuous",i=e.margins,s=e.pageSize,a=e.orientation;i&&(typeof i.top=="number"&&(r.pendingTopMargin=Math.max(0,i.top)),typeof i.bottom=="number"&&(r.pendingBottomMargin=Math.max(0,i.bottom)),typeof i.left=="number"&&(r.pendingLeftMargin=Math.max(0,i.left)),typeof i.right=="number"&&(r.pendingRightMargin=Math.max(0,i.right))),s&&(r.pendingPageSize={w:s.w,h:s.h}),a&&(r.pendingOrientation=a);let l=Ht((e.margins,void 0),r.activeColumns);switch(o){case "nextPage":return r.pendingColumns=ae(void 0),{decision:{forcePageBreak:true,forceMidPageRegion:false},state:r};case "evenPage":return r.pendingColumns=ae(void 0),{decision:{forcePageBreak:true,forceMidPageRegion:false,requiredParity:"even"},state:r};case "oddPage":return r.pendingColumns=ae(void 0),{decision:{forcePageBreak:true,forceMidPageRegion:false,requiredParity:"odd"},state:r};default:return l?(r.pendingColumns=ae(void 0),{decision:{forcePageBreak:false,forceMidPageRegion:true},state:r}):{decision:{forcePageBreak:false,forceMidPageRegion:false},state:r}}}function Ot(e){let t={...e};return t.pendingTopMargin!==null&&(t.activeTopMargin=t.pendingTopMargin,t.pendingTopMargin=null),t.pendingBottomMargin!==null&&(t.activeBottomMargin=t.pendingBottomMargin,t.pendingBottomMargin=null),t.pendingLeftMargin!==null&&(t.activeLeftMargin=t.pendingLeftMargin,t.pendingLeftMargin=null),t.pendingRightMargin!==null&&(t.activeRightMargin=t.pendingRightMargin,t.pendingRightMargin=null),t.pendingPageSize!==null&&(t.activePageSize=t.pendingPageSize,t.pendingPageSize=null),t.pendingColumns!==null&&(t.activeColumns=t.pendingColumns,t.pendingColumns=null),t.pendingOrientation!==null&&(t.activeOrientation=t.pendingOrientation,t.pendingOrientation=null),t}function _t(e){return {top:e.pendingTopMargin??e.activeTopMargin,bottom:e.pendingBottomMargin??e.activeBottomMargin,left:e.pendingLeftMargin??e.activeLeftMargin,right:e.pendingRightMargin??e.activeRightMargin}}function zt(e){return e.pendingPageSize??e.activePageSize}function Nt(e){return e.pendingColumns??e.activeColumns}function Yt(e,t){for(let n=0;n<e.pages.length;n++)for(let r of e.pages[n].fragments){if(r.pmStart==null)continue;let o=r.pmStart,i=r.pmEnd??o+1;if(t>=o&&t<i)return n}return null}var Dt={w:816,h:1056},G={top:96,right:96,bottom:96,left:96},tt={count:1,gap:0};function Zt(e,t,n){let r=[],o=[],i=t;for(let s=0;s<e.length;s++){if(e[s].kind!=="sectionBreak")continue;let a=e[s],l={pageSize:a.pageSize??i.pageSize,margins:a.margins??i.margins,columns:a.columns};r.push(l),o.push(s),i=l;}return r.push(n),{configs:r,breakIndices:o}}function nt(e){for(let t=0;t<e.length-1;t++){let n=e[t],r=e[t+1];if(n.kind!=="paragraph"||r.kind!=="paragraph")continue;let o=n.attrs,i=r.attrs;o?.contextualSpacing&&i?.contextualSpacing&&o.styleId&&o.styleId===i.styleId&&(o.spacing&&(o.spacing={...o.spacing,after:0}),i.spacing&&(i.spacing={...i.spacing,before:0}));}for(let t of e)if(t.kind==="table")for(let n of t.rows)for(let r of n.cells)nt(r.blocks);}function Qn(e,t,n={}){if(e.length!==t.length)throw new Error(`layoutDocument: expected one measure per block (blocks=${e.length}, measures=${t.length})`);let r=n.pageSize??Dt,o={top:n.margins?.top??G.top,right:n.margins?.right??G.right,bottom:n.margins?.bottom??G.bottom,left:n.margins?.left??G.left,header:n.margins?.header??n.margins?.top??G.top,footer:n.margins?.footer??n.margins?.bottom??G.bottom};n.headerContentHeights,n.footerContentHeights,n.titlePage,n.evenAndOddHeaders;let i={...o},s=n.finalPageSize??r,a=n.finalMargins??i;if(r.w-i.left-i.right<=0)throw new Error("layoutDocument: page size and margins yield no content area");let u={pageSize:r,margins:i,columns:n.columns},c={pageSize:s,margins:a,columns:n.columns},{configs:g,breakIndices:d}=Zt(e,u,c),S=[...d.map(w=>e[w].type),n.bodyBreakType],P=g[0]??u,T=me({pageSize:P.pageSize,margins:P.margins,columns:P.columns??tt,footnoteReservedHeights:n.footnoteReservedHeights});nt(e);let B=pe(e),M=he(B),I=0;for(let w=0;w<e.length;w++){let C=e[w],R=t[w];be(C)&&T.forcePageBreak();let f=B.get(w);if(f&&!M.has(w)){let L=de(f,e,t),W=T.getCurrentState(),H=T.getAvailableHeight(),h=W.contentBottom-W.topMargin;L<=h&&L>H&&W.page.fragments.length>0&&T.forcePageBreak();}switch(C.kind){case "paragraph":Ut(C,R,T,T.getContentWidth());break;case "table":C.floating?$t(C,R,T,T.getContentWidth()):Kt(C,R,T);break;case "image":jt(C,R,T);break;case "textBox":qt(C,R,T);break;case "pageBreak":T.forcePageBreak();break;case "columnBreak":T.forceColumnBreak();break;case "sectionBreak":{let L=S[I+1]??S[I],W=g[I+1]??P;Jt(C,T,W,L),d[I+1]===void 0&&(L??"nextPage")==="continuous"&&(W.columns?.count??1)>1&&Qe({blocks:e,measures:t,paginator:T,start:w+1,end:e.length}),I++;break}default:c$1(C,"runLayoutPipeline");}}return T.pages.length===0&&T.getCurrentState(),{pageSize:r,pages:T.pages,columns:n.columns,pageGap:n.pageGap}}function Ut(e,t,n,r){if(t.kind!=="paragraph")throw new Error("layoutParagraph: expected paragraph measure");let o=t.lines;if(o.length===0){let l=J(e),u=Q(e),c=n.getCurrentState(),g={kind:"paragraph",blockId:e.id,x:n.getColumnX(c.columnIndex),y:c.cursorY+l,width:r,height:0,fromLine:0,toLine:0,pmStart:e.pmStart,pmEnd:e.pmEnd};n.addFragment(g,0,l,u);return}let i=J(e),s=Q(e),a=0;for(;a<o.length;){let l=n.getCurrentState(),u=a===0?Math.max(i,l.trailingSpacing):0,c=n.getAvailableHeight()-u,g=0,d=0;for(let C=a;C<o.length;C++){let R=o[C].lineHeight+(o[C].floatSkipBefore??0),f=g+R;if(f<=c||d===0)g=f,d++;else break}let S=a===0,P=a+d>=o.length,T=S?i:0,B=P?s:0,M=qe(e,t,a,a+d),I={kind:"paragraph",blockId:e.id,x:n.getColumnX(l.columnIndex),y:0,width:r,height:g,fromLine:a,toLine:a+d,pmStart:M.pmStart,pmEnd:M.pmEnd,continuesFromPrev:!S,continuesOnNext:!P},w=n.addFragment(I,g,T,B);I.y=w.y,a+=d,a<o.length&&n.ensureFits(o[a].lineHeight);}}function Xt(e){let t=0;for(let n of e.rows)if(n.isHeader)t++;else break;return t}function Gt(e,t){let n=0;for(let r=0;r<t&&r<e.rows.length;r++)n+=e.rows[r].height;return n}function Kt(e,t,n){if(t.kind!=="table")throw new Error("layoutTable: expected table measure");let r=t.rows;if(r.length===0)return;let o=Xt(e),i=Gt(t,o),s=ve(e,t),a=0,l=0;for(;a<r.length;){let u=n.getCurrentState(),c=a===0&&l===0,g=c?u.trailingSpacing:0,d=!c&&o>0?i:0,S=n.getAvailableHeight()-g-d,P=a,T=l,B=0,M=a,I=l,w=a,C,R=false;for(;M<r.length;){let F=r[M].height,v=M===P?I:0,m=F-v;if(B+m<=S){B+=m,M+=1,w=M;continue}let p=S-B,x=e.rows[M]?.cantSplit?0:Ee(s,M,v,p);x>0?(B+=x,w=M+1,C=v+x,R=true):w>P||(B+=m,w=M+1);break}let f=d+B,L=w===r.length&&!R,W=n.getColumnX(u.columnIndex);e.justification==="center"?W=W+(n.columnWidth-t.totalWidth)/2:e.justification==="right"?W=W+n.columnWidth-t.totalWidth:e.indent&&(W+=e.indent);let H={kind:"table",blockId:e.id,x:W,y:0,width:t.totalWidth,height:f,fromRow:P,toRow:w,pmStart:e.pmStart,pmEnd:e.pmEnd,continuesFromPrev:!c,continuesOnNext:!L,headerRowCount:!c&&o>0?o:void 0,topClip:T>0?T:void 0,bottomClip:C},h=n.addFragment(H,f,0,0);if(H.y=h.y,H.x=W,R?(a=w-1,l=C??0):(a=w,l=0),a<r.length){let F=(o>0?i:0)+(r[a].height-l);n.ensureFits(F);}}}function $t(e,t,n,r){if(t.kind!=="table")throw new Error("layoutFloatingTable: expected table measure");let o=n.getCurrentState(),i=e.floating,s=o.page,a=s.margins,l=t.totalWidth,u=t.totalHeight,c=s.size.h-a.top-a.bottom,g=a.left,d=a.top;i?.horzAnchor==="page"&&(g=0),i?.vertAnchor==="page"&&(d=0),i?.vertAnchor==="text"&&(d=o.cursorY);let S=n.getColumnX(o.columnIndex);if(i?.tblpX!==void 0)S=g+i.tblpX;else if(i?.tblpXSpec){let L=i.tblpXSpec;L==="left"||L==="inside"?S=g:L==="right"||L==="outside"?S=g+r-l:L==="center"&&(S=g+(r-l)/2);}else e.justification==="center"?S=g+(r-l)/2:e.justification==="right"&&(S=g+r-l);let P=o.cursorY,T=false;if(i?.tblpY!==void 0)P=d+i.tblpY,T=true;else if(i?.tblpYSpec){T=true;let L=i.tblpYSpec;L==="top"?P=d:L==="bottom"?P=d+c-u:L==="center"&&(P=d+(c-u)/2);}T||(P=n.ensureFits(u).cursorY);let B=a.left,M=a.left+r-l;Number.isFinite(M)&&(S=Math.max(B,Math.min(S,M)));let I={kind:"table",blockId:e.id,x:S,y:P,width:l,height:u,fromRow:0,toRow:e.rows.length,pmStart:e.pmStart,pmEnd:e.pmEnd,isFloating:true};o.page.fragments.push(I);let w=i?.leftFromText??0,C=i?.rightFromText??0,R=S-a.left-w,f=a.left+r-(S+l)-C;if(R<U&&f<U){let L=P+u+(i?.bottomFromText??0);L>o.cursorY&&(o.cursorY=L);}}function jt(e,t,n){if(t.kind!=="image")throw new Error("layoutImage: expected image measure");if(e.anchor?.isAnchored){Vt(e,t,n);return}let r=n.ensureFits(t.height),o={kind:"image",blockId:e.id,x:n.getColumnX(r.columnIndex),y:0,width:t.width,height:t.height,pmStart:e.pmStart,pmEnd:e.pmEnd},i=n.addFragment(o,t.height,0,0);o.y=i.y;}function Vt(e,t,n){let r=n.getCurrentState(),o=e.anchor,i=o.offsetH??n.getColumnX(r.columnIndex),s=o.offsetV??r.cursorY,a={kind:"image",blockId:e.id,x:i,y:s,width:t.width,height:t.height,pmStart:e.pmStart,pmEnd:e.pmEnd,isAnchored:true,zIndex:o.behindDoc?-1:1};r.page.fragments.push(a);}function qt(e,t,n){if(t.kind!=="textBox")throw new Error("layoutTextBox: expected textBox measure");if($(e)){let s=n.getCurrentState(),a={kind:"textBox",blockId:e.id,x:n.getColumnX(s.columnIndex),y:s.cursorY,width:t.width,height:t.height,pmStart:e.pmStart,pmEnd:e.pmEnd,isFloating:true,zIndex:e.wrapType==="behind"?-1:1};s.page.fragments.push(a);return}let r=n.ensureFits(t.height),o={kind:"textBox",blockId:e.id,x:n.getColumnX(r.columnIndex),y:0,width:t.width,height:t.height,pmStart:e.pmStart,pmEnd:e.pmEnd},i=n.addFragment(o,t.height,0,0);o.y=i.y;}function Jt(e,t,n,r){switch(r??"nextPage"){case "nextPage":t.updatePageLayout(n.pageSize,n.margins),t.forcePageBreak();break;case "evenPage":{t.updatePageLayout(n.pageSize,n.margins),t.forcePageBreak().page.number%2!==0&&t.forcePageBreak();break}case "oddPage":{t.updatePageLayout(n.pageSize,n.margins),t.forcePageBreak().page.number%2===0&&t.forcePageBreak();break}case "continuous":t.updatePageLayout(n.pageSize,n.margins,false);break}t.updateColumns(n.columns??tt);}export{vn as A,En as B,An as C,oe as D,U as E,me as F,pe as G,de as H,he as I,at as J,be as K,$ as L,st as M,lt as N,Ie as O,Wt as P,At as Q,Ot as R,_t as S,zt as T,Nt as U,Yt as V,Zt as W,Qn as X,Gt as Y,Le as a,ke as b,ut as c,ct as d,ft as e,on as f,Se as g,gn as h,Te as i,V as j,O as k,mn as l,ze as m,pn as n,dn as o,hn as p,bn as q,Y as r,bt as s,xn as t,Sn as u,Ne as v,Mt as w,Ye as x,je as y,wt as z};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var u=1440;var o=96,P=14;function _(n){return n/1440*96}function I(n){return n/96*1440}function E(n){return n==null||isNaN(n)?0:Math.round(n*96/914400)}function i(n){return Math.round(n/96*914400)}function m(n){return Math.round(n/914400*1440)}function N(n){return Math.round(n/1440*914400)}function H(n){return n/72*96}function b(n){return n/144*96}function s(n){return n/2}function p(n){return n*2}function x(n){return n/576*96}function e(n,t=2){let r=Math.pow(10,t);return Math.round(n*r)/r}function R(n,t,r){return Math.min(Math.max(n,t),r)}function S(n){return `${e(n)}px`}exports.a=u;exports.b=o;exports.c=P;exports.d=_;exports.e=I;exports.f=E;exports.g=i;exports.h=m;exports.i=N;exports.j=H;exports.k=b;exports.l=s;exports.m=p;exports.n=x;exports.o=e;exports.p=R;exports.q=S;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var chunk34DJT72K_js=require('./chunk-34DJT72K.js'),chunkJFZIXFRC_js=require('./chunk-JFZIXFRC.js'),chunkRQVHKDXK_js=require('./chunk-RQVHKDXK.js'),chunkAXVWVIIN_js=require('./chunk-AXVWVIIN.js'),chunkLWH66Q7Q_js=require('./chunk-LWH66Q7Q.js'),chunkMJ5FQX7Q_js=require('./chunk-MJ5FQX7Q.js'),chunkBJSG6TEG_js=require('./chunk-BJSG6TEG.js'),chunkGSKMHXHG_js=require('./chunk-GSKMHXHG.js');function we(e){if(!e||e.pattern&&e.pattern!=="clear")return;let n=e.fill?.rgb;if(!(!n||e.fill?.auto))return chunkMJ5FQX7Q_js.n(n)}function X(e){if(!e)return [];let n=[];e.bold&&n.push(chunkAXVWVIIN_js.b.mark("bold")),e.italic&&n.push(chunkAXVWVIIN_js.b.mark("italic")),e.underline&&e.underline.style!=="none"&&n.push(chunkAXVWVIIN_js.b.mark("underline",{style:e.underline.style,color:e.underline.color})),(e.strike||e.doubleStrike)&&n.push(chunkAXVWVIIN_js.b.mark("strike",{double:e.doubleStrike||false})),e.color&&!e.color.auto&&n.push(chunkAXVWVIIN_js.b.mark("textColor",{rgb:e.color.rgb,themeColor:e.color.themeColor,themeTint:e.color.themeTint,themeShade:e.color.themeShade}));let o=e.highlight&&e.highlight!=="none"?e.highlight:we(e.shading);return o&&n.push(chunkAXVWVIIN_js.b.mark("highlight",{color:o})),e.fontSize&&n.push(chunkAXVWVIIN_js.b.mark("fontSize",{size:e.fontSize})),e.fontFamily&&n.push(chunkAXVWVIIN_js.b.mark("fontFamily",{ascii:e.fontFamily.ascii,hAnsi:e.fontFamily.hAnsi,eastAsia:e.fontFamily.eastAsia,cs:e.fontFamily.cs,asciiTheme:e.fontFamily.asciiTheme,hAnsiTheme:e.fontFamily.hAnsiTheme,eastAsiaTheme:e.fontFamily.eastAsiaTheme,csTheme:e.fontFamily.csTheme})),e.vertAlign==="superscript"?n.push(chunkAXVWVIIN_js.b.mark("superscript")):e.vertAlign==="subscript"&&n.push(chunkAXVWVIIN_js.b.mark("subscript")),e.allCaps&&n.push(chunkAXVWVIIN_js.b.mark("allCaps")),e.smallCaps&&n.push(chunkAXVWVIIN_js.b.mark("smallCaps")),(e.spacing!=null||e.position!=null||e.scale!=null||e.kerning!=null)&&n.push(chunkAXVWVIIN_js.b.mark("characterSpacing",{spacing:e.spacing??null,position:e.position??null,scale:e.scale??null,kerning:e.kerning??null})),e.emboss&&n.push(chunkAXVWVIIN_js.b.mark("emboss")),e.imprint&&n.push(chunkAXVWVIIN_js.b.mark("imprint")),e.shadow&&n.push(chunkAXVWVIIN_js.b.mark("textShadow")),e.emphasisMark&&e.emphasisMark!=="none"&&n.push(chunkAXVWVIIN_js.b.mark("emphasisMark",{type:e.emphasisMark})),e.outline&&n.push(chunkAXVWVIIN_js.b.mark("textOutline")),e.hidden&&n.push(chunkAXVWVIIN_js.b.mark("hidden")),e.rtl&&n.push(chunkAXVWVIIN_js.b.mark("rtl")),e.effect&&e.effect!=="none"&&n.push(chunkAXVWVIIN_js.b.mark("textEffect",{effect:e.effect})),e.styleId&&n.push(chunkAXVWVIIN_js.b.mark("runStyle",{styleId:e.styleId})),n}function E(e,n){if(!e)return;if(!n)return e;let o=n.resolveRunStyle(e.styleId);return o?chunkGSKMHXHG_js.b(o,e):e}function ee(e,n){let o="",l,t=e.type==="simpleField"?e.content:e.fieldResult;if(t){for(let s of t)if(s.type==="run"){for(let u of s.content)u.type==="text"&&(o+=u.text);!l&&s.formatting&&(l=s.formatting);}}let r=chunkGSKMHXHG_js.b(n,l),i=X(r);return chunkAXVWVIIN_js.b.node("field",{fieldType:e.fieldType,instruction:e.instruction,displayText:o,fieldKind:e.type==="simpleField"?"simple":"complex",fldLock:e.fldLock??false,dirty:e.dirty??false},void 0,i)}function te(e){return chunkAXVWVIIN_js.b.node("math",{display:e.display,ommlXml:e.ommlXml,plainText:e.plainText||""})}function K(e,n,o){let l=[],t=e.formatting?.styleId?o?.getRunStyleOwnProperties(e.formatting.styleId):void 0,r=chunkGSKMHXHG_js.b(chunkGSKMHXHG_js.b(n,t),e.formatting),i=X(r);for(let s of e.content){let u=pe(s,i);l.push(...u);}return l}function pe(e,n){switch(e.type){case "text":return e.text?[chunkAXVWVIIN_js.b.text(e.text,n)]:[];case "break":return e.breakType==="textWrapping"||!e.breakType?[chunkAXVWVIIN_js.b.node("hardBreak",null,void 0,n)]:[];case "tab":return [chunkAXVWVIIN_js.b.node("tab",null,void 0,n)];case "drawing":return e.image?[xe(e.image)]:[];case "shape":{let t=e.shape;return t.textBody&&t.textBody.content.length>0?[]:[Fe(t)]}case "footnoteRef":let o=chunkAXVWVIIN_js.b.mark("footnoteRef",{id:e.id.toString(),noteType:"footnote"});return [chunkAXVWVIIN_js.b.text(e.id.toString(),[...n,o])];case "endnoteRef":let l=chunkAXVWVIIN_js.b.mark("footnoteRef",{id:e.id.toString(),noteType:"endnote"});return [chunkAXVWVIIN_js.b.text(e.id.toString(),[...n,l])];default:return []}}function xe(e){let n=e.size?.width?chunkBJSG6TEG_js.f(e.size.width):void 0,o=e.size?.height?chunkBJSG6TEG_js.f(e.size.height):void 0,l=e.wrap.type,t=e.wrap.wrapText,r=e.position?.horizontal?.alignment,i;l==="inline"||l==="topAndBottom"?i="none":l==="square"||l==="tight"||l==="through"?t==="left"?i="right":t==="right"||r==="left"?i="left":r==="right"?i="right":i="none":i="none";let s="inline";l==="inline"?s="inline":l==="topAndBottom"?s="block":chunkJFZIXFRC_js.b(l)||i&&i!=="none"?s="float":s="block";let u;if(e.transform){let P=[];e.transform.rotation&&P.push(`rotate(${e.transform.rotation}deg)`),e.transform.flipH&&P.push("scaleX(-1)"),e.transform.flipV&&P.push("scaleY(-1)"),P.length>0&&(u=P.join(" "));}let c=e.wrap.distT!=null?chunkBJSG6TEG_js.f(e.wrap.distT):void 0,f=e.wrap.distB!=null?chunkBJSG6TEG_js.f(e.wrap.distB):void 0,d=e.wrap.distL!=null?chunkBJSG6TEG_js.f(e.wrap.distL):void 0,p=e.wrap.distR!=null?chunkBJSG6TEG_js.f(e.wrap.distR):void 0,m;e.position&&(m={horizontal:e.position.horizontal?{relativeTo:e.position.horizontal.relativeTo,posOffset:e.position.horizontal.posOffset,align:e.position.horizontal.alignment}:void 0,vertical:e.position.vertical?{relativeTo:e.position.vertical.relativeTo,posOffset:e.position.vertical.posOffset,align:e.position.vertical.alignment}:void 0});let S,w,M;if(e.outline&&e.outline.width){S=Math.round(e.outline.width/914400*96*100)/100,e.outline.color?.rgb&&(w=`#${e.outline.color.rgb}`);let P={solid:"solid",dot:"dotted",dash:"dashed",lgDash:"dashed",dashDot:"dashed",lgDashDot:"dashed",lgDashDotDot:"dashed",sysDot:"dotted",sysDash:"dashed",sysDashDot:"dashed",sysDashDotDot:"dashed"};M=e.outline.style&&P[e.outline.style]||"solid";}let z=e.padding?.top?chunkBJSG6TEG_js.f(e.padding.top):void 0,I=e.padding?.bottom?chunkBJSG6TEG_js.f(e.padding.bottom):void 0,B=e.padding?.left?chunkBJSG6TEG_js.f(e.padding.left):void 0,g=e.padding?.right?chunkBJSG6TEG_js.f(e.padding.right):void 0;return chunkAXVWVIIN_js.b.node("image",{src:e.src||"",alt:e.alt,title:e.title,width:n,height:o,rId:e.rId,wrapType:l,displayMode:s,cssFloat:i,transform:u,distTop:c,distBottom:f,distLeft:d,distRight:p,position:m,borderWidth:S,borderColor:w,borderStyle:M,wrapText:t,hlinkHref:e.hlinkHref,cropTop:e.crop?.top,cropRight:e.crop?.right,cropBottom:e.crop?.bottom,cropLeft:e.crop?.left,opacity:e.opacity,effectExtentTop:z,effectExtentBottom:I,effectExtentLeft:B,effectExtentRight:g,layoutInCell:e.layoutInCell,allowOverlap:e.allowOverlap})}function Y(e,n,o){let l=[],t=e.href||(e.anchor?`#${e.anchor}`:""),r=chunkAXVWVIIN_js.b.mark("hyperlink",{href:t,tooltip:e.tooltip,rId:e.rId});for(let i of e.children)if(i.type==="run"){let s=i.formatting?.styleId?o?.getRunStyleOwnProperties(i.formatting.styleId):void 0,u=chunkGSKMHXHG_js.b(chunkGSKMHXHG_js.b(n,s),i.formatting),f=[...X(u),r];for(let d of i.content)l.push(...pe(d,f));}return l}function Fe(e){let n=e.size?.width?chunkBJSG6TEG_js.f(e.size.width):100,o=e.size?.height?chunkBJSG6TEG_js.f(e.size.height):80,l,t="solid",r,i,s;if(e.fill&&(t=e.fill.type,e.fill.color?.rgb&&(l=`#${e.fill.color.rgb}`),e.fill.type==="gradient"&&e.fill.gradient)){let p=e.fill.gradient;r=p.type,i=p.angle,s=JSON.stringify(p.stops.map(m=>({position:m.position,color:m.color.rgb?`#${m.color.rgb}`:"#000000"})));}let u,c,f;e.outline&&(e.outline.width&&(u=Math.round(e.outline.width/914400*96*100)/100),e.outline.color?.rgb&&(c=`#${e.outline.color.rgb}`),f=e.outline.style||"solid");let d;if(e.transform){let p=[];e.transform.rotation&&p.push(`rotate(${e.transform.rotation}deg)`),e.transform.flipH&&p.push("scaleX(-1)"),e.transform.flipV&&p.push("scaleY(-1)"),p.length>0&&(d=p.join(" "));}return chunkAXVWVIIN_js.b.node("shape",{shapeType:e.shapeType||"rect",shapeId:e.id,width:n,height:o,fillColor:l,fillType:t,gradientType:r,gradientAngle:i,gradientStops:s,outlineWidth:u,outlineColor:c,outlineStyle:f,transform:d})}function V(e,n,o,l){let t=ke(e,n),r=[],i,s=new Set,u;n&&(u=n.resolveParagraphStyle(e.formatting?.styleId).runFormatting);let c=chunkGSKMHXHG_js.b(u,l);for(let f of e.content){if(f.type==="commentRangeStart")s.add(f.id);else if(f.type==="commentRangeEnd")s.delete(f.id);else if(f.type==="run"){let d=K(f,c,n);s.size>0&&(d=O(d,s)),r.push(...d);}else if(f.type==="hyperlink"){let d=Y(f,c,n);r.push(...d);}else if(f.type==="simpleField"||f.type==="complexField"){let d=ee(f,c);d&&r.push(d);}else if(f.type==="inlineSdt"){let d=me(f,c,n);d&&r.push(d);}else if(f.type==="insertion"){let d=J(f,"insertion",c,n);s.size>0&&(d=O(d,s)),r.push(...d);}else if(f.type==="deletion"){let d=J(f,"deletion",c,n);s.size>0&&(d=O(d,s)),r.push(...d);}else if(f.type==="moveFrom"){let d=J(f,"deletion",c,n,true);s.size>0&&(d=O(d,s)),r.push(...d);}else if(f.type==="moveTo"){let d=J(f,"insertion",c,n,true);s.size>0&&(d=O(d,s)),r.push(...d);}else if(f.type==="mathEquation"){let d=te(f);d&&r.push(d);}f.type==="bookmarkStart"&&(i||(i=[]),i.push({id:f.id,name:f.name}));}return i&&(t.bookmarks=i),chunkAXVWVIIN_js.b.node("paragraph",t,r)}function O(e,n){if(n.size===0)return e;let o=[...n][0],l=chunkAXVWVIIN_js.b.marks.comment.create({commentId:o});return e.map(t=>t.isText?t.mark(l.addToSet(t.marks)):t)}function J(e,n,o,l,t=false){let r=[];for(let s of e.content)s.type==="run"?r.push(...K(s,o,l)):s.type==="hyperlink"&&r.push(...Y(s,o,l));let i=chunkAXVWVIIN_js.b.marks[n].create({revisionId:e.info.id,author:e.info.author,date:e.info.date??null,isMovePair:t});return r.map(s=>s.isText||s.type.allowsMarkType(i.type)?s.mark(i.addToSet(s.marks)):s)}function ke(e,n){let o=e.formatting,l=o?.styleId,t={paraId:e.paraId??void 0,textId:e.textId??void 0,styleId:l,numPr:o?.numPr,numPrFromStyle:o?.numPrFromStyle,listNumFmt:e.listRendering?.numFmt,listIsBullet:e.listRendering?.isBullet,listMarker:e.listRendering?.marker,listMarkerHidden:e.listRendering?.markerHidden||void 0,listMarkerFontFamily:e.listRendering?.markerFontFamily||void 0,listMarkerFontSize:e.listRendering?.markerFontSize||void 0,listMarkerSuffix:e.listRendering?.markerSuffix||void 0,listLevelNumFmts:e.listRendering?.levelNumFmts||void 0,listAbstractNumId:e.listRendering?.abstractNumId,listStartOverride:e.listRendering?.startOverride,_originalFormatting:o||void 0};if(n){let r=n.resolveParagraphStyle(l),i=r.paragraphFormatting,s=r.runFormatting;t.alignment=o?.alignment??i?.alignment,t.spaceBefore=o?.spaceBefore??i?.spaceBefore,t.spaceAfter=o?.spaceAfter??i?.spaceAfter,t.lineSpacing=o?.lineSpacing??i?.lineSpacing,t.lineSpacingRule=o?.lineSpacingRule??i?.lineSpacingRule,o?.spacingExplicit&&(t.spacingExplicit=o.spacingExplicit),t.indentLeft=o?.indentLeft??i?.indentLeft,t.indentRight=o?.indentRight??i?.indentRight;let c=o?.numPr?.numId===0&&i?.numPr&&i.numPr.numId!==0?void 0:i;t.indentFirstLine=o?.indentFirstLine??c?.indentFirstLine,t.hangingIndent=o?.hangingIndent??c?.hangingIndent,t.borders=o?.borders??i?.borders,t.shading=o?.shading??i?.shading,t.tabs=o?.tabs??i?.tabs,t.pageBreakBefore=o?.pageBreakBefore??i?.pageBreakBefore,t.keepNext=o?.keepNext??i?.keepNext,t.keepLines=o?.keepLines??i?.keepLines,t.contextualSpacing=o?.contextualSpacing??i?.contextualSpacing,t.outlineLevel=o?.outlineLevel??i?.outlineLevel,t.bidi=o?.bidi??i?.bidi;let f=n.getDefaultCharacterStyle()?.rPr,d=f?chunkGSKMHXHG_js.b(s,f):s,p=E(o?.runProperties,n);t.defaultTextFormatting=chunkGSKMHXHG_js.b(d,p),!o?.numPr&&i?.numPr&&i.numPr.numId!==0&&(t.numPr=i.numPr,t.numPrFromStyle=i.numPr);}else t.alignment=o?.alignment,t.spaceBefore=o?.spaceBefore,t.spaceAfter=o?.spaceAfter,t.lineSpacing=o?.lineSpacing,t.lineSpacingRule=o?.lineSpacingRule,o?.spacingExplicit&&(t.spacingExplicit=o.spacingExplicit),t.indentLeft=o?.indentLeft,t.indentRight=o?.indentRight,t.indentFirstLine=o?.indentFirstLine,t.hangingIndent=o?.hangingIndent,t.borders=o?.borders,t.shading=o?.shading,t.tabs=o?.tabs,t.pageBreakBefore=o?.pageBreakBefore,t.keepNext=o?.keepNext,t.keepLines=o?.keepLines,t.outlineLevel=o?.outlineLevel,t.bidi=o?.bidi,t.defaultTextFormatting=E(o?.runProperties,n);if(e.sectionProperties){t._sectionProperties=e.sectionProperties;let r=e.sectionProperties.sectionStart;(r==="nextPage"||r==="continuous"||r==="oddPage"||r==="evenPage")&&(t.sectionBreakType=r);}return e.renderedPageBreakBefore&&(t.renderedPageBreakBefore=true),e.pPrIns&&(t.pPrIns={revisionId:e.pPrIns.id,author:e.pPrIns.author,date:e.pPrIns.date??null}),e.pPrDel&&(t.pPrDel={revisionId:e.pPrDel.id,author:e.pPrDel.author,date:e.pPrDel.date??null}),e.propertyChanges&&e.propertyChanges.length>0&&(t.pPrChange=e.propertyChanges),t}function me(e,n,o){let l=e.properties,t=[];for(let r of e.content)if(r.type==="run"){let i=K(r,n,o);t.push(...i);}else if(r.type==="hyperlink"){let i=Y(r,n,o);t.push(...i);}else if(r.type==="simpleField"||r.type==="complexField"){let i=ee(r,n);i&&t.push(i);}else if(r.type==="inlineSdt"){let i=me(r,n,o);i&&t.push(i);}else if(r.type==="mathEquation"){let i=te(r);i&&t.push(i);}return chunkAXVWVIIN_js.b.node("sdt",chunk34DJT72K_js.a(l),t.length>0?t:void 0)}function ge(e){function n(l){return l.type==="break"&&l.breakType==="page"}function o(l){if(l.type==="run"){for(let t of l.content)if(n(t))return true;return false}if(l.type==="hyperlink"){for(let t of l.children)if(t.type==="run"&&o(t))return true;return false}if(l.type==="insertion"||l.type==="deletion"){let t=l;for(let r of t.content)if(o(r))return true;return false}return false}for(let l of e.content)if(o(l))return true;return false}function R(e,n,o){if(!e||!n)return;let l=e.getStyle(n);if(!l?.tblStylePr)return;let t=l.tblStylePr.find(u=>u.type===o);if(!t)return;let r=E(t.pPr?.runProperties,e),i=E(t.rPr,e),s=chunkGSKMHXHG_js.b(r,i);return {tcPr:t.tcPr,rPr:s}}function N(e,n){if(!e&&!n)return;if(!e)return n;if(!n)return e;let o={},l=e.tcPr,t=n.tcPr;if(l||t){let r={...l??{},...t??{}};(l?.borders||t?.borders)&&(r.borders={...l?.borders??{},...t?.borders??{}}),(l?.shading||t?.shading)&&(r.shading={...l?.shading??{},...t?.shading??{}}),(l?.margins||t?.margins)&&(r.margins={...l?.margins??{},...t?.margins??{}}),o.tcPr=r;}return o.rPr=chunkGSKMHXHG_js.b(e.rPr,n.rPr),o}function Se(e){let n=new Map,o=e.rows.length,l=new Map;for(let t=0;t<o;t++){let r=e.rows[t],i=0,s=r.cells.map(c=>{let f=c.formatting?.gridSpan??1,d=i;return i+=f,{colIndex:d,vMerge:c.formatting?.vMerge,key:`${t}-${d}`}});if(s.length>0&&s.every(({colIndex:c,vMerge:f})=>f==="continue"&&l.has(c))){for(let{colIndex:c,key:f}of s)l.delete(c),n.set(f,{rowSpan:1,skip:false});continue}for(let{colIndex:c,vMerge:f,key:d}of s){let p=c;if(f==="restart")l.set(p,t),n.set(d,{rowSpan:1,skip:false});else if(f==="continue"){let m=l.get(p);if(m!==void 0){let S=`${m}-${p}`,w=n.get(S);w&&w.rowSpan++,n.set(d,{rowSpan:1,skip:true});}else n.set(d,{rowSpan:1,skip:false});}else l.delete(p),n.set(d,{rowSpan:1,skip:false});}}return n}function ne(e,n,o){let l=Se(e),t=e.columnWidths,r=t?.reduce((P,x)=>P+x,0)??0,i=e.formatting?.styleId,s=e.formatting?.look,u=i?n?.getStyle(i):void 0,c=n?.getDefaultTableStyle(),f=e.formatting?.borders??u?.tblPr?.borders??c?.tblPr?.borders,d=e.formatting?.cellMargins??u?.tblPr?.cellMargins??c?.tblPr?.cellMargins??void 0,p=d?{top:d.top?.value,bottom:d.bottom?.value,left:d.left?.value,right:d.right?.value}:void 0,m={styleId:e.formatting?.styleId,width:e.formatting?.width?.value,widthType:e.formatting?.width?.type,justification:e.formatting?.justification,columnWidths:t,tableLayout:e.formatting?.layout??null,floating:e.formatting?.floating,cellMargins:p,look:e.formatting?.look,_originalFormatting:e.formatting||void 0};e.propertyChanges&&e.propertyChanges.length>0&&(m.tblPrChange=e.propertyChanges);let S={wholeTable:R(n,i,"wholeTable"),firstRow:R(n,i,"firstRow"),lastRow:R(n,i,"lastRow"),firstCol:R(n,i,"firstCol"),lastCol:R(n,i,"lastCol"),band1Horz:R(n,i,"band1Horz"),band2Horz:R(n,i,"band2Horz"),band1Vert:R(n,i,"band1Vert"),band2Vert:R(n,i,"band2Vert"),nwCell:R(n,i,"nwCell"),neCell:R(n,i,"neCell"),swCell:R(n,i,"swCell"),seCell:R(n,i,"seCell")},w=s?.noHBand!==true,M=s?.noVBand!==true,z=0,I=e.rows.length,B=t?.length??Math.max(0,...e.rows.map(P=>P.cells.reduce((x,k)=>x+(k.formatting?.gridSpan??1),0))),g=e.rows.map((P,x)=>{let k=x===0&&!!s?.firstRow,v=x===I-1&&!!s?.lastRow,h=w&&!k&&!v?z%2===0?S.band1Horz:S.band2Horz:void 0;return w&&!k&&!v&&z++,Re(P,n,k,t,r,S,h,M,s,f,x,I,B,l,p,o)});return chunkAXVWVIIN_js.b.node("table",m,g)}function Re(e,n,o,l,t,r,i,s,u,c,f,d,p,m,S,w){let M={height:e.formatting?.height?.value,heightRule:e.formatting?.heightRule,isHeader:!!e.formatting?.header,_originalFormatting:e.formatting||void 0};if(e.structuralChange){let C=e.structuralChange,D={revisionId:C.info.id,author:C.info.author,date:C.info.date??null};C.type==="tableRowInsertion"?M.trIns=D:C.type==="tableRowDeletion"&&(M.trDel=D);}e.propertyChanges&&e.propertyChanges.length>0&&(M.trPrChange=e.propertyChanges);let z=e.cells.length,I=f===0,B=f===(d??1)-1,g=e.formatting?.conditionalFormat,P=g?.firstRow??I,x=g?.lastRow??B,k=p??z,v=0,h=[];for(let C=0;C<e.cells.length;C++){let D=e.cells[C],H=D.formatting?.gridSpan??1,ye=`${f??0}-${v}`,re=m?.get(ye),Pe=re?.skip??false,Ce=re?.rowSpan??1,ie;if(l&&t&&t>0){let q=0;for(let A=0;A<H&&v+A<l.length;A++)q+=l[v+A];ie=Math.round(q/t*100);}if(v+=H,Pe)continue;let le=v-H===0,se=v===k,b=D.formatting?.conditionalFormat,G=b?.firstRow??P,Q=b?.lastRow??x,$=b?.firstColumn??le,W=b?.lastColumn??se,_;if(s){let q=u?.firstColumn?1:0,A=v-H-q;A>=0&&!(u?.lastColumn&&W)&&!(u?.firstColumn&&$)&&(_=A%2===0?r?.band1Vert:r?.band2Vert);}b?.oddVBand?_=r?.band1Vert:b?.evenVBand&&(_=r?.band2Vert);let L=i;g?.oddHBand?L=r?.band1Horz:g?.evenHBand&&(L=r?.band2Horz),b?.oddHBand?L=r?.band1Horz:b?.evenHBand&&(L=r?.band2Horz);let T=r?.wholeTable;T=N(T,L),T=N(T,_),G&&(u?.firstRow||g?.firstRow||b?.firstRow)&&(T=N(T,r?.firstRow)),Q&&(u?.lastRow||g?.lastRow||b?.lastRow)&&(T=N(T,r?.lastRow)),$&&(u?.firstColumn||g?.firstColumn||b?.firstColumn)&&(T=N(T,r?.firstCol)),W&&(u?.lastColumn||g?.lastColumn||b?.lastColumn)&&(T=N(T,r?.lastCol)),G&&$&&(u?.firstRow||g?.firstRow||b?.firstRow)&&(u?.firstColumn||g?.firstColumn||b?.firstColumn)&&(T=N(T,r?.nwCell)),G&&W&&(u?.firstRow||g?.firstRow||b?.firstRow)&&(u?.lastColumn||g?.lastColumn||b?.lastColumn)&&(T=N(T,r?.neCell)),Q&&$&&(u?.lastRow||g?.lastRow||b?.lastRow)&&(u?.firstColumn||g?.firstColumn||b?.firstColumn)&&(T=N(T,r?.swCell)),Q&&W&&(u?.lastRow||g?.lastRow||b?.lastRow)&&(u?.lastColumn||g?.lastColumn||b?.lastColumn)&&(T=N(T,r?.seCell)),h.push(he(D,n,o,ie,T,c,I,B,le,se,Ce,S,w));}if(h.length===0){let C=Math.max(k,1),D={formatting:C>1?{gridSpan:C}:void 0,content:[{type:"paragraph",content:[]}]},H=N(r?.wholeTable,i);h.push(he(D,n,o,t&&t>0?100:void 0,H,c,I,B,true,true,1,S,w));}return chunkAXVWVIIN_js.b.node("tableRow",M,h)}var Me=["top","bottom","left","right","insideH","insideV"];function ve(e,n){if(!e)return e;let o;for(let l of Me){let t=e[l];if(!t?.color?.themeColor||t.color.auto)continue;let r=chunkMJ5FQX7Q_js.b(t.color,n);r&&(o??(o={...e}),o[l]={...t,color:{rgb:r}});}return o??e}function he(e,n,o,l,t,r,i,s,u,c,f,d,p){let m=e.formatting,S=f??1,w=m?.width?.value,M=m?.width?.type;w===void 0&&l!==void 0&&(w=l,M="pct");let z=chunkMJ5FQX7Q_js.b(m?.shading?.fill??t?.tcPr?.shading?.fill,p),I=r?{top:i?r.top:r.insideH,bottom:s?r.bottom:r.insideH,left:u?r.left:r.insideV,right:c?r.right:r.insideV}:void 0,B=t?.tcPr?.borders,g=m?.borders,P=ve(I||B||g?{...I??{},...B??{},...g??{}}:void 0,p),x={colspan:m?.gridSpan??1,rowspan:S,width:w,widthType:M,verticalAlign:m?.verticalAlign,backgroundColor:z,textDirection:m?.textDirection,noWrap:m?.noWrap,borders:P,margins:m?.margins?{top:m.margins.top?.value,bottom:m.margins.bottom?.value,left:m.margins.left?.value,right:m.margins.right?.value}:t?.tcPr?.margins?{top:t.tcPr.margins.top?.value,bottom:t.tcPr.margins.bottom?.value,left:t.tcPr.margins.left?.value,right:t.tcPr.margins.right?.value}:d,_originalFormatting:m||void 0,_originalResolvedFill:z};if(e.structuralChange){let h=e.structuralChange,C={revisionId:h.info.id,author:h.info.author,date:h.info.date??null};h.type==="tableCellInsertion"?x.cellMarker={kind:"ins",info:C}:h.type==="tableCellDeletion"?x.cellMarker={kind:"del",info:C}:h.type==="tableCellMerge"&&(x.cellMarker={kind:"merge",info:C,vMerge:h.vMerge??"cont",...h.vMergeOrig?{vMergeOrig:h.vMergeOrig}:{}});}e.propertyChanges&&e.propertyChanges.length>0&&(x.tcPrChange=e.propertyChanges);let k=[];for(let h of e.content)h.type==="paragraph"?k.push(V(h,n,void 0,t?.rPr)):h.type==="table"&&k.push(ne(h,n));k.length===0&&k.push(chunkAXVWVIIN_js.b.node("paragraph",{},[]));let v=o?"tableHeader":"tableCell";return chunkAXVWVIIN_js.b.node(v,x,k)}function be(e,n){let o=Ne(e),l=V(e,n),t=[],r=o.length>0&&l.content.size===0,{anchored:i,inFlow:s}=Ie(o);for(let u of i)t.push(Te(u,n));r||t.push(l);for(let u of s)t.push(Te(u,n));return t}function Ie(e){let n=[],o=[];for(let l of e)chunk34DJT72K_js.c(l)?n.push(l):o.push(l);return {anchored:n,inFlow:o}}function Ne(e){let n=[];for(let o of e.content)if(o.type==="run"){for(let l of o.content)if(l.type==="shape"&&"shape"in l){let t=l.shape;t.textBody&&t.textBody.content.length>0&&n.push({type:"textBox",id:t.id,size:t.size,position:t.position,wrap:t.wrap,fill:t.fill,outline:t.outline,content:t.textBody.content,margins:t.textBody.margins});}}return n}function Te(e,n){let o=e.size?.width?chunkBJSG6TEG_js.f(e.size.width):200,l=e.size?.height?chunkBJSG6TEG_js.f(e.size.height):void 0,t;e.fill?.color?.rgb&&(t=`#${e.fill.color.rgb}`);let r,i,s;e.outline&&e.outline.width&&(r=Math.round(e.outline.width/914400*96*100)/100,e.outline.color?.rgb&&(i=`#${e.outline.color.rgb}`),s=e.outline.style||"solid");let u=e.margins?.top!=null?chunkBJSG6TEG_js.f(e.margins.top):4,c=e.margins?.bottom!=null?chunkBJSG6TEG_js.f(e.margins.bottom):4,f=e.margins?.left!=null?chunkBJSG6TEG_js.f(e.margins.left):7,d=e.margins?.right!=null?chunkBJSG6TEG_js.f(e.margins.right):7,p=[];for(let m of e.content)p.push(V(m,n));return p.length===0&&p.push(chunkAXVWVIIN_js.b.node("paragraph",{},[])),chunkAXVWVIIN_js.b.node("textBox",{width:o,height:l,textBoxId:e.id,fillColor:t,outlineWidth:r,outlineColor:i,outlineStyle:s,marginTop:u,marginBottom:c,marginLeft:f,marginRight:d,...chunk34DJT72K_js.d(e)},p)}function oe(e,n,o,l){let t=[];for(let r of e)if(r.type==="paragraph")t.push(...be(r,n)),l&&ge(r)&&t.push(chunkAXVWVIIN_js.b.node("pageBreak"));else if(r.type==="table")t.push(ne(r,n,o));else if(r.type==="blockSdt"){let i=oe(r.content,n,o,l),s=i.length>0?i:[chunkAXVWVIIN_js.b.node("paragraph",{},[])];t.push(chunkAXVWVIIN_js.b.node("blockSdt",chunk34DJT72K_js.a(r.properties),s));}return t}function mt(e,n){let o=e.package.theme??null,l=n?.styles?chunkLWH66Q7Q_js.b(n.styles):null,t=oe(e.package.document.content,l,o,true);return t.length===0&&t.push(chunkAXVWVIIN_js.b.node("paragraph",{},[])),t[t.length-1]?.type.name==="blockSdt"&&t.push(chunkAXVWVIIN_js.b.node("paragraph",{},[])),chunkAXVWVIIN_js.b.node("doc",{defaultTabStopTwips:e.package.settings?.defaultTabStop??null,watermark:chunkRQVHKDXK_js.a(e)??null},t)}function Be(e,n){let o=n?.styles?chunkLWH66Q7Q_js.b(n.styles):null,l=n?.theme??null,t=oe(e,o,l,false);return t.length===0&&t.push(chunkAXVWVIIN_js.b.node("paragraph",{},[])),chunkAXVWVIIN_js.b.node("doc",{defaultTabStopTwips:n?.defaultTabStopTwips??null},t)}function gt(e,n){return Be(e,n)}function ht(){return chunkAXVWVIIN_js.b.node("doc",null,[chunkAXVWVIIN_js.b.node("paragraph",{},[])])}exports.a=mt;exports.b=Be;exports.c=gt;exports.d=ht;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {a,r,s,t,u as u$1,A,z,q as q$1,B,D,O,N,C,b as b$3}from'./chunk-RT52EYG3.mjs';import {b as b$1}from'./chunk-MOCGHQ4A.mjs';import {u,q}from'./chunk-CDBKFBC2.mjs';import {b,a as a$2}from'./chunk-W77JXDEV.mjs';import {b as b$2}from'./chunk-DI6CRWSW.mjs';import {a as a$1}from'./chunk-VJFIAFZ5.mjs';import {c,f,e,l,j as j$1,a as a$3,i,m}from'./chunk-3ANZ3252.mjs';import He from'jszip';async function G(t){let n=await He.loadAsync(t),e={documentXml:null,stylesXml:null,themeXml:null,numberingXml:null,fontTableXml:null,settingsXml:null,webSettingsXml:null,headers:new Map,footers:new Map,footnotesXml:null,endnotesXml:null,commentsXml:null,commentsExtensibleXml:null,commentsExtendedXml:null,documentRels:null,packageRels:null,contentTypesXml:null,corePropsXml:null,appPropsXml:null,customPropsXml:null,media:new Map,fonts:new Map,allXml:new Map,originalZip:n,originalBuffer:t};for(let[o,i]of Object.entries(n.files)){if(i.dir)continue;let r=o.toLowerCase();if(r.endsWith(".xml")||r.endsWith(".rels")){let a=await i.async("text");if(e.allXml.set(o,a),r==="word/document.xml")e.documentXml=a;else if(r==="word/styles.xml")e.stylesXml=a;else if(r==="word/theme/theme1.xml")e.themeXml=a;else if(r==="word/numbering.xml")e.numberingXml=a;else if(r==="word/fonttable.xml")e.fontTableXml=a;else if(r==="word/settings.xml")e.settingsXml=a;else if(r==="word/websettings.xml")e.webSettingsXml=a;else if(r==="word/footnotes.xml")e.footnotesXml=a;else if(r==="word/endnotes.xml")e.endnotesXml=a;else if(r==="word/comments.xml")e.commentsXml=a;else if(r==="word/commentsextensible.xml")e.commentsExtensibleXml=a;else if(r==="word/commentsextended.xml")e.commentsExtendedXml=a;else if(r==="word/_rels/document.xml.rels")e.documentRels=a;else if(r==="_rels/.rels")e.packageRels=a;else if(r==="[content_types].xml")e.contentTypesXml=a;else if(r==="docprops/core.xml")e.corePropsXml=a;else if(r==="docprops/app.xml")e.appPropsXml=a;else if(r==="docprops/custom.xml")e.customPropsXml=a;else if(r.match(/^word\/header\d+\.xml$/)){let c=o.split("/").pop()||o;e.headers.set(c,a);}else if(r.match(/^word\/footer\d+\.xml$/)){let c=o.split("/").pop()||o;e.footers.set(c,a);}}else if(r.startsWith("word/media/")){let a=await i.async("arraybuffer");e.media.set(o,a);}else if(r.startsWith("word/fonts/")){let a=await i.async("arraybuffer");e.fonts.set(o,a);}}return e}function Me(t){switch(t.toLowerCase().split(".").pop()){case "png":return "image/png";case "jpg":case "jpeg":return "image/jpeg";case "gif":return "image/gif";case "bmp":return "image/bmp";case "tif":case "tiff":return "image/tiff";case "wmf":return "image/x-wmf";case "emf":return "image/x-emf";case "svg":return "image/svg+xml";case "webp":return "image/webp";default:return "application/octet-stream"}}function Y(t,n,e,o){let i={};return t&&t!=="auto"?i.rgb=t:t==="auto"&&(i.auto=true),n&&(i.themeColor=n),e&&(i.themeTint=e),o&&(i.themeShade=o),i}function W(t){if(!t)return;let n={},e=j$1(t,"w","color");e&&e!=="auto"&&(n.color={rgb:e});let o=j$1(t,"w","fill");o&&o!=="auto"&&(n.fill={rgb:o});let i=j$1(t,"w","themeFill");i&&(n.fill=n.fill||{},n.fill.themeColor=i);let r=j$1(t,"w","themeFillTint");r&&n.fill&&(n.fill.themeTint=r);let a=j$1(t,"w","themeFillShade");a&&n.fill&&(n.fill.themeShade=a);let c=j$1(t,"w","val");return c&&(n.pattern=c),Object.keys(n).length>0?n:void 0}function $(t,n){if(!t)return;let e$1={},o=e(t,"w","b");o&&(e$1.bold=m(o));let i=e(t,"w","bCs");i&&(e$1.boldCs=m(i));let r=e(t,"w","i");r&&(e$1.italic=m(r));let a=e(t,"w","iCs");a&&(e$1.italicCs=m(a));let c=e(t,"w","u");if(c){let m=j$1(c,"w","val");if(m){e$1.underline={style:m};let P=j$1(c,"w","color"),I=j$1(c,"w","themeColor");(P||I)&&(e$1.underline.color=Y(P,I,j$1(c,"w","themeTint"),j$1(c,"w","themeShade")));}}let g=e(t,"w","strike");g&&(e$1.strike=m(g));let d=e(t,"w","dstrike");d&&(e$1.doubleStrike=m(d));let h=e(t,"w","vertAlign");if(h){let m=j$1(h,"w","val");(m==="superscript"||m==="subscript"||m==="baseline")&&(e$1.vertAlign=m);}let b=e(t,"w","smallCaps");b&&(e$1.smallCaps=m(b));let u=e(t,"w","caps");u&&(e$1.allCaps=m(u));let S=e(t,"w","vanish");S&&(e$1.hidden=m(S));let f=e(t,"w","color");f&&(e$1.color=Y(j$1(f,"w","val"),j$1(f,"w","themeColor"),j$1(f,"w","themeTint"),j$1(f,"w","themeShade")));let y=e(t,"w","highlight");if(y){let m=j$1(y,"w","val");m&&(e$1.highlight=m);}let C=e(t,"w","shd");C&&(e$1.shading=W(C));let D=e(t,"w","sz");if(D){let m=l(D,"w","val");m!==void 0&&(e$1.fontSize=m);}let B=e(t,"w","szCs");if(B){let m=l(B,"w","val");m!==void 0&&(e$1.fontSizeCs=m);}let v=e(t,"w","rFonts");if(v){e$1.fontFamily={ascii:j$1(v,"w","ascii")??void 0,hAnsi:j$1(v,"w","hAnsi")??void 0,eastAsia:j$1(v,"w","eastAsia")??void 0,cs:j$1(v,"w","cs")??void 0};let m=j$1(v,"w","asciiTheme");m&&(e$1.fontFamily.asciiTheme=m,n&&!e$1.fontFamily.ascii&&(e$1.fontFamily.ascii=b$3(n,m)));let P=j$1(v,"w","hAnsiTheme");P&&(e$1.fontFamily.hAnsiTheme=P,n&&!e$1.fontFamily.hAnsi&&(e$1.fontFamily.hAnsi=b$3(n,P)));let I=j$1(v,"w","eastAsiaTheme");I&&(e$1.fontFamily.eastAsiaTheme=I,n&&!e$1.fontFamily.eastAsia&&(e$1.fontFamily.eastAsia=b$3(n,I)));let U=j$1(v,"w","cstheme");U&&(e$1.fontFamily.csTheme=U,n&&!e$1.fontFamily.cs&&(e$1.fontFamily.cs=b$3(n,U)));}let X=e(t,"w","spacing");if(X){let m=l(X,"w","val");m!==void 0&&(e$1.spacing=m);}let p=e(t,"w","position");if(p){let m=l(p,"w","val");m!==void 0&&(e$1.position=m);}let x=e(t,"w","w");if(x){let m=l(x,"w","val");m!==void 0&&(e$1.scale=m);}let F=e(t,"w","kern");if(F){let m=l(F,"w","val");m!==void 0&&(e$1.kerning=m);}let A=e(t,"w","effect");if(A){let m=j$1(A,"w","val");m&&(e$1.effect=m);}let k=e(t,"w","em");if(k){let m=j$1(k,"w","val");m&&(e$1.emphasisMark=m);}let M=e(t,"w","emboss");M&&(e$1.emboss=m(M));let R=e(t,"w","imprint");R&&(e$1.imprint=m(R));let V=e(t,"w","outline");V&&(e$1.outline=m(V));let L=e(t,"w","shadow");L&&(e$1.shadow=m(L));let N=e(t,"w","rtl");N&&(e$1.rtl=m(N));let H=e(t,"w","cs");H&&(e$1.cs=m(H));let _=e(t,"w","rStyle");if(_){let m=j$1(_,"w","val");m&&(e$1.styleId=m);}return Object.keys(e$1).length>0?e$1:void 0}function E(t){if(!t)return;let n=j$1(t,"w","val");if(!n)return;let e={style:n},o=j$1(t,"w","color"),i=j$1(t,"w","themeColor");(o||i)&&(e.color=Y(o,i,j$1(t,"w","themeTint"),j$1(t,"w","themeShade")));let r=l(t,"w","sz");r!==void 0&&(e.size=r);let a=l(t,"w","space");a!==void 0&&(e.space=a);let c=j$1(t,"w","shadow");c&&(e.shadow=c==="1"||c==="true");let g=j$1(t,"w","frame");return g&&(e.frame=g==="1"||g==="true"),e}function je(t){if(!t)return;let n=f(t,"w","tab");if(n.length===0)return;let e=[];for(let o of n){let i=l(o,"w","pos"),r=j$1(o,"w","val");if(i!==void 0&&r){let a={position:i,alignment:r},c=j$1(o,"w","leader");c&&(a.leader=c),e.push(a);}}return e.length>0?e:void 0}function K(t,n){if(!t)return;let e$1={},o=e(t,"w","jc");if(o){let p=j$1(o,"w","val");p&&(e$1.alignment=p);}let i=e(t,"w","bidi");i&&(e$1.bidi=m(i));let r=e(t,"w","spacing");if(r){let p=l(r,"w","before");p!==void 0&&(e$1.spaceBefore=p);let x=l(r,"w","after");x!==void 0&&(e$1.spaceAfter=x);let F=l(r,"w","line");F!==void 0&&(e$1.lineSpacing=F);let A=j$1(r,"w","lineRule");A&&(e$1.lineSpacingRule=A);let k=j$1(r,"w","beforeAutospacing");k&&(e$1.beforeAutospacing=k==="1"||k==="true");let M=j$1(r,"w","afterAutospacing");M&&(e$1.afterAutospacing=M==="1"||M==="true");}let a=e(t,"w","ind");if(a){let p=l(a,"w","left");p!==void 0&&(e$1.indentLeft=p);let x=l(a,"w","right");x!==void 0&&(e$1.indentRight=x);let F=l(a,"w","firstLine");F!==void 0&&(e$1.indentFirstLine=F);let A=l(a,"w","hanging");A!==void 0&&(e$1.indentFirstLine=-A,e$1.hangingIndent=true);}let c=e(t,"w","pBdr");if(c){let p={},x=E(e(c,"w","top"));x&&(p.top=x);let F=E(e(c,"w","bottom"));F&&(p.bottom=F);let A=E(e(c,"w","left"));A&&(p.left=A);let k=E(e(c,"w","right"));k&&(p.right=k);let M=E(e(c,"w","between"));M&&(p.between=M);let R=E(e(c,"w","bar"));R&&(p.bar=R),Object.keys(p).length>0&&(e$1.borders=p);}let g=e(t,"w","shd");g&&(e$1.shading=W(g));let d=e(t,"w","tabs");d&&(e$1.tabs=je(d));let h=e(t,"w","keepNext");h&&(e$1.keepNext=m(h));let b=e(t,"w","keepLines");b&&(e$1.keepLines=m(b));let u=e(t,"w","widowControl");u&&(e$1.widowControl=m(u));let S=e(t,"w","pageBreakBefore");S&&(e$1.pageBreakBefore=m(S));let f=e(t,"w","contextualSpacing");f&&(e$1.contextualSpacing=m(f));let y=e(t,"w","numPr");if(y){let p=e(y,"w","numId"),x=e(y,"w","ilvl");if(p||x){if(e$1.numPr={},p){let F=l(p,"w","val");F!==void 0&&(e$1.numPr.numId=F);}if(x){let F=l(x,"w","val");F!==void 0&&(e$1.numPr.ilvl=F);}}}let C=e(t,"w","outlineLvl");if(C){let p=l(C,"w","val");p!==void 0&&(e$1.outlineLevel=p);}let D=e(t,"w","pStyle");if(D){let p=j$1(D,"w","val");p&&(e$1.styleId=p);}let B=e(t,"w","suppressLineNumbers");B&&(e$1.suppressLineNumbers=m(B));let v=e(t,"w","suppressAutoHyphens");v&&(e$1.suppressAutoHyphens=m(v));let X=e(t,"w","rPr");return X&&(e$1.runProperties=$(X,n)),Object.keys(e$1).length>0?e$1:void 0}function j(t){if(!t)return;let n=l(t,"w","w"),e=j$1(t,"w","type");if(n!==void 0&&e)return {value:n,type:e}}function De(t){if(!t)return;let n={},e$1=E(e(t,"w","top"));e$1&&(n.top=e$1);let o=E(e(t,"w","bottom"));o&&(n.bottom=o);let i=E(e(t,"w","left"));i&&(n.left=i);let r=E(e(t,"w","right"));r&&(n.right=r);let a=E(e(t,"w","insideH"));a&&(n.insideH=a);let c=E(e(t,"w","insideV"));return c&&(n.insideV=c),Object.keys(n).length>0?n:void 0}function Ae(t){if(!t)return;let n={},e$1=j(e(t,"w","top"));e$1&&(n.top=e$1);let o=j(e(t,"w","bottom"));o&&(n.bottom=o);let i=j(e(t,"w","left"));i&&(n.left=i);let r=j(e(t,"w","right"));return r&&(n.right=r),Object.keys(n).length>0?n:void 0}function Le(t){if(!t)return;let n={},e=j$1(t,"w","val");if(e){let d=parseInt(e,16);isNaN(d)||(n.firstRow=(d&32)!==0,n.lastRow=(d&64)!==0,n.firstColumn=(d&128)!==0,n.lastColumn=(d&256)!==0,n.noHBand=(d&512)!==0,n.noVBand=(d&1024)!==0);}let o=j$1(t,"w","firstColumn");o&&(n.firstColumn=o==="1");let i=j$1(t,"w","firstRow");i&&(n.firstRow=i==="1");let r=j$1(t,"w","lastColumn");r&&(n.lastColumn=r==="1");let a=j$1(t,"w","lastRow");a&&(n.lastRow=a==="1");let c=j$1(t,"w","noHBand");c&&(n.noHBand=c==="1");let g=j$1(t,"w","noVBand");return g&&(n.noVBand=g==="1"),Object.keys(n).length>0?n:void 0}function le(t,n){if(!t)return;let e$1={},o=e(t,"w","tblW");o&&(e$1.width=j(o));let i=e(t,"w","jc");if(i){let f=j$1(i,"w","val");(f==="left"||f==="center"||f==="right")&&(e$1.justification=f);}let r=e(t,"w","tblCellSpacing");r&&(e$1.cellSpacing=j(r));let a=e(t,"w","tblInd");a&&(e$1.indent=j(a));let c=e(t,"w","tblBorders");c&&(e$1.borders=De(c));let g=e(t,"w","tblCellMar");g&&(e$1.cellMargins=Ae(g));let d=e(t,"w","tblLayout");if(d){let f=j$1(d,"w","type");(f==="fixed"||f==="autofit")&&(e$1.layout=f);}let h=e(t,"w","tblStyle");if(h){let f=j$1(h,"w","val");f&&(e$1.styleId=f);}let b=e(t,"w","tblLook");b&&(e$1.look=Le(b));let u=e(t,"w","shd");u&&(e$1.shading=W(u));let S=e(t,"w","bidiVisual");return S&&(e$1.bidi=m(S)),Object.keys(e$1).length>0?e$1:void 0}function ce(t){if(!t)return;let n={},e$1=e(t,"w","trHeight");if(e$1){n.height=j(e$1);let c=j$1(e$1,"w","hRule");c&&(n.heightRule=c);}let o=e(t,"w","tblHeader");o&&(n.header=m(o));let i=e(t,"w","cantSplit");i&&(n.cantSplit=m(i));let r=e(t,"w","jc");if(r){let c=j$1(r,"w","val");(c==="left"||c==="center"||c==="right")&&(n.justification=c);}let a=e(t,"w","hidden");return a&&(n.hidden=m(a)),Object.keys(n).length>0?n:void 0}function fe(t,n){if(!t)return;let e$1={},o=e(t,"w","tcW");o&&(e$1.width=j(o));let i=e(t,"w","tcBorders");i&&(e$1.borders=De(i));let r=e(t,"w","tcMar");r&&(e$1.margins=Ae(r));let a=e(t,"w","shd");a&&(e$1.shading=W(a));let c=e(t,"w","vAlign");if(c){let f=j$1(c,"w","val");(f==="top"||f==="center"||f==="bottom")&&(e$1.verticalAlign=f);}let g=e(t,"w","textDirection");if(g){let f=j$1(g,"w","val");f&&(e$1.textDirection=f);}let d=e(t,"w","gridSpan");if(d){let f=l(d,"w","val");f!==void 0&&(e$1.gridSpan=f);}let h=e(t,"w","vMerge");if(h){let f=j$1(h,"w","val");e$1.vMerge=f==="restart"?"restart":"continue";}let b=e(t,"w","tcFitText");b&&(e$1.fitText=m(b));let u=e(t,"w","noWrap");u&&(e$1.noWrap=m(u));let S=e(t,"w","hideMark");return S&&(e$1.hideMark=m(S)),Object.keys(e$1).length>0?e$1:void 0}function Ue(t,n){let e$1={styleId:j$1(t,"w","styleId")??"",type:j$1(t,"w","type")??"paragraph"},o=j$1(t,"w","default");o&&(e$1.default=o==="1"||o==="true");let i=e(t,"w","name");i&&(e$1.name=j$1(i,"w","val")??void 0);let r=e(t,"w","basedOn");r&&(e$1.basedOn=j$1(r,"w","val")??void 0);let a=e(t,"w","next");a&&(e$1.next=j$1(a,"w","val")??void 0);let c=e(t,"w","link");c&&(e$1.link=j$1(c,"w","val")??void 0);let g=e(t,"w","uiPriority");if(g){let X=l(g,"w","val");X!==void 0&&(e$1.uiPriority=X);}let d=e(t,"w","hidden");d&&(e$1.hidden=m(d));let h=e(t,"w","semiHidden");h&&(e$1.semiHidden=m(h));let b=e(t,"w","unhideWhenUsed");b&&(e$1.unhideWhenUsed=m(b));let u=e(t,"w","qFormat");u&&(e$1.qFormat=m(u));let S=e(t,"w","personal");S&&(e$1.personal=m(S));let f$1=e(t,"w","pPr");f$1&&(e$1.pPr=K(f$1,n));let y=e(t,"w","rPr");y&&(e$1.rPr=$(y,n));let C=e(t,"w","tblPr");C&&(e$1.tblPr=le(C));let D=e(t,"w","trPr");D&&(e$1.trPr=ce(D));let B=e(t,"w","tcPr");B&&(e$1.tcPr=fe(B));let v=f(t,"w","tblStylePr");if(v.length>0){e$1.tblStylePr=[];for(let X of v){let p=j$1(X,"w","type");if(p){let x={type:p},F=e(X,"w","pPr");F&&(x.pPr=K(F,n));let A=e(X,"w","rPr");A&&(x.rPr=$(A,n));let k=e(X,"w","tblPr");k&&(x.tblPr=le(k));let M=e(X,"w","trPr");M&&(x.trPr=ce(M));let R=e(X,"w","tcPr");R&&(x.tcPr=fe(R)),e$1.tblStylePr.push(x);}}}return e$1}function Oe(t,n){if(!t)return;let e$1={},o=e(t,"w","rPrDefault");if(o){let r=e(o,"w","rPr");r&&(e$1.rPr=$(r,n));}let i=e(t,"w","pPrDefault");if(i){let r=e(i,"w","pPr");r&&(e$1.pPr=K(r,n));}return e$1.rPr||e$1.pPr?e$1:void 0}function ze(t,n){if(!n)return t;if(!t)return n?{...n}:void 0;let e={...t};for(let o of Object.keys(n)){let i=n[o];if(i!==void 0)if(o==="runProperties")e.runProperties=b$2(e.runProperties,n.runProperties);else if(o==="borders"||o==="numPr"||o==="frame"){let r=e[o],a=i;e[o]={...r||{},...a||{}};}else o==="tabs"&&Array.isArray(i)?e.tabs=[...i]:e[o]=i;}return e}function Be(t,n,e,o=new Set){if(o.has(t.styleId)||(o.add(t.styleId),!t.basedOn))return t;let i=n.get(t.basedOn);if(!i)return t;let r=Be(i,n,e,o),a={...t,pPr:ze(r.pPr,t.pPr),rPr:b$2(r.rPr,t.rPr)};return t.type==="table"&&((r.tblPr||t.tblPr)&&(a.tblPr={...r.tblPr||{},...t.tblPr||{}}),(r.trPr||t.trPr)&&(a.trPr={...r.trPr||{},...t.trPr||{}}),(r.tcPr||t.tcPr)&&(a.tcPr={...r.tcPr||{},...t.tcPr||{}})),a}function ue(t,n){let e=new Map;try{let o=c(t);if(!o)return e;let i=f(o,"w","style");for(let r of i){let a=Ue(r,n);a.styleId&&e.set(a.styleId,a);}for(let[r,a]of e){let c=Be(a,e,n);e.set(r,c);}}catch(o){console.warn("Failed to parse styles:",o);}return e}function ke(t,n){let e$1={styles:[]};try{let o=c(t);if(!o)return e$1;let i=e(o,"w","docDefaults");e$1.docDefaults=Oe(i,n);let r=e(o,"w","latentStyles");r&&(e$1.latentStyles={defLockedState:j$1(r,"w","defLockedState")==="1",defUIPriority:l(r,"w","defUIPriority"),defSemiHidden:j$1(r,"w","defSemiHidden")==="1",defUnhideWhenUsed:j$1(r,"w","defUnhideWhenUsed")==="1",defQFormat:j$1(r,"w","defQFormat")==="1",count:l(r,"w","count")});let a=ue(t,n);e$1.styles=Array.from(a.values());}catch(o){console.warn("Failed to parse style definitions:",o);}return e$1}var Ie=/\{([a-zA-Z_][a-zA-Z0-9_\-\.]*)\}/g;function Re(t){let n=[],e;for(Ie.lastIndex=0;(e=Ie.exec(t))!==null;){let o=e[1].trim();o&&!n.includes(o)&&n.push(o);}return n}function ee(t){let n=[];for(let e of t)if(e.type==="paragraph"){let o=N(e),i=Re(o);for(let r of i)n.includes(r)||n.push(r);}else if(e.type==="table"){let o=Ee(e);for(let i of o)n.includes(i)||n.push(i);}return n}function Ee(t){let n=[];for(let e of t.rows)for(let o of e.cells)for(let i of o.content)if(i.type==="paragraph"){let r=N(i),a=Re(r);for(let c of a)n.includes(c)||n.push(c);}else if(i.type==="table"){let r=Ee(i);for(let a of r)n.includes(a)||n.push(a);}return n}function We(t,n){let e=[],o=[];for(let i of t)o.push(i),i.type==="paragraph"&&i.sectionProperties&&(e.push({properties:i.sectionProperties,content:o}),o=[]);return (o.length>0||e.length===0)&&e.push({properties:n??C(),content:o}),e}function te(t,n=null,e$1=null,o=null,i=null,r=null){let a={content:[]};if(!t)return a;let c=a$3(t);if(!c)return a;let g=(c.elements??[]).find(u=>u.type==="element"&&(u.name==="w:document"||u.name?.endsWith(":document")));if(!g)return a;let d=e(g,"w","body");if(!d)return a;a.content=q$1(d,n,e$1,o,i,r);let h=e(d,"w","sectPr");h&&(a.finalSectionProperties=B(h,i));let b=We(a.content,a.finalSectionProperties);return a.sections=D(b),a.finalSectionProperties&&a.sections.length>0&&(a.finalSectionProperties=a.sections[a.sections.length-1].properties),a}function $e(t){let n=new Map,e$1=a$3(t);if(!e$1)return n;let o=e(e$1,"w16cex","commentsExtensible")??e$1;for(let i$1 of i(o)){if((i$1.name?.replace(/^.*:/,"")??"")!=="comment")continue;let a=j$1(i$1,"w16cex","paraId")??j$1(i$1,"w15","paraId")??i$1.attributes?.["w16cex:paraId"]??i$1.attributes?.["w15:paraId"],c=j$1(i$1,"w16cex","dateUtc")??j$1(i$1,"w15","dateUtc")??i$1.attributes?.["w16cex:dateUtc"]??i$1.attributes?.["w15:dateUtc"];a&&c&&n.set(String(a).toUpperCase(),String(c));}return n}function _e(t){let n=new Map,e$1=new Map,o=a$3(t);if(!o)return {parentByParaId:n,doneByParaId:e$1};let i$1=e(o,"w15","commentsEx")??o;for(let r of i(i$1)){if((r.name?.replace(/^.*:/,"")??"")!=="commentEx")continue;let c=j$1(r,"w15","paraId")??r.attributes?.["w15:paraId"],g=j$1(r,"w15","paraIdParent")??r.attributes?.["w15:paraIdParent"],d=j$1(r,"w15","done")??r.attributes?.["w15:done"];if(c){let h=String(c).toUpperCase();g&&n.set(h,String(g).toUpperCase()),d==="1"&&e$1.set(h,true);}}return {parentByParaId:n,doneByParaId:e$1}}function Ne(t,n,e$1,o,i$1,r,a){if(!t)return [];let c=a$3(t);if(!c)return [];let g=r?$e(r):new Map,d=a?_e(a):null,h=e(c,"w","comments")??c,b=i(h),u=[],S=[];for(let f of b){if((f.name?.replace(/^.*:/,"")??"")!=="comment")continue;let C=parseInt(j$1(f,"w","id")??"0",10),D=j$1(f,"w","author")??"Unknown",B=j$1(f,"w","initials"),v=B!=null?String(B):void 0,X=j$1(f,"w","date"),p=X!=null?String(X):void 0,x=j$1(f,"w14","paraId")??f.attributes?.["w14:paraId"]??j$1(f,"w","paraId"),A=(x?g.get(String(x).toUpperCase()):void 0)??p,k=j$1(f,"w","done")??f.attributes?.["w:done"],M=k==="1"||k==="true"?true:void 0,R=j$1(f,"w16cid","parentId")??j$1(f,"w","parentId")??f.attributes?.["w16cid:parentId"]??f.attributes?.["w:parentId"],V=R!=null?parseInt(String(R),10):void 0,L=[],N="";for(let H of i(f))if((H.name?.replace(/^.*:/,"")??"")==="p"){let m=O(H,n,e$1,null,o,i$1);L.push(m);let P=j$1(H,"w14","paraId")??H.attributes?.["w14:paraId"];P&&(N=String(P).toUpperCase());}M==null&&d&&N&&d.doneByParaId.get(N)&&(M=true),S.push(N),u.push({id:C,author:D,initials:v,date:A,content:L,...M!=null?{done:M}:{},...V!=null&&!isNaN(V)?{parentId:V}:{}});}if(d&&d.parentByParaId.size>0){let f=new Map;for(let y=0;y<u.length;y++){let C=S[y];C&&f.set(C,u[y].id);}for(let y=0;y<u.length;y++){if(u[y].parentId!=null)continue;let C=S[y];if(!C)continue;let D=d.parentByParaId.get(C);if(!D)continue;let B=f.get(D);B!=null&&(u[y]={...u[y],parentId:B});}}return u}async function Ve(t,n={}){let e=t instanceof ArrayBuffer?t:await u(t),{onProgress:o=()=>{},preloadFonts:i=true,parseHeadersFooters:r=true,parseNotes:a$2=true,detectVariables:c=true}=n,g=[];try{let u=function(P,I){let U=performance.now(),oe=I(),O=performance.now()-U;return b$2.push({stage:P,ms:O}),O>1e3&&console.warn(`[parseDocx] ${P} took ${Math.round(O)}ms`),oe};var d=u;let h=performance.now(),b$2=[];async function S(P,I){let U=performance.now(),oe=await I(),O=performance.now()-U;return b$2.push({stage:P,ms:O}),O>1e3&&console.warn(`[parseDocx] ${P} took ${Math.round(O)}ms`),oe}o("Extracting DOCX...",0);let f=await S("unzip",()=>G(e));o("Extracted DOCX",10),o("Parsing relationships...",10);let y=u("relationships",()=>f.documentRels?b(f.documentRels):new Map);o("Parsed relationships",15),o("Parsing theme...",15);let C=u("theme",()=>a(f.themeXml));o("Parsed theme",20),o("Parsing styles...",20);let D=null,B;u("styles",()=>{f.stylesXml&&(D=ue(f.stylesXml,C),B=ke(f.stylesXml,C));}),o("Parsed styles",30),o("Parsing numbering...",30);let v=u("numbering",()=>a$1(f.numberingXml)),X=u("settings",()=>b$1(f.settingsXml));o("Parsed numbering",35),o("Processing media files...",35);let p=u("media",()=>Ze(f,y));o("Processed media",40),o("Parsing document body...",40);let x={content:[]};u("documentBody",()=>{f.documentXml?x=te(f.documentXml,D,C,v,y,p):g.push("No document.xml found in DOCX");}),o("Parsed document body",55);let F,A;if(r){o("Parsing headers/footers...",55);let P=u("headersFooters",()=>qe(f,D,C,v,y,p));F=P.headers,A=P.footers,o("Parsed headers/footers",65);}else o("Skipping headers/footers",65);let k,M,R,V;if(a$2){o("Parsing footnotes/endnotes...",65);let P=u("footnotesEndnotes",()=>Je(f,D,C,v,y,p));k=P.footnotes,M=P.endnotes,R=P.footnoteSeparators,V=P.endnoteSeparators,o("Parsed footnotes/endnotes",75);}else o("Skipping footnotes/endnotes",75);o("Parsing comments...",75);let L=u("comments",()=>Ne(f.commentsXml,D,C,y,p,f.commentsExtensibleXml,f.commentsExtendedXml));L.length>0&&(x.comments=L);let N;c?(o("Detecting template variables...",75),N=u("variables",()=>ee(x.content)),o("Detected variables",80)):o("Skipping variable detection",80),i?(o("Loading fonts...",80),await S("fonts",()=>Qe(C,B,x)),o("Loaded fonts",95)):o("Skipping font loading",95),o("Assembling document...",95);let _={package:{document:x,styles:B,theme:C,numbering:v.definitions,settings:X,headers:F,footers:A,footnotes:k,endnotes:M,footnoteSeparators:R,endnoteSeparators:V,relationships:y,media:p},originalBuffer:e,templateVariables:N,warnings:g.length>0?g:void 0},m=performance.now()-h;if(m>2e3){let P=b$2.filter(I=>I.ms>100).map(I=>`${I.stage}: ${Math.round(I.ms)}ms`).join(", ");console.warn(`[parseDocx] Total: ${Math.round(m)}ms`+(P?` (${P})`:""));}return o("Complete",100),_}catch(h){let b=h instanceof Error?h.message:String(h);throw console.error("[parseDocx] Failed to parse DOCX:",b,h),new Error(`Failed to parse DOCX: ${b}`)}}function Ze(t,n){let e=new Map;for(let[o,i]of t.media.entries()){let r=o.split("/").pop()||o,a=Me(o),c=new Uint8Array(i),g="";for(let S=0;S<c.length;S++)g+=String.fromCharCode(c[S]);let d=btoa(g),h=`data:${a};base64,${d}`,b={path:o,filename:r,mimeType:a,data:i,dataUrl:h};e.set(o,b);let u=o.replace(/^word\//,"");u!==o&&e.set(u,b);}return e}function ne(t,n){let e=n.toLowerCase();for(let[o,i]of t.entries())if(o.toLowerCase()===e)return i}function qe(t,n,e,o,i,r$1){let a=new Map,c=new Map;for(let[g,d]of i.entries())if(d.type===a$2.header&&d.target){let h=d.target.split("/").pop()||d.target,b$1=ne(t.headers,h);if(b$1){let u=`word/_rels/${h}.rels`,S=ne(t.allXml,u),f=S?b(S):i,y=r(b$1,"default",n,e,o,f,r$1);a.set(g,y);}}else if(d.type===a$2.footer&&d.target){let h=d.target.split("/").pop()||d.target,b$1=ne(t.footers,h);if(b$1){let u=`word/_rels/${h}.rels`,S=ne(t.allXml,u),f=S?b(S):i,y=s(b$1,"default",n,e,o,f,r$1);c.set(g,y);}}return {headers:a,footers:c}}function Je(t$1,n,e,o,i,r){let a=t(t$1.footnotesXml,n,e,o,i,r),c=u$1(t$1.endnotesXml,n,e,o,i,r);return {footnotes:a.getNormalFootnotes(),endnotes:c.getNormalEndnotes(),footnoteSeparators:a.footnotes.filter(z),endnoteSeparators:c.endnotes.filter(A)}}async function Qe(t,n,e){let o=new Set;if(t?.fontScheme){let{majorFont:i,minorFont:r}=t.fontScheme;i?.latin&&o.add(i.latin),r?.latin&&o.add(r.latin);}if(n?.docDefaults?.rPr?.fontFamily?.ascii&&o.add(n.docDefaults.rPr.fontFamily.ascii),n?.styles)for(let i of n.styles)i.rPr?.fontFamily?.ascii&&o.add(i.rPr.fontFamily.ascii),i.rPr?.fontFamily?.hAnsi&&o.add(i.rPr.fontFamily.hAnsi);if(e.content){for(let i of e.content)if(i.type==="paragraph")for(let r of i.content)r.type==="run"&&r.formatting?.fontFamily&&(r.formatting.fontFamily.ascii&&o.add(r.formatting.fontFamily.ascii),r.formatting.fontFamily.hAnsi&&o.add(r.formatting.fontFamily.hAnsi));}if(o.size>0)try{await q(Array.from(o));}catch(i){console.warn("Failed to load some fonts:",i);}}async function Et(t){return Ve(t,{preloadFonts:false,parseHeadersFooters:false,parseNotes:false,detectVariables:true})}async function Nt(t,n){return Ve(t,{onProgress:n,preloadFonts:true,parseHeadersFooters:true,parseNotes:true,detectVariables:true})}async function Vt(t){let n=await G(t);if(!n.documentXml)return [];let e=te(n.documentXml);return ee(e.content)}async function Ht(t){let n=await G(t),e=n.documentXml?ee(te(n.documentXml).content):[];return {hasDocument:n.documentXml!==null,hasStyles:n.stylesXml!==null,hasTheme:n.themeXml!==null,hasNumbering:n.numberingXml!==null,headerCount:n.headers.size,footerCount:n.footers.size,mediaCount:n.media.size,variableCount:e.length}}
|
|
1
|
+
import {a,r,s,t,u as u$1,A,z,q as q$1,B,D,O,N,C,b as b$3}from'./chunk-4QJEMD23.mjs';import {b as b$1}from'./chunk-MOCGHQ4A.mjs';import {u,q}from'./chunk-CDBKFBC2.mjs';import {b,a as a$2}from'./chunk-W77JXDEV.mjs';import {b as b$2}from'./chunk-DI6CRWSW.mjs';import {a as a$1}from'./chunk-VJFIAFZ5.mjs';import {c,f,e,l,j as j$1,a as a$3,i,m}from'./chunk-3ANZ3252.mjs';import He from'jszip';async function G(t){let n=await He.loadAsync(t),e={documentXml:null,stylesXml:null,themeXml:null,numberingXml:null,fontTableXml:null,settingsXml:null,webSettingsXml:null,headers:new Map,footers:new Map,footnotesXml:null,endnotesXml:null,commentsXml:null,commentsExtensibleXml:null,commentsExtendedXml:null,documentRels:null,packageRels:null,contentTypesXml:null,corePropsXml:null,appPropsXml:null,customPropsXml:null,media:new Map,fonts:new Map,allXml:new Map,originalZip:n,originalBuffer:t};for(let[o,i]of Object.entries(n.files)){if(i.dir)continue;let r=o.toLowerCase();if(r.endsWith(".xml")||r.endsWith(".rels")){let a=await i.async("text");if(e.allXml.set(o,a),r==="word/document.xml")e.documentXml=a;else if(r==="word/styles.xml")e.stylesXml=a;else if(r==="word/theme/theme1.xml")e.themeXml=a;else if(r==="word/numbering.xml")e.numberingXml=a;else if(r==="word/fonttable.xml")e.fontTableXml=a;else if(r==="word/settings.xml")e.settingsXml=a;else if(r==="word/websettings.xml")e.webSettingsXml=a;else if(r==="word/footnotes.xml")e.footnotesXml=a;else if(r==="word/endnotes.xml")e.endnotesXml=a;else if(r==="word/comments.xml")e.commentsXml=a;else if(r==="word/commentsextensible.xml")e.commentsExtensibleXml=a;else if(r==="word/commentsextended.xml")e.commentsExtendedXml=a;else if(r==="word/_rels/document.xml.rels")e.documentRels=a;else if(r==="_rels/.rels")e.packageRels=a;else if(r==="[content_types].xml")e.contentTypesXml=a;else if(r==="docprops/core.xml")e.corePropsXml=a;else if(r==="docprops/app.xml")e.appPropsXml=a;else if(r==="docprops/custom.xml")e.customPropsXml=a;else if(r.match(/^word\/header\d+\.xml$/)){let c=o.split("/").pop()||o;e.headers.set(c,a);}else if(r.match(/^word\/footer\d+\.xml$/)){let c=o.split("/").pop()||o;e.footers.set(c,a);}}else if(r.startsWith("word/media/")){let a=await i.async("arraybuffer");e.media.set(o,a);}else if(r.startsWith("word/fonts/")){let a=await i.async("arraybuffer");e.fonts.set(o,a);}}return e}function Me(t){switch(t.toLowerCase().split(".").pop()){case "png":return "image/png";case "jpg":case "jpeg":return "image/jpeg";case "gif":return "image/gif";case "bmp":return "image/bmp";case "tif":case "tiff":return "image/tiff";case "wmf":return "image/x-wmf";case "emf":return "image/x-emf";case "svg":return "image/svg+xml";case "webp":return "image/webp";default:return "application/octet-stream"}}function Y(t,n,e,o){let i={};return t&&t!=="auto"?i.rgb=t:t==="auto"&&(i.auto=true),n&&(i.themeColor=n),e&&(i.themeTint=e),o&&(i.themeShade=o),i}function W(t){if(!t)return;let n={},e=j$1(t,"w","color");e&&e!=="auto"&&(n.color={rgb:e});let o=j$1(t,"w","fill");o&&o!=="auto"&&(n.fill={rgb:o});let i=j$1(t,"w","themeFill");i&&(n.fill=n.fill||{},n.fill.themeColor=i);let r=j$1(t,"w","themeFillTint");r&&n.fill&&(n.fill.themeTint=r);let a=j$1(t,"w","themeFillShade");a&&n.fill&&(n.fill.themeShade=a);let c=j$1(t,"w","val");return c&&(n.pattern=c),Object.keys(n).length>0?n:void 0}function $(t,n){if(!t)return;let e$1={},o=e(t,"w","b");o&&(e$1.bold=m(o));let i=e(t,"w","bCs");i&&(e$1.boldCs=m(i));let r=e(t,"w","i");r&&(e$1.italic=m(r));let a=e(t,"w","iCs");a&&(e$1.italicCs=m(a));let c=e(t,"w","u");if(c){let m=j$1(c,"w","val");if(m){e$1.underline={style:m};let P=j$1(c,"w","color"),I=j$1(c,"w","themeColor");(P||I)&&(e$1.underline.color=Y(P,I,j$1(c,"w","themeTint"),j$1(c,"w","themeShade")));}}let g=e(t,"w","strike");g&&(e$1.strike=m(g));let d=e(t,"w","dstrike");d&&(e$1.doubleStrike=m(d));let h=e(t,"w","vertAlign");if(h){let m=j$1(h,"w","val");(m==="superscript"||m==="subscript"||m==="baseline")&&(e$1.vertAlign=m);}let b=e(t,"w","smallCaps");b&&(e$1.smallCaps=m(b));let u=e(t,"w","caps");u&&(e$1.allCaps=m(u));let S=e(t,"w","vanish");S&&(e$1.hidden=m(S));let f=e(t,"w","color");f&&(e$1.color=Y(j$1(f,"w","val"),j$1(f,"w","themeColor"),j$1(f,"w","themeTint"),j$1(f,"w","themeShade")));let y=e(t,"w","highlight");if(y){let m=j$1(y,"w","val");m&&(e$1.highlight=m);}let C=e(t,"w","shd");C&&(e$1.shading=W(C));let D=e(t,"w","sz");if(D){let m=l(D,"w","val");m!==void 0&&(e$1.fontSize=m);}let B=e(t,"w","szCs");if(B){let m=l(B,"w","val");m!==void 0&&(e$1.fontSizeCs=m);}let v=e(t,"w","rFonts");if(v){e$1.fontFamily={ascii:j$1(v,"w","ascii")??void 0,hAnsi:j$1(v,"w","hAnsi")??void 0,eastAsia:j$1(v,"w","eastAsia")??void 0,cs:j$1(v,"w","cs")??void 0};let m=j$1(v,"w","asciiTheme");m&&(e$1.fontFamily.asciiTheme=m,n&&!e$1.fontFamily.ascii&&(e$1.fontFamily.ascii=b$3(n,m)));let P=j$1(v,"w","hAnsiTheme");P&&(e$1.fontFamily.hAnsiTheme=P,n&&!e$1.fontFamily.hAnsi&&(e$1.fontFamily.hAnsi=b$3(n,P)));let I=j$1(v,"w","eastAsiaTheme");I&&(e$1.fontFamily.eastAsiaTheme=I,n&&!e$1.fontFamily.eastAsia&&(e$1.fontFamily.eastAsia=b$3(n,I)));let U=j$1(v,"w","cstheme");U&&(e$1.fontFamily.csTheme=U,n&&!e$1.fontFamily.cs&&(e$1.fontFamily.cs=b$3(n,U)));}let X=e(t,"w","spacing");if(X){let m=l(X,"w","val");m!==void 0&&(e$1.spacing=m);}let p=e(t,"w","position");if(p){let m=l(p,"w","val");m!==void 0&&(e$1.position=m);}let x=e(t,"w","w");if(x){let m=l(x,"w","val");m!==void 0&&(e$1.scale=m);}let F=e(t,"w","kern");if(F){let m=l(F,"w","val");m!==void 0&&(e$1.kerning=m);}let A=e(t,"w","effect");if(A){let m=j$1(A,"w","val");m&&(e$1.effect=m);}let k=e(t,"w","em");if(k){let m=j$1(k,"w","val");m&&(e$1.emphasisMark=m);}let M=e(t,"w","emboss");M&&(e$1.emboss=m(M));let R=e(t,"w","imprint");R&&(e$1.imprint=m(R));let V=e(t,"w","outline");V&&(e$1.outline=m(V));let L=e(t,"w","shadow");L&&(e$1.shadow=m(L));let N=e(t,"w","rtl");N&&(e$1.rtl=m(N));let H=e(t,"w","cs");H&&(e$1.cs=m(H));let _=e(t,"w","rStyle");if(_){let m=j$1(_,"w","val");m&&(e$1.styleId=m);}return Object.keys(e$1).length>0?e$1:void 0}function E(t){if(!t)return;let n=j$1(t,"w","val");if(!n)return;let e={style:n},o=j$1(t,"w","color"),i=j$1(t,"w","themeColor");(o||i)&&(e.color=Y(o,i,j$1(t,"w","themeTint"),j$1(t,"w","themeShade")));let r=l(t,"w","sz");r!==void 0&&(e.size=r);let a=l(t,"w","space");a!==void 0&&(e.space=a);let c=j$1(t,"w","shadow");c&&(e.shadow=c==="1"||c==="true");let g=j$1(t,"w","frame");return g&&(e.frame=g==="1"||g==="true"),e}function je(t){if(!t)return;let n=f(t,"w","tab");if(n.length===0)return;let e=[];for(let o of n){let i=l(o,"w","pos"),r=j$1(o,"w","val");if(i!==void 0&&r){let a={position:i,alignment:r},c=j$1(o,"w","leader");c&&(a.leader=c),e.push(a);}}return e.length>0?e:void 0}function K(t,n){if(!t)return;let e$1={},o=e(t,"w","jc");if(o){let p=j$1(o,"w","val");p&&(e$1.alignment=p);}let i=e(t,"w","bidi");i&&(e$1.bidi=m(i));let r=e(t,"w","spacing");if(r){let p=l(r,"w","before");p!==void 0&&(e$1.spaceBefore=p);let x=l(r,"w","after");x!==void 0&&(e$1.spaceAfter=x);let F=l(r,"w","line");F!==void 0&&(e$1.lineSpacing=F);let A=j$1(r,"w","lineRule");A&&(e$1.lineSpacingRule=A);let k=j$1(r,"w","beforeAutospacing");k&&(e$1.beforeAutospacing=k==="1"||k==="true");let M=j$1(r,"w","afterAutospacing");M&&(e$1.afterAutospacing=M==="1"||M==="true");}let a=e(t,"w","ind");if(a){let p=l(a,"w","left");p!==void 0&&(e$1.indentLeft=p);let x=l(a,"w","right");x!==void 0&&(e$1.indentRight=x);let F=l(a,"w","firstLine");F!==void 0&&(e$1.indentFirstLine=F);let A=l(a,"w","hanging");A!==void 0&&(e$1.indentFirstLine=-A,e$1.hangingIndent=true);}let c=e(t,"w","pBdr");if(c){let p={},x=E(e(c,"w","top"));x&&(p.top=x);let F=E(e(c,"w","bottom"));F&&(p.bottom=F);let A=E(e(c,"w","left"));A&&(p.left=A);let k=E(e(c,"w","right"));k&&(p.right=k);let M=E(e(c,"w","between"));M&&(p.between=M);let R=E(e(c,"w","bar"));R&&(p.bar=R),Object.keys(p).length>0&&(e$1.borders=p);}let g=e(t,"w","shd");g&&(e$1.shading=W(g));let d=e(t,"w","tabs");d&&(e$1.tabs=je(d));let h=e(t,"w","keepNext");h&&(e$1.keepNext=m(h));let b=e(t,"w","keepLines");b&&(e$1.keepLines=m(b));let u=e(t,"w","widowControl");u&&(e$1.widowControl=m(u));let S=e(t,"w","pageBreakBefore");S&&(e$1.pageBreakBefore=m(S));let f=e(t,"w","contextualSpacing");f&&(e$1.contextualSpacing=m(f));let y=e(t,"w","numPr");if(y){let p=e(y,"w","numId"),x=e(y,"w","ilvl");if(p||x){if(e$1.numPr={},p){let F=l(p,"w","val");F!==void 0&&(e$1.numPr.numId=F);}if(x){let F=l(x,"w","val");F!==void 0&&(e$1.numPr.ilvl=F);}}}let C=e(t,"w","outlineLvl");if(C){let p=l(C,"w","val");p!==void 0&&(e$1.outlineLevel=p);}let D=e(t,"w","pStyle");if(D){let p=j$1(D,"w","val");p&&(e$1.styleId=p);}let B=e(t,"w","suppressLineNumbers");B&&(e$1.suppressLineNumbers=m(B));let v=e(t,"w","suppressAutoHyphens");v&&(e$1.suppressAutoHyphens=m(v));let X=e(t,"w","rPr");return X&&(e$1.runProperties=$(X,n)),Object.keys(e$1).length>0?e$1:void 0}function j(t){if(!t)return;let n=l(t,"w","w"),e=j$1(t,"w","type");if(n!==void 0&&e)return {value:n,type:e}}function De(t){if(!t)return;let n={},e$1=E(e(t,"w","top"));e$1&&(n.top=e$1);let o=E(e(t,"w","bottom"));o&&(n.bottom=o);let i=E(e(t,"w","left"));i&&(n.left=i);let r=E(e(t,"w","right"));r&&(n.right=r);let a=E(e(t,"w","insideH"));a&&(n.insideH=a);let c=E(e(t,"w","insideV"));return c&&(n.insideV=c),Object.keys(n).length>0?n:void 0}function Ae(t){if(!t)return;let n={},e$1=j(e(t,"w","top"));e$1&&(n.top=e$1);let o=j(e(t,"w","bottom"));o&&(n.bottom=o);let i=j(e(t,"w","left"));i&&(n.left=i);let r=j(e(t,"w","right"));return r&&(n.right=r),Object.keys(n).length>0?n:void 0}function Le(t){if(!t)return;let n={},e=j$1(t,"w","val");if(e){let d=parseInt(e,16);isNaN(d)||(n.firstRow=(d&32)!==0,n.lastRow=(d&64)!==0,n.firstColumn=(d&128)!==0,n.lastColumn=(d&256)!==0,n.noHBand=(d&512)!==0,n.noVBand=(d&1024)!==0);}let o=j$1(t,"w","firstColumn");o&&(n.firstColumn=o==="1");let i=j$1(t,"w","firstRow");i&&(n.firstRow=i==="1");let r=j$1(t,"w","lastColumn");r&&(n.lastColumn=r==="1");let a=j$1(t,"w","lastRow");a&&(n.lastRow=a==="1");let c=j$1(t,"w","noHBand");c&&(n.noHBand=c==="1");let g=j$1(t,"w","noVBand");return g&&(n.noVBand=g==="1"),Object.keys(n).length>0?n:void 0}function le(t,n){if(!t)return;let e$1={},o=e(t,"w","tblW");o&&(e$1.width=j(o));let i=e(t,"w","jc");if(i){let f=j$1(i,"w","val");(f==="left"||f==="center"||f==="right")&&(e$1.justification=f);}let r=e(t,"w","tblCellSpacing");r&&(e$1.cellSpacing=j(r));let a=e(t,"w","tblInd");a&&(e$1.indent=j(a));let c=e(t,"w","tblBorders");c&&(e$1.borders=De(c));let g=e(t,"w","tblCellMar");g&&(e$1.cellMargins=Ae(g));let d=e(t,"w","tblLayout");if(d){let f=j$1(d,"w","type");(f==="fixed"||f==="autofit")&&(e$1.layout=f);}let h=e(t,"w","tblStyle");if(h){let f=j$1(h,"w","val");f&&(e$1.styleId=f);}let b=e(t,"w","tblLook");b&&(e$1.look=Le(b));let u=e(t,"w","shd");u&&(e$1.shading=W(u));let S=e(t,"w","bidiVisual");return S&&(e$1.bidi=m(S)),Object.keys(e$1).length>0?e$1:void 0}function ce(t){if(!t)return;let n={},e$1=e(t,"w","trHeight");if(e$1){n.height=j(e$1);let c=j$1(e$1,"w","hRule");c&&(n.heightRule=c);}let o=e(t,"w","tblHeader");o&&(n.header=m(o));let i=e(t,"w","cantSplit");i&&(n.cantSplit=m(i));let r=e(t,"w","jc");if(r){let c=j$1(r,"w","val");(c==="left"||c==="center"||c==="right")&&(n.justification=c);}let a=e(t,"w","hidden");return a&&(n.hidden=m(a)),Object.keys(n).length>0?n:void 0}function fe(t,n){if(!t)return;let e$1={},o=e(t,"w","tcW");o&&(e$1.width=j(o));let i=e(t,"w","tcBorders");i&&(e$1.borders=De(i));let r=e(t,"w","tcMar");r&&(e$1.margins=Ae(r));let a=e(t,"w","shd");a&&(e$1.shading=W(a));let c=e(t,"w","vAlign");if(c){let f=j$1(c,"w","val");(f==="top"||f==="center"||f==="bottom")&&(e$1.verticalAlign=f);}let g=e(t,"w","textDirection");if(g){let f=j$1(g,"w","val");f&&(e$1.textDirection=f);}let d=e(t,"w","gridSpan");if(d){let f=l(d,"w","val");f!==void 0&&(e$1.gridSpan=f);}let h=e(t,"w","vMerge");if(h){let f=j$1(h,"w","val");e$1.vMerge=f==="restart"?"restart":"continue";}let b=e(t,"w","tcFitText");b&&(e$1.fitText=m(b));let u=e(t,"w","noWrap");u&&(e$1.noWrap=m(u));let S=e(t,"w","hideMark");return S&&(e$1.hideMark=m(S)),Object.keys(e$1).length>0?e$1:void 0}function Ue(t,n){let e$1={styleId:j$1(t,"w","styleId")??"",type:j$1(t,"w","type")??"paragraph"},o=j$1(t,"w","default");o&&(e$1.default=o==="1"||o==="true");let i=e(t,"w","name");i&&(e$1.name=j$1(i,"w","val")??void 0);let r=e(t,"w","basedOn");r&&(e$1.basedOn=j$1(r,"w","val")??void 0);let a=e(t,"w","next");a&&(e$1.next=j$1(a,"w","val")??void 0);let c=e(t,"w","link");c&&(e$1.link=j$1(c,"w","val")??void 0);let g=e(t,"w","uiPriority");if(g){let X=l(g,"w","val");X!==void 0&&(e$1.uiPriority=X);}let d=e(t,"w","hidden");d&&(e$1.hidden=m(d));let h=e(t,"w","semiHidden");h&&(e$1.semiHidden=m(h));let b=e(t,"w","unhideWhenUsed");b&&(e$1.unhideWhenUsed=m(b));let u=e(t,"w","qFormat");u&&(e$1.qFormat=m(u));let S=e(t,"w","personal");S&&(e$1.personal=m(S));let f$1=e(t,"w","pPr");f$1&&(e$1.pPr=K(f$1,n));let y=e(t,"w","rPr");y&&(e$1.rPr=$(y,n));let C=e(t,"w","tblPr");C&&(e$1.tblPr=le(C));let D=e(t,"w","trPr");D&&(e$1.trPr=ce(D));let B=e(t,"w","tcPr");B&&(e$1.tcPr=fe(B));let v=f(t,"w","tblStylePr");if(v.length>0){e$1.tblStylePr=[];for(let X of v){let p=j$1(X,"w","type");if(p){let x={type:p},F=e(X,"w","pPr");F&&(x.pPr=K(F,n));let A=e(X,"w","rPr");A&&(x.rPr=$(A,n));let k=e(X,"w","tblPr");k&&(x.tblPr=le(k));let M=e(X,"w","trPr");M&&(x.trPr=ce(M));let R=e(X,"w","tcPr");R&&(x.tcPr=fe(R)),e$1.tblStylePr.push(x);}}}return e$1}function Oe(t,n){if(!t)return;let e$1={},o=e(t,"w","rPrDefault");if(o){let r=e(o,"w","rPr");r&&(e$1.rPr=$(r,n));}let i=e(t,"w","pPrDefault");if(i){let r=e(i,"w","pPr");r&&(e$1.pPr=K(r,n));}return e$1.rPr||e$1.pPr?e$1:void 0}function ze(t,n){if(!n)return t;if(!t)return n?{...n}:void 0;let e={...t};for(let o of Object.keys(n)){let i=n[o];if(i!==void 0)if(o==="runProperties")e.runProperties=b$2(e.runProperties,n.runProperties);else if(o==="borders"||o==="numPr"||o==="frame"){let r=e[o],a=i;e[o]={...r||{},...a||{}};}else o==="tabs"&&Array.isArray(i)?e.tabs=[...i]:e[o]=i;}return e}function Be(t,n,e,o=new Set){if(o.has(t.styleId)||(o.add(t.styleId),!t.basedOn))return t;let i=n.get(t.basedOn);if(!i)return t;let r=Be(i,n,e,o),a={...t,pPr:ze(r.pPr,t.pPr),rPr:b$2(r.rPr,t.rPr)};return t.type==="table"&&((r.tblPr||t.tblPr)&&(a.tblPr={...r.tblPr||{},...t.tblPr||{}}),(r.trPr||t.trPr)&&(a.trPr={...r.trPr||{},...t.trPr||{}}),(r.tcPr||t.tcPr)&&(a.tcPr={...r.tcPr||{},...t.tcPr||{}})),a}function ue(t,n){let e=new Map;try{let o=c(t);if(!o)return e;let i=f(o,"w","style");for(let r of i){let a=Ue(r,n);a.styleId&&e.set(a.styleId,a);}for(let[r,a]of e){let c=Be(a,e,n);e.set(r,c);}}catch(o){console.warn("Failed to parse styles:",o);}return e}function ke(t,n){let e$1={styles:[]};try{let o=c(t);if(!o)return e$1;let i=e(o,"w","docDefaults");e$1.docDefaults=Oe(i,n);let r=e(o,"w","latentStyles");r&&(e$1.latentStyles={defLockedState:j$1(r,"w","defLockedState")==="1",defUIPriority:l(r,"w","defUIPriority"),defSemiHidden:j$1(r,"w","defSemiHidden")==="1",defUnhideWhenUsed:j$1(r,"w","defUnhideWhenUsed")==="1",defQFormat:j$1(r,"w","defQFormat")==="1",count:l(r,"w","count")});let a=ue(t,n);e$1.styles=Array.from(a.values());}catch(o){console.warn("Failed to parse style definitions:",o);}return e$1}var Ie=/\{([a-zA-Z_][a-zA-Z0-9_\-\.]*)\}/g;function Re(t){let n=[],e;for(Ie.lastIndex=0;(e=Ie.exec(t))!==null;){let o=e[1].trim();o&&!n.includes(o)&&n.push(o);}return n}function ee(t){let n=[];for(let e of t)if(e.type==="paragraph"){let o=N(e),i=Re(o);for(let r of i)n.includes(r)||n.push(r);}else if(e.type==="table"){let o=Ee(e);for(let i of o)n.includes(i)||n.push(i);}return n}function Ee(t){let n=[];for(let e of t.rows)for(let o of e.cells)for(let i of o.content)if(i.type==="paragraph"){let r=N(i),a=Re(r);for(let c of a)n.includes(c)||n.push(c);}else if(i.type==="table"){let r=Ee(i);for(let a of r)n.includes(a)||n.push(a);}return n}function We(t,n){let e=[],o=[];for(let i of t)o.push(i),i.type==="paragraph"&&i.sectionProperties&&(e.push({properties:i.sectionProperties,content:o}),o=[]);return (o.length>0||e.length===0)&&e.push({properties:n??C(),content:o}),e}function te(t,n=null,e$1=null,o=null,i=null,r=null){let a={content:[]};if(!t)return a;let c=a$3(t);if(!c)return a;let g=(c.elements??[]).find(u=>u.type==="element"&&(u.name==="w:document"||u.name?.endsWith(":document")));if(!g)return a;let d=e(g,"w","body");if(!d)return a;a.content=q$1(d,n,e$1,o,i,r);let h=e(d,"w","sectPr");h&&(a.finalSectionProperties=B(h,i));let b=We(a.content,a.finalSectionProperties);return a.sections=D(b),a.finalSectionProperties&&a.sections.length>0&&(a.finalSectionProperties=a.sections[a.sections.length-1].properties),a}function $e(t){let n=new Map,e$1=a$3(t);if(!e$1)return n;let o=e(e$1,"w16cex","commentsExtensible")??e$1;for(let i$1 of i(o)){if((i$1.name?.replace(/^.*:/,"")??"")!=="comment")continue;let a=j$1(i$1,"w16cex","paraId")??j$1(i$1,"w15","paraId")??i$1.attributes?.["w16cex:paraId"]??i$1.attributes?.["w15:paraId"],c=j$1(i$1,"w16cex","dateUtc")??j$1(i$1,"w15","dateUtc")??i$1.attributes?.["w16cex:dateUtc"]??i$1.attributes?.["w15:dateUtc"];a&&c&&n.set(String(a).toUpperCase(),String(c));}return n}function _e(t){let n=new Map,e$1=new Map,o=a$3(t);if(!o)return {parentByParaId:n,doneByParaId:e$1};let i$1=e(o,"w15","commentsEx")??o;for(let r of i(i$1)){if((r.name?.replace(/^.*:/,"")??"")!=="commentEx")continue;let c=j$1(r,"w15","paraId")??r.attributes?.["w15:paraId"],g=j$1(r,"w15","paraIdParent")??r.attributes?.["w15:paraIdParent"],d=j$1(r,"w15","done")??r.attributes?.["w15:done"];if(c){let h=String(c).toUpperCase();g&&n.set(h,String(g).toUpperCase()),d==="1"&&e$1.set(h,true);}}return {parentByParaId:n,doneByParaId:e$1}}function Ne(t,n,e$1,o,i$1,r,a){if(!t)return [];let c=a$3(t);if(!c)return [];let g=r?$e(r):new Map,d=a?_e(a):null,h=e(c,"w","comments")??c,b=i(h),u=[],S=[];for(let f of b){if((f.name?.replace(/^.*:/,"")??"")!=="comment")continue;let C=parseInt(j$1(f,"w","id")??"0",10),D=j$1(f,"w","author")??"Unknown",B=j$1(f,"w","initials"),v=B!=null?String(B):void 0,X=j$1(f,"w","date"),p=X!=null?String(X):void 0,x=j$1(f,"w14","paraId")??f.attributes?.["w14:paraId"]??j$1(f,"w","paraId"),A=(x?g.get(String(x).toUpperCase()):void 0)??p,k=j$1(f,"w","done")??f.attributes?.["w:done"],M=k==="1"||k==="true"?true:void 0,R=j$1(f,"w16cid","parentId")??j$1(f,"w","parentId")??f.attributes?.["w16cid:parentId"]??f.attributes?.["w:parentId"],V=R!=null?parseInt(String(R),10):void 0,L=[],N="";for(let H of i(f))if((H.name?.replace(/^.*:/,"")??"")==="p"){let m=O(H,n,e$1,null,o,i$1);L.push(m);let P=j$1(H,"w14","paraId")??H.attributes?.["w14:paraId"];P&&(N=String(P).toUpperCase());}M==null&&d&&N&&d.doneByParaId.get(N)&&(M=true),S.push(N),u.push({id:C,author:D,initials:v,date:A,content:L,...M!=null?{done:M}:{},...V!=null&&!isNaN(V)?{parentId:V}:{}});}if(d&&d.parentByParaId.size>0){let f=new Map;for(let y=0;y<u.length;y++){let C=S[y];C&&f.set(C,u[y].id);}for(let y=0;y<u.length;y++){if(u[y].parentId!=null)continue;let C=S[y];if(!C)continue;let D=d.parentByParaId.get(C);if(!D)continue;let B=f.get(D);B!=null&&(u[y]={...u[y],parentId:B});}}return u}async function Ve(t,n={}){let e=t instanceof ArrayBuffer?t:await u(t),{onProgress:o=()=>{},preloadFonts:i=true,parseHeadersFooters:r=true,parseNotes:a$2=true,detectVariables:c=true}=n,g=[];try{let u=function(P,I){let U=performance.now(),oe=I(),O=performance.now()-U;return b$2.push({stage:P,ms:O}),O>1e3&&console.warn(`[parseDocx] ${P} took ${Math.round(O)}ms`),oe};var d=u;let h=performance.now(),b$2=[];async function S(P,I){let U=performance.now(),oe=await I(),O=performance.now()-U;return b$2.push({stage:P,ms:O}),O>1e3&&console.warn(`[parseDocx] ${P} took ${Math.round(O)}ms`),oe}o("Extracting DOCX...",0);let f=await S("unzip",()=>G(e));o("Extracted DOCX",10),o("Parsing relationships...",10);let y=u("relationships",()=>f.documentRels?b(f.documentRels):new Map);o("Parsed relationships",15),o("Parsing theme...",15);let C=u("theme",()=>a(f.themeXml));o("Parsed theme",20),o("Parsing styles...",20);let D=null,B;u("styles",()=>{f.stylesXml&&(D=ue(f.stylesXml,C),B=ke(f.stylesXml,C));}),o("Parsed styles",30),o("Parsing numbering...",30);let v=u("numbering",()=>a$1(f.numberingXml)),X=u("settings",()=>b$1(f.settingsXml));o("Parsed numbering",35),o("Processing media files...",35);let p=u("media",()=>Ze(f,y));o("Processed media",40),o("Parsing document body...",40);let x={content:[]};u("documentBody",()=>{f.documentXml?x=te(f.documentXml,D,C,v,y,p):g.push("No document.xml found in DOCX");}),o("Parsed document body",55);let F,A;if(r){o("Parsing headers/footers...",55);let P=u("headersFooters",()=>qe(f,D,C,v,y,p));F=P.headers,A=P.footers,o("Parsed headers/footers",65);}else o("Skipping headers/footers",65);let k,M,R,V;if(a$2){o("Parsing footnotes/endnotes...",65);let P=u("footnotesEndnotes",()=>Je(f,D,C,v,y,p));k=P.footnotes,M=P.endnotes,R=P.footnoteSeparators,V=P.endnoteSeparators,o("Parsed footnotes/endnotes",75);}else o("Skipping footnotes/endnotes",75);o("Parsing comments...",75);let L=u("comments",()=>Ne(f.commentsXml,D,C,y,p,f.commentsExtensibleXml,f.commentsExtendedXml));L.length>0&&(x.comments=L);let N;c?(o("Detecting template variables...",75),N=u("variables",()=>ee(x.content)),o("Detected variables",80)):o("Skipping variable detection",80),i?(o("Loading fonts...",80),await S("fonts",()=>Qe(C,B,x)),o("Loaded fonts",95)):o("Skipping font loading",95),o("Assembling document...",95);let _={package:{document:x,styles:B,theme:C,numbering:v.definitions,settings:X,headers:F,footers:A,footnotes:k,endnotes:M,footnoteSeparators:R,endnoteSeparators:V,relationships:y,media:p},originalBuffer:e,templateVariables:N,warnings:g.length>0?g:void 0},m=performance.now()-h;if(m>2e3){let P=b$2.filter(I=>I.ms>100).map(I=>`${I.stage}: ${Math.round(I.ms)}ms`).join(", ");console.warn(`[parseDocx] Total: ${Math.round(m)}ms`+(P?` (${P})`:""));}return o("Complete",100),_}catch(h){let b=h instanceof Error?h.message:String(h);throw console.error("[parseDocx] Failed to parse DOCX:",b,h),new Error(`Failed to parse DOCX: ${b}`)}}function Ze(t,n){let e=new Map;for(let[o,i]of t.media.entries()){let r=o.split("/").pop()||o,a=Me(o),c=new Uint8Array(i),g="";for(let S=0;S<c.length;S++)g+=String.fromCharCode(c[S]);let d=btoa(g),h=`data:${a};base64,${d}`,b={path:o,filename:r,mimeType:a,data:i,dataUrl:h};e.set(o,b);let u=o.replace(/^word\//,"");u!==o&&e.set(u,b);}return e}function ne(t,n){let e=n.toLowerCase();for(let[o,i]of t.entries())if(o.toLowerCase()===e)return i}function qe(t,n,e,o,i,r$1){let a=new Map,c=new Map;for(let[g,d]of i.entries())if(d.type===a$2.header&&d.target){let h=d.target.split("/").pop()||d.target,b$1=ne(t.headers,h);if(b$1){let u=`word/_rels/${h}.rels`,S=ne(t.allXml,u),f=S?b(S):i,y=r(b$1,"default",n,e,o,f,r$1);a.set(g,y);}}else if(d.type===a$2.footer&&d.target){let h=d.target.split("/").pop()||d.target,b$1=ne(t.footers,h);if(b$1){let u=`word/_rels/${h}.rels`,S=ne(t.allXml,u),f=S?b(S):i,y=s(b$1,"default",n,e,o,f,r$1);c.set(g,y);}}return {headers:a,footers:c}}function Je(t$1,n,e,o,i,r){let a=t(t$1.footnotesXml,n,e,o,i,r),c=u$1(t$1.endnotesXml,n,e,o,i,r);return {footnotes:a.getNormalFootnotes(),endnotes:c.getNormalEndnotes(),footnoteSeparators:a.footnotes.filter(z),endnoteSeparators:c.endnotes.filter(A)}}async function Qe(t,n,e){let o=new Set;if(t?.fontScheme){let{majorFont:i,minorFont:r}=t.fontScheme;i?.latin&&o.add(i.latin),r?.latin&&o.add(r.latin);}if(n?.docDefaults?.rPr?.fontFamily?.ascii&&o.add(n.docDefaults.rPr.fontFamily.ascii),n?.styles)for(let i of n.styles)i.rPr?.fontFamily?.ascii&&o.add(i.rPr.fontFamily.ascii),i.rPr?.fontFamily?.hAnsi&&o.add(i.rPr.fontFamily.hAnsi);if(e.content){for(let i of e.content)if(i.type==="paragraph")for(let r of i.content)r.type==="run"&&r.formatting?.fontFamily&&(r.formatting.fontFamily.ascii&&o.add(r.formatting.fontFamily.ascii),r.formatting.fontFamily.hAnsi&&o.add(r.formatting.fontFamily.hAnsi));}if(o.size>0)try{await q(Array.from(o));}catch(i){console.warn("Failed to load some fonts:",i);}}async function Et(t){return Ve(t,{preloadFonts:false,parseHeadersFooters:false,parseNotes:false,detectVariables:true})}async function Nt(t,n){return Ve(t,{onProgress:n,preloadFonts:true,parseHeadersFooters:true,parseNotes:true,detectVariables:true})}async function Vt(t){let n=await G(t);if(!n.documentXml)return [];let e=te(n.documentXml);return ee(e.content)}async function Ht(t){let n=await G(t),e=n.documentXml?ee(te(n.documentXml).content):[];return {hasDocument:n.documentXml!==null,hasStyles:n.stylesXml!==null,hasTheme:n.themeXml!==null,hasNumbering:n.numberingXml!==null,headerCount:n.headers.size,footerCount:n.footers.size,mediaCount:n.media.size,variableCount:e.length}}
|
|
2
2
|
export{Ve as a,Et as b,Nt as c,Vt as d,Ht as e};
|