@eigenpal/docx-editor-core 1.6.1 → 1.6.2
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.js +1 -1
- package/dist/agent/index.mjs +1 -1
- package/dist/chunk-25775MLP.mjs +2 -0
- package/dist/{chunk-DKUHG27E.js → chunk-2AEZLDY4.js} +1 -1
- package/dist/chunk-2EFI3BAN.js +59 -0
- package/dist/{chunk-XCXQWCV2.js → chunk-2EKWMNCY.js} +1 -1
- package/dist/chunk-3QQLHMB6.mjs +4 -0
- package/dist/{chunk-DEQFU56O.js → chunk-455DUC37.js} +1 -1
- package/dist/chunk-4EATD3FP.js +2 -0
- package/dist/chunk-4VLKSJRK.mjs +1 -0
- package/dist/{chunk-WTIN6QHX.js → chunk-5CLYWBNI.js} +1 -1
- package/dist/{chunk-NKIDBERV.js → chunk-5TLT5TUD.js} +1 -1
- package/dist/{chunk-DUXHJ6QP.js → chunk-5ZAMEYCA.js} +1 -1
- package/dist/{chunk-O4RCQNUW.mjs → chunk-6BAIXYUY.mjs} +1 -1
- package/dist/{chunk-7EU6E64E.mjs → chunk-6UCWVS7Y.mjs} +1 -1
- package/dist/chunk-7E2TOWBX.mjs +1 -0
- package/dist/{chunk-YSBX4LFA.mjs → chunk-7LPUPZAO.mjs} +2 -2
- package/dist/{chunk-OWGY46IW.mjs → chunk-AC6JHCPC.mjs} +1 -1
- package/dist/chunk-B3SVS2AF.js +1 -0
- package/dist/{chunk-4HNEXEGS.js → chunk-BA4OW45H.js} +1 -1
- package/dist/{chunk-KPWWI5UW.mjs → chunk-CF4SIWV2.mjs} +1 -1
- package/dist/{chunk-GFM6PERG.js → chunk-CMZXBKDH.js} +1 -1
- package/dist/chunk-CRQO6WI3.mjs +2 -0
- package/dist/chunk-DPMR7U7D.js +2 -0
- package/dist/{chunk-QZPVZY6S.mjs → chunk-EEEED6FG.mjs} +1 -1
- package/dist/{chunk-HQ76VZAN.mjs → chunk-IJ2PPHRN.mjs} +1 -1
- package/dist/chunk-IUYHWUBF.mjs +1 -0
- package/dist/chunk-LMGFGJTJ.mjs +1 -0
- package/dist/chunk-LZTEPSU2.js +4 -0
- package/dist/{chunk-TXAB4I4M.mjs → chunk-NJBEJTIO.mjs} +1 -1
- package/dist/chunk-OBRTIXHC.mjs +59 -0
- package/dist/{chunk-TT3ILFZC.js → chunk-OTXLG6KM.js} +1 -1
- package/dist/chunk-QI6JDDGO.js +1 -0
- package/dist/{chunk-DUVSDFRG.js → chunk-R5DGXEWJ.js} +1 -1
- package/dist/{chunk-DU5TWD2W.mjs → chunk-RT5AAIEK.mjs} +1 -1
- package/dist/{chunk-KEDY4GFG.js → chunk-SSL74NAS.js} +3 -3
- package/dist/{chunk-NN2EJIO7.mjs → chunk-T5G3IWCO.mjs} +1 -1
- package/dist/{chunk-QRBFMR7Z.mjs → chunk-U55TPVTA.mjs} +1 -1
- package/dist/{chunk-ICNIAAH7.mjs → chunk-V4DLVFYG.mjs} +1 -1
- package/dist/chunk-WA4IJOGH.js +1 -0
- package/dist/{chunk-PM4KDJJ2.js → chunk-XLY5A37T.js} +1 -1
- package/dist/{chunk-K7NSOCSY.js → chunk-XRJFWDCV.js} +1 -1
- package/dist/chunk-ZCYUN3EC.js +1 -0
- package/dist/{chunk-A7C3DGQA.mjs → chunk-ZW3VG4TK.mjs} +1 -1
- package/dist/core-plugins.js +1 -1
- package/dist/core-plugins.mjs +1 -1
- package/dist/core.js +1 -1
- package/dist/core.mjs +1 -1
- package/dist/docx/index.js +1 -1
- package/dist/docx/index.mjs +1 -1
- 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/rezip.js +1 -1
- package/dist/docx/rezip.mjs +1 -1
- package/dist/docx/serializer/index.js +1 -1
- package/dist/docx/serializer/index.mjs +1 -1
- package/dist/editor/index.js +1 -1
- package/dist/editor/index.mjs +1 -1
- package/dist/executor-LAWUSXNG.mjs +1 -0
- package/dist/executor-SJOHUTMY.js +1 -0
- package/dist/headless.js +1 -1
- package/dist/headless.mjs +1 -1
- package/dist/layout-bridge/index.js +1 -1
- package/dist/layout-bridge/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.js +1 -1
- package/dist/layout-bridge/toFlowBlocks.mjs +1 -1
- package/dist/layout-painter/index.js +1 -1
- package/dist/layout-painter/index.mjs +1 -1
- package/dist/layout-painter/renderPage.js +1 -1
- package/dist/layout-painter/renderPage.mjs +1 -1
- package/dist/mcp-cli.mjs +23 -23
- package/dist/mcp.js +8 -8
- package/dist/mcp.mjs +1 -1
- 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.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/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.js +2 -2
- package/dist/prosemirror/index.mjs +1 -1
- package/dist/prosemirror/schema/index.js +1 -1
- package/dist/prosemirror/schema/index.mjs +1 -1
- package/package.json +1 -1
- package/dist/chunk-2LVK7EF5.mjs +0 -2
- package/dist/chunk-47SKD7QB.mjs +0 -4
- package/dist/chunk-4JPHW7ZI.js +0 -2
- package/dist/chunk-4U2S3WV2.js +0 -1
- package/dist/chunk-5EP47PMQ.mjs +0 -2
- package/dist/chunk-B6FA4MJ5.mjs +0 -1
- package/dist/chunk-C2BAPYGJ.js +0 -1
- package/dist/chunk-DFDL337G.js +0 -4
- package/dist/chunk-F24WZXN4.mjs +0 -59
- package/dist/chunk-FETIBXTH.js +0 -1
- package/dist/chunk-JQUIUKRO.js +0 -59
- package/dist/chunk-LE67NTCN.mjs +0 -1
- package/dist/chunk-SHZOAUHB.mjs +0 -1
- package/dist/chunk-WVY2UXAK.js +0 -2
- package/dist/executor-FHL5D4CB.js +0 -1
- package/dist/executor-FL6XGVP3.mjs +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkOTXLG6KM_js=require('./chunk-OTXLG6KM.js'),chunkBJSG6TEG_js=require('./chunk-BJSG6TEG.js'),chunkDC7S76ZX_js=require('./chunk-DC7S76ZX.js');var i={runImage:"layout-run-image",blockImage:"layout-block-image",pageFloatingImage:"layout-page-floating-image",cellFloatingImage:"layout-cell-floating-image",pageContent:"layout-page-content",paragraph:"layout-paragraph"},y=[`.${i.pageFloatingImage}`,`.${i.cellFloatingImage}`,`.${i.blockImage}`,`.${i.runImage}`].join(", ");function L(n){if(!(n instanceof Element))return null;let e=n.closest(y);if(!e)return null;let o=e.dataset.pmStart;if(o===void 0)return null;let t=Number(o);return Number.isNaN(t)?null:{pos:t,imageEl:e}}function b(n){if(!(n instanceof HTMLElement))return null;if(n.tagName==="IMG"&&n.classList.contains(i.runImage))return n;let e=n.closest(y);return e&&e.dataset.pmStart?e:null}function x(n,e=1){if(!n.classList.contains(i.runImage))return;let o=n.closest(`.${i.pageContent}`),t=n.closest(`.${i.paragraph}`);if(!o||!t)return;let r=n.getBoundingClientRect(),a=o.getBoundingClientRect(),l=t.getBoundingClientRect(),p=e>0?e:1;return {horizontalEmu:Math.round(chunkBJSG6TEG_js.g((r.left-a.left)/p)),verticalEmu:Math.round(chunkBJSG6TEG_js.g((r.top-l.top)/p))}}function T(n,e){return n==="inline"?"inline":n==="behind"?"behind":n==="inFront"?"inFront":n==="square"||n==="tight"||n==="through"?e==="right"?"squareRight":"squareLeft":null}var k=[{choice:"inline",i18nLabelKey:"inLineWithText",i18nDescKey:"inLineWithText",iconHint:"inline"},{choice:"squareLeft",i18nLabelKey:"squareLeft",i18nDescKey:"squareLeft",iconHint:"squareLeft"},{choice:"squareRight",i18nLabelKey:"squareRight",i18nDescKey:"squareRight",iconHint:"squareRight"},{choice:"behind",i18nLabelKey:"behindText",i18nDescKey:"behindText",iconHint:"behind"},{choice:"inFront",i18nLabelKey:"inFrontOfText",i18nDescKey:"inFrontOfText",iconHint:"inFront"}];function I(n,e){return true}function E(n){switch(n){case "inline":return "inline";case "square":case "tight":case "through":return "squareLeft";case "topAndBottom":return "topAndBottom";case "behind":return "behind";case "inFront":return "inFront";case "wrapRight":return "squareLeft";case "wrapLeft":return "squareRight";default:return}}function X(n,e){let o=new Map;for(let t=0;t<n.length;t++){let r=n[t],a=e[t];r&&a&&o.set(String(r.id),{block:r,measure:a});}return o}var c=class{constructor(e={}){chunkDC7S76ZX_js.a(this,"container",null);chunkDC7S76ZX_js.a(this,"blockLookup",new Map);chunkDC7S76ZX_js.a(this,"pageStates",[]);chunkDC7S76ZX_js.a(this,"totalPages",0);chunkDC7S76ZX_js.a(this,"options");chunkDC7S76ZX_js.a(this,"doc");chunkDC7S76ZX_js.a(this,"resolvedCommentIds",new Set);this.options=e,this.doc=e.document??document;}setBlockLookup(e){this.blockLookup=e;}mount(e){this.container=e,this.applyContainerStyles();}unmount(){this.container&&(this.container.innerHTML=""),this.container=null,this.pageStates=[];}applyContainerStyles(){if(!this.container)return;let e=this.options.pageGap??24;this.container.style.display="flex",this.container.style.flexDirection="column",this.container.style.alignItems="center",this.container.style.gap=`${e}px`,this.container.style.padding=`${e}px`,this.container.style.backgroundColor=this.options.containerBackground??"var(--doc-bg, #f8f9fa)",this.container.style.minHeight="100%";}paint(e){if(!this.container)throw new Error("LayoutPainter: not mounted");let{pages:o}=e;this.totalPages=o.length,this.container.innerHTML="",this.pageStates=[];for(let t=0;t<o.length;t++){let r=o[t],a={pageNumber:r.number,totalPages:this.totalPages,section:"body",resolvedCommentIds:this.resolvedCommentIds},l=this.renderPageWithLookup(r,a);this.container.appendChild(l),this.pageStates.push({element:l,pageNumber:r.number,fragmentCount:r.fragments.length});}}renderPageWithLookup(e,o){let t=this.doc.createElement("div");t.className="layout-page",t.dataset.pageNumber=String(e.number),t.style.position="relative",t.style.width=`${e.size.w}px`,t.style.height=`${e.size.h}px`,t.style.backgroundColor=this.options.pageBackground??"var(--doc-page-bg, #ffffff)",t.style.color="var(--doc-page-text, #000000)",t.style.overflow="hidden",this.options.showShadow&&(t.style.boxShadow="0 2px 8px rgba(0, 0, 0, 0.15)");let r=this.doc.createElement("div");r.className="layout-page-content",r.style.position="absolute",r.style.top=`${e.margins.top}px`,r.style.left=`${e.margins.left}px`,r.style.right=`${e.margins.right}px`,r.style.bottom=`${e.margins.bottom}px`,r.style.overflow="visible";for(let a of e.fragments){let l=this.renderFragmentWithLookup(a,o);this.applyFragmentPosition(l,a),r.appendChild(l);}return t.appendChild(r),t}renderFragmentWithLookup(e,o){let t=this.blockLookup.get(String(e.blockId));if(e.kind==="paragraph"&&t){let r=t.block,a=t.measure;return chunkOTXLG6KM_js.t(e,r,a,o,{document:this.doc})}if(e.kind==="table"&&t){let r=t.block,a=t.measure;return chunkOTXLG6KM_js.w(e,r,a,o,{document:this.doc})}if(e.kind==="image"&&t){let r=t.block,a=t.measure;return chunkOTXLG6KM_js.q(e,r,a,o,{document:this.doc})}if(e.kind==="textBox"&&t){let r=t.block,a=t.measure;return chunkOTXLG6KM_js.y(e,r,a,o,{document:this.doc})}return chunkOTXLG6KM_js.o(e,o,{document:this.doc})}applyFragmentPosition(e,o){e.style.position="absolute",e.style.left=`${o.x}px`,e.style.top=`${o.y}px`,e.style.width=`${o.width}px`,"height"in o&&(e.style.height=`${o.height}px`);}getPageCount(){return this.totalPages}getPageElement(e){return this.pageStates[e]?.element??null}scrollToPage(e){let o=this.pageStates.find(t=>t.pageNumber===e);o?.element&&o.element.scrollIntoView({behavior:"smooth",block:"start"});}};function Z(n){return new c(n)}exports.a=i;exports.b=L;exports.c=b;exports.d=x;exports.e=T;exports.f=k;exports.g=I;exports.h=E;exports.i=X;exports.j=c;exports.k=Z;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkCMZXBKDH_js=require('./chunk-CMZXBKDH.js'),chunkU4UCHBZ7_js=require('./chunk-U4UCHBZ7.js'),chunkQI6JDDGO_js=require('./chunk-QI6JDDGO.js'),chunk2EFI3BAN_js=require('./chunk-2EFI3BAN.js'),chunkDPMR7U7D_js=require('./chunk-DPMR7U7D.js'),chunkDC7S76ZX_js=require('./chunk-DC7S76ZX.js');var P=class o{constructor(t){chunkDC7S76ZX_js.a(this,"_document");chunkDC7S76ZX_js.a(this,"_pendingVariables");t instanceof ArrayBuffer||ArrayBuffer.isView(t)?this._document={package:{document:{content:[]}},originalBuffer:t instanceof ArrayBuffer?t:t.buffer}:this._document=t,this._pendingVariables={};}static async fromBuffer(t){let e=await chunkDPMR7U7D_js.a(t);return new o(e)}static fromDocument(t){return new o(t)}getDocument(){return this._document}getText(){let t=this._document.package.document;return this._getBodyText(t)}getFormattedText(){let t=[],e=this._document.package.document;for(let n of e.content)n.type==="paragraph"&&this._extractParagraphSegments(n,t);return t}getVariables(){return chunkU4UCHBZ7_js.a(this._document)}getStyles(){let t=this._document.package.styles;if(!t?.styles)return [];let e=[];for(let[n,r]of Object.entries(t.styles))if(typeof r=="object"&&r!==null){let a=r;e.push({id:n,name:a.name||n,type:a.type==="numbering"?"paragraph":a.type||"paragraph",builtIn:a.default});}return e}getPageCount(){let t=this.getWordCount();return Math.max(1,Math.ceil(t/500))}getWordCount(){return this.getText().split(/\s+/).filter(n=>n.length>0).length}getCharacterCount(t=true){let e=this.getText();return t?e.length:e.replace(/\s/g,"").length}getParagraphCount(){return this._document.package.document.content.filter(t=>t.type==="paragraph").length}getTableCount(){return this._document.package.document.content.filter(t=>t.type==="table").length}getAgentContext(t=100){let e=this._document.package.document,n=e.content.filter(i=>i.type==="paragraph"),r=n.map((i,s)=>{let c=this._getParagraphText(i),p=i.formatting?.styleId;return {index:s,preview:c.slice(0,t),style:p,isHeading:p?.toLowerCase().includes("heading")||false,headingLevel:this._parseHeadingLevel(p),isListItem:!!i.listRendering,isEmpty:c.trim().length===0}}),a=(e.sections||[]).map((i,s)=>({index:s,paragraphCount:i.content?.length||0,pageSize:i.properties?.pageWidth&&i.properties?.pageHeight?{width:i.properties.pageWidth,height:i.properties.pageHeight}:void 0,isLandscape:i.properties?.orientation==="landscape",hasHeader:!!i.properties?.headerReferences?.length,hasFooter:!!i.properties?.footerReferences?.length}));return {paragraphCount:n.length,wordCount:this.getWordCount(),characterCount:this.getCharacterCount(),variables:this.getVariables(),variableCount:this.getVariables().length,availableStyles:this.getStyles(),outline:r,sections:a,hasTables:this.getTableCount()>0,hasImages:this._hasImages(),hasHyperlinks:this._hasHyperlinks()}}insertText(t,e,n={}){let r={type:"insertText",position:t,text:e,formatting:n.formatting};return this._executeCommand(r)}replaceRange(t,e,n={}){let r={type:"replaceText",range:t,text:e,formatting:n.formatting};return this._executeCommand(r)}deleteRange(t){let e={type:"deleteText",range:t};return this._executeCommand(e)}applyFormatting(t,e){let n={type:"formatText",range:t,formatting:e};return this._executeCommand(n)}applyStyle(t,e){let n={type:"applyStyle",paragraphIndex:t,styleId:e};return this._executeCommand(n)}applyParagraphFormatting(t,e){let n={type:"formatParagraph",paragraphIndex:t,formatting:e};return this._executeCommand(n)}insertTable(t,e,n,r={}){let a={type:"insertTable",position:t,rows:e,columns:n,data:r.data,hasHeader:r.hasHeader};return this._executeCommand(a)}insertImage(t,e,n={}){let r={type:"insertImage",position:t,src:e,width:n.width,height:n.height,alt:n.alt};return this._executeCommand(r)}insertHyperlink(t,e,n={}){let r={type:"insertHyperlink",range:t,url:e,displayText:n.displayText,tooltip:n.tooltip};return this._executeCommand(r)}removeHyperlink(t){let e={type:"removeHyperlink",range:t};return this._executeCommand(e)}insertParagraphBreak(t){let e={type:"insertParagraphBreak",position:t};return this._executeCommand(e)}mergeParagraphs(t,e){let n={type:"mergeParagraphs",paragraphIndex:t,count:e};return this._executeCommand(n)}setVariable(t,e){return this._pendingVariables[t]=e,this}setVariables(t){for(let[e,n]of Object.entries(t))this._pendingVariables[e]=n;return this}getPendingVariables(){return {...this._pendingVariables}}clearPendingVariables(){return this._pendingVariables={},this}async applyVariables(t){let e={...this._pendingVariables,...t};if(Object.keys(e).length===0)return this;let n=this._document.originalBuffer;if(!n)throw new Error("Cannot apply variables: no original buffer for processing");let{processTemplate:r}=await import('./processTemplate-HH2E3HBO.js'),a=r(n,e),i=await chunkDPMR7U7D_js.a(a),s=new o(i);return s._pendingVariables={},s}async toBuffer(t){if(this._document.originalBuffer){if(t?.selective){let n=await chunkCMZXBKDH_js.c(this._document,this._document.originalBuffer,t.selective);if(n)return this._document.originalBuffer=n,n}let e=await chunk2EFI3BAN_js.i(this._document);return this._document.originalBuffer=e,e}return chunk2EFI3BAN_js.t(this._document)}async toBlob(t="application/vnd.openxmlformats-officedocument.wordprocessingml.document"){let e=await this.toBuffer();return new Blob([e],{type:t})}executeCommands(t){return new o(chunkQI6JDDGO_js.b(this._document,t))}_executeCommand(t){let e=new o(chunkQI6JDDGO_js.a(this._document,t));return e._pendingVariables={...this._pendingVariables},e}_getBodyText(t){let e=[];for(let n of t.content)n.type==="paragraph"?e.push(this._getParagraphText(n)):n.type==="table"&&e.push(this._getTableText(n));return e.join(`
|
|
2
2
|
`)}_getParagraphText(t){let e=[];for(let n of t.content)n.type==="run"?e.push(this._getRunText(n)):n.type==="hyperlink"&&e.push(this._getHyperlinkText(n));return e.join("")}_getRunText(t){return t.content.filter(e=>e.type==="text").map(e=>e.text).join("")}_getHyperlinkText(t){let e=[];for(let n of t.children)n.type==="run"&&e.push(this._getRunText(n));return e.join("")}_getTableText(t){let e=[];for(let n of t.rows)for(let r of n.cells)for(let a of r.content)a.type==="paragraph"&&e.push(this._getParagraphText(a));return e.join(" ")}_extractParagraphSegments(t,e){for(let n of t.content)if(n.type==="run"){let r=this._getRunText(n);r&&e.push({text:r,formatting:n.formatting});}else if(n.type==="hyperlink"){let r=n.href||"";for(let a of n.children)if(a.type==="run"){let i=this._getRunText(a);i&&e.push({text:i,formatting:a.formatting,isHyperlink:true,hyperlinkUrl:r});}}}_parseHeadingLevel(t){if(!t)return;let e=t.match(/heading\s*(\d)/i);if(e)return parseInt(e[1],10)}_hasImages(){let t=this._document.package.document;for(let e of t.content)if(e.type==="paragraph"){for(let n of e.content)if(n.type==="run"){for(let r of n.content)if(r.type==="drawing")return true}}return false}_hasHyperlinks(){let t=this._document.package.document;for(let e of t.content)if(e.type==="paragraph"){for(let n of e.content)if(n.type==="hyperlink")return true}return false}};async function Ct(o){return P.fromBuffer(o)}function kt(o){return P.fromDocument(o)}function M(o,t={}){let{outlineMaxChars:e=100,maxOutlineParagraphs:n=50}=t,r=o.package.document,a=r.content.filter(y=>y.type==="paragraph"),i=z(a,e,n),s=chunkU4UCHBZ7_js.a(o),c=W(o),p=$(r),u=U(r),d=G(r),f=r.content.some(y=>y.type==="table"),x=K(r),l=N(r);return {paragraphCount:a.length,wordCount:u,characterCount:d,variables:s,variableCount:s.length,availableStyles:c,outline:i,sections:p,hasTables:f,hasImages:x,hasHyperlinks:l}}function At(o,t,e={}){let{contextChars:n=200,includeSuggestions:r=true}=e,i=o.package.document.content.filter(m=>m.type==="paragraph"),s=i[t.start.paragraphIndex];if(!s)throw new Error(`Paragraph not found at index ${t.start.paragraphIndex}`);let c=g(s),p="";if(t.start.paragraphIndex===t.end.paragraphIndex)p=c.slice(t.start.offset,t.end.offset);else {let m=[];for(let b=t.start.paragraphIndex;b<=t.end.paragraphIndex;b++){let H=i[b];if(!H)continue;let _=g(H);b===t.start.paragraphIndex?m.push(_.slice(t.start.offset)):b===t.end.paragraphIndex?m.push(_.slice(0,t.end.offset)):m.push(_);}p=m.join(`
|
|
3
3
|
`);}let u=Y(i,t.start.paragraphIndex,t.start.offset,n),d=Z(i,t.end.paragraphIndex,t.end.offset,n),f=tt(s,t.start.offset),x=s.formatting||{},l={index:t.start.paragraphIndex,fullText:c,style:s.formatting?.styleId,wordCount:v(c)},y=false,A=et(s,t.start.offset),S=r?nt(p):[];return {selectedText:p,range:t,formatting:f,paragraphFormatting:x,textBefore:u,textAfter:d,paragraph:l,inTable:y,inHyperlink:A,suggestedActions:S}}function L(o){let t=M(o,{outlineMaxChars:50,maxOutlineParagraphs:10}),e=[`Document with ${t.paragraphCount} paragraphs, ${t.wordCount} words.`];t.hasTables&&e.push("Contains tables."),t.hasImages&&e.push("Contains images."),t.hasHyperlinks&&e.push("Contains hyperlinks."),t.variableCount>0&&e.push(`Has ${t.variableCount} template variables: ${t.variables.join(", ")}`);let n=t.outline.filter(r=>r.isHeading);if(n.length>0){e.push(`
|
|
4
4
|
Headings:`);for(let r of n.slice(0,5)){let a=r.headingLevel||1;e.push(`${" ".repeat(a-1)}- ${r.preview}`);}n.length>5&&e.push(` ... and ${n.length-5} more headings`);}return e.join(" ")}function z(o,t,e){let n=[];for(let r=0;r<Math.min(o.length,e);r++){let a=o[r],i=g(a),s=a.formatting?.styleId;n.push({index:r,preview:i.slice(0,t),style:s,isHeading:Q(s),headingLevel:X(s),isListItem:!!a.listRendering,isEmpty:i.trim().length===0});}return n}function W(o){let t=o.package.styles;if(!t?.styles)return [];let e=[];for(let[n,r]of Object.entries(t.styles))if(typeof r=="object"&&r!==null){let a=r;e.push({id:n,name:a.name||n,type:a.type==="numbering"?"paragraph":a.type||"paragraph",builtIn:a.default});}return e}function $(o){return o.sections?o.sections.map((t,e)=>({index:e,paragraphCount:t.content?.length||0,pageSize:t.properties?.pageWidth&&t.properties?.pageHeight?{width:t.properties.pageWidth,height:t.properties.pageHeight}:void 0,isLandscape:t.properties?.orientation==="landscape",hasHeader:!!t.properties?.headerReferences?.length,hasFooter:!!t.properties?.footerReferences?.length})):[]}function U(o){let t=0;for(let e of o.content)if(e.type==="paragraph"){let n=g(e);t+=v(n);}else e.type==="table"&&(t+=q(e));return t}function v(o){return o.split(/\s+/).filter(e=>e.length>0).length}function G(o){let t=0;for(let e of o.content)if(e.type==="paragraph"){let n=g(e);t+=n.length;}else e.type==="table"&&(t+=J(e));return t}function q(o){let t=0;for(let e of o.rows)for(let n of e.cells)for(let r of n.content)if(r.type==="paragraph"){let a=g(r);t+=v(a);}return t}function J(o){let t=0;for(let e of o.rows)for(let n of e.cells)for(let r of n.content)if(r.type==="paragraph"){let a=g(r);t+=a.length;}return t}function g(o){let t=[];for(let e of o.content)e.type==="run"?t.push(T(e)):e.type==="hyperlink"&&t.push(F(e));return t.join("")}function T(o){return o.content.filter(t=>t.type==="text").map(t=>t.text).join("")}function F(o){let t=[];for(let e of o.children)e.type==="run"&&t.push(T(e));return t.join("")}function K(o){for(let t of o.content)if(t.type==="paragraph"){for(let e of t.content)if(e.type==="run"){for(let n of e.content)if(n.type==="drawing")return true}}return false}function N(o){for(let t of o.content)if(t.type==="paragraph"){for(let e of t.content)if(e.type==="hyperlink")return true}return false}function Q(o){return o?o.toLowerCase().includes("heading"):false}function X(o){if(!o)return;let t=o.match(/heading\s*(\d)/i);if(t)return parseInt(t[1],10)}function Y(o,t,e,n){let r=[],a=0,i=o[t];if(i){let p=g(i).slice(0,e);r.unshift(p),a+=p.length;}for(let c=t-1;c>=0&&a<n;c--){let p=o[c];if(!p)continue;let u=g(p);r.unshift(u),a+=u.length;}let s=r.join(`
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var chunkR5DGXEWJ_js=require('./chunk-R5DGXEWJ.js');var t=new chunkR5DGXEWJ_js.r(chunkR5DGXEWJ_js.q());t.buildSchema();t.initializeRuntime();var s=t,n=t.getSchema();exports.a=s;exports.b=n;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {c}from'./chunk-7EU6E64E.mjs';import {f,E,Y,O,W as W$1,m,n}from'./chunk-VMBCUUZM.mjs';import {b}from'./chunk-NN2EJIO7.mjs';import {f as f$1}from'./chunk-KNY7SXPJ.mjs';function be(e,n){let i=e.floating;if(!i)return false;let r=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<E&&s<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?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$1,i,r){let{pmStart:t,pmEnd:o}=Fe(e,n$1);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$1.width)/2):l==="right"&&(a=Math.max(0,r-n$1.width));let s=Math.max(0,i-a);if(s<=0)return {charOffset:0,pmPosition:t};let f=ke(e,n$1);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$1=m(x,d),p=u+m$1.width;if(s<=p){let b=s-u,k=n(b,m$1.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$1=0;for(let p of x)if(p.kind==="tab"){if(h<=m$1+1)return h<=m$1?{x:d,lineIndex:a}:{x:d+(p.width??48),lineIndex:a};d+=p.width??48,m$1+=1;}else if(p.kind==="image"){if(h<=m$1+1)return h<=m$1?{x:d,lineIndex:a}:{x:d+p.width,lineIndex:a};d+=p.width,m$1+=1;}else if(p.kind==="lineBreak"){if(h<=m$1)return {x:d,lineIndex:a};m$1+=1;}else if(p.kind==="text"){let b=p.text??"";if(h<=m$1+b.length){let M=h-m$1,T=re(p),P=m(b.slice(0,M),T);return {x:d+P.width,lineIndex:a}}let k=re(p),H=m(b,k);d+=H.width,m$1+=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$1=i-o,p=He(a),b=m(h.slice(0,m$1),p);return t+b.width}let x=He(a),d=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?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=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?f$1(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=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=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}=W$1(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}export{ut as A,Ce as B,ft as C,dt as D,mt as E,gt as F,Ae as G,De as H,U as I,le as J,$ as K,ht as L,pt as M,bt as N,xt as O,ve as P,Tt as Q,be as a,We as b,ne as c,A as d,Ge as e,xe as f,Ue as g,Te as h,$e as i,qe as j,je as k,Je as l,ie as m,Me as n,Ze as o,ye as p,et as q,tt as r,nt as s,ot as t,rt as u,it as v,Pe as w,Be as x,Re as y,Ie as z};
|
|
1
|
+
import {c}from'./chunk-6UCWVS7Y.mjs';import {f,E,Y,O,W as W$1,m,n}from'./chunk-VMBCUUZM.mjs';import {b}from'./chunk-T5G3IWCO.mjs';import {f as f$1}from'./chunk-KNY7SXPJ.mjs';function be(e,n){let i=e.floating;if(!i)return false;let r=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<E&&s<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?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$1,i,r){let{pmStart:t,pmEnd:o}=Fe(e,n$1);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$1.width)/2):l==="right"&&(a=Math.max(0,r-n$1.width));let s=Math.max(0,i-a);if(s<=0)return {charOffset:0,pmPosition:t};let f=ke(e,n$1);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$1=m(x,d),p=u+m$1.width;if(s<=p){let b=s-u,k=n(b,m$1.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$1=0;for(let p of x)if(p.kind==="tab"){if(h<=m$1+1)return h<=m$1?{x:d,lineIndex:a}:{x:d+(p.width??48),lineIndex:a};d+=p.width??48,m$1+=1;}else if(p.kind==="image"){if(h<=m$1+1)return h<=m$1?{x:d,lineIndex:a}:{x:d+p.width,lineIndex:a};d+=p.width,m$1+=1;}else if(p.kind==="lineBreak"){if(h<=m$1)return {x:d,lineIndex:a};m$1+=1;}else if(p.kind==="text"){let b=p.text??"";if(h<=m$1+b.length){let M=h-m$1,T=re(p),P=m(b.slice(0,M),T);return {x:d+P.width,lineIndex:a}}let k=re(p),H=m(b,k);d+=H.width,m$1+=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$1=i-o,p=He(a),b=m(h.slice(0,m$1),p);return t+b.width}let x=He(a),d=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?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=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?f$1(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=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=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}=W$1(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}export{ut as A,Ce as B,ft as C,dt as D,mt as E,gt as F,Ae as G,De as H,U as I,le as J,$ as K,ht as L,pt as M,bt as N,xt as O,ve as P,Tt as Q,be as a,We as b,ne as c,A as d,Ge as e,xe as f,Ue as g,Te as h,$e as i,qe as j,je as k,Je as l,ie as m,Me as n,Ze as o,ye as p,et as q,tt as r,nt as s,ot as t,rt as u,it as v,Pe as w,Be as x,Re as y,Ie as z};
|
package/dist/core-plugins.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkSSL74NAS_js=require('./chunk-SSL74NAS.js');require('./chunk-U4UCHBZ7.js'),require('./chunk-ESI4BSBF.js');var chunk4BFNWPKW_js=require('./chunk-4BFNWPKW.js');require('./chunk-DPMR7U7D.js'),require('./chunk-LZTEPSU2.js'),require('./chunk-FIGLFSNR.js'),require('./chunk-QVRMX2AC.js'),require('./chunk-LW5OFHSW.js'),require('./chunk-Z3LGMBJC.js'),require('./chunk-B3SVS2AF.js'),require('./chunk-BJSG6TEG.js'),require('./chunk-GSKMHXHG.js'),require('./chunk-H57LNDBH.js'),require('./chunk-3R7QHNI5.js'),require('./chunk-DC7S76ZX.js');Object.defineProperty(exports,"docxtemplaterPlugin",{enumerable:true,get:function(){return chunkSSL74NAS_js.b}});Object.defineProperty(exports,"isZodSchema",{enumerable:true,get:function(){return chunkSSL74NAS_js.a}});Object.defineProperty(exports,"PluginRegistry",{enumerable:true,get:function(){return chunk4BFNWPKW_js.a}});Object.defineProperty(exports,"createPluginRegistrar",{enumerable:true,get:function(){return chunk4BFNWPKW_js.d}});Object.defineProperty(exports,"pluginRegistry",{enumerable:true,get:function(){return chunk4BFNWPKW_js.b}});Object.defineProperty(exports,"registerPlugins",{enumerable:true,get:function(){return chunk4BFNWPKW_js.c}});
|
package/dist/core-plugins.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{b as docxtemplaterPlugin,a as isZodSchema}from'./chunk-
|
|
1
|
+
export{b as docxtemplaterPlugin,a as isZodSchema}from'./chunk-7LPUPZAO.mjs';import'./chunk-ARHPXIBJ.mjs';import'./chunk-CGJ6S3AH.mjs';export{a as PluginRegistry,d as createPluginRegistrar,b as pluginRegistry,c as registerPlugins}from'./chunk-3NRMSZX2.mjs';import'./chunk-CRQO6WI3.mjs';import'./chunk-3QQLHMB6.mjs';import'./chunk-MOCGHQ4A.mjs';import'./chunk-CDBKFBC2.mjs';import'./chunk-3HLRRK6N.mjs';import'./chunk-W77JXDEV.mjs';import'./chunk-4VLKSJRK.mjs';import'./chunk-KNY7SXPJ.mjs';import'./chunk-DI6CRWSW.mjs';import'./chunk-VJFIAFZ5.mjs';import'./chunk-3ANZ3252.mjs';import'./chunk-QYUPLKLP.mjs';
|
package/dist/core.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var chunkTE2VQJZG_js=require('./chunk-TE2VQJZG.js'),chunk4G6AJ4ZM_js=require('./chunk-4G6AJ4ZM.js'),chunkY74ANBPV_js=require('./chunk-Y74ANBPV.js'),chunkWTIN6QHX_js=require('./chunk-WTIN6QHX.js');require('./chunk-DUXHJ6QP.js');var chunkTT3ILFZC_js=require('./chunk-TT3ILFZC.js');require('./chunk-NKIDBERV.js'),require('./chunk-MWOHCSZE.js'),require('./chunk-YUHOVME2.js'),require('./chunk-XCTYXYEU.js'),require('./chunk-IMKU4O3P.js'),require('./chunk-DROCYKAR.js');var chunkKESNGXGO_js=require('./chunk-KESNGXGO.js'),chunkK7NSOCSY_js=require('./chunk-K7NSOCSY.js'),chunkGFM6PERG_js=require('./chunk-GFM6PERG.js'),chunkNXLJVVVE_js=require('./chunk-NXLJVVVE.js'),chunkKEDY4GFG_js=require('./chunk-KEDY4GFG.js'),chunkU4UCHBZ7_js=require('./chunk-U4UCHBZ7.js'),chunkESI4BSBF_js=require('./chunk-ESI4BSBF.js'),chunkFETIBXTH_js=require('./chunk-FETIBXTH.js'),chunkJQUIUKRO_js=require('./chunk-JQUIUKRO.js'),chunk4JPHW7ZI_js=require('./chunk-4JPHW7ZI.js'),chunk4BFNWPKW_js=require('./chunk-4BFNWPKW.js'),chunkWVY2UXAK_js=require('./chunk-WVY2UXAK.js');require('./chunk-DFDL337G.js'),require('./chunk-FIGLFSNR.js');var chunkQVRMX2AC_js=require('./chunk-QVRMX2AC.js'),chunkI6PMX4BO_js=require('./chunk-I6PMX4BO.js');require('./chunk-DKUHG27E.js'),require('./chunk-PGWY6UFK.js'),require('./chunk-ISKTBM4L.js'),require('./chunk-JFZIXFRC.js'),require('./chunk-RQVHKDXK.js'),require('./chunk-LW5OFHSW.js'),require('./chunk-Z3LGMBJC.js'),require('./chunk-4U2S3WV2.js'),require('./chunk-DUVSDFRG.js'),require('./chunk-Q2VALXEU.js'),require('./chunk-MZ7LW5CH.js'),require('./chunk-N3Y5BUKV.js'),require('./chunk-ILPNMG7Q.js'),require('./chunk-6LVPRTB6.js'),require('./chunk-LWH66Q7Q.js'),require('./chunk-X6AICTHN.js'),require('./chunk-7HANRHHL.js');var chunkMJ5FQX7Q_js=require('./chunk-MJ5FQX7Q.js');require('./chunk-C2BAPYGJ.js');var chunkBJSG6TEG_js=require('./chunk-BJSG6TEG.js');require('./chunk-GSKMHXHG.js'),require('./chunk-H57LNDBH.js'),require('./chunk-3R7QHNI5.js');var chunkDC7S76ZX_js=require('./chunk-DC7S76ZX.js');function L(i){if(!i||i==="transparent"||i==="inherit")return null;if(i.startsWith("#"))return i.slice(1).toUpperCase();let o=i.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/);if(o){let e=parseInt(o[1]).toString(16).padStart(2,"0"),t=parseInt(o[2]).toString(16).padStart(2,"0"),n=parseInt(o[3]).toString(16).padStart(2,"0");return (e+t+n).toUpperCase()}return null}function h(i){let o=window.getComputedStyle(i),e={};(o.fontWeight==="bold"||parseInt(o.fontWeight)>=700)&&(e.bold=true),o.fontStyle==="italic"&&(e.italic=true);let t=o.textDecoration||o.textDecorationLine;t&&t.includes("underline")&&(e.underline={style:"single"}),t&&t.includes("line-through")&&(e.strike=true);let n=parseFloat(o.fontSize);!isNaN(n)&&n>0&&(e.fontSize=Math.round(n/1.333*2));let r=o.fontFamily.replace(/["']/g,"").split(",")[0].trim();r&&(e.fontFamily={ascii:r});let s=o.color;if(s&&s!=="rgb(0, 0, 0)"){let c=L(s);c&&(e.color={rgb:c});}let l=o.backgroundColor;if(l&&l!=="transparent"&&l!=="rgba(0, 0, 0, 0)"){let c=S(l);c&&(e.shading={fill:{rgb:c}});}return Object.keys(e).length>0?e:void 0}function zt(i,o){let e=document.createRange();e.selectNodeContents(i);let t=o.compareBoundaryPoints(Range.START_TO_START,e)>=0&&o.compareBoundaryPoints(Range.START_TO_END,e)<=0,n=o.compareBoundaryPoints(Range.END_TO_START,e)>=0&&o.compareBoundaryPoints(Range.END_TO_END,e)<=0;if(t&&n)return o.toString();if(t){let r=document.createRange();return r.setStart(o.startContainer,o.startOffset),r.selectNodeContents(i),r.setEnd(e.endContainer,e.endOffset),r.toString()}else if(n){let r=document.createRange();return r.selectNodeContents(i),r.setEnd(o.endContainer,o.endOffset),r.setStart(e.startContainer,e.startOffset),r.toString()}else if(o.intersectsNode(i))return i.textContent||"";return ""}function F(i){let o=i;for(;o;){if(o.nodeType===Node.ELEMENT_NODE){let e=o;if(e.hasAttribute("data-paragraph-index"))return e}o=o.parentNode;}return null}function f(){let i=window.getSelection();if(!i||i.isCollapsed)return [];let o=[],e=i.getRangeAt(0),t=e.commonAncestorContainer,n=t.nodeType===Node.ELEMENT_NODE?t:t.parentElement;if(!n)return o;if(n.querySelectorAll(".docx-run").forEach(s=>{if(e.intersectsNode(s)){let l=zt(s,e);if(l){let c=h(s);o.push({type:"run",formatting:c,content:[{type:"text",text:l}]});}}}),o.length===0){let s=i.toString();s&&o.push({type:"run",content:[{type:"text",text:s}]});}return o}function A(){let i=window.getSelection();if(!i||i.isCollapsed)return null;let o=f();if(o.length===0)return null;let e=i.toString(),t=i.getRangeAt(0),n=F(t.startContainer),r=F(t.endContainer),s=n?parseInt(n.getAttribute("data-paragraph-index")||"0",10):0,l=r?parseInt(r.getAttribute("data-paragraph-index")||"0",10):0;return {text:e,runs:o,startParagraphIndex:s,startRunIndex:0,startOffset:t.startOffset,endParagraphIndex:l,endRunIndex:0,endOffset:t.endOffset,isMultiParagraph:s!==l}}var S=L;var d=class extends chunkY74ANBPV_js.a{constructor(){super({notifications:[]});chunkDC7S76ZX_js.a(this,"notifications",[]);chunkDC7S76ZX_js.a(this,"idCounter",0);chunkDC7S76ZX_js.a(this,"timers",new Set);}showError(e,t){return this.addNotification(e,"error",t)}showWarning(e,t){return this.addNotification(e,"warning",t)}showInfo(e,t){return this.addNotification(e,"info",t)}dismiss(e){this.notifications=this.notifications.map(n=>n.id===e?{...n,dismissed:true}:n),this.emitSnapshot();let t=setTimeout(()=>{this.timers.delete(t),this.notifications=this.notifications.filter(n=>n.id!==e),this.emitSnapshot();},300);this.timers.add(t);}clearAll(){this.notifications=[];for(let e of this.timers)clearTimeout(e);this.timers.clear(),this.emitSnapshot();}destroy(){for(let e of this.timers)clearTimeout(e);this.timers.clear(),this.notifications=[];}addNotification(e,t,n){let r=`error-${++this.idCounter}-${Date.now()}`,s={id:r,message:e,severity:t,details:n,timestamp:Date.now()};if(this.notifications=[...this.notifications,s],this.emitSnapshot(),t!=="error"){let l=setTimeout(()=>{this.timers.delete(l),this.dismiss(r);},5e3);this.timers.add(l);}return r}emitSnapshot(){this.setSnapshot({notifications:this.notifications});}};function z(i,o){let e=`plugin-styles-${i}`,t=document.getElementById(e);t&&t.remove();let n=document.createElement("style");return n.id=e,n.textContent=o,document.head.appendChild(n),()=>{let r=document.getElementById(e);r&&r.remove();}}var u=class extends chunkY74ANBPV_js.a{constructor(){super({states:new Map,version:0});chunkDC7S76ZX_js.a(this,"plugins",[]);chunkDC7S76ZX_js.a(this,"pluginStates",new Map);chunkDC7S76ZX_js.a(this,"version",0);}initialize(e,t){this.destroyPlugins(),this.plugins=e;for(let n of e)n.initialize&&!this.pluginStates.has(n.id)&&this.pluginStates.set(n.id,n.initialize(t));this.emitSnapshot();}updateStates(e){let t=false;for(let n of this.plugins)if(n.onStateChange){let r=n.onStateChange(e);r!==void 0&&(this.pluginStates.set(n.id,r),t=true);}return t&&(this.version++,this.emitSnapshot()),t}getPluginState(e){return this.pluginStates.get(e)}setPluginState(e,t){this.pluginStates.set(e,t),this.version++,this.emitSnapshot();}destroy(){this.destroyPlugins(),this.emitSnapshot();}destroyPlugins(){for(let e of this.plugins)e.destroy&&e.destroy();this.pluginStates.clear(),this.plugins=[];}emitSnapshot(){this.setSnapshot({states:new Map(this.pluginStates),version:this.version});}};var p=class extends chunkY74ANBPV_js.a{constructor(){super({hasLayout:false,selectionRects:[],caretPosition:null,selectedImageInfo:null,isFocused:false,isDragging:false,isResizingColumn:false,isImageInteracting:false,version:0});chunkDC7S76ZX_js.a(this,"_hasLayout",false);chunkDC7S76ZX_js.a(this,"_selectionRects",[]);chunkDC7S76ZX_js.a(this,"_caretPosition",null);chunkDC7S76ZX_js.a(this,"_isDragging",false);chunkDC7S76ZX_js.a(this,"_dragAnchor",null);chunkDC7S76ZX_js.a(this,"_columnResize",{isResizing:false,startX:0,columnIndex:0,tablePmStart:0,originalWidths:{left:0,right:0}});chunkDC7S76ZX_js.a(this,"_selectedImageInfo",null);chunkDC7S76ZX_js.a(this,"_isImageInteracting",false);chunkDC7S76ZX_js.a(this,"_isFocused",false);chunkDC7S76ZX_js.a(this,"_version",0);}setLayoutReady(e){this._hasLayout=e,this.emitSnapshot();}updateSelection(e,t){this._selectionRects=e,this._caretPosition=t,this.emitSnapshot();}startDrag(e){this._isDragging=true,this._dragAnchor=e,this.emitSnapshot();}endDrag(){this._isDragging=false,this._dragAnchor=null,this.emitSnapshot();}getDragAnchor(){return this._dragAnchor}startColumnResize(e,t,n,r){this._columnResize={isResizing:true,startX:n,columnIndex:t,tablePmStart:e,originalWidths:r},this.emitSnapshot();}endColumnResize(){this._columnResize={...this._columnResize,isResizing:false},this.emitSnapshot();}getColumnResize(){return this._columnResize}setSelectedImage(e){this._selectedImageInfo=e,this.emitSnapshot();}clearSelectedImage(){this._selectedImageInfo=null,this._isImageInteracting=false,this.emitSnapshot();}setImageInteracting(e){this._isImageInteracting=e,this.emitSnapshot();}setFocused(e){this._isFocused=e,this.emitSnapshot();}emitSnapshot(){this._version++,this.setSnapshot({hasLayout:this._hasLayout,selectionRects:this._selectionRects,caretPosition:this._caretPosition,selectedImageInfo:this._selectedImageInfo,isFocused:this._isFocused,isDragging:this._isDragging,isResizingColumn:this._columnResize.isResizing,isImageInteracting:this._isImageInteracting,version:this._version});}};var g=class extends chunkY74ANBPV_js.a{constructor(e={}){let t=e.initialZoom??1;super({loadingState:"idle",parseError:null,isReady:false,zoom:t,fontsLoaded:false,version:0});chunkDC7S76ZX_js.a(this,"_loadingState","idle");chunkDC7S76ZX_js.a(this,"_parseError",null);chunkDC7S76ZX_js.a(this,"_zoom");chunkDC7S76ZX_js.a(this,"_fontsLoaded",false);chunkDC7S76ZX_js.a(this,"_document",null);chunkDC7S76ZX_js.a(this,"_version",0);chunkDC7S76ZX_js.a(this,"onChangeCallback");chunkDC7S76ZX_js.a(this,"onErrorCallback");this._zoom=t,this.onChangeCallback=e.onChange,this.onErrorCallback=e.onError;}setParsingStarted(){this._loadingState="parsing",this._parseError=null,this.emitSnapshot();}setDocumentLoaded(e){this._document=e,this._loadingState="loading-fonts",this._parseError=null,this.emitSnapshot();}setFontsLoaded(){this._fontsLoaded=true,this._loadingState="ready",this.emitSnapshot();}setLoadError(e){this._loadingState="error",this._parseError=e.message,this.onErrorCallback?.(e),this.emitSnapshot();}getDocument(){return this._document}updateDocument(e){this._document=e,this.onChangeCallback?.(e),this.emitSnapshot();}setZoom(e){this._zoom=Math.max(.25,Math.min(4,e)),this.emitSnapshot();}getZoom(){return this._zoom}emitSnapshot(){this._version++,this.setSnapshot({loadingState:this._loadingState,parseError:this._parseError,isReady:this._loadingState==="ready",zoom:this._zoom,fontsLoaded:this._fontsLoaded,version:this._version});}};var no="0.0.2";Object.defineProperty(exports,"AutoSaveManager",{enumerable:true,get:function(){return chunkTE2VQJZG_js.a}});Object.defineProperty(exports,"formatLastSaveTime",{enumerable:true,get:function(){return chunkTE2VQJZG_js.b}});Object.defineProperty(exports,"formatStorageSize",{enumerable:true,get:function(){return chunkTE2VQJZG_js.e}});Object.defineProperty(exports,"getAutoSaveStatusLabel",{enumerable:true,get:function(){return chunkTE2VQJZG_js.c}});Object.defineProperty(exports,"getAutoSaveStorageSize",{enumerable:true,get:function(){return chunkTE2VQJZG_js.d}});Object.defineProperty(exports,"isAutoSaveSupported",{enumerable:true,get:function(){return chunkTE2VQJZG_js.f}});Object.defineProperty(exports,"TABLE_DATA_ATTRIBUTES",{enumerable:true,get:function(){return chunk4G6AJ4ZM_js.a}});Object.defineProperty(exports,"TableSelectionManager",{enumerable:true,get:function(){return chunk4G6AJ4ZM_js.f}});Object.defineProperty(exports,"deleteTableFromDocument",{enumerable:true,get:function(){return chunk4G6AJ4ZM_js.e}});Object.defineProperty(exports,"findTableFromClick",{enumerable:true,get:function(){return chunk4G6AJ4ZM_js.b}});Object.defineProperty(exports,"getTableFromDocument",{enumerable:true,get:function(){return chunk4G6AJ4ZM_js.c}});Object.defineProperty(exports,"updateTableInDocument",{enumerable:true,get:function(){return chunk4G6AJ4ZM_js.d}});Object.defineProperty(exports,"Subscribable",{enumerable:true,get:function(){return chunkY74ANBPV_js.a}});Object.defineProperty(exports,"convertHeaderFooterToContent",{enumerable:true,get:function(){return chunkWTIN6QHX_js.A}});Object.defineProperty(exports,"FOOTNOTE_SEPARATOR_HEIGHT",{enumerable:true,get:function(){return chunkTT3ILFZC_js.a}});Object.defineProperty(exports,"MAX_FOOTNOTE_LAYOUT_PASSES",{enumerable:true,get:function(){return chunkTT3ILFZC_js.b}});Object.defineProperty(exports,"buildFootnoteContentMap",{enumerable:true,get:function(){return chunkTT3ILFZC_js.h}});Object.defineProperty(exports,"buildFootnoteRenderItems",{enumerable:true,get:function(){return chunkTT3ILFZC_js.k}});Object.defineProperty(exports,"calculateFootnoteReservedHeights",{enumerable:true,get:function(){return chunkTT3ILFZC_js.i}});Object.defineProperty(exports,"collectFootnoteRefs",{enumerable:true,get:function(){return chunkTT3ILFZC_js.d}});Object.defineProperty(exports,"footnoteReservedHeightsEqual",{enumerable:true,get:function(){return chunkTT3ILFZC_js.c}});Object.defineProperty(exports,"mapFootnotesToPages",{enumerable:true,get:function(){return chunkTT3ILFZC_js.e}});Object.defineProperty(exports,"stabilizeFootnoteLayout",{enumerable:true,get:function(){return chunkTT3ILFZC_js.j}});Object.defineProperty(exports,"countPageBreaks",{enumerable:true,get:function(){return chunkKESNGXGO_js.n}});Object.defineProperty(exports,"createColumnBreak",{enumerable:true,get:function(){return chunkKESNGXGO_js.b}});Object.defineProperty(exports,"createHorizontalRule",{enumerable:true,get:function(){return chunkKESNGXGO_js.g}});Object.defineProperty(exports,"createLineBreak",{enumerable:true,get:function(){return chunkKESNGXGO_js.c}});Object.defineProperty(exports,"createPageBreak",{enumerable:true,get:function(){return chunkKESNGXGO_js.a}});Object.defineProperty(exports,"createPageBreakParagraph",{enumerable:true,get:function(){return chunkKESNGXGO_js.e}});Object.defineProperty(exports,"createPageBreakRun",{enumerable:true,get:function(){return chunkKESNGXGO_js.d}});Object.defineProperty(exports,"findPageBreaks",{enumerable:true,get:function(){return chunkKESNGXGO_js.o}});Object.defineProperty(exports,"hasPageBreakBefore",{enumerable:true,get:function(){return chunkKESNGXGO_js.m}});Object.defineProperty(exports,"insertHorizontalRule",{enumerable:true,get:function(){return chunkKESNGXGO_js.h}});Object.defineProperty(exports,"insertPageBreak",{enumerable:true,get:function(){return chunkKESNGXGO_js.f}});Object.defineProperty(exports,"isBreakContent",{enumerable:true,get:function(){return chunkKESNGXGO_js.l}});Object.defineProperty(exports,"isColumnBreak",{enumerable:true,get:function(){return chunkKESNGXGO_js.j}});Object.defineProperty(exports,"isLineBreak",{enumerable:true,get:function(){return chunkKESNGXGO_js.k}});Object.defineProperty(exports,"isPageBreak",{enumerable:true,get:function(){return chunkKESNGXGO_js.i}});Object.defineProperty(exports,"removePageBreak",{enumerable:true,get:function(){return chunkKESNGXGO_js.p}});Object.defineProperty(exports,"DocumentAgent",{enumerable:true,get:function(){return chunkK7NSOCSY_js.a}});Object.defineProperty(exports,"buildExtendedSelectionContext",{enumerable:true,get:function(){return chunkK7NSOCSY_js.h}});Object.defineProperty(exports,"buildSelectionContext",{enumerable:true,get:function(){return chunkK7NSOCSY_js.g}});Object.defineProperty(exports,"getAgentContext",{enumerable:true,get:function(){return chunkK7NSOCSY_js.d}});Object.defineProperty(exports,"getDocumentSummary",{enumerable:true,get:function(){return chunkK7NSOCSY_js.f}});Object.defineProperty(exports,"attemptSelectiveSave",{enumerable:true,get:function(){return chunkGFM6PERG_js.c}});Object.defineProperty(exports,"buildPatchedDocumentXml",{enumerable:true,get:function(){return chunkGFM6PERG_js.b}});Object.defineProperty(exports,"validatePatchSafety",{enumerable:true,get:function(){return chunkGFM6PERG_js.a}});Object.defineProperty(exports,"createDocumentWithText",{enumerable:true,get:function(){return chunkNXLJVVVE_js.b}});Object.defineProperty(exports,"createEmptyDocument",{enumerable:true,get:function(){return chunkNXLJVVVE_js.a}});Object.defineProperty(exports,"docxtemplaterPlugin",{enumerable:true,get:function(){return chunkKEDY4GFG_js.b}});Object.defineProperty(exports,"detectVariables",{enumerable:true,get:function(){return chunkU4UCHBZ7_js.a}});Object.defineProperty(exports,"detectVariablesDetailed",{enumerable:true,get:function(){return chunkU4UCHBZ7_js.b}});Object.defineProperty(exports,"detectVariablesInBody",{enumerable:true,get:function(){return chunkU4UCHBZ7_js.c}});Object.defineProperty(exports,"detectVariablesInParagraph",{enumerable:true,get:function(){return chunkU4UCHBZ7_js.d}});Object.defineProperty(exports,"documentHasVariables",{enumerable:true,get:function(){return chunkU4UCHBZ7_js.m}});Object.defineProperty(exports,"extractVariablesFromText",{enumerable:true,get:function(){return chunkU4UCHBZ7_js.e}});Object.defineProperty(exports,"formatVariable",{enumerable:true,get:function(){return chunkU4UCHBZ7_js.i}});Object.defineProperty(exports,"hasTemplateVariables",{enumerable:true,get:function(){return chunkU4UCHBZ7_js.f}});Object.defineProperty(exports,"isValidVariableName",{enumerable:true,get:function(){return chunkU4UCHBZ7_js.g}});Object.defineProperty(exports,"parseVariable",{enumerable:true,get:function(){return chunkU4UCHBZ7_js.j}});Object.defineProperty(exports,"removeVariables",{enumerable:true,get:function(){return chunkU4UCHBZ7_js.l}});Object.defineProperty(exports,"replaceVariables",{enumerable:true,get:function(){return chunkU4UCHBZ7_js.k}});Object.defineProperty(exports,"sanitizeVariableName",{enumerable:true,get:function(){return chunkU4UCHBZ7_js.h}});Object.defineProperty(exports,"getTemplateTags",{enumerable:true,get:function(){return chunkESI4BSBF_js.e}});Object.defineProperty(exports,"processTemplate",{enumerable:true,get:function(){return chunkESI4BSBF_js.a}});Object.defineProperty(exports,"processTemplateAsBlob",{enumerable:true,get:function(){return chunkESI4BSBF_js.c}});Object.defineProperty(exports,"processTemplateDetailed",{enumerable:true,get:function(){return chunkESI4BSBF_js.b}});Object.defineProperty(exports,"validateTemplate",{enumerable:true,get:function(){return chunkESI4BSBF_js.f}});Object.defineProperty(exports,"executeCommand",{enumerable:true,get:function(){return chunkFETIBXTH_js.a}});Object.defineProperty(exports,"executeCommands",{enumerable:true,get:function(){return chunkFETIBXTH_js.b}});Object.defineProperty(exports,"createDocx",{enumerable:true,get:function(){return chunkJQUIUKRO_js.t}});Object.defineProperty(exports,"repackDocx",{enumerable:true,get:function(){return chunkJQUIUKRO_js.i}});Object.defineProperty(exports,"updateMultipleFiles",{enumerable:true,get:function(){return chunkJQUIUKRO_js.m}});Object.defineProperty(exports,"serializeDocumentBody",{enumerable:true,get:function(){return chunk4JPHW7ZI_js.g}});Object.defineProperty(exports,"serializeDocx",{enumerable:true,get:function(){return chunk4JPHW7ZI_js.h}});Object.defineProperty(exports,"serializeSectionProperties",{enumerable:true,get:function(){return chunk4JPHW7ZI_js.c}});Object.defineProperty(exports,"PluginRegistry",{enumerable:true,get:function(){return chunk4BFNWPKW_js.a}});Object.defineProperty(exports,"pluginRegistry",{enumerable:true,get:function(){return chunk4BFNWPKW_js.b}});Object.defineProperty(exports,"registerPlugins",{enumerable:true,get:function(){return chunk4BFNWPKW_js.c}});Object.defineProperty(exports,"parseDocx",{enumerable:true,get:function(){return chunkWVY2UXAK_js.a}});Object.defineProperty(exports,"canRenderFont",{enumerable:true,get:function(){return chunkQVRMX2AC_js.j}});Object.defineProperty(exports,"getLoadedFonts",{enumerable:true,get:function(){return chunkQVRMX2AC_js.g}});Object.defineProperty(exports,"isFontLoaded",{enumerable:true,get:function(){return chunkQVRMX2AC_js.c}});Object.defineProperty(exports,"isFontsLoading",{enumerable:true,get:function(){return chunkQVRMX2AC_js.f}});Object.defineProperty(exports,"isGoogleFontsEnabled",{enumerable:true,get:function(){return chunkQVRMX2AC_js.e}});Object.defineProperty(exports,"loadFont",{enumerable:true,get:function(){return chunkQVRMX2AC_js.a}});Object.defineProperty(exports,"loadFontFromBuffer",{enumerable:true,get:function(){return chunkQVRMX2AC_js.k}});Object.defineProperty(exports,"loadFonts",{enumerable:true,get:function(){return chunkQVRMX2AC_js.b}});Object.defineProperty(exports,"onFontsLoaded",{enumerable:true,get:function(){return chunkQVRMX2AC_js.h}});Object.defineProperty(exports,"preloadCommonFonts",{enumerable:true,get:function(){return chunkQVRMX2AC_js.r}});Object.defineProperty(exports,"setGoogleFontsEnabled",{enumerable:true,get:function(){return chunkQVRMX2AC_js.d}});Object.defineProperty(exports,"toArrayBuffer",{enumerable:true,get:function(){return chunkQVRMX2AC_js.u}});Object.defineProperty(exports,"findParagraphByParaId",{enumerable:true,get:function(){return chunkI6PMX4BO_js.b}});Object.defineProperty(exports,"findStartPosForParaId",{enumerable:true,get:function(){return chunkI6PMX4BO_js.a}});Object.defineProperty(exports,"blendColors",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.m}});Object.defineProperty(exports,"colorsEqual",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.r}});Object.defineProperty(exports,"createRgbColor",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.j}});Object.defineProperty(exports,"createThemeColor",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.i}});Object.defineProperty(exports,"darkenColor",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.k}});Object.defineProperty(exports,"ensureHexPrefix",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.n}});Object.defineProperty(exports,"generateThemeTintShadeMatrix",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.q}});Object.defineProperty(exports,"getContrastingColor",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.g}});Object.defineProperty(exports,"getThemeTintShadeHex",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.p}});Object.defineProperty(exports,"isBlack",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.e}});Object.defineProperty(exports,"isWhite",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.f}});Object.defineProperty(exports,"lightenColor",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.l}});Object.defineProperty(exports,"parseColorString",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.h}});Object.defineProperty(exports,"resolveColor",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.a}});Object.defineProperty(exports,"resolveHighlightColor",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.c}});Object.defineProperty(exports,"resolveHighlightToCss",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.o}});Object.defineProperty(exports,"resolveShadingColor",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.d}});Object.defineProperty(exports,"emuToPixels",{enumerable:true,get:function(){return chunkBJSG6TEG_js.f}});Object.defineProperty(exports,"emuToTwips",{enumerable:true,get:function(){return chunkBJSG6TEG_js.h}});Object.defineProperty(exports,"formatPx",{enumerable:true,get:function(){return chunkBJSG6TEG_js.q}});Object.defineProperty(exports,"halfPointsToPixels",{enumerable:true,get:function(){return chunkBJSG6TEG_js.k}});Object.defineProperty(exports,"pixelsToEmu",{enumerable:true,get:function(){return chunkBJSG6TEG_js.g}});Object.defineProperty(exports,"pixelsToTwips",{enumerable:true,get:function(){return chunkBJSG6TEG_js.e}});Object.defineProperty(exports,"pointsToPixels",{enumerable:true,get:function(){return chunkBJSG6TEG_js.j}});Object.defineProperty(exports,"twipsToEmu",{enumerable:true,get:function(){return chunkBJSG6TEG_js.i}});Object.defineProperty(exports,"twipsToPixels",{enumerable:true,get:function(){return chunkBJSG6TEG_js.d}});exports.EditorCoordinator=g;exports.ErrorManager=d;exports.LayoutCoordinator=p;exports.PluginLifecycleManager=u;exports.VERSION=no;exports.createSelectionFromDOM=A;exports.extractFormattingFromElement=h;exports.getSelectionRuns=f;exports.injectStyles=z;exports.rgbToHex=S;
|
|
1
|
+
'use strict';var chunkTE2VQJZG_js=require('./chunk-TE2VQJZG.js'),chunk4G6AJ4ZM_js=require('./chunk-4G6AJ4ZM.js'),chunkY74ANBPV_js=require('./chunk-Y74ANBPV.js'),chunk5CLYWBNI_js=require('./chunk-5CLYWBNI.js');require('./chunk-5ZAMEYCA.js');var chunkOTXLG6KM_js=require('./chunk-OTXLG6KM.js');require('./chunk-5TLT5TUD.js'),require('./chunk-MWOHCSZE.js'),require('./chunk-YUHOVME2.js'),require('./chunk-XCTYXYEU.js'),require('./chunk-IMKU4O3P.js'),require('./chunk-DROCYKAR.js');var chunkKESNGXGO_js=require('./chunk-KESNGXGO.js'),chunkXRJFWDCV_js=require('./chunk-XRJFWDCV.js'),chunkCMZXBKDH_js=require('./chunk-CMZXBKDH.js'),chunkNXLJVVVE_js=require('./chunk-NXLJVVVE.js'),chunkSSL74NAS_js=require('./chunk-SSL74NAS.js'),chunkU4UCHBZ7_js=require('./chunk-U4UCHBZ7.js'),chunkESI4BSBF_js=require('./chunk-ESI4BSBF.js'),chunkQI6JDDGO_js=require('./chunk-QI6JDDGO.js'),chunk2EFI3BAN_js=require('./chunk-2EFI3BAN.js'),chunk4EATD3FP_js=require('./chunk-4EATD3FP.js');require('./chunk-WA4IJOGH.js');var chunk4BFNWPKW_js=require('./chunk-4BFNWPKW.js'),chunkDPMR7U7D_js=require('./chunk-DPMR7U7D.js');require('./chunk-LZTEPSU2.js'),require('./chunk-FIGLFSNR.js');var chunkQVRMX2AC_js=require('./chunk-QVRMX2AC.js'),chunkI6PMX4BO_js=require('./chunk-I6PMX4BO.js');require('./chunk-2AEZLDY4.js'),require('./chunk-PGWY6UFK.js'),require('./chunk-ISKTBM4L.js'),require('./chunk-JFZIXFRC.js'),require('./chunk-RQVHKDXK.js'),require('./chunk-LW5OFHSW.js'),require('./chunk-Z3LGMBJC.js'),require('./chunk-ZCYUN3EC.js'),require('./chunk-R5DGXEWJ.js'),require('./chunk-Q2VALXEU.js'),require('./chunk-MZ7LW5CH.js'),require('./chunk-N3Y5BUKV.js'),require('./chunk-ILPNMG7Q.js'),require('./chunk-6LVPRTB6.js'),require('./chunk-LWH66Q7Q.js'),require('./chunk-X6AICTHN.js'),require('./chunk-7HANRHHL.js');var chunkMJ5FQX7Q_js=require('./chunk-MJ5FQX7Q.js');require('./chunk-B3SVS2AF.js');var chunkBJSG6TEG_js=require('./chunk-BJSG6TEG.js');require('./chunk-GSKMHXHG.js'),require('./chunk-H57LNDBH.js'),require('./chunk-3R7QHNI5.js');var chunkDC7S76ZX_js=require('./chunk-DC7S76ZX.js');function L(i){if(!i||i==="transparent"||i==="inherit")return null;if(i.startsWith("#"))return i.slice(1).toUpperCase();let o=i.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/);if(o){let e=parseInt(o[1]).toString(16).padStart(2,"0"),t=parseInt(o[2]).toString(16).padStart(2,"0"),n=parseInt(o[3]).toString(16).padStart(2,"0");return (e+t+n).toUpperCase()}return null}function h(i){let o=window.getComputedStyle(i),e={};(o.fontWeight==="bold"||parseInt(o.fontWeight)>=700)&&(e.bold=true),o.fontStyle==="italic"&&(e.italic=true);let t=o.textDecoration||o.textDecorationLine;t&&t.includes("underline")&&(e.underline={style:"single"}),t&&t.includes("line-through")&&(e.strike=true);let n=parseFloat(o.fontSize);!isNaN(n)&&n>0&&(e.fontSize=Math.round(n/1.333*2));let r=o.fontFamily.replace(/["']/g,"").split(",")[0].trim();r&&(e.fontFamily={ascii:r});let s=o.color;if(s&&s!=="rgb(0, 0, 0)"){let c=L(s);c&&(e.color={rgb:c});}let l=o.backgroundColor;if(l&&l!=="transparent"&&l!=="rgba(0, 0, 0, 0)"){let c=S(l);c&&(e.shading={fill:{rgb:c}});}return Object.keys(e).length>0?e:void 0}function zt(i,o){let e=document.createRange();e.selectNodeContents(i);let t=o.compareBoundaryPoints(Range.START_TO_START,e)>=0&&o.compareBoundaryPoints(Range.START_TO_END,e)<=0,n=o.compareBoundaryPoints(Range.END_TO_START,e)>=0&&o.compareBoundaryPoints(Range.END_TO_END,e)<=0;if(t&&n)return o.toString();if(t){let r=document.createRange();return r.setStart(o.startContainer,o.startOffset),r.selectNodeContents(i),r.setEnd(e.endContainer,e.endOffset),r.toString()}else if(n){let r=document.createRange();return r.selectNodeContents(i),r.setEnd(o.endContainer,o.endOffset),r.setStart(e.startContainer,e.startOffset),r.toString()}else if(o.intersectsNode(i))return i.textContent||"";return ""}function F(i){let o=i;for(;o;){if(o.nodeType===Node.ELEMENT_NODE){let e=o;if(e.hasAttribute("data-paragraph-index"))return e}o=o.parentNode;}return null}function f(){let i=window.getSelection();if(!i||i.isCollapsed)return [];let o=[],e=i.getRangeAt(0),t=e.commonAncestorContainer,n=t.nodeType===Node.ELEMENT_NODE?t:t.parentElement;if(!n)return o;if(n.querySelectorAll(".docx-run").forEach(s=>{if(e.intersectsNode(s)){let l=zt(s,e);if(l){let c=h(s);o.push({type:"run",formatting:c,content:[{type:"text",text:l}]});}}}),o.length===0){let s=i.toString();s&&o.push({type:"run",content:[{type:"text",text:s}]});}return o}function A(){let i=window.getSelection();if(!i||i.isCollapsed)return null;let o=f();if(o.length===0)return null;let e=i.toString(),t=i.getRangeAt(0),n=F(t.startContainer),r=F(t.endContainer),s=n?parseInt(n.getAttribute("data-paragraph-index")||"0",10):0,l=r?parseInt(r.getAttribute("data-paragraph-index")||"0",10):0;return {text:e,runs:o,startParagraphIndex:s,startRunIndex:0,startOffset:t.startOffset,endParagraphIndex:l,endRunIndex:0,endOffset:t.endOffset,isMultiParagraph:s!==l}}var S=L;var d=class extends chunkY74ANBPV_js.a{constructor(){super({notifications:[]});chunkDC7S76ZX_js.a(this,"notifications",[]);chunkDC7S76ZX_js.a(this,"idCounter",0);chunkDC7S76ZX_js.a(this,"timers",new Set);}showError(e,t){return this.addNotification(e,"error",t)}showWarning(e,t){return this.addNotification(e,"warning",t)}showInfo(e,t){return this.addNotification(e,"info",t)}dismiss(e){this.notifications=this.notifications.map(n=>n.id===e?{...n,dismissed:true}:n),this.emitSnapshot();let t=setTimeout(()=>{this.timers.delete(t),this.notifications=this.notifications.filter(n=>n.id!==e),this.emitSnapshot();},300);this.timers.add(t);}clearAll(){this.notifications=[];for(let e of this.timers)clearTimeout(e);this.timers.clear(),this.emitSnapshot();}destroy(){for(let e of this.timers)clearTimeout(e);this.timers.clear(),this.notifications=[];}addNotification(e,t,n){let r=`error-${++this.idCounter}-${Date.now()}`,s={id:r,message:e,severity:t,details:n,timestamp:Date.now()};if(this.notifications=[...this.notifications,s],this.emitSnapshot(),t!=="error"){let l=setTimeout(()=>{this.timers.delete(l),this.dismiss(r);},5e3);this.timers.add(l);}return r}emitSnapshot(){this.setSnapshot({notifications:this.notifications});}};function z(i,o){let e=`plugin-styles-${i}`,t=document.getElementById(e);t&&t.remove();let n=document.createElement("style");return n.id=e,n.textContent=o,document.head.appendChild(n),()=>{let r=document.getElementById(e);r&&r.remove();}}var u=class extends chunkY74ANBPV_js.a{constructor(){super({states:new Map,version:0});chunkDC7S76ZX_js.a(this,"plugins",[]);chunkDC7S76ZX_js.a(this,"pluginStates",new Map);chunkDC7S76ZX_js.a(this,"version",0);}initialize(e,t){this.destroyPlugins(),this.plugins=e;for(let n of e)n.initialize&&!this.pluginStates.has(n.id)&&this.pluginStates.set(n.id,n.initialize(t));this.emitSnapshot();}updateStates(e){let t=false;for(let n of this.plugins)if(n.onStateChange){let r=n.onStateChange(e);r!==void 0&&(this.pluginStates.set(n.id,r),t=true);}return t&&(this.version++,this.emitSnapshot()),t}getPluginState(e){return this.pluginStates.get(e)}setPluginState(e,t){this.pluginStates.set(e,t),this.version++,this.emitSnapshot();}destroy(){this.destroyPlugins(),this.emitSnapshot();}destroyPlugins(){for(let e of this.plugins)e.destroy&&e.destroy();this.pluginStates.clear(),this.plugins=[];}emitSnapshot(){this.setSnapshot({states:new Map(this.pluginStates),version:this.version});}};var p=class extends chunkY74ANBPV_js.a{constructor(){super({hasLayout:false,selectionRects:[],caretPosition:null,selectedImageInfo:null,isFocused:false,isDragging:false,isResizingColumn:false,isImageInteracting:false,version:0});chunkDC7S76ZX_js.a(this,"_hasLayout",false);chunkDC7S76ZX_js.a(this,"_selectionRects",[]);chunkDC7S76ZX_js.a(this,"_caretPosition",null);chunkDC7S76ZX_js.a(this,"_isDragging",false);chunkDC7S76ZX_js.a(this,"_dragAnchor",null);chunkDC7S76ZX_js.a(this,"_columnResize",{isResizing:false,startX:0,columnIndex:0,tablePmStart:0,originalWidths:{left:0,right:0}});chunkDC7S76ZX_js.a(this,"_selectedImageInfo",null);chunkDC7S76ZX_js.a(this,"_isImageInteracting",false);chunkDC7S76ZX_js.a(this,"_isFocused",false);chunkDC7S76ZX_js.a(this,"_version",0);}setLayoutReady(e){this._hasLayout=e,this.emitSnapshot();}updateSelection(e,t){this._selectionRects=e,this._caretPosition=t,this.emitSnapshot();}startDrag(e){this._isDragging=true,this._dragAnchor=e,this.emitSnapshot();}endDrag(){this._isDragging=false,this._dragAnchor=null,this.emitSnapshot();}getDragAnchor(){return this._dragAnchor}startColumnResize(e,t,n,r){this._columnResize={isResizing:true,startX:n,columnIndex:t,tablePmStart:e,originalWidths:r},this.emitSnapshot();}endColumnResize(){this._columnResize={...this._columnResize,isResizing:false},this.emitSnapshot();}getColumnResize(){return this._columnResize}setSelectedImage(e){this._selectedImageInfo=e,this.emitSnapshot();}clearSelectedImage(){this._selectedImageInfo=null,this._isImageInteracting=false,this.emitSnapshot();}setImageInteracting(e){this._isImageInteracting=e,this.emitSnapshot();}setFocused(e){this._isFocused=e,this.emitSnapshot();}emitSnapshot(){this._version++,this.setSnapshot({hasLayout:this._hasLayout,selectionRects:this._selectionRects,caretPosition:this._caretPosition,selectedImageInfo:this._selectedImageInfo,isFocused:this._isFocused,isDragging:this._isDragging,isResizingColumn:this._columnResize.isResizing,isImageInteracting:this._isImageInteracting,version:this._version});}};var g=class extends chunkY74ANBPV_js.a{constructor(e={}){let t=e.initialZoom??1;super({loadingState:"idle",parseError:null,isReady:false,zoom:t,fontsLoaded:false,version:0});chunkDC7S76ZX_js.a(this,"_loadingState","idle");chunkDC7S76ZX_js.a(this,"_parseError",null);chunkDC7S76ZX_js.a(this,"_zoom");chunkDC7S76ZX_js.a(this,"_fontsLoaded",false);chunkDC7S76ZX_js.a(this,"_document",null);chunkDC7S76ZX_js.a(this,"_version",0);chunkDC7S76ZX_js.a(this,"onChangeCallback");chunkDC7S76ZX_js.a(this,"onErrorCallback");this._zoom=t,this.onChangeCallback=e.onChange,this.onErrorCallback=e.onError;}setParsingStarted(){this._loadingState="parsing",this._parseError=null,this.emitSnapshot();}setDocumentLoaded(e){this._document=e,this._loadingState="loading-fonts",this._parseError=null,this.emitSnapshot();}setFontsLoaded(){this._fontsLoaded=true,this._loadingState="ready",this.emitSnapshot();}setLoadError(e){this._loadingState="error",this._parseError=e.message,this.onErrorCallback?.(e),this.emitSnapshot();}getDocument(){return this._document}updateDocument(e){this._document=e,this.onChangeCallback?.(e),this.emitSnapshot();}setZoom(e){this._zoom=Math.max(.25,Math.min(4,e)),this.emitSnapshot();}getZoom(){return this._zoom}emitSnapshot(){this._version++,this.setSnapshot({loadingState:this._loadingState,parseError:this._parseError,isReady:this._loadingState==="ready",zoom:this._zoom,fontsLoaded:this._fontsLoaded,version:this._version});}};var no="0.0.2";Object.defineProperty(exports,"AutoSaveManager",{enumerable:true,get:function(){return chunkTE2VQJZG_js.a}});Object.defineProperty(exports,"formatLastSaveTime",{enumerable:true,get:function(){return chunkTE2VQJZG_js.b}});Object.defineProperty(exports,"formatStorageSize",{enumerable:true,get:function(){return chunkTE2VQJZG_js.e}});Object.defineProperty(exports,"getAutoSaveStatusLabel",{enumerable:true,get:function(){return chunkTE2VQJZG_js.c}});Object.defineProperty(exports,"getAutoSaveStorageSize",{enumerable:true,get:function(){return chunkTE2VQJZG_js.d}});Object.defineProperty(exports,"isAutoSaveSupported",{enumerable:true,get:function(){return chunkTE2VQJZG_js.f}});Object.defineProperty(exports,"TABLE_DATA_ATTRIBUTES",{enumerable:true,get:function(){return chunk4G6AJ4ZM_js.a}});Object.defineProperty(exports,"TableSelectionManager",{enumerable:true,get:function(){return chunk4G6AJ4ZM_js.f}});Object.defineProperty(exports,"deleteTableFromDocument",{enumerable:true,get:function(){return chunk4G6AJ4ZM_js.e}});Object.defineProperty(exports,"findTableFromClick",{enumerable:true,get:function(){return chunk4G6AJ4ZM_js.b}});Object.defineProperty(exports,"getTableFromDocument",{enumerable:true,get:function(){return chunk4G6AJ4ZM_js.c}});Object.defineProperty(exports,"updateTableInDocument",{enumerable:true,get:function(){return chunk4G6AJ4ZM_js.d}});Object.defineProperty(exports,"Subscribable",{enumerable:true,get:function(){return chunkY74ANBPV_js.a}});Object.defineProperty(exports,"convertHeaderFooterToContent",{enumerable:true,get:function(){return chunk5CLYWBNI_js.A}});Object.defineProperty(exports,"FOOTNOTE_SEPARATOR_HEIGHT",{enumerable:true,get:function(){return chunkOTXLG6KM_js.a}});Object.defineProperty(exports,"MAX_FOOTNOTE_LAYOUT_PASSES",{enumerable:true,get:function(){return chunkOTXLG6KM_js.b}});Object.defineProperty(exports,"buildFootnoteContentMap",{enumerable:true,get:function(){return chunkOTXLG6KM_js.h}});Object.defineProperty(exports,"buildFootnoteRenderItems",{enumerable:true,get:function(){return chunkOTXLG6KM_js.k}});Object.defineProperty(exports,"calculateFootnoteReservedHeights",{enumerable:true,get:function(){return chunkOTXLG6KM_js.i}});Object.defineProperty(exports,"collectFootnoteRefs",{enumerable:true,get:function(){return chunkOTXLG6KM_js.d}});Object.defineProperty(exports,"footnoteReservedHeightsEqual",{enumerable:true,get:function(){return chunkOTXLG6KM_js.c}});Object.defineProperty(exports,"mapFootnotesToPages",{enumerable:true,get:function(){return chunkOTXLG6KM_js.e}});Object.defineProperty(exports,"stabilizeFootnoteLayout",{enumerable:true,get:function(){return chunkOTXLG6KM_js.j}});Object.defineProperty(exports,"countPageBreaks",{enumerable:true,get:function(){return chunkKESNGXGO_js.n}});Object.defineProperty(exports,"createColumnBreak",{enumerable:true,get:function(){return chunkKESNGXGO_js.b}});Object.defineProperty(exports,"createHorizontalRule",{enumerable:true,get:function(){return chunkKESNGXGO_js.g}});Object.defineProperty(exports,"createLineBreak",{enumerable:true,get:function(){return chunkKESNGXGO_js.c}});Object.defineProperty(exports,"createPageBreak",{enumerable:true,get:function(){return chunkKESNGXGO_js.a}});Object.defineProperty(exports,"createPageBreakParagraph",{enumerable:true,get:function(){return chunkKESNGXGO_js.e}});Object.defineProperty(exports,"createPageBreakRun",{enumerable:true,get:function(){return chunkKESNGXGO_js.d}});Object.defineProperty(exports,"findPageBreaks",{enumerable:true,get:function(){return chunkKESNGXGO_js.o}});Object.defineProperty(exports,"hasPageBreakBefore",{enumerable:true,get:function(){return chunkKESNGXGO_js.m}});Object.defineProperty(exports,"insertHorizontalRule",{enumerable:true,get:function(){return chunkKESNGXGO_js.h}});Object.defineProperty(exports,"insertPageBreak",{enumerable:true,get:function(){return chunkKESNGXGO_js.f}});Object.defineProperty(exports,"isBreakContent",{enumerable:true,get:function(){return chunkKESNGXGO_js.l}});Object.defineProperty(exports,"isColumnBreak",{enumerable:true,get:function(){return chunkKESNGXGO_js.j}});Object.defineProperty(exports,"isLineBreak",{enumerable:true,get:function(){return chunkKESNGXGO_js.k}});Object.defineProperty(exports,"isPageBreak",{enumerable:true,get:function(){return chunkKESNGXGO_js.i}});Object.defineProperty(exports,"removePageBreak",{enumerable:true,get:function(){return chunkKESNGXGO_js.p}});Object.defineProperty(exports,"DocumentAgent",{enumerable:true,get:function(){return chunkXRJFWDCV_js.a}});Object.defineProperty(exports,"buildExtendedSelectionContext",{enumerable:true,get:function(){return chunkXRJFWDCV_js.h}});Object.defineProperty(exports,"buildSelectionContext",{enumerable:true,get:function(){return chunkXRJFWDCV_js.g}});Object.defineProperty(exports,"getAgentContext",{enumerable:true,get:function(){return chunkXRJFWDCV_js.d}});Object.defineProperty(exports,"getDocumentSummary",{enumerable:true,get:function(){return chunkXRJFWDCV_js.f}});Object.defineProperty(exports,"attemptSelectiveSave",{enumerable:true,get:function(){return chunkCMZXBKDH_js.c}});Object.defineProperty(exports,"buildPatchedDocumentXml",{enumerable:true,get:function(){return chunkCMZXBKDH_js.b}});Object.defineProperty(exports,"validatePatchSafety",{enumerable:true,get:function(){return chunkCMZXBKDH_js.a}});Object.defineProperty(exports,"createDocumentWithText",{enumerable:true,get:function(){return chunkNXLJVVVE_js.b}});Object.defineProperty(exports,"createEmptyDocument",{enumerable:true,get:function(){return chunkNXLJVVVE_js.a}});Object.defineProperty(exports,"docxtemplaterPlugin",{enumerable:true,get:function(){return chunkSSL74NAS_js.b}});Object.defineProperty(exports,"detectVariables",{enumerable:true,get:function(){return chunkU4UCHBZ7_js.a}});Object.defineProperty(exports,"detectVariablesDetailed",{enumerable:true,get:function(){return chunkU4UCHBZ7_js.b}});Object.defineProperty(exports,"detectVariablesInBody",{enumerable:true,get:function(){return chunkU4UCHBZ7_js.c}});Object.defineProperty(exports,"detectVariablesInParagraph",{enumerable:true,get:function(){return chunkU4UCHBZ7_js.d}});Object.defineProperty(exports,"documentHasVariables",{enumerable:true,get:function(){return chunkU4UCHBZ7_js.m}});Object.defineProperty(exports,"extractVariablesFromText",{enumerable:true,get:function(){return chunkU4UCHBZ7_js.e}});Object.defineProperty(exports,"formatVariable",{enumerable:true,get:function(){return chunkU4UCHBZ7_js.i}});Object.defineProperty(exports,"hasTemplateVariables",{enumerable:true,get:function(){return chunkU4UCHBZ7_js.f}});Object.defineProperty(exports,"isValidVariableName",{enumerable:true,get:function(){return chunkU4UCHBZ7_js.g}});Object.defineProperty(exports,"parseVariable",{enumerable:true,get:function(){return chunkU4UCHBZ7_js.j}});Object.defineProperty(exports,"removeVariables",{enumerable:true,get:function(){return chunkU4UCHBZ7_js.l}});Object.defineProperty(exports,"replaceVariables",{enumerable:true,get:function(){return chunkU4UCHBZ7_js.k}});Object.defineProperty(exports,"sanitizeVariableName",{enumerable:true,get:function(){return chunkU4UCHBZ7_js.h}});Object.defineProperty(exports,"getTemplateTags",{enumerable:true,get:function(){return chunkESI4BSBF_js.e}});Object.defineProperty(exports,"processTemplate",{enumerable:true,get:function(){return chunkESI4BSBF_js.a}});Object.defineProperty(exports,"processTemplateAsBlob",{enumerable:true,get:function(){return chunkESI4BSBF_js.c}});Object.defineProperty(exports,"processTemplateDetailed",{enumerable:true,get:function(){return chunkESI4BSBF_js.b}});Object.defineProperty(exports,"validateTemplate",{enumerable:true,get:function(){return chunkESI4BSBF_js.f}});Object.defineProperty(exports,"executeCommand",{enumerable:true,get:function(){return chunkQI6JDDGO_js.a}});Object.defineProperty(exports,"executeCommands",{enumerable:true,get:function(){return chunkQI6JDDGO_js.b}});Object.defineProperty(exports,"createDocx",{enumerable:true,get:function(){return chunk2EFI3BAN_js.t}});Object.defineProperty(exports,"repackDocx",{enumerable:true,get:function(){return chunk2EFI3BAN_js.i}});Object.defineProperty(exports,"updateMultipleFiles",{enumerable:true,get:function(){return chunk2EFI3BAN_js.m}});Object.defineProperty(exports,"serializeDocumentBody",{enumerable:true,get:function(){return chunk4EATD3FP_js.g}});Object.defineProperty(exports,"serializeDocx",{enumerable:true,get:function(){return chunk4EATD3FP_js.h}});Object.defineProperty(exports,"serializeSectionProperties",{enumerable:true,get:function(){return chunk4EATD3FP_js.c}});Object.defineProperty(exports,"PluginRegistry",{enumerable:true,get:function(){return chunk4BFNWPKW_js.a}});Object.defineProperty(exports,"pluginRegistry",{enumerable:true,get:function(){return chunk4BFNWPKW_js.b}});Object.defineProperty(exports,"registerPlugins",{enumerable:true,get:function(){return chunk4BFNWPKW_js.c}});Object.defineProperty(exports,"parseDocx",{enumerable:true,get:function(){return chunkDPMR7U7D_js.a}});Object.defineProperty(exports,"canRenderFont",{enumerable:true,get:function(){return chunkQVRMX2AC_js.j}});Object.defineProperty(exports,"getLoadedFonts",{enumerable:true,get:function(){return chunkQVRMX2AC_js.g}});Object.defineProperty(exports,"isFontLoaded",{enumerable:true,get:function(){return chunkQVRMX2AC_js.c}});Object.defineProperty(exports,"isFontsLoading",{enumerable:true,get:function(){return chunkQVRMX2AC_js.f}});Object.defineProperty(exports,"isGoogleFontsEnabled",{enumerable:true,get:function(){return chunkQVRMX2AC_js.e}});Object.defineProperty(exports,"loadFont",{enumerable:true,get:function(){return chunkQVRMX2AC_js.a}});Object.defineProperty(exports,"loadFontFromBuffer",{enumerable:true,get:function(){return chunkQVRMX2AC_js.k}});Object.defineProperty(exports,"loadFonts",{enumerable:true,get:function(){return chunkQVRMX2AC_js.b}});Object.defineProperty(exports,"onFontsLoaded",{enumerable:true,get:function(){return chunkQVRMX2AC_js.h}});Object.defineProperty(exports,"preloadCommonFonts",{enumerable:true,get:function(){return chunkQVRMX2AC_js.r}});Object.defineProperty(exports,"setGoogleFontsEnabled",{enumerable:true,get:function(){return chunkQVRMX2AC_js.d}});Object.defineProperty(exports,"toArrayBuffer",{enumerable:true,get:function(){return chunkQVRMX2AC_js.u}});Object.defineProperty(exports,"findParagraphByParaId",{enumerable:true,get:function(){return chunkI6PMX4BO_js.b}});Object.defineProperty(exports,"findStartPosForParaId",{enumerable:true,get:function(){return chunkI6PMX4BO_js.a}});Object.defineProperty(exports,"blendColors",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.m}});Object.defineProperty(exports,"colorsEqual",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.r}});Object.defineProperty(exports,"createRgbColor",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.j}});Object.defineProperty(exports,"createThemeColor",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.i}});Object.defineProperty(exports,"darkenColor",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.k}});Object.defineProperty(exports,"ensureHexPrefix",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.n}});Object.defineProperty(exports,"generateThemeTintShadeMatrix",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.q}});Object.defineProperty(exports,"getContrastingColor",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.g}});Object.defineProperty(exports,"getThemeTintShadeHex",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.p}});Object.defineProperty(exports,"isBlack",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.e}});Object.defineProperty(exports,"isWhite",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.f}});Object.defineProperty(exports,"lightenColor",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.l}});Object.defineProperty(exports,"parseColorString",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.h}});Object.defineProperty(exports,"resolveColor",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.a}});Object.defineProperty(exports,"resolveHighlightColor",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.c}});Object.defineProperty(exports,"resolveHighlightToCss",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.o}});Object.defineProperty(exports,"resolveShadingColor",{enumerable:true,get:function(){return chunkMJ5FQX7Q_js.d}});Object.defineProperty(exports,"emuToPixels",{enumerable:true,get:function(){return chunkBJSG6TEG_js.f}});Object.defineProperty(exports,"emuToTwips",{enumerable:true,get:function(){return chunkBJSG6TEG_js.h}});Object.defineProperty(exports,"formatPx",{enumerable:true,get:function(){return chunkBJSG6TEG_js.q}});Object.defineProperty(exports,"halfPointsToPixels",{enumerable:true,get:function(){return chunkBJSG6TEG_js.k}});Object.defineProperty(exports,"pixelsToEmu",{enumerable:true,get:function(){return chunkBJSG6TEG_js.g}});Object.defineProperty(exports,"pixelsToTwips",{enumerable:true,get:function(){return chunkBJSG6TEG_js.e}});Object.defineProperty(exports,"pointsToPixels",{enumerable:true,get:function(){return chunkBJSG6TEG_js.j}});Object.defineProperty(exports,"twipsToEmu",{enumerable:true,get:function(){return chunkBJSG6TEG_js.i}});Object.defineProperty(exports,"twipsToPixels",{enumerable:true,get:function(){return chunkBJSG6TEG_js.d}});exports.EditorCoordinator=g;exports.ErrorManager=d;exports.LayoutCoordinator=p;exports.PluginLifecycleManager=u;exports.VERSION=no;exports.createSelectionFromDOM=A;exports.extractFormattingFromElement=h;exports.getSelectionRuns=f;exports.injectStyles=z;exports.rgbToHex=S;
|
package/dist/core.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as AutoSaveManager,b as formatLastSaveTime,e as formatStorageSize,c as getAutoSaveStatusLabel,d as getAutoSaveStorageSize,f as isAutoSaveSupported}from'./chunk-6NQSIC27.mjs';export{a as TABLE_DATA_ATTRIBUTES,f as TableSelectionManager,e as deleteTableFromDocument,b as findTableFromClick,c as getTableFromDocument,d as updateTableInDocument}from'./chunk-JHZ3HLSR.mjs';import {a}from'./chunk-D6GO7UGD.mjs';export{a as Subscribable}from'./chunk-D6GO7UGD.mjs';export{A as convertHeaderFooterToContent}from'./chunk-A7C3DGQA.mjs';import'./chunk-ICNIAAH7.mjs';export{a as FOOTNOTE_SEPARATOR_HEIGHT,b as MAX_FOOTNOTE_LAYOUT_PASSES,h as buildFootnoteContentMap,k as buildFootnoteRenderItems,i as calculateFootnoteReservedHeights,d as collectFootnoteRefs,c as footnoteReservedHeightsEqual,e as mapFootnotesToPages,j as stabilizeFootnoteLayout}from'./chunk-HQ76VZAN.mjs';import'./chunk-7EU6E64E.mjs';import'./chunk-RRJKF2XI.mjs';import'./chunk-QCPISGPW.mjs';import'./chunk-VMBCUUZM.mjs';import'./chunk-FCJWLEKT.mjs';import'./chunk-7E5VBRDL.mjs';export{n as countPageBreaks,b as createColumnBreak,g as createHorizontalRule,c as createLineBreak,a as createPageBreak,e as createPageBreakParagraph,d as createPageBreakRun,o as findPageBreaks,m as hasPageBreakBefore,h as insertHorizontalRule,f as insertPageBreak,l as isBreakContent,j as isColumnBreak,k as isLineBreak,i as isPageBreak,p as removePageBreak}from'./chunk-WTFLNYAT.mjs';export{a as DocumentAgent,h as buildExtendedSelectionContext,g as buildSelectionContext,d as getAgentContext,f as getDocumentSummary}from'./chunk-OWGY46IW.mjs';export{c as attemptSelectiveSave,b as buildPatchedDocumentXml,a as validatePatchSafety}from'./chunk-QZPVZY6S.mjs';export{b as createDocumentWithText,a as createEmptyDocument}from'./chunk-CKKO4JWE.mjs';export{b as docxtemplaterPlugin}from'./chunk-YSBX4LFA.mjs';export{a as detectVariables,b as detectVariablesDetailed,c as detectVariablesInBody,d as detectVariablesInParagraph,m as documentHasVariables,e as extractVariablesFromText,i as formatVariable,f as hasTemplateVariables,g as isValidVariableName,j as parseVariable,l as removeVariables,k as replaceVariables,h as sanitizeVariableName}from'./chunk-ARHPXIBJ.mjs';export{e as getTemplateTags,a as processTemplate,c as processTemplateAsBlob,b as processTemplateDetailed,f as validateTemplate}from'./chunk-CGJ6S3AH.mjs';export{a as executeCommand,b as executeCommands}from'./chunk-B6FA4MJ5.mjs';export{t as createDocx,i as repackDocx,m as updateMultipleFiles}from'./chunk-F24WZXN4.mjs';export{g as serializeDocumentBody,h as serializeDocx,c as serializeSectionProperties}from'./chunk-2LVK7EF5.mjs';export{a as PluginRegistry,b as pluginRegistry,c as registerPlugins}from'./chunk-3NRMSZX2.mjs';export{a as parseDocx}from'./chunk-5EP47PMQ.mjs';import'./chunk-47SKD7QB.mjs';import'./chunk-MOCGHQ4A.mjs';export{j as canRenderFont,g as getLoadedFonts,c as isFontLoaded,f as isFontsLoading,e as isGoogleFontsEnabled,a as loadFont,k as loadFontFromBuffer,b as loadFonts,h as onFontsLoaded,r as preloadCommonFonts,d as setGoogleFontsEnabled,u as toArrayBuffer}from'./chunk-CDBKFBC2.mjs';export{b as findParagraphByParaId,a as findStartPosForParaId}from'./chunk-3SXJPJSV.mjs';import'./chunk-NN2EJIO7.mjs';import'./chunk-O5L4BZCZ.mjs';import'./chunk-LK6I3HMH.mjs';import'./chunk-QPFJJPIC.mjs';import'./chunk-GYWTUUXX.mjs';import'./chunk-3HLRRK6N.mjs';import'./chunk-W77JXDEV.mjs';import'./chunk-SHZOAUHB.mjs';import'./chunk-TXAB4I4M.mjs';import'./chunk-PJEB3ZWG.mjs';import'./chunk-OZMNIX6U.mjs';import'./chunk-AMENZY5F.mjs';import'./chunk-HEJJXAXN.mjs';import'./chunk-BGY3CB37.mjs';import'./chunk-2XP6GLA4.mjs';import'./chunk-NTBZRITU.mjs';import'./chunk-MJ6XZFVD.mjs';export{m as blendColors,r as colorsEqual,j as createRgbColor,i as createThemeColor,k as darkenColor,n as ensureHexPrefix,q as generateThemeTintShadeMatrix,g as getContrastingColor,p as getThemeTintShadeHex,e as isBlack,f as isWhite,l as lightenColor,h as parseColorString,a as resolveColor,c as resolveHighlightColor,o as resolveHighlightToCss,d as resolveShadingColor}from'./chunk-67LVRQIR.mjs';import'./chunk-LE67NTCN.mjs';export{f as emuToPixels,h as emuToTwips,q as formatPx,k as halfPointsToPixels,g as pixelsToEmu,e as pixelsToTwips,j as pointsToPixels,i as twipsToEmu,d as twipsToPixels}from'./chunk-KNY7SXPJ.mjs';import'./chunk-DI6CRWSW.mjs';import'./chunk-VJFIAFZ5.mjs';import'./chunk-3ANZ3252.mjs';import {a as a$1}from'./chunk-QYUPLKLP.mjs';function L(i){if(!i||i==="transparent"||i==="inherit")return null;if(i.startsWith("#"))return i.slice(1).toUpperCase();let o=i.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/);if(o){let e=parseInt(o[1]).toString(16).padStart(2,"0"),t=parseInt(o[2]).toString(16).padStart(2,"0"),n=parseInt(o[3]).toString(16).padStart(2,"0");return (e+t+n).toUpperCase()}return null}function h(i){let o=window.getComputedStyle(i),e={};(o.fontWeight==="bold"||parseInt(o.fontWeight)>=700)&&(e.bold=true),o.fontStyle==="italic"&&(e.italic=true);let t=o.textDecoration||o.textDecorationLine;t&&t.includes("underline")&&(e.underline={style:"single"}),t&&t.includes("line-through")&&(e.strike=true);let n=parseFloat(o.fontSize);!isNaN(n)&&n>0&&(e.fontSize=Math.round(n/1.333*2));let r=o.fontFamily.replace(/["']/g,"").split(",")[0].trim();r&&(e.fontFamily={ascii:r});let s=o.color;if(s&&s!=="rgb(0, 0, 0)"){let c=L(s);c&&(e.color={rgb:c});}let l=o.backgroundColor;if(l&&l!=="transparent"&&l!=="rgba(0, 0, 0, 0)"){let c=S(l);c&&(e.shading={fill:{rgb:c}});}return Object.keys(e).length>0?e:void 0}function zt(i,o){let e=document.createRange();e.selectNodeContents(i);let t=o.compareBoundaryPoints(Range.START_TO_START,e)>=0&&o.compareBoundaryPoints(Range.START_TO_END,e)<=0,n=o.compareBoundaryPoints(Range.END_TO_START,e)>=0&&o.compareBoundaryPoints(Range.END_TO_END,e)<=0;if(t&&n)return o.toString();if(t){let r=document.createRange();return r.setStart(o.startContainer,o.startOffset),r.selectNodeContents(i),r.setEnd(e.endContainer,e.endOffset),r.toString()}else if(n){let r=document.createRange();return r.selectNodeContents(i),r.setEnd(o.endContainer,o.endOffset),r.setStart(e.startContainer,e.startOffset),r.toString()}else if(o.intersectsNode(i))return i.textContent||"";return ""}function F(i){let o=i;for(;o;){if(o.nodeType===Node.ELEMENT_NODE){let e=o;if(e.hasAttribute("data-paragraph-index"))return e}o=o.parentNode;}return null}function f(){let i=window.getSelection();if(!i||i.isCollapsed)return [];let o=[],e=i.getRangeAt(0),t=e.commonAncestorContainer,n=t.nodeType===Node.ELEMENT_NODE?t:t.parentElement;if(!n)return o;if(n.querySelectorAll(".docx-run").forEach(s=>{if(e.intersectsNode(s)){let l=zt(s,e);if(l){let c=h(s);o.push({type:"run",formatting:c,content:[{type:"text",text:l}]});}}}),o.length===0){let s=i.toString();s&&o.push({type:"run",content:[{type:"text",text:s}]});}return o}function A(){let i=window.getSelection();if(!i||i.isCollapsed)return null;let o=f();if(o.length===0)return null;let e=i.toString(),t=i.getRangeAt(0),n=F(t.startContainer),r=F(t.endContainer),s=n?parseInt(n.getAttribute("data-paragraph-index")||"0",10):0,l=r?parseInt(r.getAttribute("data-paragraph-index")||"0",10):0;return {text:e,runs:o,startParagraphIndex:s,startRunIndex:0,startOffset:t.startOffset,endParagraphIndex:l,endRunIndex:0,endOffset:t.endOffset,isMultiParagraph:s!==l}}var S=L;var d=class extends a{constructor(){super({notifications:[]});a$1(this,"notifications",[]);a$1(this,"idCounter",0);a$1(this,"timers",new Set);}showError(e,t){return this.addNotification(e,"error",t)}showWarning(e,t){return this.addNotification(e,"warning",t)}showInfo(e,t){return this.addNotification(e,"info",t)}dismiss(e){this.notifications=this.notifications.map(n=>n.id===e?{...n,dismissed:true}:n),this.emitSnapshot();let t=setTimeout(()=>{this.timers.delete(t),this.notifications=this.notifications.filter(n=>n.id!==e),this.emitSnapshot();},300);this.timers.add(t);}clearAll(){this.notifications=[];for(let e of this.timers)clearTimeout(e);this.timers.clear(),this.emitSnapshot();}destroy(){for(let e of this.timers)clearTimeout(e);this.timers.clear(),this.notifications=[];}addNotification(e,t,n){let r=`error-${++this.idCounter}-${Date.now()}`,s={id:r,message:e,severity:t,details:n,timestamp:Date.now()};if(this.notifications=[...this.notifications,s],this.emitSnapshot(),t!=="error"){let l=setTimeout(()=>{this.timers.delete(l),this.dismiss(r);},5e3);this.timers.add(l);}return r}emitSnapshot(){this.setSnapshot({notifications:this.notifications});}};function z(i,o){let e=`plugin-styles-${i}`,t=document.getElementById(e);t&&t.remove();let n=document.createElement("style");return n.id=e,n.textContent=o,document.head.appendChild(n),()=>{let r=document.getElementById(e);r&&r.remove();}}var u=class extends a{constructor(){super({states:new Map,version:0});a$1(this,"plugins",[]);a$1(this,"pluginStates",new Map);a$1(this,"version",0);}initialize(e,t){this.destroyPlugins(),this.plugins=e;for(let n of e)n.initialize&&!this.pluginStates.has(n.id)&&this.pluginStates.set(n.id,n.initialize(t));this.emitSnapshot();}updateStates(e){let t=false;for(let n of this.plugins)if(n.onStateChange){let r=n.onStateChange(e);r!==void 0&&(this.pluginStates.set(n.id,r),t=true);}return t&&(this.version++,this.emitSnapshot()),t}getPluginState(e){return this.pluginStates.get(e)}setPluginState(e,t){this.pluginStates.set(e,t),this.version++,this.emitSnapshot();}destroy(){this.destroyPlugins(),this.emitSnapshot();}destroyPlugins(){for(let e of this.plugins)e.destroy&&e.destroy();this.pluginStates.clear(),this.plugins=[];}emitSnapshot(){this.setSnapshot({states:new Map(this.pluginStates),version:this.version});}};var p=class extends a{constructor(){super({hasLayout:false,selectionRects:[],caretPosition:null,selectedImageInfo:null,isFocused:false,isDragging:false,isResizingColumn:false,isImageInteracting:false,version:0});a$1(this,"_hasLayout",false);a$1(this,"_selectionRects",[]);a$1(this,"_caretPosition",null);a$1(this,"_isDragging",false);a$1(this,"_dragAnchor",null);a$1(this,"_columnResize",{isResizing:false,startX:0,columnIndex:0,tablePmStart:0,originalWidths:{left:0,right:0}});a$1(this,"_selectedImageInfo",null);a$1(this,"_isImageInteracting",false);a$1(this,"_isFocused",false);a$1(this,"_version",0);}setLayoutReady(e){this._hasLayout=e,this.emitSnapshot();}updateSelection(e,t){this._selectionRects=e,this._caretPosition=t,this.emitSnapshot();}startDrag(e){this._isDragging=true,this._dragAnchor=e,this.emitSnapshot();}endDrag(){this._isDragging=false,this._dragAnchor=null,this.emitSnapshot();}getDragAnchor(){return this._dragAnchor}startColumnResize(e,t,n,r){this._columnResize={isResizing:true,startX:n,columnIndex:t,tablePmStart:e,originalWidths:r},this.emitSnapshot();}endColumnResize(){this._columnResize={...this._columnResize,isResizing:false},this.emitSnapshot();}getColumnResize(){return this._columnResize}setSelectedImage(e){this._selectedImageInfo=e,this.emitSnapshot();}clearSelectedImage(){this._selectedImageInfo=null,this._isImageInteracting=false,this.emitSnapshot();}setImageInteracting(e){this._isImageInteracting=e,this.emitSnapshot();}setFocused(e){this._isFocused=e,this.emitSnapshot();}emitSnapshot(){this._version++,this.setSnapshot({hasLayout:this._hasLayout,selectionRects:this._selectionRects,caretPosition:this._caretPosition,selectedImageInfo:this._selectedImageInfo,isFocused:this._isFocused,isDragging:this._isDragging,isResizingColumn:this._columnResize.isResizing,isImageInteracting:this._isImageInteracting,version:this._version});}};var g=class extends a{constructor(e={}){let t=e.initialZoom??1;super({loadingState:"idle",parseError:null,isReady:false,zoom:t,fontsLoaded:false,version:0});a$1(this,"_loadingState","idle");a$1(this,"_parseError",null);a$1(this,"_zoom");a$1(this,"_fontsLoaded",false);a$1(this,"_document",null);a$1(this,"_version",0);a$1(this,"onChangeCallback");a$1(this,"onErrorCallback");this._zoom=t,this.onChangeCallback=e.onChange,this.onErrorCallback=e.onError;}setParsingStarted(){this._loadingState="parsing",this._parseError=null,this.emitSnapshot();}setDocumentLoaded(e){this._document=e,this._loadingState="loading-fonts",this._parseError=null,this.emitSnapshot();}setFontsLoaded(){this._fontsLoaded=true,this._loadingState="ready",this.emitSnapshot();}setLoadError(e){this._loadingState="error",this._parseError=e.message,this.onErrorCallback?.(e),this.emitSnapshot();}getDocument(){return this._document}updateDocument(e){this._document=e,this.onChangeCallback?.(e),this.emitSnapshot();}setZoom(e){this._zoom=Math.max(.25,Math.min(4,e)),this.emitSnapshot();}getZoom(){return this._zoom}emitSnapshot(){this._version++,this.setSnapshot({loadingState:this._loadingState,parseError:this._parseError,isReady:this._loadingState==="ready",zoom:this._zoom,fontsLoaded:this._fontsLoaded,version:this._version});}};var no="0.0.2";export{g as EditorCoordinator,d as ErrorManager,p as LayoutCoordinator,u as PluginLifecycleManager,no as VERSION,A as createSelectionFromDOM,h as extractFormattingFromElement,f as getSelectionRuns,z as injectStyles,S as rgbToHex};
|
|
1
|
+
export{a as AutoSaveManager,b as formatLastSaveTime,e as formatStorageSize,c as getAutoSaveStatusLabel,d as getAutoSaveStorageSize,f as isAutoSaveSupported}from'./chunk-6NQSIC27.mjs';export{a as TABLE_DATA_ATTRIBUTES,f as TableSelectionManager,e as deleteTableFromDocument,b as findTableFromClick,c as getTableFromDocument,d as updateTableInDocument}from'./chunk-JHZ3HLSR.mjs';import {a}from'./chunk-D6GO7UGD.mjs';export{a as Subscribable}from'./chunk-D6GO7UGD.mjs';export{A as convertHeaderFooterToContent}from'./chunk-ZW3VG4TK.mjs';import'./chunk-V4DLVFYG.mjs';export{a as FOOTNOTE_SEPARATOR_HEIGHT,b as MAX_FOOTNOTE_LAYOUT_PASSES,h as buildFootnoteContentMap,k as buildFootnoteRenderItems,i as calculateFootnoteReservedHeights,d as collectFootnoteRefs,c as footnoteReservedHeightsEqual,e as mapFootnotesToPages,j as stabilizeFootnoteLayout}from'./chunk-IJ2PPHRN.mjs';import'./chunk-6UCWVS7Y.mjs';import'./chunk-RRJKF2XI.mjs';import'./chunk-QCPISGPW.mjs';import'./chunk-VMBCUUZM.mjs';import'./chunk-FCJWLEKT.mjs';import'./chunk-7E5VBRDL.mjs';export{n as countPageBreaks,b as createColumnBreak,g as createHorizontalRule,c as createLineBreak,a as createPageBreak,e as createPageBreakParagraph,d as createPageBreakRun,o as findPageBreaks,m as hasPageBreakBefore,h as insertHorizontalRule,f as insertPageBreak,l as isBreakContent,j as isColumnBreak,k as isLineBreak,i as isPageBreak,p as removePageBreak}from'./chunk-WTFLNYAT.mjs';export{a as DocumentAgent,h as buildExtendedSelectionContext,g as buildSelectionContext,d as getAgentContext,f as getDocumentSummary}from'./chunk-AC6JHCPC.mjs';export{c as attemptSelectiveSave,b as buildPatchedDocumentXml,a as validatePatchSafety}from'./chunk-EEEED6FG.mjs';export{b as createDocumentWithText,a as createEmptyDocument}from'./chunk-CKKO4JWE.mjs';export{b as docxtemplaterPlugin}from'./chunk-7LPUPZAO.mjs';export{a as detectVariables,b as detectVariablesDetailed,c as detectVariablesInBody,d as detectVariablesInParagraph,m as documentHasVariables,e as extractVariablesFromText,i as formatVariable,f as hasTemplateVariables,g as isValidVariableName,j as parseVariable,l as removeVariables,k as replaceVariables,h as sanitizeVariableName}from'./chunk-ARHPXIBJ.mjs';export{e as getTemplateTags,a as processTemplate,c as processTemplateAsBlob,b as processTemplateDetailed,f as validateTemplate}from'./chunk-CGJ6S3AH.mjs';export{a as executeCommand,b as executeCommands}from'./chunk-IUYHWUBF.mjs';export{t as createDocx,i as repackDocx,m as updateMultipleFiles}from'./chunk-OBRTIXHC.mjs';export{g as serializeDocumentBody,h as serializeDocx,c as serializeSectionProperties}from'./chunk-25775MLP.mjs';import'./chunk-7E2TOWBX.mjs';export{a as PluginRegistry,b as pluginRegistry,c as registerPlugins}from'./chunk-3NRMSZX2.mjs';export{a as parseDocx}from'./chunk-CRQO6WI3.mjs';import'./chunk-3QQLHMB6.mjs';import'./chunk-MOCGHQ4A.mjs';export{j as canRenderFont,g as getLoadedFonts,c as isFontLoaded,f as isFontsLoading,e as isGoogleFontsEnabled,a as loadFont,k as loadFontFromBuffer,b as loadFonts,h as onFontsLoaded,r as preloadCommonFonts,d as setGoogleFontsEnabled,u as toArrayBuffer}from'./chunk-CDBKFBC2.mjs';export{b as findParagraphByParaId,a as findStartPosForParaId}from'./chunk-3SXJPJSV.mjs';import'./chunk-T5G3IWCO.mjs';import'./chunk-O5L4BZCZ.mjs';import'./chunk-LK6I3HMH.mjs';import'./chunk-QPFJJPIC.mjs';import'./chunk-GYWTUUXX.mjs';import'./chunk-3HLRRK6N.mjs';import'./chunk-W77JXDEV.mjs';import'./chunk-LMGFGJTJ.mjs';import'./chunk-NJBEJTIO.mjs';import'./chunk-PJEB3ZWG.mjs';import'./chunk-OZMNIX6U.mjs';import'./chunk-AMENZY5F.mjs';import'./chunk-HEJJXAXN.mjs';import'./chunk-BGY3CB37.mjs';import'./chunk-2XP6GLA4.mjs';import'./chunk-NTBZRITU.mjs';import'./chunk-MJ6XZFVD.mjs';export{m as blendColors,r as colorsEqual,j as createRgbColor,i as createThemeColor,k as darkenColor,n as ensureHexPrefix,q as generateThemeTintShadeMatrix,g as getContrastingColor,p as getThemeTintShadeHex,e as isBlack,f as isWhite,l as lightenColor,h as parseColorString,a as resolveColor,c as resolveHighlightColor,o as resolveHighlightToCss,d as resolveShadingColor}from'./chunk-67LVRQIR.mjs';import'./chunk-4VLKSJRK.mjs';export{f as emuToPixels,h as emuToTwips,q as formatPx,k as halfPointsToPixels,g as pixelsToEmu,e as pixelsToTwips,j as pointsToPixels,i as twipsToEmu,d as twipsToPixels}from'./chunk-KNY7SXPJ.mjs';import'./chunk-DI6CRWSW.mjs';import'./chunk-VJFIAFZ5.mjs';import'./chunk-3ANZ3252.mjs';import {a as a$1}from'./chunk-QYUPLKLP.mjs';function L(i){if(!i||i==="transparent"||i==="inherit")return null;if(i.startsWith("#"))return i.slice(1).toUpperCase();let o=i.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/);if(o){let e=parseInt(o[1]).toString(16).padStart(2,"0"),t=parseInt(o[2]).toString(16).padStart(2,"0"),n=parseInt(o[3]).toString(16).padStart(2,"0");return (e+t+n).toUpperCase()}return null}function h(i){let o=window.getComputedStyle(i),e={};(o.fontWeight==="bold"||parseInt(o.fontWeight)>=700)&&(e.bold=true),o.fontStyle==="italic"&&(e.italic=true);let t=o.textDecoration||o.textDecorationLine;t&&t.includes("underline")&&(e.underline={style:"single"}),t&&t.includes("line-through")&&(e.strike=true);let n=parseFloat(o.fontSize);!isNaN(n)&&n>0&&(e.fontSize=Math.round(n/1.333*2));let r=o.fontFamily.replace(/["']/g,"").split(",")[0].trim();r&&(e.fontFamily={ascii:r});let s=o.color;if(s&&s!=="rgb(0, 0, 0)"){let c=L(s);c&&(e.color={rgb:c});}let l=o.backgroundColor;if(l&&l!=="transparent"&&l!=="rgba(0, 0, 0, 0)"){let c=S(l);c&&(e.shading={fill:{rgb:c}});}return Object.keys(e).length>0?e:void 0}function zt(i,o){let e=document.createRange();e.selectNodeContents(i);let t=o.compareBoundaryPoints(Range.START_TO_START,e)>=0&&o.compareBoundaryPoints(Range.START_TO_END,e)<=0,n=o.compareBoundaryPoints(Range.END_TO_START,e)>=0&&o.compareBoundaryPoints(Range.END_TO_END,e)<=0;if(t&&n)return o.toString();if(t){let r=document.createRange();return r.setStart(o.startContainer,o.startOffset),r.selectNodeContents(i),r.setEnd(e.endContainer,e.endOffset),r.toString()}else if(n){let r=document.createRange();return r.selectNodeContents(i),r.setEnd(o.endContainer,o.endOffset),r.setStart(e.startContainer,e.startOffset),r.toString()}else if(o.intersectsNode(i))return i.textContent||"";return ""}function F(i){let o=i;for(;o;){if(o.nodeType===Node.ELEMENT_NODE){let e=o;if(e.hasAttribute("data-paragraph-index"))return e}o=o.parentNode;}return null}function f(){let i=window.getSelection();if(!i||i.isCollapsed)return [];let o=[],e=i.getRangeAt(0),t=e.commonAncestorContainer,n=t.nodeType===Node.ELEMENT_NODE?t:t.parentElement;if(!n)return o;if(n.querySelectorAll(".docx-run").forEach(s=>{if(e.intersectsNode(s)){let l=zt(s,e);if(l){let c=h(s);o.push({type:"run",formatting:c,content:[{type:"text",text:l}]});}}}),o.length===0){let s=i.toString();s&&o.push({type:"run",content:[{type:"text",text:s}]});}return o}function A(){let i=window.getSelection();if(!i||i.isCollapsed)return null;let o=f();if(o.length===0)return null;let e=i.toString(),t=i.getRangeAt(0),n=F(t.startContainer),r=F(t.endContainer),s=n?parseInt(n.getAttribute("data-paragraph-index")||"0",10):0,l=r?parseInt(r.getAttribute("data-paragraph-index")||"0",10):0;return {text:e,runs:o,startParagraphIndex:s,startRunIndex:0,startOffset:t.startOffset,endParagraphIndex:l,endRunIndex:0,endOffset:t.endOffset,isMultiParagraph:s!==l}}var S=L;var d=class extends a{constructor(){super({notifications:[]});a$1(this,"notifications",[]);a$1(this,"idCounter",0);a$1(this,"timers",new Set);}showError(e,t){return this.addNotification(e,"error",t)}showWarning(e,t){return this.addNotification(e,"warning",t)}showInfo(e,t){return this.addNotification(e,"info",t)}dismiss(e){this.notifications=this.notifications.map(n=>n.id===e?{...n,dismissed:true}:n),this.emitSnapshot();let t=setTimeout(()=>{this.timers.delete(t),this.notifications=this.notifications.filter(n=>n.id!==e),this.emitSnapshot();},300);this.timers.add(t);}clearAll(){this.notifications=[];for(let e of this.timers)clearTimeout(e);this.timers.clear(),this.emitSnapshot();}destroy(){for(let e of this.timers)clearTimeout(e);this.timers.clear(),this.notifications=[];}addNotification(e,t,n){let r=`error-${++this.idCounter}-${Date.now()}`,s={id:r,message:e,severity:t,details:n,timestamp:Date.now()};if(this.notifications=[...this.notifications,s],this.emitSnapshot(),t!=="error"){let l=setTimeout(()=>{this.timers.delete(l),this.dismiss(r);},5e3);this.timers.add(l);}return r}emitSnapshot(){this.setSnapshot({notifications:this.notifications});}};function z(i,o){let e=`plugin-styles-${i}`,t=document.getElementById(e);t&&t.remove();let n=document.createElement("style");return n.id=e,n.textContent=o,document.head.appendChild(n),()=>{let r=document.getElementById(e);r&&r.remove();}}var u=class extends a{constructor(){super({states:new Map,version:0});a$1(this,"plugins",[]);a$1(this,"pluginStates",new Map);a$1(this,"version",0);}initialize(e,t){this.destroyPlugins(),this.plugins=e;for(let n of e)n.initialize&&!this.pluginStates.has(n.id)&&this.pluginStates.set(n.id,n.initialize(t));this.emitSnapshot();}updateStates(e){let t=false;for(let n of this.plugins)if(n.onStateChange){let r=n.onStateChange(e);r!==void 0&&(this.pluginStates.set(n.id,r),t=true);}return t&&(this.version++,this.emitSnapshot()),t}getPluginState(e){return this.pluginStates.get(e)}setPluginState(e,t){this.pluginStates.set(e,t),this.version++,this.emitSnapshot();}destroy(){this.destroyPlugins(),this.emitSnapshot();}destroyPlugins(){for(let e of this.plugins)e.destroy&&e.destroy();this.pluginStates.clear(),this.plugins=[];}emitSnapshot(){this.setSnapshot({states:new Map(this.pluginStates),version:this.version});}};var p=class extends a{constructor(){super({hasLayout:false,selectionRects:[],caretPosition:null,selectedImageInfo:null,isFocused:false,isDragging:false,isResizingColumn:false,isImageInteracting:false,version:0});a$1(this,"_hasLayout",false);a$1(this,"_selectionRects",[]);a$1(this,"_caretPosition",null);a$1(this,"_isDragging",false);a$1(this,"_dragAnchor",null);a$1(this,"_columnResize",{isResizing:false,startX:0,columnIndex:0,tablePmStart:0,originalWidths:{left:0,right:0}});a$1(this,"_selectedImageInfo",null);a$1(this,"_isImageInteracting",false);a$1(this,"_isFocused",false);a$1(this,"_version",0);}setLayoutReady(e){this._hasLayout=e,this.emitSnapshot();}updateSelection(e,t){this._selectionRects=e,this._caretPosition=t,this.emitSnapshot();}startDrag(e){this._isDragging=true,this._dragAnchor=e,this.emitSnapshot();}endDrag(){this._isDragging=false,this._dragAnchor=null,this.emitSnapshot();}getDragAnchor(){return this._dragAnchor}startColumnResize(e,t,n,r){this._columnResize={isResizing:true,startX:n,columnIndex:t,tablePmStart:e,originalWidths:r},this.emitSnapshot();}endColumnResize(){this._columnResize={...this._columnResize,isResizing:false},this.emitSnapshot();}getColumnResize(){return this._columnResize}setSelectedImage(e){this._selectedImageInfo=e,this.emitSnapshot();}clearSelectedImage(){this._selectedImageInfo=null,this._isImageInteracting=false,this.emitSnapshot();}setImageInteracting(e){this._isImageInteracting=e,this.emitSnapshot();}setFocused(e){this._isFocused=e,this.emitSnapshot();}emitSnapshot(){this._version++,this.setSnapshot({hasLayout:this._hasLayout,selectionRects:this._selectionRects,caretPosition:this._caretPosition,selectedImageInfo:this._selectedImageInfo,isFocused:this._isFocused,isDragging:this._isDragging,isResizingColumn:this._columnResize.isResizing,isImageInteracting:this._isImageInteracting,version:this._version});}};var g=class extends a{constructor(e={}){let t=e.initialZoom??1;super({loadingState:"idle",parseError:null,isReady:false,zoom:t,fontsLoaded:false,version:0});a$1(this,"_loadingState","idle");a$1(this,"_parseError",null);a$1(this,"_zoom");a$1(this,"_fontsLoaded",false);a$1(this,"_document",null);a$1(this,"_version",0);a$1(this,"onChangeCallback");a$1(this,"onErrorCallback");this._zoom=t,this.onChangeCallback=e.onChange,this.onErrorCallback=e.onError;}setParsingStarted(){this._loadingState="parsing",this._parseError=null,this.emitSnapshot();}setDocumentLoaded(e){this._document=e,this._loadingState="loading-fonts",this._parseError=null,this.emitSnapshot();}setFontsLoaded(){this._fontsLoaded=true,this._loadingState="ready",this.emitSnapshot();}setLoadError(e){this._loadingState="error",this._parseError=e.message,this.onErrorCallback?.(e),this.emitSnapshot();}getDocument(){return this._document}updateDocument(e){this._document=e,this.onChangeCallback?.(e),this.emitSnapshot();}setZoom(e){this._zoom=Math.max(.25,Math.min(4,e)),this.emitSnapshot();}getZoom(){return this._zoom}emitSnapshot(){this._version++,this.setSnapshot({loadingState:this._loadingState,parseError:this._parseError,isReady:this._loadingState==="ready",zoom:this._zoom,fontsLoaded:this._fontsLoaded,version:this._version});}};var no="0.0.2";export{g as EditorCoordinator,d as ErrorManager,p as LayoutCoordinator,u as PluginLifecycleManager,no as VERSION,A as createSelectionFromDOM,h as extractFormattingFromElement,f as getSelectionRuns,z as injectStyles,S as rgbToHex};
|
package/dist/docx/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var chunkGFM6PERG_js=require('../chunk-GFM6PERG.js'),chunkJQUIUKRO_js=require('../chunk-JQUIUKRO.js');require('../chunk-4JPHW7ZI.js');var chunkWVY2UXAK_js=require('../chunk-WVY2UXAK.js'),chunkDFDL337G_js=require('../chunk-DFDL337G.js');require('../chunk-FIGLFSNR.js'),require('../chunk-QVRMX2AC.js');var chunkLW5OFHSW_js=require('../chunk-LW5OFHSW.js');require('../chunk-Z3LGMBJC.js'),require('../chunk-C2BAPYGJ.js');var chunkBJSG6TEG_js=require('../chunk-BJSG6TEG.js');require('../chunk-GSKMHXHG.js');var chunkH57LNDBH_js=require('../chunk-H57LNDBH.js'),chunk3R7QHNI5_js=require('../chunk-3R7QHNI5.js');require('../chunk-DC7S76ZX.js');var M=["PAGE","NUMPAGES","NUMWORDS","NUMCHARS","DATE","TIME","CREATEDATE","SAVEDATE","PRINTDATE","EDITTIME","AUTHOR","TITLE","SUBJECT","KEYWORDS","COMMENTS","FILENAME","FILESIZE","TEMPLATE","REVNUM","DOCPROPERTY","DOCVARIABLE","REF","PAGEREF","NOTEREF","HYPERLINK","TOC","TOA","INDEX","SEQ","STYLEREF","AUTONUM","AUTONUMLGL","AUTONUMOUT","SECTION","SECTIONPAGES","USERADDRESS","USERNAME","USERINITIALS","IF","MERGEFIELD","NEXT","NEXTIF","ASK","SET","QUOTE","INCLUDETEXT","INCLUDEPICTURE","SYMBOL","ADVANCE"];function I(e){if(!e)return "UNKNOWN";let n=e.trim().match(/^\\?([A-Z][A-Z0-9]*)/i);if(!n)return "UNKNOWN";let o=n[1].toUpperCase();return M.includes(o)?o:"UNKNOWN"}function ct(e){return M.includes(e)}function ut(e){let t=I(e),n=e.trim(),o=[],r=n.match(/^\\?([A-Z][A-Z0-9]*)/i),i=r?r[0].length:0,a=n.substring(i).trim(),s=/\\(\*|@|#|!|[a-z])\s*(?:"([^"]*)"|([\S]*))?/gi,l,u=[];for(;(l=s.exec(a))!==null;){let p={switch:l[1]};l[2]?p.value=l[2]:l[3]&&(p.value=l[3]),o.push(p),u.push({start:l.index,end:l.index+l[0].length});}let c;if(a.length>0){let p=u.length>0?u[0].start:a.length,m=a.substring(0,p).trim();m.startsWith('"')&&m.endsWith('"')?c=m.slice(1,-1):m&&(c=m);}return {type:t,raw:e,argument:c,switches:o}}function dt(e){return e.switches.find(n=>n.switch==="*"||n.switch==="@")?.value}function ft(e){return e.switches.find(n=>n.switch==="*")?.value?.toUpperCase()==="MERGEFORMAT"}function mt(e,t,n){let o=chunk3R7QHNI5_js.j(e,"w","instr")??"",r=I(o),i={type:"simpleField",instruction:o,fieldType:r,content:[]},a=chunk3R7QHNI5_js.j(e,"w","fldLock");(a==="1"||a==="true")&&(i.fldLock=true);let s=chunk3R7QHNI5_js.j(e,"w","dirty");(s==="1"||s==="true")&&(i.dirty=true);let l=chunk3R7QHNI5_js.f(e,"w","r");for(let u of l){let c=chunkDFDL337G_js.E(u,t,n);i.content.push(c);}return i}function ht(){return {state:"outside",instruction:"",codeRuns:[],resultRuns:[],fldLock:false,dirty:false,nestingLevel:0}}function gt(e){return e.type==="simpleField"?e.content.filter(t=>"content"in t).map(t=>U(t)).join(""):e.fieldResult.map(t=>U(t)).join("")}function U(e){return e.content.filter(t=>t.type==="text").map(t=>t.text).join("")}function Tt(e){return e.fieldType==="PAGE"}function xt(e){return e.fieldType==="NUMPAGES"}function yt(e){return ["DATE","TIME","CREATEDATE","SAVEDATE","PRINTDATE","EDITTIME"].includes(e.fieldType)}function St(e){return ["AUTHOR","TITLE","SUBJECT","KEYWORDS","COMMENTS","FILENAME","FILESIZE","TEMPLATE","REVNUM","DOCPROPERTY","DOCVARIABLE"].includes(e.fieldType)}function Ft(e){return ["REF","PAGEREF","NOTEREF"].includes(e.fieldType)}function bt(e){return ["MERGEFIELD","IF","NEXT","NEXTIF","ASK","SET"].includes(e.fieldType)}function Et(e){return ["TOC","TOA","INDEX"].includes(e.fieldType)}function H(e){if(!e)return;let t=parseInt(e,10);if(!isNaN(t))return t/6e4}function Ct(e,t){let n=chunkLW5OFHSW_js.b(e);if(n){if(n.type==="gradient"&&e){let r=chunk3R7QHNI5_js.i(e).find(i=>i.name==="a:gradFill");if(r)return wt(r)}return n}if(e){let o=chunk3R7QHNI5_js.i(e);if(o.find(a=>a.name==="a:pattFill"))return {type:"pattern"};if(o.find(a=>a.name==="a:blipFill"))return {type:"picture"}}if(t){let o=chunk3R7QHNI5_js.h(t,"a:fillRef");if(o){if(chunk3R7QHNI5_js.j(o,null,"idx")==="0")return {type:"none"};let i=chunkLW5OFHSW_js.a(o);if(i)return {type:"solid",color:i}}}}function wt(e){let t=chunk3R7QHNI5_js.i(e),n="linear",o,r=t.find(l=>l.name==="a:lin");if(r){n="linear";let l=chunk3R7QHNI5_js.j(r,null,"ang");l&&(o=parseInt(l,10)/6e4);}let i=t.find(l=>l.name==="a:path");if(i){let l=chunk3R7QHNI5_js.j(i,null,"path");l==="circle"?n="radial":l==="rect"?n="rectangular":n="path";}let a=t.find(l=>l.name==="a:gsLst"),s=[];if(a){let l=chunk3R7QHNI5_js.g(a,"gs");for(let u of l){let c=chunk3R7QHNI5_js.j(u,null,"pos"),p=c?parseInt(c,10):0,m=chunkLW5OFHSW_js.a(u);m&&s.push({position:p,color:m});}}return {type:"gradient",gradient:{type:n,angle:o,stops:s}}}function At(e,t){let n=e?chunk3R7QHNI5_js.h(e,"a:ln"):null;if(!n){if(t){let f=chunk3R7QHNI5_js.h(t,"a:lnRef");if(f){if(chunk3R7QHNI5_js.j(f,null,"idx")==="0")return;let g=chunkLW5OFHSW_js.a(f);if(g)return {color:g,width:9525}}}return}let o=chunk3R7QHNI5_js.i(n);if(o.find(f=>f.name==="a:noFill"))return;let i={},a=chunk3R7QHNI5_js.j(n,null,"w");a&&(i.width=parseInt(a,10));let s=chunk3R7QHNI5_js.j(n,null,"cap");(s==="flat"||s==="rnd"||s==="sq")&&(i.cap=s==="rnd"?"round":s==="sq"?"square":"flat");let l=o.find(f=>f.name==="a:bevel"),u=o.find(f=>f.name==="a:miter"),c=o.find(f=>f.name==="a:round");l?i.join="bevel":c?i.join="round":u&&(i.join="miter");let p=o.find(f=>f.name==="a:solidFill");p&&(i.color=chunkLW5OFHSW_js.a(p));let m=o.find(f=>f.name==="a:prstDash");if(m){let f=chunk3R7QHNI5_js.j(m,null,"val");f&&(i.style=f);}let y=o.find(f=>f.name==="a:headEnd");y&&(i.headEnd=X(y));let T=o.find(f=>f.name==="a:tailEnd");return T&&(i.tailEnd=X(T)),i}function X(e){let t=chunk3R7QHNI5_js.j(e,null,"type")??"none",n=chunk3R7QHNI5_js.j(e,null,"w"),o=chunk3R7QHNI5_js.j(e,null,"len");return {type:{none:"none",triangle:"triangle",stealth:"stealth",diamond:"diamond",oval:"oval",arrow:"arrow"}[t]??"none",width:n,length:o}}function Mt(e){if(!e)return {size:{width:0,height:0}};let t=chunk3R7QHNI5_js.h(e,"a:ext"),n=chunk3R7QHNI5_js.l(t,null,"cx")??0,o=chunk3R7QHNI5_js.l(t,null,"cy")??0,r={width:n,height:o},i=chunk3R7QHNI5_js.h(e,"a:off"),a;if(i){let m=chunk3R7QHNI5_js.l(i,null,"x")??0,y=chunk3R7QHNI5_js.l(i,null,"y")??0;a={x:m,y};}let s=chunk3R7QHNI5_js.j(e,null,"rot"),l=chunk3R7QHNI5_js.j(e,null,"flipH")==="1",u=chunk3R7QHNI5_js.j(e,null,"flipV")==="1",c=H(s),p;return (c!==void 0||l||u)&&(p={},c!==void 0&&(p.rotation=c),l&&(p.flipH=true),u&&(p.flipV=true)),{size:r,transform:p,offset:a}}function It(e){if(!e)return "rect";let t=chunk3R7QHNI5_js.h(e,"a:prstGeom");if(t){let o=chunk3R7QHNI5_js.j(t,null,"prst");if(o)return o}return chunk3R7QHNI5_js.h(e,"a:custGeom"),"rect"}function Rt(e){if(!e)return {};let t={},n=chunk3R7QHNI5_js.j(e,null,"vert");(n==="vert"||n==="vert270"||n==="wordArtVert")&&(t.vertical=true);let o=chunk3R7QHNI5_js.j(e,null,"rot");o&&(t.rotation=H(o));let r=chunk3R7QHNI5_js.j(e,null,"anchor");if(r){let m={t:"top",ctr:"middle",b:"bottom",dist:"distributed",just:"justified"};t.anchor=m[r];}chunk3R7QHNI5_js.j(e,null,"anchorCtr")==="1"&&(t.anchorCenter=true);let i=chunk3R7QHNI5_js.h(e,"a:noAutofit"),a=chunk3R7QHNI5_js.h(e,"a:normAutofit"),s=chunk3R7QHNI5_js.h(e,"a:spAutoFit");i?t.autoFit="none":a?t.autoFit="normal":s&&(t.autoFit="shape");let l=chunk3R7QHNI5_js.l(e,null,"lIns"),u=chunk3R7QHNI5_js.l(e,null,"rIns"),c=chunk3R7QHNI5_js.l(e,null,"tIns"),p=chunk3R7QHNI5_js.l(e,null,"bIns");return (l!==void 0||u!==void 0||c!==void 0||p!==void 0)&&(t.margins={left:l,right:u,top:c,bottom:p}),t}function Lt(e){if(!e)return [];let t=[],n=chunk3R7QHNI5_js.g(e,"p");for(let o of n)t.push({type:"paragraph",formatting:{},content:[]});return t}function W(e){let t=chunk3R7QHNI5_js.i(e),n=t.find(g=>g.name==="wps:cNvPr"),o=t.find(g=>g.name==="wps:spPr"),r=t.find(g=>g.name==="wps:style"),i=t.find(g=>g.name==="wps:txbx"),a=i?chunk3R7QHNI5_js.h(i,"w:txbxContent"):null,s=t.find(g=>g.name==="wps:bodyPr"),l=It(o??null),u=o?chunk3R7QHNI5_js.h(o,"a:xfrm"):null,{size:c,transform:p}=Mt(u),m=Ct(o??null,r??null),y=At(o??null,r??null),T,f;n&&(T=chunk3R7QHNI5_js.j(n,null,"id")??void 0,f=chunk3R7QHNI5_js.j(n,null,"name")??void 0);let S={type:"shape",shapeType:l,size:c};if(T&&(S.id=T),f&&(S.name=f),m&&(S.fill=m),y&&(S.outline=y),p&&(S.transform=p),a||s){let g=Rt(s??null),P=Lt(a);(P.length>0||Object.keys(g).length>0)&&(S.textBody={...g,content:P});}return S}function Dt(e){let n=chunk3R7QHNI5_js.i(e).find(c=>c.name==="wp:inline"||c.name==="wp:anchor");if(!n)return null;let o=n.name==="wp:anchor",r=chunk3R7QHNI5_js.h(n,"a:graphic");if(!r)return null;let i=chunk3R7QHNI5_js.h(r,"a:graphicData");if(!i)return null;let a=chunk3R7QHNI5_js.h(i,"wps:wsp");if(!a)return null;let s=W(a),l=chunk3R7QHNI5_js.h(n,"wp:extent");if(l){let c=chunk3R7QHNI5_js.l(l,null,"cx")??0,p=chunk3R7QHNI5_js.l(l,null,"cy")??0;s.size={width:c,height:p};}if(o){let c=chunkLW5OFHSW_js.c(n);c&&(s.position=c);let p=chunkLW5OFHSW_js.d(n);p&&(s.wrap=p);}let u=chunk3R7QHNI5_js.h(n,"wp:docPr");if(u){let c=chunk3R7QHNI5_js.j(u,null,"id"),p=chunk3R7QHNI5_js.j(u,null,"name");c&&(s.id=c),p&&(s.name=p);}return s}function Pt(e){let n=chunk3R7QHNI5_js.i(e).find(a=>a.name==="wp:inline"||a.name==="wp:anchor");if(!n)return false;let o=chunk3R7QHNI5_js.h(n,"a:graphic");if(!o)return false;let r=chunk3R7QHNI5_js.h(o,"a:graphicData");return r?chunk3R7QHNI5_js.h(r,"wps:wsp")!==null:false}function Nt(e){return ["line","straightConnector1","bentConnector2","bentConnector3","bentConnector4","bentConnector5","curvedConnector2","curvedConnector3","curvedConnector4","curvedConnector5"].includes(e.shapeType)}function Bt(e){return e.shapeType==="textBox"||e.textBody!==void 0&&e.textBody.content.length>0}function vt(e){return e.textBody!==void 0&&e.textBody.content.length>0}function Ot(e){return chunkBJSG6TEG_js.f(e.size.width)}function kt(e){return chunkBJSG6TEG_js.f(e.size.height)}function Ut(e){return {width:chunkBJSG6TEG_js.f(e.size.width),height:chunkBJSG6TEG_js.f(e.size.height)}}function Xt(e){return e.position!==void 0||e.wrap!==void 0}function Ht(e){return e.fill!==void 0&&e.fill.type!=="none"}function Wt(e){return e.outline!==void 0}function Vt(e){return e.outline?.width?chunkBJSG6TEG_js.f(e.outline.width):0}function Gt(e){if(!(!e.fill||e.fill.type!=="solid"))return chunkLW5OFHSW_js.e(e.fill.color)}function _t(e){if(e.outline?.color)return chunkLW5OFHSW_js.e(e.outline.color)}var R=720,L="left",jt="none";function V(e){let t=chunk3R7QHNI5_js.l(e,"w","pos"),n=chunk3R7QHNI5_js.j(e,"w","val");if(t===void 0||!n)return null;let o={position:t,alignment:n},r=chunk3R7QHNI5_js.j(e,"w","leader");return r&&(o.leader=r),o}function G(e){if(!e)return [];let t=chunk3R7QHNI5_js.f(e,"w","tab");if(t.length===0)return [];let n=[];for(let o of t){let r=V(o);r&&n.push(r);}return n.sort((o,r)=>o.position-r.position),n}function zt(e){if(!e)return;let t=chunk3R7QHNI5_js.e(e,"w","tabs"),n=G(t);return n.length>0?n:void 0}function Kt(e,t){if(!e&&!t)return [];if(!e)return t??[];if(!t)return [...e];let n=new Map;for(let r of e)n.set(r.position,r);for(let r of t)r.alignment==="clear"?n.delete(r.position):n.set(r.position,r);let o=Array.from(n.values());return o.sort((r,i)=>r.position-i.position),o}function D(e,t,n){for(let r of t)if(r.position>e&&r.alignment!=="clear")return r;let o=Math.ceil((e+1)/R)*R;return o>n?{position:n,alignment:L}:{position:o,alignment:L}}function Yt(e,t,n){let o=D(e,t,n);return Math.max(0,o.position-e)}function Jt(e,t,n,o=0){let r=D(e,t,n),i;switch(r.alignment){case "right":i=Math.max(0,r.position-e-o);break;case "center":i=Math.max(0,r.position-e-o/2);break;case "decimal":i=Math.max(0,r.position-e-o);break;case "bar":i=Math.max(0,r.position-e);break;default:i=Math.max(0,r.position-e);break}return {width:i,alignment:r.alignment}}function Zt(e){switch(e){case "dot":return ".";case "hyphen":return "-";case "underscore":return "_";case "heavy":return "_";case "middleDot":return "\xB7";default:return " "}}function qt(e){return e!==void 0&&e!=="none"}function Qt(e,t){let n=t.filter(i=>i.parentId!=null);if(n.length===0)return;let o=new Map;for(let i of n){let a=o.get(i.parentId);a?a.push(i.id):o.set(i.parentId,[i.id]);}function r(i){for(let a of i)if(a.type==="paragraph"){if(!a.content.some(l=>l.type==="commentRangeStart"||l.type==="commentRangeEnd"))continue;let s=[];for(let l of a.content)if(l.type==="commentRangeStart"){s.push(l);let u=o.get(l.id);if(u)for(let c of u)s.push({type:"commentRangeStart",id:c});}else if(l.type==="commentRangeEnd"){s.push(l);let u=o.get(l.id);if(u)for(let c of u)s.push({type:"commentRangeEnd",id:c});}else s.push(l);a.content=s;}else if(a.type==="table")for(let s of a.rows)for(let l of s.cells)r(l.content);}r(e);}function $t(e,t){let n=new Set(t.map(a=>a.id)),o=t.filter(a=>a.parentId!=null&&!n.has(a.parentId));if(o.length===0)return;let r=new Map;for(let a of o){let s=r.get(a.parentId);s?s.push(a.id):r.set(a.parentId,[a.id]);}function i(a){for(let s of a)if(s.type==="paragraph"){if(!s.content.some(p=>(p.type==="insertion"||p.type==="deletion")&&r.has(p.info.id)))continue;let u=[],c=s.content;for(let p=0;p<c.length;p++){let m=c[p];if((m.type==="insertion"||m.type==="deletion")&&r.has(m.info.id)){let y=r.get(m.info.id);for(let f of y)u.push({type:"commentRangeStart",id:f});u.push(m);let T=c[p+1];T&&(T.type==="insertion"||T.type==="deletion")&&T.type!==m.type&&T.info.author===m.info.author&&T.info.date===m.info.date&&(u.push(T),p++);for(let f of y)u.push({type:"commentRangeEnd",id:f});}else u.push(m);}s.content=u;}else if(s.type==="table")for(let l of s.rows)for(let u of l.cells)i(u.content);}i(e);}Object.defineProperty(exports,"attemptSelectiveSave",{enumerable:true,get:function(){return chunkGFM6PERG_js.c}});Object.defineProperty(exports,"buildPatchedDocumentXml",{enumerable:true,get:function(){return chunkGFM6PERG_js.b}});Object.defineProperty(exports,"validatePatchSafety",{enumerable:true,get:function(){return chunkGFM6PERG_js.a}});Object.defineProperty(exports,"createDocx",{enumerable:true,get:function(){return chunkJQUIUKRO_js.t}});Object.defineProperty(exports,"repackDocx",{enumerable:true,get:function(){return chunkJQUIUKRO_js.i}});Object.defineProperty(exports,"updateMultipleFiles",{enumerable:true,get:function(){return chunkJQUIUKRO_js.m}});Object.defineProperty(exports,"parseDocx",{enumerable:true,get:function(){return chunkWVY2UXAK_js.a}});Object.defineProperty(exports,"getEndnoteText",{enumerable:true,get:function(){return chunkDFDL337G_js.y}});Object.defineProperty(exports,"getFootnoteText",{enumerable:true,get:function(){return chunkDFDL337G_js.x}});Object.defineProperty(exports,"getHyperlinkRuns",{enumerable:true,get:function(){return chunkDFDL337G_js.L}});Object.defineProperty(exports,"getHyperlinkText",{enumerable:true,get:function(){return chunkDFDL337G_js.G}});Object.defineProperty(exports,"getHyperlinkUrl",{enumerable:true,get:function(){return chunkDFDL337G_js.J}});Object.defineProperty(exports,"getTableColumnCount",{enumerable:true,get:function(){return chunkDFDL337G_js.j}});Object.defineProperty(exports,"getTableRowCount",{enumerable:true,get:function(){return chunkDFDL337G_js.k}});Object.defineProperty(exports,"hasContent",{enumerable:true,get:function(){return chunkDFDL337G_js.K}});Object.defineProperty(exports,"hasHeaderRow",{enumerable:true,get:function(){return chunkDFDL337G_js.n}});Object.defineProperty(exports,"isCellMergeContinuation",{enumerable:true,get:function(){return chunkDFDL337G_js.l}});Object.defineProperty(exports,"isCellMergeStart",{enumerable:true,get:function(){return chunkDFDL337G_js.m}});Object.defineProperty(exports,"isExternalLink",{enumerable:true,get:function(){return chunkDFDL337G_js.H}});Object.defineProperty(exports,"isInternalLink",{enumerable:true,get:function(){return chunkDFDL337G_js.I}});Object.defineProperty(exports,"isSeparatorEndnote",{enumerable:true,get:function(){return chunkDFDL337G_js.A}});Object.defineProperty(exports,"isSeparatorFootnote",{enumerable:true,get:function(){return chunkDFDL337G_js.z}});Object.defineProperty(exports,"parseBorderSpec",{enumerable:true,get:function(){return chunkDFDL337G_js.d}});Object.defineProperty(exports,"parseCellMargins",{enumerable:true,get:function(){return chunkDFDL337G_js.f}});Object.defineProperty(exports,"parseEndnoteProperties",{enumerable:true,get:function(){return chunkDFDL337G_js.w}});Object.defineProperty(exports,"parseEndnotes",{enumerable:true,get:function(){return chunkDFDL337G_js.u}});Object.defineProperty(exports,"parseFloatingTableProperties",{enumerable:true,get:function(){return chunkDFDL337G_js.i}});Object.defineProperty(exports,"parseFootnoteProperties",{enumerable:true,get:function(){return chunkDFDL337G_js.v}});Object.defineProperty(exports,"parseFootnotes",{enumerable:true,get:function(){return chunkDFDL337G_js.t}});Object.defineProperty(exports,"parseHyperlink",{enumerable:true,get:function(){return chunkDFDL337G_js.F}});Object.defineProperty(exports,"parseShading",{enumerable:true,get:function(){return chunkDFDL337G_js.g}});Object.defineProperty(exports,"parseTableBorders",{enumerable:true,get:function(){return chunkDFDL337G_js.e}});Object.defineProperty(exports,"parseTableLook",{enumerable:true,get:function(){return chunkDFDL337G_js.h}});Object.defineProperty(exports,"parseTableMeasurement",{enumerable:true,get:function(){return chunkDFDL337G_js.c}});Object.defineProperty(exports,"parseTableProperties",{enumerable:true,get:function(){return chunkDFDL337G_js.o}});Object.defineProperty(exports,"resolveHyperlinkUrl",{enumerable:true,get:function(){return chunkDFDL337G_js.M}});Object.defineProperty(exports,"extractTextBoxContentElements",{enumerable:true,get:function(){return chunkLW5OFHSW_js.f}});Object.defineProperty(exports,"getImageHeightPx",{enumerable:true,get:function(){return chunkLW5OFHSW_js.G}});Object.defineProperty(exports,"getImageWidthPx",{enumerable:true,get:function(){return chunkLW5OFHSW_js.F}});Object.defineProperty(exports,"getTextBoxContentElement",{enumerable:true,get:function(){return chunkLW5OFHSW_js.k}});Object.defineProperty(exports,"getTextBoxDimensionsPx",{enumerable:true,get:function(){return chunkLW5OFHSW_js.o}});Object.defineProperty(exports,"getTextBoxHeightPx",{enumerable:true,get:function(){return chunkLW5OFHSW_js.n}});Object.defineProperty(exports,"getTextBoxMarginsPx",{enumerable:true,get:function(){return chunkLW5OFHSW_js.p}});Object.defineProperty(exports,"getTextBoxOutlineWidthPx",{enumerable:true,get:function(){return chunkLW5OFHSW_js.x}});Object.defineProperty(exports,"getTextBoxText",{enumerable:true,get:function(){return chunkLW5OFHSW_js.u}});Object.defineProperty(exports,"getTextBoxWidthPx",{enumerable:true,get:function(){return chunkLW5OFHSW_js.m}});Object.defineProperty(exports,"getWrapDistancesPx",{enumerable:true,get:function(){return chunkLW5OFHSW_js.I}});Object.defineProperty(exports,"hasTextBoxContent",{enumerable:true,get:function(){return chunkLW5OFHSW_js.t}});Object.defineProperty(exports,"hasTextBoxFill",{enumerable:true,get:function(){return chunkLW5OFHSW_js.r}});Object.defineProperty(exports,"hasTextBoxOutline",{enumerable:true,get:function(){return chunkLW5OFHSW_js.s}});Object.defineProperty(exports,"isBehindText",{enumerable:true,get:function(){return chunkLW5OFHSW_js.D}});Object.defineProperty(exports,"isDecorativeImage",{enumerable:true,get:function(){return chunkLW5OFHSW_js.H}});Object.defineProperty(exports,"isFloatingImage",{enumerable:true,get:function(){return chunkLW5OFHSW_js.C}});Object.defineProperty(exports,"isFloatingTextBox",{enumerable:true,get:function(){return chunkLW5OFHSW_js.q}});Object.defineProperty(exports,"isInFrontOfText",{enumerable:true,get:function(){return chunkLW5OFHSW_js.E}});Object.defineProperty(exports,"isInlineImage",{enumerable:true,get:function(){return chunkLW5OFHSW_js.B}});Object.defineProperty(exports,"isShapeTextBox",{enumerable:true,get:function(){return chunkLW5OFHSW_js.i}});Object.defineProperty(exports,"isTextBoxDrawing",{enumerable:true,get:function(){return chunkLW5OFHSW_js.h}});Object.defineProperty(exports,"parseDrawing",{enumerable:true,get:function(){return chunkLW5OFHSW_js.z}});Object.defineProperty(exports,"parseImage",{enumerable:true,get:function(){return chunkLW5OFHSW_js.A}});Object.defineProperty(exports,"parseTextBox",{enumerable:true,get:function(){return chunkLW5OFHSW_js.j}});Object.defineProperty(exports,"parseTextBoxContent",{enumerable:true,get:function(){return chunkLW5OFHSW_js.g}});Object.defineProperty(exports,"parseTextBoxFromShape",{enumerable:true,get:function(){return chunkLW5OFHSW_js.l}});Object.defineProperty(exports,"resolveTextBoxFillColor",{enumerable:true,get:function(){return chunkLW5OFHSW_js.v}});Object.defineProperty(exports,"resolveTextBoxOutlineColor",{enumerable:true,get:function(){return chunkLW5OFHSW_js.w}});Object.defineProperty(exports,"emuToPixels",{enumerable:true,get:function(){return chunkBJSG6TEG_js.f}});Object.defineProperty(exports,"pixelsToEmu",{enumerable:true,get:function(){return chunkBJSG6TEG_js.g}});Object.defineProperty(exports,"computeListRendering",{enumerable:true,get:function(){return chunkH57LNDBH_js.d}});Object.defineProperty(exports,"createNumberingMap",{enumerable:true,get:function(){return chunkH57LNDBH_js.c}});Object.defineProperty(exports,"formatNumber",{enumerable:true,get:function(){return chunkH57LNDBH_js.e}});Object.defineProperty(exports,"getBulletCharacter",{enumerable:true,get:function(){return chunkH57LNDBH_js.h}});Object.defineProperty(exports,"getCachedNumberingMap",{enumerable:true,get:function(){return chunkH57LNDBH_js.b}});Object.defineProperty(exports,"isBulletLevel",{enumerable:true,get:function(){return chunkH57LNDBH_js.i}});Object.defineProperty(exports,"parseNumbering",{enumerable:true,get:function(){return chunkH57LNDBH_js.a}});Object.defineProperty(exports,"renderListMarker",{enumerable:true,get:function(){return chunkH57LNDBH_js.g}});exports.DEFAULT_TAB_ALIGNMENT=L;exports.DEFAULT_TAB_INTERVAL_TWIPS=R;exports.DEFAULT_TAB_LEADER=jt;exports.KNOWN_FIELD_TYPES=M;exports.calculateTabWidth=Yt;exports.calculateTabWidthWithAlignment=Jt;exports.createComplexFieldContext=ht;exports.getFieldDisplayValue=gt;exports.getFormatSwitch=dt;exports.getLeaderCharacter=Zt;exports.getNextTabStop=D;exports.getOutlineWidthPx=Vt;exports.getShapeDimensionsPx=Ut;exports.getShapeHeightPx=kt;exports.getShapeWidthPx=Ot;exports.hasFill=Ht;exports.hasMergeFormat=ft;exports.hasOutline=Wt;exports.hasTextContent=vt;exports.hasVisibleLeader=qt;exports.injectReplyRangeMarkers=Qt;exports.injectTCReplyRangeMarkers=$t;exports.isDateTimeField=yt;exports.isDocPropertyField=St;exports.isFloatingShape=Xt;exports.isKnownFieldType=ct;exports.isLineShape=Nt;exports.isMergeField=bt;exports.isPageNumberField=Tt;exports.isReferenceField=Ft;exports.isShapeDrawing=Pt;exports.isTextBoxShape=Bt;exports.isTocField=Et;exports.isTotalPagesField=xt;exports.mergeTabStops=Kt;exports.parseFieldInstruction=ut;exports.parseFieldType=I;exports.parseShape=W;exports.parseShapeFromDrawing=Dt;exports.parseSimpleField=mt;exports.parseTabStop=V;exports.parseTabStops=G;exports.parseTabStopsFromParagraphProperties=zt;exports.resolveFillColor=Gt;exports.resolveOutlineColor=_t;
|
|
1
|
+
'use strict';var chunkCMZXBKDH_js=require('../chunk-CMZXBKDH.js'),chunk2EFI3BAN_js=require('../chunk-2EFI3BAN.js');require('../chunk-4EATD3FP.js'),require('../chunk-WA4IJOGH.js');var chunkDPMR7U7D_js=require('../chunk-DPMR7U7D.js'),chunkLZTEPSU2_js=require('../chunk-LZTEPSU2.js');require('../chunk-FIGLFSNR.js'),require('../chunk-QVRMX2AC.js');var chunkLW5OFHSW_js=require('../chunk-LW5OFHSW.js');require('../chunk-Z3LGMBJC.js'),require('../chunk-B3SVS2AF.js');var chunkBJSG6TEG_js=require('../chunk-BJSG6TEG.js');require('../chunk-GSKMHXHG.js');var chunkH57LNDBH_js=require('../chunk-H57LNDBH.js'),chunk3R7QHNI5_js=require('../chunk-3R7QHNI5.js');require('../chunk-DC7S76ZX.js');var M=["PAGE","NUMPAGES","NUMWORDS","NUMCHARS","DATE","TIME","CREATEDATE","SAVEDATE","PRINTDATE","EDITTIME","AUTHOR","TITLE","SUBJECT","KEYWORDS","COMMENTS","FILENAME","FILESIZE","TEMPLATE","REVNUM","DOCPROPERTY","DOCVARIABLE","REF","PAGEREF","NOTEREF","HYPERLINK","TOC","TOA","INDEX","SEQ","STYLEREF","AUTONUM","AUTONUMLGL","AUTONUMOUT","SECTION","SECTIONPAGES","USERADDRESS","USERNAME","USERINITIALS","IF","MERGEFIELD","NEXT","NEXTIF","ASK","SET","QUOTE","INCLUDETEXT","INCLUDEPICTURE","SYMBOL","ADVANCE"];function I(e){if(!e)return "UNKNOWN";let n=e.trim().match(/^\\?([A-Z][A-Z0-9]*)/i);if(!n)return "UNKNOWN";let o=n[1].toUpperCase();return M.includes(o)?o:"UNKNOWN"}function ct(e){return M.includes(e)}function ut(e){let t=I(e),n=e.trim(),o=[],r=n.match(/^\\?([A-Z][A-Z0-9]*)/i),i=r?r[0].length:0,a=n.substring(i).trim(),s=/\\(\*|@|#|!|[a-z])\s*(?:"([^"]*)"|([\S]*))?/gi,l,u=[];for(;(l=s.exec(a))!==null;){let p={switch:l[1]};l[2]?p.value=l[2]:l[3]&&(p.value=l[3]),o.push(p),u.push({start:l.index,end:l.index+l[0].length});}let c;if(a.length>0){let p=u.length>0?u[0].start:a.length,m=a.substring(0,p).trim();m.startsWith('"')&&m.endsWith('"')?c=m.slice(1,-1):m&&(c=m);}return {type:t,raw:e,argument:c,switches:o}}function dt(e){return e.switches.find(n=>n.switch==="*"||n.switch==="@")?.value}function ft(e){return e.switches.find(n=>n.switch==="*")?.value?.toUpperCase()==="MERGEFORMAT"}function mt(e,t,n){let o=chunk3R7QHNI5_js.j(e,"w","instr")??"",r=I(o),i={type:"simpleField",instruction:o,fieldType:r,content:[]},a=chunk3R7QHNI5_js.j(e,"w","fldLock");(a==="1"||a==="true")&&(i.fldLock=true);let s=chunk3R7QHNI5_js.j(e,"w","dirty");(s==="1"||s==="true")&&(i.dirty=true);let l=chunk3R7QHNI5_js.f(e,"w","r");for(let u of l){let c=chunkLZTEPSU2_js.E(u,t,n);i.content.push(c);}return i}function ht(){return {state:"outside",instruction:"",codeRuns:[],resultRuns:[],fldLock:false,dirty:false,nestingLevel:0}}function gt(e){return e.type==="simpleField"?e.content.filter(t=>"content"in t).map(t=>U(t)).join(""):e.fieldResult.map(t=>U(t)).join("")}function U(e){return e.content.filter(t=>t.type==="text").map(t=>t.text).join("")}function Tt(e){return e.fieldType==="PAGE"}function xt(e){return e.fieldType==="NUMPAGES"}function yt(e){return ["DATE","TIME","CREATEDATE","SAVEDATE","PRINTDATE","EDITTIME"].includes(e.fieldType)}function St(e){return ["AUTHOR","TITLE","SUBJECT","KEYWORDS","COMMENTS","FILENAME","FILESIZE","TEMPLATE","REVNUM","DOCPROPERTY","DOCVARIABLE"].includes(e.fieldType)}function Ft(e){return ["REF","PAGEREF","NOTEREF"].includes(e.fieldType)}function bt(e){return ["MERGEFIELD","IF","NEXT","NEXTIF","ASK","SET"].includes(e.fieldType)}function Et(e){return ["TOC","TOA","INDEX"].includes(e.fieldType)}function H(e){if(!e)return;let t=parseInt(e,10);if(!isNaN(t))return t/6e4}function Ct(e,t){let n=chunkLW5OFHSW_js.b(e);if(n){if(n.type==="gradient"&&e){let r=chunk3R7QHNI5_js.i(e).find(i=>i.name==="a:gradFill");if(r)return wt(r)}return n}if(e){let o=chunk3R7QHNI5_js.i(e);if(o.find(a=>a.name==="a:pattFill"))return {type:"pattern"};if(o.find(a=>a.name==="a:blipFill"))return {type:"picture"}}if(t){let o=chunk3R7QHNI5_js.h(t,"a:fillRef");if(o){if(chunk3R7QHNI5_js.j(o,null,"idx")==="0")return {type:"none"};let i=chunkLW5OFHSW_js.a(o);if(i)return {type:"solid",color:i}}}}function wt(e){let t=chunk3R7QHNI5_js.i(e),n="linear",o,r=t.find(l=>l.name==="a:lin");if(r){n="linear";let l=chunk3R7QHNI5_js.j(r,null,"ang");l&&(o=parseInt(l,10)/6e4);}let i=t.find(l=>l.name==="a:path");if(i){let l=chunk3R7QHNI5_js.j(i,null,"path");l==="circle"?n="radial":l==="rect"?n="rectangular":n="path";}let a=t.find(l=>l.name==="a:gsLst"),s=[];if(a){let l=chunk3R7QHNI5_js.g(a,"gs");for(let u of l){let c=chunk3R7QHNI5_js.j(u,null,"pos"),p=c?parseInt(c,10):0,m=chunkLW5OFHSW_js.a(u);m&&s.push({position:p,color:m});}}return {type:"gradient",gradient:{type:n,angle:o,stops:s}}}function At(e,t){let n=e?chunk3R7QHNI5_js.h(e,"a:ln"):null;if(!n){if(t){let f=chunk3R7QHNI5_js.h(t,"a:lnRef");if(f){if(chunk3R7QHNI5_js.j(f,null,"idx")==="0")return;let g=chunkLW5OFHSW_js.a(f);if(g)return {color:g,width:9525}}}return}let o=chunk3R7QHNI5_js.i(n);if(o.find(f=>f.name==="a:noFill"))return;let i={},a=chunk3R7QHNI5_js.j(n,null,"w");a&&(i.width=parseInt(a,10));let s=chunk3R7QHNI5_js.j(n,null,"cap");(s==="flat"||s==="rnd"||s==="sq")&&(i.cap=s==="rnd"?"round":s==="sq"?"square":"flat");let l=o.find(f=>f.name==="a:bevel"),u=o.find(f=>f.name==="a:miter"),c=o.find(f=>f.name==="a:round");l?i.join="bevel":c?i.join="round":u&&(i.join="miter");let p=o.find(f=>f.name==="a:solidFill");p&&(i.color=chunkLW5OFHSW_js.a(p));let m=o.find(f=>f.name==="a:prstDash");if(m){let f=chunk3R7QHNI5_js.j(m,null,"val");f&&(i.style=f);}let y=o.find(f=>f.name==="a:headEnd");y&&(i.headEnd=X(y));let T=o.find(f=>f.name==="a:tailEnd");return T&&(i.tailEnd=X(T)),i}function X(e){let t=chunk3R7QHNI5_js.j(e,null,"type")??"none",n=chunk3R7QHNI5_js.j(e,null,"w"),o=chunk3R7QHNI5_js.j(e,null,"len");return {type:{none:"none",triangle:"triangle",stealth:"stealth",diamond:"diamond",oval:"oval",arrow:"arrow"}[t]??"none",width:n,length:o}}function Mt(e){if(!e)return {size:{width:0,height:0}};let t=chunk3R7QHNI5_js.h(e,"a:ext"),n=chunk3R7QHNI5_js.l(t,null,"cx")??0,o=chunk3R7QHNI5_js.l(t,null,"cy")??0,r={width:n,height:o},i=chunk3R7QHNI5_js.h(e,"a:off"),a;if(i){let m=chunk3R7QHNI5_js.l(i,null,"x")??0,y=chunk3R7QHNI5_js.l(i,null,"y")??0;a={x:m,y};}let s=chunk3R7QHNI5_js.j(e,null,"rot"),l=chunk3R7QHNI5_js.j(e,null,"flipH")==="1",u=chunk3R7QHNI5_js.j(e,null,"flipV")==="1",c=H(s),p;return (c!==void 0||l||u)&&(p={},c!==void 0&&(p.rotation=c),l&&(p.flipH=true),u&&(p.flipV=true)),{size:r,transform:p,offset:a}}function It(e){if(!e)return "rect";let t=chunk3R7QHNI5_js.h(e,"a:prstGeom");if(t){let o=chunk3R7QHNI5_js.j(t,null,"prst");if(o)return o}return chunk3R7QHNI5_js.h(e,"a:custGeom"),"rect"}function Rt(e){if(!e)return {};let t={},n=chunk3R7QHNI5_js.j(e,null,"vert");(n==="vert"||n==="vert270"||n==="wordArtVert")&&(t.vertical=true);let o=chunk3R7QHNI5_js.j(e,null,"rot");o&&(t.rotation=H(o));let r=chunk3R7QHNI5_js.j(e,null,"anchor");if(r){let m={t:"top",ctr:"middle",b:"bottom",dist:"distributed",just:"justified"};t.anchor=m[r];}chunk3R7QHNI5_js.j(e,null,"anchorCtr")==="1"&&(t.anchorCenter=true);let i=chunk3R7QHNI5_js.h(e,"a:noAutofit"),a=chunk3R7QHNI5_js.h(e,"a:normAutofit"),s=chunk3R7QHNI5_js.h(e,"a:spAutoFit");i?t.autoFit="none":a?t.autoFit="normal":s&&(t.autoFit="shape");let l=chunk3R7QHNI5_js.l(e,null,"lIns"),u=chunk3R7QHNI5_js.l(e,null,"rIns"),c=chunk3R7QHNI5_js.l(e,null,"tIns"),p=chunk3R7QHNI5_js.l(e,null,"bIns");return (l!==void 0||u!==void 0||c!==void 0||p!==void 0)&&(t.margins={left:l,right:u,top:c,bottom:p}),t}function Lt(e){if(!e)return [];let t=[],n=chunk3R7QHNI5_js.g(e,"p");for(let o of n)t.push({type:"paragraph",formatting:{},content:[]});return t}function W(e){let t=chunk3R7QHNI5_js.i(e),n=t.find(g=>g.name==="wps:cNvPr"),o=t.find(g=>g.name==="wps:spPr"),r=t.find(g=>g.name==="wps:style"),i=t.find(g=>g.name==="wps:txbx"),a=i?chunk3R7QHNI5_js.h(i,"w:txbxContent"):null,s=t.find(g=>g.name==="wps:bodyPr"),l=It(o??null),u=o?chunk3R7QHNI5_js.h(o,"a:xfrm"):null,{size:c,transform:p}=Mt(u),m=Ct(o??null,r??null),y=At(o??null,r??null),T,f;n&&(T=chunk3R7QHNI5_js.j(n,null,"id")??void 0,f=chunk3R7QHNI5_js.j(n,null,"name")??void 0);let S={type:"shape",shapeType:l,size:c};if(T&&(S.id=T),f&&(S.name=f),m&&(S.fill=m),y&&(S.outline=y),p&&(S.transform=p),a||s){let g=Rt(s??null),P=Lt(a);(P.length>0||Object.keys(g).length>0)&&(S.textBody={...g,content:P});}return S}function Dt(e){let n=chunk3R7QHNI5_js.i(e).find(c=>c.name==="wp:inline"||c.name==="wp:anchor");if(!n)return null;let o=n.name==="wp:anchor",r=chunk3R7QHNI5_js.h(n,"a:graphic");if(!r)return null;let i=chunk3R7QHNI5_js.h(r,"a:graphicData");if(!i)return null;let a=chunk3R7QHNI5_js.h(i,"wps:wsp");if(!a)return null;let s=W(a),l=chunk3R7QHNI5_js.h(n,"wp:extent");if(l){let c=chunk3R7QHNI5_js.l(l,null,"cx")??0,p=chunk3R7QHNI5_js.l(l,null,"cy")??0;s.size={width:c,height:p};}if(o){let c=chunkLW5OFHSW_js.c(n);c&&(s.position=c);let p=chunkLW5OFHSW_js.d(n);p&&(s.wrap=p);}let u=chunk3R7QHNI5_js.h(n,"wp:docPr");if(u){let c=chunk3R7QHNI5_js.j(u,null,"id"),p=chunk3R7QHNI5_js.j(u,null,"name");c&&(s.id=c),p&&(s.name=p);}return s}function Pt(e){let n=chunk3R7QHNI5_js.i(e).find(a=>a.name==="wp:inline"||a.name==="wp:anchor");if(!n)return false;let o=chunk3R7QHNI5_js.h(n,"a:graphic");if(!o)return false;let r=chunk3R7QHNI5_js.h(o,"a:graphicData");return r?chunk3R7QHNI5_js.h(r,"wps:wsp")!==null:false}function Nt(e){return ["line","straightConnector1","bentConnector2","bentConnector3","bentConnector4","bentConnector5","curvedConnector2","curvedConnector3","curvedConnector4","curvedConnector5"].includes(e.shapeType)}function Bt(e){return e.shapeType==="textBox"||e.textBody!==void 0&&e.textBody.content.length>0}function vt(e){return e.textBody!==void 0&&e.textBody.content.length>0}function Ot(e){return chunkBJSG6TEG_js.f(e.size.width)}function kt(e){return chunkBJSG6TEG_js.f(e.size.height)}function Ut(e){return {width:chunkBJSG6TEG_js.f(e.size.width),height:chunkBJSG6TEG_js.f(e.size.height)}}function Xt(e){return e.position!==void 0||e.wrap!==void 0}function Ht(e){return e.fill!==void 0&&e.fill.type!=="none"}function Wt(e){return e.outline!==void 0}function Vt(e){return e.outline?.width?chunkBJSG6TEG_js.f(e.outline.width):0}function Gt(e){if(!(!e.fill||e.fill.type!=="solid"))return chunkLW5OFHSW_js.e(e.fill.color)}function _t(e){if(e.outline?.color)return chunkLW5OFHSW_js.e(e.outline.color)}var R=720,L="left",jt="none";function V(e){let t=chunk3R7QHNI5_js.l(e,"w","pos"),n=chunk3R7QHNI5_js.j(e,"w","val");if(t===void 0||!n)return null;let o={position:t,alignment:n},r=chunk3R7QHNI5_js.j(e,"w","leader");return r&&(o.leader=r),o}function G(e){if(!e)return [];let t=chunk3R7QHNI5_js.f(e,"w","tab");if(t.length===0)return [];let n=[];for(let o of t){let r=V(o);r&&n.push(r);}return n.sort((o,r)=>o.position-r.position),n}function zt(e){if(!e)return;let t=chunk3R7QHNI5_js.e(e,"w","tabs"),n=G(t);return n.length>0?n:void 0}function Kt(e,t){if(!e&&!t)return [];if(!e)return t??[];if(!t)return [...e];let n=new Map;for(let r of e)n.set(r.position,r);for(let r of t)r.alignment==="clear"?n.delete(r.position):n.set(r.position,r);let o=Array.from(n.values());return o.sort((r,i)=>r.position-i.position),o}function D(e,t,n){for(let r of t)if(r.position>e&&r.alignment!=="clear")return r;let o=Math.ceil((e+1)/R)*R;return o>n?{position:n,alignment:L}:{position:o,alignment:L}}function Yt(e,t,n){let o=D(e,t,n);return Math.max(0,o.position-e)}function Jt(e,t,n,o=0){let r=D(e,t,n),i;switch(r.alignment){case "right":i=Math.max(0,r.position-e-o);break;case "center":i=Math.max(0,r.position-e-o/2);break;case "decimal":i=Math.max(0,r.position-e-o);break;case "bar":i=Math.max(0,r.position-e);break;default:i=Math.max(0,r.position-e);break}return {width:i,alignment:r.alignment}}function Zt(e){switch(e){case "dot":return ".";case "hyphen":return "-";case "underscore":return "_";case "heavy":return "_";case "middleDot":return "\xB7";default:return " "}}function qt(e){return e!==void 0&&e!=="none"}function Qt(e,t){let n=t.filter(i=>i.parentId!=null);if(n.length===0)return;let o=new Map;for(let i of n){let a=o.get(i.parentId);a?a.push(i.id):o.set(i.parentId,[i.id]);}function r(i){for(let a of i)if(a.type==="paragraph"){if(!a.content.some(l=>l.type==="commentRangeStart"||l.type==="commentRangeEnd"))continue;let s=[];for(let l of a.content)if(l.type==="commentRangeStart"){s.push(l);let u=o.get(l.id);if(u)for(let c of u)s.push({type:"commentRangeStart",id:c});}else if(l.type==="commentRangeEnd"){s.push(l);let u=o.get(l.id);if(u)for(let c of u)s.push({type:"commentRangeEnd",id:c});}else s.push(l);a.content=s;}else if(a.type==="table")for(let s of a.rows)for(let l of s.cells)r(l.content);}r(e);}function $t(e,t){let n=new Set(t.map(a=>a.id)),o=t.filter(a=>a.parentId!=null&&!n.has(a.parentId));if(o.length===0)return;let r=new Map;for(let a of o){let s=r.get(a.parentId);s?s.push(a.id):r.set(a.parentId,[a.id]);}function i(a){for(let s of a)if(s.type==="paragraph"){if(!s.content.some(p=>(p.type==="insertion"||p.type==="deletion")&&r.has(p.info.id)))continue;let u=[],c=s.content;for(let p=0;p<c.length;p++){let m=c[p];if((m.type==="insertion"||m.type==="deletion")&&r.has(m.info.id)){let y=r.get(m.info.id);for(let f of y)u.push({type:"commentRangeStart",id:f});u.push(m);let T=c[p+1];T&&(T.type==="insertion"||T.type==="deletion")&&T.type!==m.type&&T.info.author===m.info.author&&T.info.date===m.info.date&&(u.push(T),p++);for(let f of y)u.push({type:"commentRangeEnd",id:f});}else u.push(m);}s.content=u;}else if(s.type==="table")for(let l of s.rows)for(let u of l.cells)i(u.content);}i(e);}Object.defineProperty(exports,"attemptSelectiveSave",{enumerable:true,get:function(){return chunkCMZXBKDH_js.c}});Object.defineProperty(exports,"buildPatchedDocumentXml",{enumerable:true,get:function(){return chunkCMZXBKDH_js.b}});Object.defineProperty(exports,"validatePatchSafety",{enumerable:true,get:function(){return chunkCMZXBKDH_js.a}});Object.defineProperty(exports,"createDocx",{enumerable:true,get:function(){return chunk2EFI3BAN_js.t}});Object.defineProperty(exports,"repackDocx",{enumerable:true,get:function(){return chunk2EFI3BAN_js.i}});Object.defineProperty(exports,"updateMultipleFiles",{enumerable:true,get:function(){return chunk2EFI3BAN_js.m}});Object.defineProperty(exports,"parseDocx",{enumerable:true,get:function(){return chunkDPMR7U7D_js.a}});Object.defineProperty(exports,"getEndnoteText",{enumerable:true,get:function(){return chunkLZTEPSU2_js.y}});Object.defineProperty(exports,"getFootnoteText",{enumerable:true,get:function(){return chunkLZTEPSU2_js.x}});Object.defineProperty(exports,"getHyperlinkRuns",{enumerable:true,get:function(){return chunkLZTEPSU2_js.L}});Object.defineProperty(exports,"getHyperlinkText",{enumerable:true,get:function(){return chunkLZTEPSU2_js.G}});Object.defineProperty(exports,"getHyperlinkUrl",{enumerable:true,get:function(){return chunkLZTEPSU2_js.J}});Object.defineProperty(exports,"getTableColumnCount",{enumerable:true,get:function(){return chunkLZTEPSU2_js.j}});Object.defineProperty(exports,"getTableRowCount",{enumerable:true,get:function(){return chunkLZTEPSU2_js.k}});Object.defineProperty(exports,"hasContent",{enumerable:true,get:function(){return chunkLZTEPSU2_js.K}});Object.defineProperty(exports,"hasHeaderRow",{enumerable:true,get:function(){return chunkLZTEPSU2_js.n}});Object.defineProperty(exports,"isCellMergeContinuation",{enumerable:true,get:function(){return chunkLZTEPSU2_js.l}});Object.defineProperty(exports,"isCellMergeStart",{enumerable:true,get:function(){return chunkLZTEPSU2_js.m}});Object.defineProperty(exports,"isExternalLink",{enumerable:true,get:function(){return chunkLZTEPSU2_js.H}});Object.defineProperty(exports,"isInternalLink",{enumerable:true,get:function(){return chunkLZTEPSU2_js.I}});Object.defineProperty(exports,"isSeparatorEndnote",{enumerable:true,get:function(){return chunkLZTEPSU2_js.A}});Object.defineProperty(exports,"isSeparatorFootnote",{enumerable:true,get:function(){return chunkLZTEPSU2_js.z}});Object.defineProperty(exports,"parseBorderSpec",{enumerable:true,get:function(){return chunkLZTEPSU2_js.d}});Object.defineProperty(exports,"parseCellMargins",{enumerable:true,get:function(){return chunkLZTEPSU2_js.f}});Object.defineProperty(exports,"parseEndnoteProperties",{enumerable:true,get:function(){return chunkLZTEPSU2_js.w}});Object.defineProperty(exports,"parseEndnotes",{enumerable:true,get:function(){return chunkLZTEPSU2_js.u}});Object.defineProperty(exports,"parseFloatingTableProperties",{enumerable:true,get:function(){return chunkLZTEPSU2_js.i}});Object.defineProperty(exports,"parseFootnoteProperties",{enumerable:true,get:function(){return chunkLZTEPSU2_js.v}});Object.defineProperty(exports,"parseFootnotes",{enumerable:true,get:function(){return chunkLZTEPSU2_js.t}});Object.defineProperty(exports,"parseHyperlink",{enumerable:true,get:function(){return chunkLZTEPSU2_js.F}});Object.defineProperty(exports,"parseShading",{enumerable:true,get:function(){return chunkLZTEPSU2_js.g}});Object.defineProperty(exports,"parseTableBorders",{enumerable:true,get:function(){return chunkLZTEPSU2_js.e}});Object.defineProperty(exports,"parseTableLook",{enumerable:true,get:function(){return chunkLZTEPSU2_js.h}});Object.defineProperty(exports,"parseTableMeasurement",{enumerable:true,get:function(){return chunkLZTEPSU2_js.c}});Object.defineProperty(exports,"parseTableProperties",{enumerable:true,get:function(){return chunkLZTEPSU2_js.o}});Object.defineProperty(exports,"resolveHyperlinkUrl",{enumerable:true,get:function(){return chunkLZTEPSU2_js.M}});Object.defineProperty(exports,"extractTextBoxContentElements",{enumerable:true,get:function(){return chunkLW5OFHSW_js.f}});Object.defineProperty(exports,"getImageHeightPx",{enumerable:true,get:function(){return chunkLW5OFHSW_js.G}});Object.defineProperty(exports,"getImageWidthPx",{enumerable:true,get:function(){return chunkLW5OFHSW_js.F}});Object.defineProperty(exports,"getTextBoxContentElement",{enumerable:true,get:function(){return chunkLW5OFHSW_js.k}});Object.defineProperty(exports,"getTextBoxDimensionsPx",{enumerable:true,get:function(){return chunkLW5OFHSW_js.o}});Object.defineProperty(exports,"getTextBoxHeightPx",{enumerable:true,get:function(){return chunkLW5OFHSW_js.n}});Object.defineProperty(exports,"getTextBoxMarginsPx",{enumerable:true,get:function(){return chunkLW5OFHSW_js.p}});Object.defineProperty(exports,"getTextBoxOutlineWidthPx",{enumerable:true,get:function(){return chunkLW5OFHSW_js.x}});Object.defineProperty(exports,"getTextBoxText",{enumerable:true,get:function(){return chunkLW5OFHSW_js.u}});Object.defineProperty(exports,"getTextBoxWidthPx",{enumerable:true,get:function(){return chunkLW5OFHSW_js.m}});Object.defineProperty(exports,"getWrapDistancesPx",{enumerable:true,get:function(){return chunkLW5OFHSW_js.I}});Object.defineProperty(exports,"hasTextBoxContent",{enumerable:true,get:function(){return chunkLW5OFHSW_js.t}});Object.defineProperty(exports,"hasTextBoxFill",{enumerable:true,get:function(){return chunkLW5OFHSW_js.r}});Object.defineProperty(exports,"hasTextBoxOutline",{enumerable:true,get:function(){return chunkLW5OFHSW_js.s}});Object.defineProperty(exports,"isBehindText",{enumerable:true,get:function(){return chunkLW5OFHSW_js.D}});Object.defineProperty(exports,"isDecorativeImage",{enumerable:true,get:function(){return chunkLW5OFHSW_js.H}});Object.defineProperty(exports,"isFloatingImage",{enumerable:true,get:function(){return chunkLW5OFHSW_js.C}});Object.defineProperty(exports,"isFloatingTextBox",{enumerable:true,get:function(){return chunkLW5OFHSW_js.q}});Object.defineProperty(exports,"isInFrontOfText",{enumerable:true,get:function(){return chunkLW5OFHSW_js.E}});Object.defineProperty(exports,"isInlineImage",{enumerable:true,get:function(){return chunkLW5OFHSW_js.B}});Object.defineProperty(exports,"isShapeTextBox",{enumerable:true,get:function(){return chunkLW5OFHSW_js.i}});Object.defineProperty(exports,"isTextBoxDrawing",{enumerable:true,get:function(){return chunkLW5OFHSW_js.h}});Object.defineProperty(exports,"parseDrawing",{enumerable:true,get:function(){return chunkLW5OFHSW_js.z}});Object.defineProperty(exports,"parseImage",{enumerable:true,get:function(){return chunkLW5OFHSW_js.A}});Object.defineProperty(exports,"parseTextBox",{enumerable:true,get:function(){return chunkLW5OFHSW_js.j}});Object.defineProperty(exports,"parseTextBoxContent",{enumerable:true,get:function(){return chunkLW5OFHSW_js.g}});Object.defineProperty(exports,"parseTextBoxFromShape",{enumerable:true,get:function(){return chunkLW5OFHSW_js.l}});Object.defineProperty(exports,"resolveTextBoxFillColor",{enumerable:true,get:function(){return chunkLW5OFHSW_js.v}});Object.defineProperty(exports,"resolveTextBoxOutlineColor",{enumerable:true,get:function(){return chunkLW5OFHSW_js.w}});Object.defineProperty(exports,"emuToPixels",{enumerable:true,get:function(){return chunkBJSG6TEG_js.f}});Object.defineProperty(exports,"pixelsToEmu",{enumerable:true,get:function(){return chunkBJSG6TEG_js.g}});Object.defineProperty(exports,"computeListRendering",{enumerable:true,get:function(){return chunkH57LNDBH_js.d}});Object.defineProperty(exports,"createNumberingMap",{enumerable:true,get:function(){return chunkH57LNDBH_js.c}});Object.defineProperty(exports,"formatNumber",{enumerable:true,get:function(){return chunkH57LNDBH_js.e}});Object.defineProperty(exports,"getBulletCharacter",{enumerable:true,get:function(){return chunkH57LNDBH_js.h}});Object.defineProperty(exports,"getCachedNumberingMap",{enumerable:true,get:function(){return chunkH57LNDBH_js.b}});Object.defineProperty(exports,"isBulletLevel",{enumerable:true,get:function(){return chunkH57LNDBH_js.i}});Object.defineProperty(exports,"parseNumbering",{enumerable:true,get:function(){return chunkH57LNDBH_js.a}});Object.defineProperty(exports,"renderListMarker",{enumerable:true,get:function(){return chunkH57LNDBH_js.g}});exports.DEFAULT_TAB_ALIGNMENT=L;exports.DEFAULT_TAB_INTERVAL_TWIPS=R;exports.DEFAULT_TAB_LEADER=jt;exports.KNOWN_FIELD_TYPES=M;exports.calculateTabWidth=Yt;exports.calculateTabWidthWithAlignment=Jt;exports.createComplexFieldContext=ht;exports.getFieldDisplayValue=gt;exports.getFormatSwitch=dt;exports.getLeaderCharacter=Zt;exports.getNextTabStop=D;exports.getOutlineWidthPx=Vt;exports.getShapeDimensionsPx=Ut;exports.getShapeHeightPx=kt;exports.getShapeWidthPx=Ot;exports.hasFill=Ht;exports.hasMergeFormat=ft;exports.hasOutline=Wt;exports.hasTextContent=vt;exports.hasVisibleLeader=qt;exports.injectReplyRangeMarkers=Qt;exports.injectTCReplyRangeMarkers=$t;exports.isDateTimeField=yt;exports.isDocPropertyField=St;exports.isFloatingShape=Xt;exports.isKnownFieldType=ct;exports.isLineShape=Nt;exports.isMergeField=bt;exports.isPageNumberField=Tt;exports.isReferenceField=Ft;exports.isShapeDrawing=Pt;exports.isTextBoxShape=Bt;exports.isTocField=Et;exports.isTotalPagesField=xt;exports.mergeTabStops=Kt;exports.parseFieldInstruction=ut;exports.parseFieldType=I;exports.parseShape=W;exports.parseShapeFromDrawing=Dt;exports.parseSimpleField=mt;exports.parseTabStop=V;exports.parseTabStops=G;exports.parseTabStopsFromParagraphProperties=zt;exports.resolveFillColor=Gt;exports.resolveOutlineColor=_t;
|