@eigenpal/docx-editor-core 1.0.1 → 1.0.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-2D3UPAMA.mjs +1 -0
- package/dist/{chunk-GNPLUGUG.mjs → chunk-2RCMY2GE.mjs} +1 -1
- package/dist/{chunk-YUKBAAB5.mjs → chunk-4S5VOHQK.mjs} +1 -1
- package/dist/chunk-5TNMVXDS.mjs +1 -0
- package/dist/{chunk-SYJAAHUK.js → chunk-6DK4UBGM.js} +1 -1
- package/dist/{chunk-LDAOONXZ.mjs → chunk-6PR4XHQ3.mjs} +1 -1
- package/dist/{chunk-62NPHRTF.js → chunk-7SGC3CXJ.js} +1 -1
- package/dist/{chunk-GXW7YSFL.mjs → chunk-APFTVA4F.mjs} +1 -1
- package/dist/chunk-BKHQA6JJ.js +1 -0
- package/dist/{chunk-O5X22KZ6.mjs → chunk-BOYVCOLZ.mjs} +1 -1
- package/dist/{chunk-NFYCMDM5.js → chunk-BS35CXMN.js} +1 -1
- package/dist/chunk-BTOBVF4I.mjs +1 -0
- package/dist/chunk-C2BAPYGJ.js +1 -0
- package/dist/{chunk-WLQEPVDR.js → chunk-CP767TWV.js} +1 -1
- package/dist/{chunk-N3GIC2UI.mjs → chunk-EXOP727C.mjs} +1 -1
- package/dist/{chunk-GH5N36F7.js → chunk-GFQM7PKY.js} +1 -1
- package/dist/{chunk-ZYESB4KC.mjs → chunk-LDKESXXK.mjs} +1 -1
- package/dist/chunk-LE67NTCN.mjs +1 -0
- package/dist/{chunk-WNTT4MGC.js → chunk-LTYW3NLX.js} +3 -3
- package/dist/{chunk-KSYEBTYE.js → chunk-NLTX7XVR.js} +1 -1
- package/dist/chunk-NMSU4MWP.mjs +1 -0
- package/dist/chunk-OLKDLRJ4.js +1 -0
- package/dist/{chunk-LVD6HXRF.mjs → chunk-P6RNOYAG.mjs} +1 -1
- package/dist/{chunk-RSMS6OTE.mjs → chunk-RCS6UNIJ.mjs} +1 -1
- package/dist/chunk-T5RYEG2V.js +1 -0
- package/dist/chunk-TYYOBPNK.js +1 -0
- package/dist/{chunk-4EHBV73E.mjs → chunk-UCZVMHB5.mjs} +1 -1
- package/dist/{chunk-CCWOLPZE.js → chunk-V435QKZB.js} +2 -2
- package/dist/{chunk-DFZTUQ7O.js → chunk-VQ2QGHYS.js} +1 -1
- package/dist/{chunk-HVZMO3BU.js → chunk-WZP6ZHBR.js} +1 -1
- package/dist/{chunk-UDPROEUK.js → chunk-XCMA7AY7.js} +1 -1
- package/dist/{chunk-DWFWYHM5.mjs → chunk-XDH55WXX.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/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/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/measuring/index.js +1 -1
- package/dist/layout-bridge/measuring/index.mjs +1 -1
- package/dist/layout-bridge/tableInsertHover.js +1 -1
- package/dist/layout-bridge/tableInsertHover.mjs +1 -1
- package/dist/layout-bridge/toFlowBlocks.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 +9 -9
- package/dist/mcp.js +2 -2
- package/dist/mcp.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 +1 -1
- 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-6VUYFDHY.mjs +0 -1
- package/dist/chunk-7UTXBQKF.mjs +0 -1
- package/dist/chunk-BD4CYYFB.js +0 -1
- package/dist/chunk-DN36K5JU.mjs +0 -1
- package/dist/chunk-ITVXBQGR.mjs +0 -1
- package/dist/chunk-JKVXID22.mjs +0 -1
- package/dist/chunk-PK4PDRTA.js +0 -1
- package/dist/chunk-SUXJX72X.js +0 -1
- package/dist/chunk-T4CPTPRP.js +0 -1
- package/dist/chunk-TZJUO3NW.js +0 -1
package/dist/chunk-ITVXBQGR.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {d}from'./chunk-DN36K5JU.mjs';import {q as q$1,g,h}from'./chunk-5N5DBQJV.mjs';import {a as a$2}from'./chunk-7E5VBRDL.mjs';import {p,s}from'./chunk-7UTXBQKF.mjs';import {v}from'./chunk-3GNIP6IX.mjs';import {c as c$1}from'./chunk-GNPLUGUG.mjs';import {b,a,c}from'./chunk-QPFJJPIC.mjs';import {c as c$2}from'./chunk-MOKKS75W.mjs';import {a as a$1}from'./chunk-AMENZY5F.mjs';import {i,e}from'./chunk-VW22RZ6C.mjs';var V={fragment:"layout-fragment",paragraph:"layout-fragment-paragraph",table:"layout-fragment-table",image:"layout-fragment-image",line:"layout-line",run:"layout-run"};function dt(e){return e.kind==="paragraph"}function pt(e){return e.kind==="table"}function ct(e){return e.kind==="image"}function oe(e){e.style.position="absolute",e.style.overflow="hidden";}function ft(e,t,o){let n=o.createElement("div");return n.className=`${V.fragment} ${V.paragraph}`,oe(n),n.dataset.blockId=String(e.blockId),n.dataset.fromLine=String(e.fromLine),n.dataset.toLine=String(e.toLine),e.pmStart!==void 0&&(n.dataset.pmStart=String(e.pmStart)),e.pmEnd!==void 0&&(n.dataset.pmEnd=String(e.pmEnd)),e.continuesFromPrev&&(n.dataset.continuesFromPrev="true"),e.continuesOnNext&&(n.dataset.continuesOnNext="true"),n}function gt(e,t,o){let n=o.createElement("div");return n.className=`${V.fragment} ${V.table}`,oe(n),n.dataset.blockId=String(e.blockId),n.dataset.fromRow=String(e.fromRow),n.dataset.toRow=String(e.toRow),e.pmStart!==void 0&&(n.dataset.pmStart=String(e.pmStart)),e.pmEnd!==void 0&&(n.dataset.pmEnd=String(e.pmEnd)),n}function mt(e,t,o){let n=o.createElement("div");return n.className=`${V.fragment} ${V.image}`,oe(n),n.dataset.blockId=String(e.blockId),e.pmStart!==void 0&&(n.dataset.pmStart=String(e.pmStart)),e.pmEnd!==void 0&&(n.dataset.pmEnd=String(e.pmEnd)),e.isAnchored&&(n.dataset.anchored="true"),e.zIndex!==void 0&&(n.style.zIndex=String(e.zIndex)),n}function we(e,t,o={}){let n=o.document??document;if(dt(e))return ft(e,t,n);if(pt(e))return gt(e,t,n);if(ct(e))return mt(e,t,n);let r=n.createElement("div");r.className=V.fragment,oe(r);let i=e;return i.blockId!==void 0&&(r.dataset.blockId=String(i.blockId)),i.kind&&(r.dataset.kind=i.kind),r}var E={fragment:"layout-paragraph",line:"layout-line",run:"layout-run",text:"layout-run-text",tab:"layout-run-tab",image:"layout-run-image",lineBreak:"layout-run-linebreak"};function A(e){return e.kind==="text"}function z(e){return e.kind==="tab"}function j(e){return e.kind==="image"}function W(e){return e.kind==="lineBreak"}function K(e){return e.kind==="field"}function Z(e){return !b(e.wrapType)&&e.wrapType!=="topAndBottom"}function Y(e){return e.wrapType==="behind"}function M(e){return a(e.wrapType)?true:e.displayMode==="float"}function ht(e){return b(e.wrapType)||e.wrapType==="topAndBottom"?false:c(e.wrapType)?true:e.displayMode==="float"&&e.cssFloat!=="none"}function re(e){return e==="left"?"right":e==="right"?"left":"bothSides"}var Ke={image:"layout-image",imageAnchored:"layout-image-anchored"};function q(e){return !!(e.cropTop||e.cropRight||e.cropBottom||e.cropLeft||e.opacity!=null&&e.opacity<1)}function J(e,t){let o=t.cropTop??0,n=t.cropRight??0,r=t.cropBottom??0,i=t.cropLeft??0;(o||n||r||i)&&(e.style.clipPath=`inset(${o*100}% ${n*100}% ${r*100}% ${i*100}%)`),t.opacity!=null&&t.opacity<1&&(e.style.opacity=String(Math.max(0,t.opacity)));}function ie(e,t,o,n,r={}){let i=r.document??document,a=i.createElement("div");a.className=Ke.image,e.isAnchored&&a.classList.add(Ke.imageAnchored),a.style.position="absolute",a.style.width=`${e.width}px`,a.style.height=`${e.height}px`,a.style.overflow="hidden",e.zIndex!==void 0&&(a.style.zIndex=String(e.zIndex)),t.anchor?.behindDoc&&(a.style.zIndex="-1"),a.dataset.blockId=String(e.blockId),e.pmStart!==void 0&&(a.dataset.pmStart=String(e.pmStart)),e.pmEnd!==void 0&&(a.dataset.pmEnd=String(e.pmEnd));let l=i.createElement("img");if(l.src=t.src,l.alt=t.alt??"",l.style.width="100%",l.style.height="100%",l.style.objectFit="contain",l.style.display="block",t.transform&&(l.style.transform=t.transform),l.draggable=false,t.hlinkHref){let d=i.createElement("a");d.href=t.hlinkHref,d.target="_blank",d.rel="noopener noreferrer",d.style.display="block",d.style.width="100%",d.style.height="100%",d.appendChild(l),a.appendChild(d);}else a.appendChild(l);return a}function ut(e,t,o){if(t.fontFamily&&(e.style.fontFamily=a$1(t.fontFamily).cssFallback),t.fontSize){let r=t.fontSize*96/72;e.style.fontSize=`${r}px`;}if(t.bold&&(e.style.fontWeight="bold"),t.italic&&(e.style.fontStyle="italic"),t.color&&(e.style.color=t.color),t.letterSpacing&&(e.style.letterSpacing=`${t.letterSpacing}px`),t.allCaps&&(e.style.textTransform="uppercase"),t.smallCaps&&(e.style.fontVariant="small-caps"),t.positionPx&&(e.style.verticalAlign=`${t.positionPx}px`),t.horizontalScale&&t.horizontalScale!==100&&(e.style.display="inline-block",e.style.transform=`scaleX(${t.horizontalScale/100})`,e.style.transformOrigin="left center"),t.kerningMinPt&&t.kerningMinPt>0&&(t.fontSize??11)>=t.kerningMinPt&&(e.style.fontKerning="normal"),t.emboss&&(e.style.textShadow="1px 1px 1px rgba(255,255,255,0.5), -1px -1px 1px rgba(0,0,0,0.3)"),t.imprint&&(e.style.textShadow="-1px -1px 1px rgba(255,255,255,0.5), 1px 1px 1px rgba(0,0,0,0.3)"),t.textShadow&&!t.emboss&&!t.imprint&&(e.style.textShadow="1px 1px 2px rgba(0,0,0,0.3)"),t.textOutline&&(e.style.webkitTextStroke="1px currentColor",e.style.webkitTextFillColor="transparent"),t.emphasisMark){let r=t.emphasisMark==="comma"?"filled sesame":t.emphasisMark==="circle"?"filled circle":"filled dot",i=t.emphasisMark==="underDot"?"under right":"over right";e.style.textEmphasis=`${r}`,e.style.textEmphasisPosition=i,e.style.webkitTextEmphasis=r,e.style.webkitTextEmphasisPosition=i;}t.highlight&&(e.style.backgroundColor=t.highlight);let n=[];if(t.underline&&(n.push("underline"),typeof t.underline=="object"&&(t.underline.style&&(e.style.textDecorationStyle=t.underline.style),t.underline.color&&(e.style.textDecorationColor=t.underline.color))),t.strike&&n.push("line-through"),t.commentIds&&t.commentIds.length>0){let r=t.commentIds.find(i=>!o||!o.has(i));r!=null&&(e.style.backgroundColor="rgba(255, 212, 0, 0.15)",e.style.borderBottom="1px solid rgba(255, 212, 0, 0.4)",e.dataset.commentId=String(r));}t.isInsertion&&(e.style.backgroundColor="rgba(52, 168, 83, 0.08)",e.style.borderBottom="2px dashed #2e7d32",e.style.paddingBottom="1px",e.classList.add("docx-insertion"),t.changeAuthor&&(e.dataset.changeAuthor=t.changeAuthor),t.changeDate&&(e.dataset.changeDate=t.changeDate),t.changeRevisionId!=null&&(e.dataset.revisionId=String(t.changeRevisionId))),t.isDeletion&&(e.style.backgroundColor="rgba(211, 47, 47, 0.08)",e.style.color="#c62828",n.includes("line-through")||n.push("line-through"),e.style.textDecorationColor="#c62828",e.classList.add("docx-deletion"),t.changeAuthor&&(e.dataset.changeAuthor=t.changeAuthor),t.changeDate&&(e.dataset.changeDate=t.changeDate),t.changeRevisionId!=null&&(e.dataset.revisionId=String(t.changeRevisionId))),n.length>0&&(e.style.textDecorationLine=n.join(" ")),t.superscript&&(e.style.verticalAlign="super",e.style.fontSize="0.75em"),t.subscript&&(e.style.verticalAlign="sub",e.style.fontSize="0.75em"),t.hidden&&(e.classList.add("docx-hidden"),e.style.opacity="0.4",e.style.textDecoration="underline dotted"),t.rtl&&e.setAttribute("dir","rtl"),t.textEffect&&(e.classList.add("docx-text-effect",`docx-text-effect-${t.textEffect}`),e.dataset.effect=t.textEffect);}function G(e,t,o){t!==void 0&&(e.dataset.pmStart=String(t)),o!==void 0&&(e.dataset.pmEnd=String(o));}function Q(e,t,o){let n=t.createElement("span");if(n.className=`${E.run} ${E.text}`,ut(n,e,o),G(n,e.pmStart,e.pmEnd),e.hyperlink){let r=t.createElement("a");r.href=e.hyperlink.href,e.hyperlink.href.startsWith("#")||(r.target="_blank",r.rel="noopener noreferrer"),e.hyperlink.tooltip&&(r.title=e.hyperlink.tooltip),r.textContent=e.text,r.style.color="inherit",r.style.textDecoration="inherit",e.hyperlink.noDefaultStyle||(e.color||(r.style.color="#0563c1",n.style.color="#0563c1"),e.underline||(r.style.textDecoration="underline")),n.appendChild(r);}else n.textContent=e.text;return n}var yt=1e3;function ae(e,t,o,n){let r=t.createElement("span");r.className=`${E.run} ${E.tab}`,r.style.display="inline-block",r.style.width=`${o}px`,G(r,e.pmStart,e.pmEnd);let i=n&&n!=="none"?bt(n):null;if(i){r.style.position="relative",r.textContent="\u200B";let a=t.createElement("span");a.style.position="absolute",a.style.left="0",a.style.right="0",a.style.top="0",a.style.bottom="0",a.style.overflow="hidden",a.style.whiteSpace="nowrap",a.textContent=i.repeat(yt),r.appendChild(a);}else r.textContent="\xA0";return r}function bt(e){switch(e){case "dot":return ".";case "hyphen":return "-";case "underscore":return "_";case "middleDot":return "\xB7";case "heavy":return "_";default:return null}}function Ue(e){if(!e)return 0;let t=e.match(/rotate\(([-\d.]+)deg\)/);return t?(parseFloat(t[1])%360+360)%360:0}function Xe(e,t,o){if(o===0||o===180)return {w:e,h:t};if(o===90||o===270)return {w:t,h:e};let n=o*Math.PI/180,r=Math.abs(Math.sin(n)),i=Math.abs(Math.cos(n));return {w:e*i+t*r,h:e*r+t*i}}function xt(e,t){let o=t.createElement("img");o.className=`${E.run} ${E.image}`,o.src=e.src,o.width=e.width,o.height=e.height,o.style.width=`${e.width}px`,o.style.height=`${e.height}px`,e.alt&&(o.alt=e.alt),e.transform&&(o.style.transform=e.transform,o.style.transformOrigin="center center"),q(e)&&J(o,e);let n=Ue(e.transform);if(n!==0){let r=Xe(e.width,e.height,n),i=t.createElement("span");return i.style.display="inline-block",i.style.position="relative",i.style.width=`${r.w}px`,i.style.height=`${r.h}px`,i.style.verticalAlign="middle",o.style.position="absolute",o.style.left=`${(r.w-e.width)/2}px`,o.style.top=`${(r.h-e.height)/2}px`,G(i,e.pmStart,e.pmEnd),i.appendChild(o),i}return o.style.display="inline-block",o.style.verticalAlign="middle",G(o,e.pmStart,e.pmEnd),o}function Ye(e,t){let o=t.createElement("div");o.className="layout-block-image",o.style.display="block",o.style.textAlign="center",o.style.marginTop=`${e.distTop??6}px`,o.style.marginBottom=`${e.distBottom??6}px`;let n=t.createElement("img");n.src=e.src,n.width=e.width,n.height=e.height,n.style.marginLeft="auto",n.style.marginRight="auto",e.alt&&(n.alt=e.alt),e.transform&&(n.style.transform=e.transform,n.style.transformOrigin="center center"),q(e)&&J(n,e);let r=Ue(e.transform);if(r!==0){let i=Xe(e.width,e.height,r);o.style.height=`${i.h}px`,o.style.position="relative",n.style.position="absolute",n.style.left="50%",n.style.top="50%",n.style.marginLeft=`${-e.width/2}px`,n.style.marginRight="0",n.style.marginTop=`${-e.height/2}px`;}return G(o,e.pmStart,e.pmEnd),o.appendChild(n),o}function se(e,t){return M(e)||e.displayMode==="block"||e.wrapType==="topAndBottom"?Ye(e,t):xt(e,t)}function Fe(e,t){let o=t.createElement("br");return o.className=`${E.run} ${E.lineBreak}`,G(o,e.pmStart,e.pmEnd),o}function le(e,t,o){let n=e.fallback??"";switch(e.fieldType){case "PAGE":n=String(o.pageNumber);break;case "NUMPAGES":n=String(o.totalPages);break;case "DATE":n=new Date().toLocaleDateString();break;case "TIME":n=new Date().toLocaleTimeString();break}let r={text:n,bold:e.bold,italic:e.italic,underline:e.underline,strike:e.strike,color:e.color,highlight:e.highlight,fontFamily:e.fontFamily,fontSize:e.fontSize,pmStart:e.pmStart,pmEnd:e.pmEnd};return Q(r,t,o?.resolvedCommentIds)}function ke(e,t,o){if(A(e))return Q(e,t,o?.resolvedCommentIds);if(z(e))return ae(e,t,48,void 0);if(j(e))return se(e,t);if(W(e))return Fe(e,t);if(K(e)&&o)return le(e,t,o);let n=t.createElement("span");return n.className=E.run,n}function Ie(e){return e/1440*96}function Tt(e){return e/96*1440}function St(e){let{explicitStops:t=[],defaultTabInterval:o=720,leftIndent:n=0}=e,r=t.filter(c=>c.val!=="clear").filter(c=>c.pos>=n),i=t.filter(c=>c.val==="clear").map(c=>c.pos),a=r.reduce((c,T)=>Math.max(c,T.pos),0),l=[...r];n>0&&!r.some(c=>c.pos<=n)&&(i.some(T=>Math.abs(T-n)<20)||l.push({val:"start",pos:n,leader:"none"}));let f=a>0?Math.max(a,n):n,s=n+14400;for(;f<s;){f+=o;let c=r.some(m=>Math.abs(m.pos-f)<20),T=i.some(m=>Math.abs(m-f)<20),b=n>0&&Math.abs(f-n)<20;!c&&!T&&!b&&l.push({val:"start",pos:f,leader:"none"});}return l.sort((c,T)=>c.pos-T.pos)}function Ze(e,t,o="",n,r="."){let{defaultTabInterval:i=720}=t,a=Tt(e),d=St(t).find(c=>c.pos>a);if(!d){let c=Ie(i),T=c-e%c;return T<=0&&(T=c),{width:T,alignment:"default"}}let s=Ie(d.pos)-e;if(d.val==="center"||d.val==="end"){let c=n?n(o):0;d.val==="center"?s-=c/2:s-=c;}else if(d.val==="decimal"){let c=o.indexOf(r);if(c>=0&&n){let T=o.slice(0,c),b=n(T);s-=b;}}else if(d.val==="bar")return {width:0,leader:d.leader,alignment:"bar"};if(s<1){let c=Ie(i),T=c-e%c;return T<=0&&(T=c),{width:T,alignment:"default"}}return {width:s,leader:d.leader,alignment:d.val}}function Je(e,t){let o=[],n=e.runs;for(let r=t.fromRun;r<=t.toRun;r++){let i=n[r];if(i)if(A(i)){let a=r===t.fromRun?t.fromChar:0,l=r===t.toRun?t.toChar:i.text.length;if(a>0||l<i.text.length){let d=i.text.slice(a,l);o.push({...i,text:d,pmStart:i.pmStart!==void 0?i.pmStart+a:void 0,pmEnd:i.pmStart!==void 0?i.pmStart+l:void 0});}else o.push(i);}else o.push(i);}return o}function qe(e){return [e.pmStart??"no-start",e.pmEnd??"no-end",e.src,e.width,e.height,e.displayMode??"inline",e.wrapType??"none"].join("|")}function wt(e){return {val:e.val,pos:e.pos,leader:e.leader}}function Ft(e,t,o){let n="";for(let r=t+1;r<e.length;r++){let i=e[r];if(A(i))n+=i.text;else if(K(i))i.fieldType==="PAGE"&&o?n+=String(o.pageNumber):i.fieldType==="NUMPAGES"&&o?n+=String(o.totalPages):n+=i.fallback??"";else if(z(i)||W(i))break}return n}var kt=.5;function It(e,t,o,n){let r=0;for(let i=t+1;i<e.length;i++){let a=e[i];if(z(a)||W(a))break;if(A(a))r+=o(a.text||"",a.fontSize,a.fontFamily,a.bold,a.italic);else if(K(a)){let l;a.fieldType==="PAGE"&&n?l=String(n.pageNumber):a.fieldType==="NUMPAGES"&&n?l=String(n.totalPages):l=a.fallback??"",r+=o(l,a.fontSize,a.fontFamily,a.bold,a.italic);}else j(a)&&!M(a)&&(r+=a.width||0);}return r}function Ct(e){let o=e.createElement("canvas").getContext("2d");return (n,r=11,i="Calibri",a=false,l=false)=>{if(!o)return n.length*7;let d=a$1(i).cssFallback,f=r*96/72,s=[];return l&&s.push("italic"),a&&s.push("bold"),s.push(`${f}px`,d),o.font=s.join(" "),o.measureText(n).width}}function de(e,t,o,n,r){let i=n.createElement("div");i.className=E.line,i.style.height=`${t.lineHeight}px`,i.style.lineHeight=`${t.lineHeight}px`;let a=Je(e,t);if(a.length===1&&j(a[0])){let p=a[0].position?.horizontal?.align??o;i.style.display="flex",i.style.alignItems="center",i.style.justifyContent=p==="center"?"center":p==="right"?"flex-end":"flex-start",i.dataset.flexLine="true";}if(a.length===0){let h=n.createElement("span");return h.className=`${E.run} layout-empty-run`,h.innerHTML=" ",i.appendChild(h),i}let l=o==="justify",d=false;l&&r&&(d=!r.isLastLine||r.paragraphEndsWithLineBreak,d&&(i.style.textAlign="justify",i.style.textAlignLast="justify",i.style.width=`${r.availableWidth}px`)),i.style.whiteSpace="pre";let f=a.some(h=>A(h)&&h.highlight);i.style.overflow=f?"hidden":"visible";let s=a.some(z),c,T=Ct(n);if(s){let h=r?.tabStops?.map(wt),g=r?.leftIndentPx?Math.round(r.leftIndentPx*15):0;c={explicitStops:h,leftIndent:g};}let b=0,m=r?.leftIndentPx??0;if(r?.isFirstLine){let h=r?.firstLineIndentPx??0;b=m+h;}else b=m;for(let h=0;h<a.length;h++){let g=a[h];if(z(g)&&c){let p=Ft(a,h,r?.context),y=Ze(b,c,p,T),u=r?.lineRightEdgePx,S=u!==void 0?It(a,h,T,r?.context):0,w=false;for(let x=h+1;x<a.length&&!W(a[x]);x++)if(z(a[x])){w=true;break}if(u!==void 0&&y.alignment==="end"&&!w&&b+y.width+S>=u-kt){i.style.display="flex",i.style.alignItems="baseline",i.style.whiteSpace="nowrap",i.style.textIndent="0",i.dataset.flexLine="true",r?.isFirstLine&&r.firstLineIndentPx&&r.firstLineIndentPx<0&&i.firstElementChild instanceof HTMLElement&&(i.firstElementChild.style.marginLeft=`${r.firstLineIndentPx}px`);let x=ae(g,n,0,y.leader);x.style.flex="1 1 0",x.style.minWidth="0",x.style.width="auto",i.appendChild(x);for(let k=h+1;k<a.length;k++){let P=a[k];if(z(P)||W(P))break;if(A(P))i.appendChild(Q(P,n,r?.context?.resolvedCommentIds));else if(K(P)&&r?.context)i.appendChild(le(P,n,r.context));else if(j(P)){if(M(P))continue;let C=qe(P);r?.renderedInlineImageKeys?.has(C)||(r?.renderedInlineImageKeys?.add(C),i.appendChild(se(P,n)));}else i.appendChild(ke(P,n,r?.context));}break}let I=y.width;u!==void 0&&b+I+S>u&&(I=Math.max(1,u-b-S));let R=ae(g,n,I,y.leader);i.appendChild(R),b+=I;}else if(A(g)){let p=Q(g,n,r?.context?.resolvedCommentIds);if(g.highlight){let w=(g.fontSize?g.fontSize*96/72:14.67)*1.2,F=Math.max(0,t.lineHeight-w);if(F>0){let I=F/2;p.style.paddingTop=`${I}px`,p.style.paddingBottom=`${I}px`;}}i.appendChild(p);let y=g.fontSize||11,u=g.fontFamily||"Calibri";b+=T(g.text,y,u,g.bold,g.italic);}else if(j(g)){if(M(g))continue;let p=qe(g);if(r?.renderedInlineImageKeys?.has(p))continue;r?.renderedInlineImageKeys?.add(p);let y=se(g,n);i.appendChild(y),g.displayMode!=="block"&&g.wrapType!=="topAndBottom"&&(b+=g.width);}else if(W(g)){let p=Fe(g,n);i.appendChild(p);}else if(K(g)&&r?.context){let p=le(g,n,r.context);i.appendChild(p);let y=g.fallback??"";g.fieldType==="PAGE"?y=String(r.context.pageNumber):g.fieldType==="NUMPAGES"&&(y=String(r.context.totalPages));let u=g.fontSize||11,S=g.fontFamily||"Calibri";b+=T(y,u,S,g.bold,g.italic);}else {let p=ke(g,n,r?.context);i.appendChild(p);}}return i}function ee(e,t){return !e&&!t?true:!e||!t?false:e.style===t.style&&e.width===t.width&&e.color===t.color}function Qe(e,t){return !e&&!t||!e||!t?false:ee(e.top,t.top)&&ee(e.bottom,t.bottom)&&ee(e.left,t.left)&&ee(e.right,t.right)&&ee(e.between,t.between)}function $(e,t,o,n,r={}){let i=r.document??document,a=i.createElement("div");a.className=E.fragment,a.style.position=n.positioning==="absolute"?"absolute":"relative",a.dataset.blockId=String(e.blockId),a.dataset.fromLine=String(e.fromLine),a.dataset.toLine=String(e.toLine),G(a,e.pmStart,e.pmEnd),e.continuesFromPrev&&(a.dataset.continuesFromPrev="true"),e.continuesOnNext&&(a.dataset.continuesOnNext="true");let l=o.lines.slice(e.fromLine,e.toLine),d=t.attrs?.alignment;t.attrs?.styleId&&(a.dataset.styleId=t.attrs.styleId);let f=t.attrs?.bidi;f&&(a.dir="rtl"),d?d==="center"?a.style.textAlign="center":d==="right"?a.style.textAlign="right":d==="left"?a.style.textAlign="left":a.style.textAlign=f?"right":"left":f&&(a.style.textAlign="right");let s=t.attrs?.indent,c=0,T=0;s&&(f?(s.left&&s.left>0&&(T=s.left),s.right&&s.right>0&&(c=s.right)):(s.left&&s.left>0&&(c=s.left),s.right&&s.right>0&&(T=s.right)));let b=t.attrs?.borders;if(b){let S=C=>{switch(C){case "single":return "solid";case "double":return "double";case "dotted":return "dotted";case "dashed":return "dashed";case "thick":return "solid";case "wave":return "wavy";case "dashSmallGap":return "dashed";case "nil":case "none":return "none";default:return "solid"}};a.style.boxSizing="border-box";let w=C=>`${C.width}px ${S(C.style)} ${C.color}`,F=Qe(r.prevBorders,b),I=Qe(b,r.nextBorders),R=F?b.between:b.top,x=I?void 0:b.bottom,k=i.createElement("div");if(k.className="layout-paragraph-border",k.style.position="absolute",k.style.pointerEvents="none",k.style.boxSizing="border-box",k.style.left=`${c-(b.left?.space??0)}px`,k.style.right=`${T-(b.right?.space??0)}px`,k.style.top=`${-(R?.space??0)}px`,k.style.bottom=`${-(x?.space??0)}px`,R&&(k.style.borderTop=w(R)),x&&(k.style.borderBottom=w(x)),b.left&&(k.style.borderLeft=w(b.left)),b.right&&(k.style.borderRight=w(b.right)),(R||x||b.left||b.right)&&a.appendChild(k),b.bar){let C=i.createElement("div");C.style.position="absolute",C.style.left="-8px",C.style.top="0",C.style.bottom="0",C.style.borderLeft=w(b.bar),a.style.position="relative",a.appendChild(C);}}t.attrs?.shading&&(a.style.backgroundColor=t.attrs.shading);let m=e.width-c-T,g=t.runs[t.runs.length-1]?.kind==="lineBreak",p=o.lines.length,y=0;s?.hanging&&s.hanging>0?y=-s.hanging:s?.firstLine&&s.firstLine>0&&(y=s.firstLine);let u=r.renderedInlineImageKeys??new Set;for(let S=0;S<l.length;S++){let w=l[S],F=e.fromLine+S,I=F===p-1,R=F===0&&!e.continuesFromPrev,x=w.leftOffset??0,k=w.rightOffset??0,P=m;if(R){let B=s?.hanging&&s.hanging>0,L=s?.firstLine&&s.firstLine>0;B&&s?.hanging?P=m+s.hanging:L&&s?.firstLine&&(P=m-s.firstLine);}if(Rt(w,t)){let B=i.createElement("div");B.className=`${E.line} layout-line-split`,B.style.position="relative",B.style.height=`${w.lineHeight}px`,B.style.lineHeight=`${w.lineHeight}px`;for(let L of w.segments){let be={fromRun:L.fromRun,fromChar:L.fromChar,toRun:L.toRun,toChar:L.toChar,width:L.width,ascent:w.ascent,descent:w.descent,lineHeight:w.lineHeight},D=de(t,be,d,i,{availableWidth:L.availableWidth,isLastLine:I,isFirstLine:R,paragraphEndsWithLineBreak:g,tabStops:t.attrs?.tabs,leftIndentPx:c,firstLineIndentPx:R?y:0,context:n,renderedInlineImageKeys:u});D.className+=" layout-line-segment",D.style.position="absolute",D.style.left=`${L.leftOffset}px`,D.style.top="0",D.style.width=`${L.availableWidth}px`,B.appendChild(D);}a.appendChild(B);continue}let C=de(t,w,d,i,{availableWidth:P-x-k,isLastLine:I,isFirstLine:R,paragraphEndsWithLineBreak:g,tabStops:t.attrs?.tabs,leftIndentPx:c,firstLineIndentPx:R?y:0,context:n,renderedInlineImageKeys:u,lineRightEdgePx:e.width-T-k});if(x>0||k>0){x>0&&(C.style.marginLeft=`${x}px`),k>0&&(C.style.marginRight=`${k}px`);let B=P-x-k;B>0&&(C.style.width=`${B}px`);}let Me=s?.hanging&&s.hanging>0,ve=s?.firstLine&&s.firstLine>0,lt=C.dataset.flexLine==="true";if(R?c>0&&Me?(C.style.paddingLeft=`${c}px`,lt||(C.style.textIndent=`-${s.hanging}px`)):c>0&&ve?(C.style.paddingLeft=`${c}px`,C.style.textIndent=`${s.firstLine}px`):c>0?C.style.paddingLeft=`${c}px`:ve&&(C.style.textIndent=`${s.firstLine}px`):c>0?C.style.paddingLeft=`${c}px`:Me&&(C.style.paddingLeft=`${s.hanging}px`),T>0&&(C.style.paddingRight=`${T}px`),R&&t.attrs?.listMarker&&!t.attrs?.listMarkerHidden){let B=Math.max(0,c-(s?.hanging??0));C.style.paddingLeft=`${B}px`,C.style.textIndent="0";let L;if(!t.attrs.listMarkerFontFamily||!t.attrs.listMarkerFontSize)for(let H=w.fromRun;H<=w.toRun;H++){let xe=t.runs[H];if(xe&&xe.kind==="text"){L=xe;break}}let be=t.attrs.listMarkerFontFamily??L?.fontFamily??t.attrs.defaultFontFamily,D=t.attrs.listMarkerFontSize??L?.fontSize??t.attrs.defaultFontSize,$e=Pt(t.attrs.listMarker,s,i,be,D);if((s?.hanging??0)>0)C.insertBefore($e,C.firstChild);else {let H=i.createElement("div");H.className="layout-line layout-list-marker-line",H.style.height=`${w.lineHeight}px`,H.style.lineHeight=`${w.lineHeight}px`,H.appendChild($e),a.appendChild(H);}}a.appendChild(C);}return a}function Rt(e,t){return (e.segments?.length??0)>1&&!t.attrs?.listMarker}function Pt(e,t,o,n,r){let i=o.createElement("span");if(i.className="layout-list-marker",n&&(i.style.fontFamily=a$1(n).cssFallback),r){let l=r*96/72;i.style.fontSize=`${l}px`;}i.textContent=e,i.style.textAlign="left",i.style.boxSizing="border-box";let a=t?.hanging??0;return i.style.display="inline-block",a>0&&(i.style.minWidth=`${a}px`),i}function U(e,t,o){let n=t.createElement("div");n.className=o.layerClass,n.style.position="absolute",n.style.top="0",n.style.left="0",o.sizing==="inset0"?(n.style.right="0",n.style.bottom="0"):(n.style.width="100%",n.style.height="100%",n.style.overflow="hidden"),n.style.pointerEvents="none",o.layerMode==="front"&&(n.style.zIndex="10");for(let r of e){let i=t.createElement("div");i.className=o.itemClass,i.style.position="absolute",i.style.pointerEvents="auto",i.style.top=`${r.y}px`,i.style.left=`${r.x}px`,r.pmStart!==void 0&&(i.dataset.pmStart=String(r.pmStart)),r.pmEnd!==void 0&&(i.dataset.pmEnd=String(r.pmEnd));let a=t.createElement("img");a.src=r.src,a.style.width=`${r.width}px`,a.style.height=`${r.height}px`,a.style.display="block",r.alt&&(a.alt=r.alt),r.transform&&(a.style.transform=r.transform,a.style.transformOrigin="center center"),q(r)&&J(a,r),i.appendChild(a),n.appendChild(i);}return n}var O={table:"layout-table",row:"layout-table-row",cell:"layout-table-cell",cellContent:"layout-table-cell-content",resizeHandle:"layout-table-resize-handle",rowResizeHandle:"layout-table-row-resize-handle",tableEdgeHandleBottom:"layout-table-edge-handle-bottom",tableEdgeHandleRight:"layout-table-edge-handle-right"};function Et(e$1,t,o){let n=[],r=0;for(let i=0;i<e$1.blocks.length;i++){let a=e$1.blocks[i];if(a?.kind!=="paragraph"){let f=t.blocks[i];f&&f.kind==="table"&&(r+=f.totalHeight??0);continue}let l=a;for(let f of l.runs){if(f.kind!=="image")continue;let s=f;if(!M(s))continue;let c=s.position,T=s.distTop??0,b=s.distBottom??0,m=s.distLeft??12,h=s.distRight??12,g="left",p=0;if(c?.horizontal){let u=c.horizontal;u.align==="right"?(g="right",p=o-s.width):u.align==="left"?p=0:u.align==="center"?p=(o-s.width)/2:u.posOffset!==void 0&&(p=e(u.posOffset),g=p>o/2?"right":"left");}else s.cssFloat==="right"&&(g="right",p=o-s.width);let y=r;if(c?.vertical){let u=c.vertical;u.posOffset!==void 0?y=r+e(u.posOffset):u.align==="top"&&(y=0);}p=Math.max(0,Math.min(p,o-s.width)),n.push({src:s.src,width:s.width,height:s.height,alt:s.alt,transform:s.transform,x:p,y,side:g,distTop:T,distBottom:b,distLeft:m,distRight:h,wrapText:re(s.cssFloat),wrapType:s.wrapType,pmStart:s.pmStart,pmEnd:s.pmEnd});}let d=t.blocks[i];d&&d.kind==="paragraph"&&(r+=d.totalHeight);}return n}function Lt(e,t,o,n){let r=n.createElement("div");r.className=O.cellContent,r.style.position="relative";let i=e.padding?.left??7,a=e.padding?.right??7,l=Math.max(0,t.width-i-a);r.style.width=`${l}px`;let d=Et(e,t,l),f;if(d.length>0){f=d.filter(Z).map(m=>{let h=m.x+m.width+m.distRight,g=m.y-m.distTop,p=m.y+m.height+m.distBottom,y=0,u=0,S=m.wrapText??"bothSides";return S==="right"?y=h:S==="left"?u=l-(m.x-m.distLeft):m.side==="left"?y=h:u=l-(m.x-m.distLeft),{leftMargin:y,rightMargin:u,topY:g,bottomY:p}});let b=d.filter(Y);b.length>0&&r.appendChild(U(b,n,{layerClass:"layout-cell-floating-images-layer",itemClass:"layout-cell-floating-image",sizing:"fullSize",layerMode:"behind"}));}let s$1=0,c=0;for(let b=0;b<e.blocks.length;b++){let m=e.blocks[b],h=t.blocks[b];if(m?.kind==="paragraph"&&h?.kind==="paragraph"){let g=m,p=h,y=g.attrs?.spacing,u=Math.max(c,y?.before??0);s$1+=u,f&&f.length>0&&(p=s(g,l,{floatingZones:f,paragraphYOffset:s$1}));let S={blockId:g.id,width:l,height:p.totalHeight,fromLine:0,toLine:p.lines.length,pmStart:g.pmStart,pmEnd:g.pmEnd},w={...o,insideTableCell:true},F=$(S,g,p,w,{document:n});F.style.position="relative",u>0&&(F.style.marginTop=`${u}px`),r.appendChild(F),s$1+=p.totalHeight,c=y?.after??0;}else if(m?.kind==="table"&&h?.kind==="table"){let g=m,p=h,y=c,u=Bt(g,p,o,n);u.style.position="relative",y>0&&(u.style.marginTop=`${y}px`),r.appendChild(u),s$1+=y+(h.totalHeight??0),c=0;}}c>0&&(r.style.paddingBottom=`${c}px`);let T=d.filter(b=>!Y(b));return T.length>0&&r.appendChild(U(T,n,{layerClass:"layout-cell-floating-images-layer",itemClass:"layout-cell-floating-image",sizing:"fullSize",layerMode:"front"})),r}function Bt(e,t,o,n){let r=n.createElement("div");r.className=`${O.table} layout-nested-table`,r.style.position="relative",r.style.width=`${t.totalWidth}px`,r.style.display="block",e.justification==="center"?(r.style.marginLeft="auto",r.style.marginRight="auto"):e.justification==="right"?r.style.marginLeft="auto":e.indent&&(r.style.marginLeft=`${e.indent}px`),r.dataset.blockId=String(e.id),e.pmStart!==void 0&&(r.dataset.pmStart=String(e.pmStart)),e.pmEnd!==void 0&&(r.dataset.pmEnd=String(e.pmEnd));let i=[],a=0;for(let f=0;f<t.rows.length;f++)i.push(a),a+=t.rows[f]?.height??0;i.push(a);let l=new Map,d=0;for(let f=0;f<e.rows.length;f++){let s=e.rows[f],c=t.rows[f];if(!s||!c)continue;let T=Ce(s,c,f,d,t.columnWidths,e.rows.length,o,n,l,i);r.appendChild(T),d+=c.height;}return r.style.height=`${d}px`,r}function pe(e,t,o){let n=`border${t.charAt(0).toUpperCase()+t.slice(1)}`;if(!o||o.style==="none"||o.style==="nil"||o.width===0)e.style[n]="none";else {let r=o.width??1,i=o.color??"#000000",a=o.style??"solid";e.style[n]=`${r}px ${a} ${i}`;}}function Mt(e,t,o,n,r,i,a){let l=a.createElement("div");l.className=O.cell,l.style.position="absolute",l.style.left=`${o}px`,l.style.top="0",l.style.width=`${t.width}px`,l.style.height=`${n}px`,l.style.overflow="hidden",l.style.boxSizing="border-box";let d=e.padding?.top??1,f=e.padding?.right??7,s=e.padding?.bottom??1,c=e.padding?.left??7;if(l.style.padding=`${d}px ${f}px ${s}px ${c}px`,e.borders&&(r.isFirstRow&&pe(l,"top",e.borders.top),pe(l,"right",e.borders.right),pe(l,"bottom",e.borders.bottom),r.isFirstCol&&pe(l,"left",e.borders.left)),e.background&&(l.style.backgroundColor=e.background),e.noWrap&&(l.style.whiteSpace="nowrap"),e.verticalAlign)switch(l.style.display="flex",l.style.flexDirection="column",e.verticalAlign){case "top":l.style.justifyContent="flex-start";break;case "center":l.style.justifyContent="center";break;case "bottom":l.style.justifyContent="flex-end";break}let T=Lt(e,t,i,a);if(l.appendChild(T),e.blocks.length>0){let b=e.blocks[0],m=e.blocks[e.blocks.length-1];b&&"pmStart"in b&&b.pmStart!==void 0&&(l.dataset.pmStart=String(b.pmStart)),m&&"pmEnd"in m&&m.pmEnd!==void 0&&(l.dataset.pmEnd=String(m.pmEnd));}return l}function Ce(e,t,o,n,r,i,a,l,d,f,s){let c=l.createElement("div");c.className=O.row,c.style.position="absolute",c.style.left="0",c.style.top=`${n}px`,c.style.width="100%",c.style.height=`${t.height}px`,c.dataset.rowIndex=String(o);let T=new Set;if(d){for(let[,h]of d)if(h.startRow<o&&h.startRow+h.rowSpan>o)for(let g=0;g<h.colSpan;g++)T.add(h.columnIndex+g);}let b=0,m=0;for(;T.has(m);)b+=r[m]??0,m++;for(let h=0;h<e.cells.length;h++){let g=e.cells[h],p=t.cells[h];if(!g||!p)continue;let y=g.colSpan??1,u=g.rowSpan??1,S=t.height;if(u>1&&f){S=0;for(let k=o;k<o+u&&k<f.length-1;k++)S+=(f[k+1]??0)-(f[k]??0);S===0&&(S=t.height*u);}let w=o===0||s===true,I=m===0;m+y>=r.length;let x=Mt(g,p,b,S,{isFirstRow:w,isFirstCol:I},a,l);if(x.dataset.cellIndex=String(h),x.dataset.columnIndex=String(m),u>1&&(x.dataset.rowSpan=String(u)),c.appendChild(x),u>1&&d){let k=`${o}-${m}`;d.set(k,{cell:g,cellMeasure:p,columnIndex:m,startRow:o,rowSpan:u,colSpan:y,x:b,totalHeight:S});}for(let k=0;k<y&&m+k<r.length;k++)b+=r[m+k]??0;for(m+=y;T.has(m);)b+=r[m]??0,m++;}return c}function X(e,t,o,n,r={}){let i=r.document??document,a=i.createElement("div");a.className=O.table,a.style.position=n.positioning==="flow"?"relative":"absolute",a.style.width=`${e.width}px`,a.style.height=`${e.height}px`,a.style.overflow="hidden",a.dataset.blockId=String(e.blockId),a.dataset.fromRow=String(e.fromRow),a.dataset.toRow=String(e.toRow),e.pmStart!==void 0&&(a.dataset.pmStart=String(e.pmStart)),e.pmEnd!==void 0&&(a.dataset.pmEnd=String(e.pmEnd));let l=0;for(let m=0;m<o.columnWidths.length-1;m++){l+=o.columnWidths[m]??0;let h=i.createElement("div");h.className=O.resizeHandle,h.style.position="absolute",h.style.left=`${l-3}px`,h.style.top="0",h.style.width="6px",h.style.height="100%",h.style.cursor="col-resize",h.style.zIndex="10",h.dataset.columnIndex=String(m),h.dataset.tableBlockId=String(e.blockId),e.pmStart!==void 0&&(h.dataset.tablePmStart=String(e.pmStart)),a.appendChild(h);}let d=[],f=0;for(let m=0;m<o.rows.length;m++)d.push(f),f+=o.rows[m]?.height??0;d.push(f);let s=new Map,c=e.headerRowCount??0,T=0;if(c>0&&e.continuesFromPrev)for(let m=0;m<c;m++){let h=t.rows[m],g=o.rows[m];if(!h||!g)continue;let p=Ce(h,g,m,T,o.columnWidths,t.rows.length,n,i,s,d,m===0);p.dataset.repeatedHeader="true",a.appendChild(p),T+=g.height;}for(let m=e.fromRow;m<e.toRow;m++){let h=t.rows[m],g=o.rows[m];if(!h||!g)continue;let p=c>0&&e.continuesFromPrev?false:e.continuesFromPrev&&m===e.fromRow,y=Ce(h,g,m,T,o.columnWidths,t.rows.length,n,i,s,d,p);a.appendChild(y),T+=g.height;}let b=0;for(let m=e.fromRow;m<e.toRow;m++)if(b+=o.rows[m]?.height??0,m<e.toRow-1){let h=i.createElement("div");h.className=O.rowResizeHandle,h.style.position="absolute",h.style.left="0",h.style.top=`${b-3}px`,h.style.width="100%",h.style.height="6px",h.style.cursor="row-resize",h.style.zIndex="10",h.dataset.rowIndex=String(m),h.dataset.tableBlockId=String(e.blockId),e.pmStart!==void 0&&(h.dataset.tablePmStart=String(e.pmStart)),a.appendChild(h);}if(e.toRow===t.rows.length){let m=i.createElement("div");m.className=O.tableEdgeHandleBottom,m.style.position="absolute",m.style.left="0",m.style.top=`${b-3}px`,m.style.width="100%",m.style.height="6px",m.style.cursor="row-resize",m.style.zIndex="10",m.dataset.rowIndex=String(t.rows.length-1),m.dataset.tableBlockId=String(e.blockId),m.dataset.isEdge="bottom",e.pmStart!==void 0&&(m.dataset.tablePmStart=String(e.pmStart)),a.appendChild(m);}if(e.toRow===t.rows.length){let m=o.columnWidths.reduce((g,p)=>g+p,0),h=i.createElement("div");h.className=O.tableEdgeHandleRight,h.style.position="absolute",h.style.left=`${m-3}px`,h.style.top="0",h.style.width="6px",h.style.height="100%",h.style.cursor="col-resize",h.style.zIndex="10",h.dataset.columnIndex=String(o.columnWidths.length-1),h.dataset.tableBlockId=String(e.blockId),h.dataset.isEdge="right",e.pmStart!==void 0&&(h.dataset.tablePmStart=String(e.pmStart)),a.appendChild(h);}return a}var vt={textBox:"layout-textbox"};function ce(e,t,o,n,r={}){let i=r.document??document,a=i.createElement("div");if(a.className=vt.textBox,a.style.position="absolute",a.style.width=`${e.width}px`,a.style.height=`${e.height}px`,a.style.overflow="hidden",a.style.boxSizing="border-box",$t(a,e),t.fillColor&&(a.style.backgroundColor=t.fillColor),t.outlineWidth&&t.outlineWidth>0){let s=t.outlineStyle||"solid",c=t.outlineColor||"#000000";a.style.border=`${t.outlineWidth}px ${s} ${c}`;}let l=t.margins??a$2;a.style.padding=`${l.top}px ${l.right}px ${l.bottom}px ${l.left}px`,a.dataset.blockId=String(e.blockId),e.pmStart!==void 0&&(a.dataset.pmStart=String(e.pmStart)),e.pmEnd!==void 0&&(a.dataset.pmEnd=String(e.pmEnd));let d=e.width-l.left-l.right,f=0;for(let s=0;s<t.content.length;s++){let c=t.content[s],T=o.innerMeasures[s];if(!T)continue;let b={blockId:c.id,width:d,height:T.totalHeight,pmStart:c.pmStart,pmEnd:c.pmEnd,fromLine:0,toLine:T.lines.length},m=$(b,c,T,{...n,positioning:"flow"},{document:i});a.appendChild(m),f+=T.totalHeight;}return a}function $t(e,t){!t.isFloating&&t.zIndex===void 0||(e.style.zIndex=String(t.zIndex??10));}function et(e){return {pageWidth:e.size.w,pageHeight:e.size.h,marginLeft:e.margins.left,marginTop:e.margins.top,contentWidth:e.size.w-e.margins.left-e.margins.right,contentHeight:e.size.h-e.margins.top-e.margins.bottom}}function Re(e,t,o,n){let{x:r,side:i}=Ht(e,o,n),a=zt(e,t,n);return {x:r,y:a,side:i}}function Ht(e$1,t,o){let n=e$1.position?.horizontal;if(!n)return e$1.cssFloat==="right"?{x:t-e$1.width,side:"right"}:{x:0,side:"left"};let r=At(n.relativeTo,t,o);if(n.align==="right")return {x:r.size?r.base+r.size-e$1.width:0,side:"right"};if(n.align==="left")return {x:r.base,side:"left"};if(n.align==="center")return {x:r.size?r.base+(r.size-e$1.width)/2:0,side:"left"};if(n.posOffset!==void 0){let i=r.base+e(n.posOffset);return {x:i,side:i>t/2?"right":"left"}}return {x:r.base,side:"left"}}function At(e,t,o){let n=o?.pageWidth??0,r=o?.marginLeft??0;switch(e){case "page":return {base:-r,size:n};case "leftMargin":return {base:-r,size:r};case "rightMargin":return {base:t,size:r};case "character":return {base:0,size:0};default:return {base:0,size:t}}}function zt(e$1,t,o){let n=e$1.position?.vertical;if(!n)return t;let r=Ot(n.relativeTo,t,o);return n.align==="top"?r.base:n.align==="center"?r.size?r.base+(r.size-e$1.height)/2:t:n.align==="bottom"?r.size?r.base+r.size-e$1.height:t:n.posOffset!==void 0?r.base+e(n.posOffset):n.relativeTo==="paragraph"||n.relativeTo==="line"?t:r.base}function Ot(e,t,o){let n=o?.pageHeight??0,r=o?.marginTop??0,i=o?.contentHeight??0;switch(e){case "paragraph":case "line":return {base:t,size:0};case "page":return {base:-r,size:n};case "topMargin":return {base:-r,size:r};case "bottomMargin":return {base:i,size:r};default:return {base:0,size:i}}}function tt(e){return e?.align??e?.alignment}function Nt(e$1,t){let o=e$1.position.vertical;if(!o)return e$1.paragraphY;let n=tt(o),r=o.posOffset!==void 0?e(o.posOffset):void 0;if(o.relativeTo==="page"){if(r!==void 0)return r-t.flowTop;if(n==="top")return -t.flowTop;if(n==="bottom")return t.pageHeight-e$1.height-t.flowTop;if(n==="center")return (t.pageHeight-e$1.height)/2-t.flowTop}if(o.relativeTo==="margin"){let i=t.margins.top,a=t.pageHeight-t.margins.top-t.margins.bottom;if(r!==void 0)return i+r-t.flowTop;if(n==="top")return i-t.flowTop;if(n==="bottom")return i+a-e$1.height-t.flowTop;if(n==="center")return i+(a-e$1.height)/2-t.flowTop}return r!==void 0?e$1.paragraphY+r:e$1.paragraphY}function Dt(e$1,t,o){let n=t.position.horizontal;if(!n){e$1.style.left="0";return}let r=tt(n);if(n.relativeTo==="page"){if(n.posOffset!==void 0){e$1.style.left=`${e(n.posOffset)-o.flowLeft}px`;return}if(r==="right"){e$1.style.left=`${o.pageWidth-t.width-o.flowLeft}px`;return}if(r==="center"){e$1.style.left=`${(o.pageWidth-t.width)/2-o.flowLeft}px`;return}if(r==="left"){e$1.style.left=`${-o.flowLeft}px`;return}}if(n.posOffset!==void 0){e$1.style.left=`${e(n.posOffset)}px`;return}if(r==="right"){e$1.style.left=`${o.contentWidth-t.width}px`;return}if(r==="center"){e$1.style.left=`${(o.contentWidth-t.width)/2}px`;return}e$1.style.left="0";}function nt(e,t){let o=e.tblpY??0;e.vertAnchor==="page"?o-=t.flowTop:e.vertAnchor==="margin"&&(o+=t.margins.top-t.flowTop);let n=e.tblpX??0;return e.horzAnchor==="page"?n-=t.flowLeft:e.horzAnchor==="margin"&&(n+=t.margins.left-t.flowLeft),{left:n,top:o}}function Pe(e,t,o,n){let r=o.document??document,i=r.createElement("div");i.style.position="relative";let a=t.contentWidth??600,l=[],d=0;for(let f=0;f<e.blocks.length;f++){let s=e.blocks[f],c=e.measures[f];if(!(!s||!c)){if(s.kind==="paragraph"&&c.kind==="paragraph"){let T=s,b=c,m=T.attrs?.spacing?.before??0,h=d,g=[];for(let S of T.runs)if(S.kind==="image"&&"position"in S&&S.position){let w=S;l.push({src:w.src,width:w.width,height:w.height,alt:w.alt,paragraphY:h,position:w.position});}else g.push(S);let p={...T,runs:g},y={blockId:T.id,width:a,height:b.totalHeight,fromLine:0,toLine:b.lines.length},u=$(y,p,b,{...t,positioning:"absolute"},{document:r});u.style.top=`${d+m}px`,u.style.left="0",u.style.width=`${a}px`,i.appendChild(u),d+=b.totalHeight;}else if(s.kind==="table"&&c.kind==="table"){let T={blockId:s.id,width:c.totalWidth,height:c.totalHeight,fromRow:0,toRow:c.rows.length,pmStart:s.pmStart,pmEnd:s.pmEnd},b=X(T,s,c,{...t,positioning:"absolute"},{document:r});if(s.floating){let{left:m,top:h}=nt(s.floating,n);b.style.top=`${h}px`,b.style.left=`${m}px`,i.appendChild(b);}else b.style.top=`${d}px`,b.style.left="0",i.appendChild(b),d+=c.totalHeight;}}}for(let f of l){let s=r.createElement("img");s.src=f.src,s.width=f.width,s.height=f.height,f.alt&&(s.alt=f.alt),s.style.position="absolute",s.style.display="block",s.style.width=`${f.width}px`,s.style.height=`${f.height}px`,s.style.maxWidth="none",s.style.maxHeight="none",Dt(s,f,n),s.style.top=`${Nt(f,n)}px`,i.appendChild(s);}return i}var fe=12,ot=6;function _t(e,t){if(e.size!==t.size)return false;for(let[o,n]of e)if(t.get(o)!==n)return false;return true}var Ee=8;function Xn(e){let t=[];for(let o of e)if(o.kind==="paragraph")for(let n of o.runs)n.kind==="text"&&n.footnoteRefId!=null&&t.push({footnoteId:n.footnoteRefId,pmPos:n.pmStart??0});return t}function Le(e,t){let o=new Map;if(t.length===0)return o;for(let n of t)for(let r of e){let i=false;for(let a of r.fragments){let l=a.pmStart??-1,d=a.pmEnd??-1;if(l>=0&&d>=0&&n.pmPos>=l&&n.pmPos<d){let f=o.get(r.number)??[];f.includes(n.footnoteId)||f.push(n.footnoteId),o.set(r.number,f),i=true;break}}if(i)break}return o}function Wt(e,t){if(e.length===0)return [{kind:"paragraph",id:`fn-empty-${t}`,runs:[{kind:"text",text:`${t} `,fontSize:Ee,superscript:true}]}];let o=e.map(r=>{if(r.kind!=="paragraph")return r;let i=r;return {...i,runs:i.runs.map(a=>(a.kind==="text"||a.kind==="tab")&&a.fontSize==null?{...a,fontSize:Ee}:a)}}),n=o[0];if(n.kind==="paragraph"){let r={kind:"text",text:`${t} `,fontSize:Ee,superscript:true};o[0]={...n,runs:[r,...n.runs]};}return o}function Gt(e,t,o,n){let r=c$1(e.content,{styles:n.styles??void 0,theme:n.theme??null}),i=d(r,{theme:n.theme??void 0}),a=Wt(i,t),l=n.measureBlocks(a,o),d$1=l.reduce((f,s)=>s.kind==="paragraph"||s.kind==="table"?f+s.totalHeight:s.kind==="image"||s.kind==="textBox"?f+s.height:f,0);return {id:e.id,displayNumber:t,blocks:a,measures:l,height:d$1}}function Zn(e,t,o,n){let r=new Map,i=new Map;for(let d of e)(d.noteType==="normal"||d.noteType==null)&&i.set(d.id,d);let a=1,l=new Set;for(let d of t){if(l.has(d.footnoteId))continue;l.add(d.footnoteId);let f=i.get(d.footnoteId);f&&(r.set(d.footnoteId,Gt(f,a,o,n)),a++);}return r}function rt(e,t){let o=new Map;for(let[n,r]of e){let i=0;for(let a of r){let l=t.get(a);l&&(i+=l.height);}i>0&&(i+=fe,o.set(n,i));}return o}function qn(e){let{blocks:t,measures:o,layoutOpts:n,footnoteRefs:r,footnoteContentMap:i,initialLayout:a}=e,l=Le(a.pages,r),d=rt(l,i);if(d.size===0)return {layout:a,pageFootnoteMap:l,converged:true};let f=a,s=false;for(let c=0;c<ot;c++){f=q$1(t,o,{...n,footnoteReservedHeights:d});let T=Le(f.pages,r),b=rt(T,i);if(l=T,_t(d,b)){d=b,s=true;break}d=b;}s||(f=q$1(t,o,{...n,footnoteReservedHeights:d}),l=Le(f.pages,r),console.warn(`[docx-editor] footnote layout did not stabilize within ${ot} passes; settling with best-effort reservation. If footnotes appear misplaced, please file a bug with the document.`));for(let[c,T]of l){let b=f.pages.find(m=>m.number===c);b&&(b.footnoteIds=T);}return {layout:f,pageFootnoteMap:l,converged:s}}function Jn(e,t,o){let n=new Map;if(!o?.package?.footnotes)return n;let r=new Map;for(let i of o.package.footnotes)i.noteType&&i.noteType!=="normal"||r.set(i.id,i);for(let[i,a]of e){let l=[];for(let d of a){let f=r.get(d);if(!f)continue;let s=t.get(d),c=s?.displayNumber??0;l.push({displayNumber:String(c),text:v(f),content:s});}l.length>0&&n.set(i,l);}return n}function Vt(e,t,o,n){let r=n.createElement("div");r.className="layout-footnote-content",r.style.position="relative",r.style.width=`${t}px`,r.style.height=`${e.height}px`;let i=0;for(let a=0;a<e.blocks.length;a++){let l=e.blocks[a],d=e.measures[a];if(!(!l||!d)){if(l.kind==="paragraph"&&d.kind==="paragraph"){let f=l.attrs?.spacing?.before??0,s={blockId:l.id,width:t,height:d.totalHeight,pmStart:l.pmStart,pmEnd:l.pmEnd,fromLine:0,toLine:d.lines.length},c=$(s,l,d,{...o,section:"body",contentWidth:t,positioning:"absolute"},{document:n});c.style.top=`${i+f}px`,c.style.left="0",c.style.width=`${t}px`,c.style.height=`${d.totalHeight}px`,r.appendChild(c),i+=d.totalHeight;}else if(l.kind==="table"&&d.kind==="table"){let f={blockId:l.id,width:d.totalWidth,height:d.totalHeight,pmStart:l.pmStart,pmEnd:l.pmEnd,fromRow:0,toRow:d.rows.length},s=X(f,l,d,{...o,section:"body",contentWidth:t,positioning:"absolute"},{document:n});s.style.top=`${i}px`,s.style.left="0",r.appendChild(s),i+=d.totalHeight;}else if(l.kind==="image"&&d.kind==="image"){let f={blockId:l.id,width:d.width,height:d.height,pmStart:l.pmStart,pmEnd:l.pmEnd},s=ie(f,l,d,{...o},{document:n});s.style.top=`${i}px`,s.style.left="0",r.appendChild(s),i+=d.height;}else if(l.kind==="textBox"&&d.kind==="textBox"){let f={blockId:l.id,width:d.width,height:d.height,pmStart:l.pmStart,pmEnd:l.pmEnd},s=ce(f,l,d,{...o,section:"body",contentWidth:t,positioning:"absolute"},{document:n});s.style.top=`${i}px`,s.style.left="0",r.appendChild(s),i+=d.height;}}}return r}function jt(e,t){let o=t.createElement("div");o.style.fontSize="10px",o.style.lineHeight="1.3",o.style.marginBottom="4px",o.style.color="#000";let n=t.createElement("sup");n.textContent=e.displayNumber,n.style.fontSize="7px",n.style.marginRight="2px",o.appendChild(n);let r=t.createTextNode(" "+e.text);return o.appendChild(r),o}function it(e){let t=fe;for(let o of e)o.content&&(t+=o.content.height);return t}function at(e,t,o,n){let r=n.createElement("div");r.className="layout-footnote-area",r.style.width=`${t}px`;let i=n.createElement("div"),a=.5,l=(fe-a)/2;i.style.width="33%",i.style.height=`${a}px`,i.style.backgroundColor="#000",i.style.marginBottom=`${l}px`,i.style.marginTop=`${l}px`,r.appendChild(i);for(let d of e)r.appendChild(d.content?Vt(d.content,t,o,n):jt(d,n));return r}function Be(e,t,o){let n={pageNumber:e.number,totalPages:t,section:"body",resolvedCommentIds:o.resolvedCommentIds},r={...o};if(o.titlePg&&e.number===1&&(r.headerContent=o.firstPageHeaderContent,r.footerContent=o.firstPageFooterContent),o.footnotesByPage){let i=o.footnotesByPage.get(e.number);i&&i.length>0&&(r.footnoteArea=i);}return {context:n,pageOptions:r}}function st(e){let t=[];t.push(`s:${e.size.w},${e.size.h}`),t.push(`m:${e.margins.top},${e.margins.right},${e.margins.bottom},${e.margins.left}`),t.push(`n:${e.number}`),e.footnoteReservedHeight&&t.push(`fn:${e.footnoteReservedHeight}`);for(let o of e.fragments){let n=`${o.kind}:${o.blockId},${o.x},${o.y},${o.width},${o.height}`;o.pmStart!==void 0&&(n+=`,ps:${o.pmStart}`),o.pmEnd!==void 0&&(n+=`,pe:${o.pmEnd}`),o.kind==="paragraph"?n+=`,fl:${o.fromLine},tl:${o.toLine}`:o.kind==="table"&&(n+=`,fr:${o.fromRow},tr:${o.toRow}`),t.push(n);}return t.join("|")}function Kt(e){let t=[];return e.headerContent&&t.push(`hdr:${e.headerContent.blocks.length},${e.headerContent.height},${e.headerContent.visualTop??0},${e.headerContent.visualBottom??e.headerContent.height}`),e.footerContent&&t.push(`ftr:${e.footerContent.blocks.length},${e.footerContent.height},${e.footerContent.visualTop??0},${e.footerContent.visualBottom??e.footerContent.height}`),e.firstPageHeaderContent&&t.push(`fp-hdr:${e.firstPageHeaderContent.blocks.length},${e.firstPageHeaderContent.height}`),e.firstPageFooterContent&&t.push(`fp-ftr:${e.firstPageFooterContent.blocks.length},${e.firstPageFooterContent.height}`),e.titlePg&&t.push("titlePg"),e.theme&&t.push(`thm:${e.theme.name??"default"}`),e.pageBorders&&t.push(`pb:${JSON.stringify(e.pageBorders)}`),e.headerDistance!==void 0&&t.push(`hd:${e.headerDistance}`),e.footerDistance!==void 0&&t.push(`fd:${e.footerDistance}`),t.join("|")}function Yt(e,t){e.style.display="flex",e.style.flexDirection="column",e.style.alignItems="center",e.style.gap=`${t}px`,e.style.padding=`${t}px`,e.style.backgroundColor="var(--doc-bg, #f8f9fa)";}var ge=2,Ut=8;function Xt(e,t,o={}){let n=e.length,r=o.pageGap??24,i=t,a=i.__pageRenderState,l=Kt(o),d=n>=Ut;if(a&&a.optionsHash===l&&d){let g=a.pageStates,p=a.pageDataMap,y=i.__pageObserver,u=[];for(let F of e)u.push(st(F));let S=a.totalPages!==n,w=Math.min(g.length,e.length);for(let F=0;F<w;F++){let I=g[F],R=u[F];if(I.fingerprint===R&&!S){let P=p.get(I.element);P&&(P.page=e[F]);continue}let x=I.element,k=p.get(x);k&&(k.page=e[F],k.rendered&&Zt(x,p,n,o)),I.fingerprint=R,te(x,e[F].size.w,e[F].size.h,o),x.dataset.pageNumber=String(e[F].number);}if(e.length>g.length){let F=o.document??document;for(let I=g.length;I<e.length;I++){let R=e[I],x=F.createElement("div");x.className=o.pageClassName??N.page,x.dataset.pageNumber=String(R.number),x.dataset.pageIndex=String(I),te(x,R.size.w,R.size.h,o),t.appendChild(x),g.push({element:x,fingerprint:u[I]}),p.set(x,{page:R,index:I,rendered:false}),y&&y.observe(x);}}if(e.length<g.length){for(let F=g.length-1;F>=e.length;F--){let I=g[F].element;y&&y.unobserve(I),p.delete(I),t.removeChild(I);}g.length=e.length;}for(let F=0;F<g.length;F++){let I=p.get(g[F].element);I&&(I.index=F);}return a.totalPages=n,a.currentOptions=o,"incremental"}let s=i.__pageObserver;s&&(s.disconnect(),i.__pageObserver=void 0),t.innerHTML="",i.__pageRenderState=void 0,Yt(t,r);let c=[],T=[];for(let g=0;g<e.length;g++){let p=e[g];if(T.push(st(p)),d){let u=(o.document??document).createElement("div");u.className=o.pageClassName??N.page,u.dataset.pageNumber=String(p.number),u.dataset.pageIndex=String(g),te(u,p.size.w,p.size.h,o),t.appendChild(u),c.push(u);}else {let{context:y,pageOptions:u}=Be(p,n,o),S=he(p,y,u);t.appendChild(S),c.push(S);}}if(!d)return "full";let b=new Map;for(let g=0;g<e.length;g++)b.set(c[g],{page:e[g],index:g,rendered:false});let m=new IntersectionObserver(g=>{let p=i.__pageRenderState;if(!p)return;let{currentOptions:y,totalPages:u,pageDataMap:S}=p;for(let R of g){let x=R.target,k=S.get(x);if(k&&R.isIntersecting){me(x,S,u,y);for(let P=-ge;P<=ge;P++){let C=k.index+P;C>=0&&C<p.pageStates.length&&C!==k.index&&me(p.pageStates[C].element,S,u,y);}}}let w=window.innerHeight,F=w*3,I=new Set;for(let[R,x]of S){if(!x.rendered)continue;let k=R.getBoundingClientRect();k.bottom>-F&&k.top<w+F&&I.add(x.index);}for(let[R,x]of S){if(!x.rendered)continue;let k=false;for(let P of I)if(Math.abs(x.index-P)<=ge+1){k=true;break}!k&&I.size>0&&qt(R,S);}},{root:null,rootMargin:"1500px 0px 1500px 0px"});for(let g of c)m.observe(g);i.__pageObserver=m,i.__pageRenderState={pageStates:c.map((g,p)=>({element:g,fingerprint:T[p]})),totalPages:n,optionsHash:l,pageDataMap:b,currentOptions:o};let h=Math.min(e.length,ge+3);for(let g=0;g<h;g++)me(c[g],b,n,o);return "full"}function me(e,t,o,n){let r=t.get(e);if(!r||r.rendered)return;let{context:i,pageOptions:a}=Be(r.page,o,n),l=he(r.page,i,a);for(;l.firstChild;)e.appendChild(l.firstChild);r.rendered=true;}function Zt(e,t,o,n){let r=t.get(e);if(!r)return;let{context:i,pageOptions:a}=Be(r.page,o,n),d=he(r.page,i,a).querySelector(`.${N.content}`),f=e.querySelector(`.${N.content}`);d&&f?e.replaceChild(d,f):(e.innerHTML="",r.rendered=false,me(e,t,o,n));}function qt(e,t){let o=t.get(e);!o||!o.rendered||(e.innerHTML="",o.rendered=false);}var N={page:"layout-page",content:"layout-page-content",header:"layout-page-header",footer:"layout-page-footer"};function te(e,t,o,n){e.style.position="relative",e.style.width=`${t}px`,e.style.height=`${o}px`,e.style.backgroundColor=n.backgroundColor??"#ffffff",e.style.overflow="hidden",e.style.fontFamily=a$1("Calibri").cssFallback,e.style.fontSize=`${1056/72}px`,e.style.color="#000000",n.showBorders&&(e.style.border="1px solid #ccc"),n.showShadow&&(e.style.boxShadow="0 2px 8px rgba(0, 0, 0, 0.15)");}function Jt(e,t){switch(t??"allPages"){case "firstPage":return e===1;case "notFirstPage":return e!==1;default:return true}}function ue(e){return e?.space!==void 0?i(e.space):0}function ye(e,t,o,n){if(!t||t.style==="none"||t.style==="nil")return;let r=c$2(t,o,n);for(let[d,f]of Object.entries(r))e.style[d]=String(f);let i=`border${o}Style`,a=`border${o}Width`;if(e.style[i]==="double"){let d=parseFloat(e.style[a]);(!Number.isFinite(d)||d<3)&&(e.style[a]="3px");}}function Qt(e,t,o){let n=t.pageBorders;if(!n||!Jt(e.number,n.display)||![n.top,n.bottom,n.left,n.right].some(c=>c&&c.style!=="none"&&c.style!=="nil"))return null;let i=n.offsetFrom??"text",a=ue(n.top),l=ue(n.right),d=ue(n.bottom),f=ue(n.left),s=o.createElement("div");return s.className="layout-page-border",s.style.position="absolute",s.style.pointerEvents="none",s.style.boxSizing="border-box",s.style.zIndex=n.zOrder==="back"?"0":"20",i==="page"?(s.style.top=`${a}px`,s.style.right=`${l}px`,s.style.bottom=`${d}px`,s.style.left=`${f}px`):(s.style.top=`${Math.max(0,e.margins.top-a)}px`,s.style.right=`${Math.max(0,e.margins.right-l)}px`,s.style.bottom=`${Math.max(0,e.margins.bottom-d)}px`,s.style.left=`${Math.max(0,e.margins.left-f)}px`),ye(s,n.top,"Top",t.theme),ye(s,n.bottom,"Bottom",t.theme),ye(s,n.left,"Left",t.theme),ye(s,n.right,"Right",t.theme),s}function en(e,t){let o=t.margins;e.style.position="absolute",e.style.top=`${o.top}px`,e.style.left=`${o.left}px`,e.style.right=`${o.right}px`,e.style.bottom=`${o.bottom}px`,e.style.overflow="visible";}function tn(e,t,o){e.style.position="absolute",e.style.left=`${t.x-o.left}px`,e.style.top=`${t.y-o.top}px`,e.style.width=`${t.width}px`,"height"in t&&(e.style.height=`${t.height}px`);}function nn(e,t,o,n){let r=[];for(let i of e.runs){if(i.kind!=="image")continue;let a=i;if(!M(a))continue;let l=a.distTop??0,d=a.distBottom??0,f=a.distLeft??12,s=a.distRight??12,{x:c,y:T,side:b}=Re(a,t,o,n);r.push({src:a.src,width:a.width,height:a.height,alt:a.alt,transform:a.transform,side:b,x:c,y:T,distTop:l,distBottom:d,distLeft:f,distRight:s,pmStart:a.pmStart,pmEnd:a.pmEnd,wrapText:re(a.cssFloat),wrapType:a.wrapType,cropTop:a.cropTop,cropRight:a.cropRight,cropBottom:a.cropBottom,cropLeft:a.cropLeft,opacity:a.opacity});}return r}function he(e,t,o={}){let n=o.document??document,r=n.createElement("div");r.className=o.pageClassName??N.page,r.dataset.pageNumber=String(e.number),te(r,e.size.w,e.size.h,o);let i=Qt(e,o,n);i&&o.pageBorders?.zOrder==="back"&&r.appendChild(i);let a=n.createElement("div");a.className=N.content,en(a,e);let l=et(e),d=l.contentWidth,f=[],s$1=[];for(let p of e.fragments)if(p.kind==="paragraph"&&o.blockLookup){let y=o.blockLookup.get(String(p.blockId));if(y?.block.kind==="paragraph"){let u=y.block,S=p.y-e.margins.top,w=nn(u,S,d,l);f.push(...w);}}for(let p of f)Z(p)&&s$1.push({side:p.side,x:p.x,y:p.y,width:p.width,height:p.height,distTop:p.distTop,distBottom:p.distBottom,distLeft:p.distLeft,distRight:p.distRight,wrapText:p.wrapText,wrapType:p.wrapType});if(o.blockLookup)for(let p of e.fragments){if(p.kind!=="table")continue;let y=o.blockLookup.get(String(p.blockId));if(y?.block.kind!=="table")continue;let S=y.block.floating;if(!S)continue;let w=p.x-e.margins.left,F=p.y-e.margins.top,I=S.topFromText??0,R=S.bottomFromText??0,x=S.leftFromText??12,k=S.rightFromText??12,P=w<d/2?"left":"right";s$1.push({side:P,x:w,y:F,width:p.width,height:p.height,distTop:I,distBottom:R,distLeft:x,distRight:k});}if(o.blockLookup)for(let p of e.fragments){if(p.kind!=="textBox")continue;let y=o.blockLookup.get(String(p.blockId));if(y?.block.kind!=="textBox")continue;let u=y.block;if(!g(u))continue;let S=p.y-e.margins.top,w=Re({width:p.width,height:p.height,position:u.position,cssFloat:u.cssFloat},S,d,l);p.x=e.margins.left+w.x,p.y=e.margins.top+w.y,h(u)&&s$1.push({side:w.side,x:w.x,y:w.y,width:p.width,height:p.height,distTop:u.distTop??0,distBottom:u.distBottom??0,distLeft:u.distLeft??12,distRight:u.distRight??12,wrapText:u.wrapText,wrapType:u.wrapType});}let c=s$1.length>0?p(s$1,d):[],T=f.filter(Y),b=f.filter(p=>!Y(p));if(T.length>0){let p=U(T,n,{layerClass:"layout-floating-images-layer",itemClass:"layout-page-floating-image",sizing:"inset0",layerMode:"behind"});a.appendChild(p);}let m=p=>{if(p.kind!=="paragraph"||!o.blockLookup||!p.blockId)return;let y=o.blockLookup.get(String(p.blockId));if(y?.block.kind==="paragraph")return y.block.attrs?.borders},h$1,g$1=new Map;for(let p=0;p<e.fragments.length;p++){let y=e.fragments[p],u,S={...t,section:"body",contentWidth:d},w=y.y-e.margins.top;if(o.blockLookup&&y.blockId){let F=o.blockLookup.get(String(y.blockId));if(y.kind==="paragraph"&&F?.block.kind==="paragraph"&&F?.measure.kind==="paragraph"){let I=F.block,R=p+1<e.fragments.length?m(e.fragments[p+1]):void 0,x=String(y.blockId),k=g$1.get(x);k||(k=new Set,g$1.set(x,k));let P=F.measure;c.length>0&&(P=s(I,d,{floatingZones:c,paragraphYOffset:w})),u=$(y,I,P,S,{document:n,prevBorders:h$1,nextBorders:R,renderedInlineImageKeys:k}),h$1=I.attrs?.borders;}else y.kind==="table"&&F?.block.kind==="table"&&F?.measure.kind==="table"?(u=X(y,F.block,F.measure,S,{document:n}),h$1=void 0):y.kind==="image"&&F?.block.kind==="image"&&F?.measure.kind==="image"?(u=ie(y,F.block,F.measure,S,{document:n}),h$1=void 0):y.kind==="textBox"&&F?.block.kind==="textBox"&&F?.measure.kind==="textBox"?(u=ce(y,F.block,F.measure,S,{document:n}),h$1=void 0):(u=we(y,S,{document:n}),h$1=void 0);}else u=we(y,S,{document:n}),h$1=void 0;tn(u,y,{left:e.margins.left,top:e.margins.top}),a.appendChild(u);}if(b.length>0){let p=U(b,n,{layerClass:"layout-floating-images-layer",itemClass:"layout-page-floating-image",sizing:"inset0",layerMode:"front"});a.appendChild(p);}if(e.columns&&e.columns.separator&&e.columns.count>1){let p=e.columns.count,y=e.columns.gap,u=(d-(p-1)*y)/p,S=e.size.h-e.margins.top-e.margins.bottom;for(let w=0;w<p-1;w++){let F=(w+1)*u+w*y+y/2,I=n.createElement("div");I.style.position="absolute",I.style.left=`${F}px`,I.style.top="0",I.style.height=`${S}px`,I.style.width="0.5px",I.style.backgroundColor="#000",I.style.pointerEvents="none",a.appendChild(I);}}if(o.footnoteArea&&o.footnoteArea.length>0){let p=at(o.footnoteArea,d,t,n);p.style.position="absolute";let y=Math.max(e.footnoteReservedHeight??0,it(o.footnoteArea)),u=e.size.h-e.margins.bottom-e.margins.top;p.style.top=`${Math.max(-e.margins.top,u-y)}px`,p.style.left="0",p.style.right="0",a.appendChild(p);}r.appendChild(a);{let y=o.headerDistance??e.margins.header??48,u=e.size.w-e.margins.left-e.margins.right,S=Math.max(e.margins.top-y,48),w=o.headerContent?.visualTop??0,F=o.headerContent?.visualBottom??o.headerContent?.height??0,I=Math.max(F-w,24),R=F>S,x=n.createElement("div");x.className=N.header,x.style.position="absolute",x.style.top=`${y+w}px`,x.style.left=`${e.margins.left}px`,x.style.right=`${e.margins.right}px`,x.style.width=`${u}px`,x.style.height=`${I}px`,x.style.minHeight=`${I}px`;let k=!R;if(o.headerContent&&o.headerContent.blocks.length>0){let P={flowTop:y,flowLeft:e.margins.left,contentWidth:u,pageWidth:e.size.w,pageHeight:e.size.h,margins:e.margins},C=Pe(o.headerContent,{...t,section:"header",contentWidth:u},o,P);C.style.top=`${-w}px`,C.querySelector("img")&&(k=false),x.appendChild(C);}k&&(x.style.maxHeight=`${S}px`,x.style.overflow="hidden"),r.appendChild(x);}{let y=o.footerDistance??e.margins.footer??48,u=e.size.w-e.margins.left-e.margins.right,S=Math.max(e.margins.bottom-y,48),w=o.footerContent?.visualTop??0,F=o.footerContent?.visualBottom??o.footerContent?.height??0,I=Math.max(F-w,24),R=I>S,x=n.createElement("div");x.className=N.footer,x.style.position="absolute",x.style.top=`${e.size.h-y-I}px`,x.style.left=`${e.margins.left}px`,x.style.right=`${e.margins.right}px`,x.style.width=`${u}px`,x.style.height=`${I}px`,x.style.minHeight=`${I}px`;let k=!R;if(o.footerContent&&o.footerContent.blocks.length>0){let P={flowTop:e.size.h-y-(o.footerContent?.height??0),flowLeft:e.margins.left,contentWidth:u,pageWidth:e.size.w,pageHeight:e.size.h,margins:e.margins},C=Pe(o.footerContent,{...t,section:"footer",contentWidth:u},o,P);C.style.top=`${-w}px`,C.querySelector("img")&&(k=false),x.appendChild(C);}k&&(x.style.maxHeight=`${S}px`,x.style.overflow="hidden"),r.appendChild(x);}return i&&o.pageBorders?.zOrder!=="back"&&r.appendChild(i),r}export{ce as A,nt as B,Xt as C,N as D,te as E,he as F,fe as a,ot as b,_t as c,Xn as d,Le as e,Wt as f,Gt as g,Zn as h,rt as i,qn as j,Jn as k,V as l,we as m,Z as n,Y as o,M as p,ht as q,Ke as r,ie as s,Je as t,de as u,$ as v,U as w,O as x,X as y,vt as z};
|
package/dist/chunk-JKVXID22.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {w,v}from'./chunk-LVD6HXRF.mjs';var t=new w(v());t.buildSchema();t.initializeRuntime();var s=t,n=t.getSchema();export{s as a,n as b};
|
package/dist/chunk-PK4PDRTA.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
'use strict';var chunkBD4CYYFB_js=require('./chunk-BD4CYYFB.js'),chunk44RUAQA2_js=require('./chunk-44RUAQA2.js'),chunkDROCYKAR_js=require('./chunk-DROCYKAR.js'),chunkTZJUO3NW_js=require('./chunk-TZJUO3NW.js'),chunkDV6IEOP5_js=require('./chunk-DV6IEOP5.js'),chunkHVZMO3BU_js=require('./chunk-HVZMO3BU.js'),chunkJFZIXFRC_js=require('./chunk-JFZIXFRC.js'),chunkBHBOAP6Z_js=require('./chunk-BHBOAP6Z.js'),chunkN3Y5BUKV_js=require('./chunk-N3Y5BUKV.js'),chunk4Q2IP5FW_js=require('./chunk-4Q2IP5FW.js');var V={fragment:"layout-fragment",paragraph:"layout-fragment-paragraph",table:"layout-fragment-table",image:"layout-fragment-image",line:"layout-line",run:"layout-run"};function dt(e){return e.kind==="paragraph"}function pt(e){return e.kind==="table"}function ct(e){return e.kind==="image"}function oe(e){e.style.position="absolute",e.style.overflow="hidden";}function ft(e,t,o){let n=o.createElement("div");return n.className=`${V.fragment} ${V.paragraph}`,oe(n),n.dataset.blockId=String(e.blockId),n.dataset.fromLine=String(e.fromLine),n.dataset.toLine=String(e.toLine),e.pmStart!==void 0&&(n.dataset.pmStart=String(e.pmStart)),e.pmEnd!==void 0&&(n.dataset.pmEnd=String(e.pmEnd)),e.continuesFromPrev&&(n.dataset.continuesFromPrev="true"),e.continuesOnNext&&(n.dataset.continuesOnNext="true"),n}function gt(e,t,o){let n=o.createElement("div");return n.className=`${V.fragment} ${V.table}`,oe(n),n.dataset.blockId=String(e.blockId),n.dataset.fromRow=String(e.fromRow),n.dataset.toRow=String(e.toRow),e.pmStart!==void 0&&(n.dataset.pmStart=String(e.pmStart)),e.pmEnd!==void 0&&(n.dataset.pmEnd=String(e.pmEnd)),n}function mt(e,t,o){let n=o.createElement("div");return n.className=`${V.fragment} ${V.image}`,oe(n),n.dataset.blockId=String(e.blockId),e.pmStart!==void 0&&(n.dataset.pmStart=String(e.pmStart)),e.pmEnd!==void 0&&(n.dataset.pmEnd=String(e.pmEnd)),e.isAnchored&&(n.dataset.anchored="true"),e.zIndex!==void 0&&(n.style.zIndex=String(e.zIndex)),n}function we(e,t,o={}){let n=o.document??document;if(dt(e))return ft(e,t,n);if(pt(e))return gt(e,t,n);if(ct(e))return mt(e,t,n);let r=n.createElement("div");r.className=V.fragment,oe(r);let i=e;return i.blockId!==void 0&&(r.dataset.blockId=String(i.blockId)),i.kind&&(r.dataset.kind=i.kind),r}var E={fragment:"layout-paragraph",line:"layout-line",run:"layout-run",text:"layout-run-text",tab:"layout-run-tab",image:"layout-run-image",lineBreak:"layout-run-linebreak"};function A(e){return e.kind==="text"}function z(e){return e.kind==="tab"}function j(e){return e.kind==="image"}function W(e){return e.kind==="lineBreak"}function K(e){return e.kind==="field"}function Z(e){return !chunkJFZIXFRC_js.b(e.wrapType)&&e.wrapType!=="topAndBottom"}function Y(e){return e.wrapType==="behind"}function M(e){return chunkJFZIXFRC_js.a(e.wrapType)?true:e.displayMode==="float"}function ht(e){return chunkJFZIXFRC_js.b(e.wrapType)||e.wrapType==="topAndBottom"?false:chunkJFZIXFRC_js.c(e.wrapType)?true:e.displayMode==="float"&&e.cssFloat!=="none"}function re(e){return e==="left"?"right":e==="right"?"left":"bothSides"}var Ke={image:"layout-image",imageAnchored:"layout-image-anchored"};function q(e){return !!(e.cropTop||e.cropRight||e.cropBottom||e.cropLeft||e.opacity!=null&&e.opacity<1)}function J(e,t){let o=t.cropTop??0,n=t.cropRight??0,r=t.cropBottom??0,i=t.cropLeft??0;(o||n||r||i)&&(e.style.clipPath=`inset(${o*100}% ${n*100}% ${r*100}% ${i*100}%)`),t.opacity!=null&&t.opacity<1&&(e.style.opacity=String(Math.max(0,t.opacity)));}function ie(e,t,o,n,r={}){let i=r.document??document,a=i.createElement("div");a.className=Ke.image,e.isAnchored&&a.classList.add(Ke.imageAnchored),a.style.position="absolute",a.style.width=`${e.width}px`,a.style.height=`${e.height}px`,a.style.overflow="hidden",e.zIndex!==void 0&&(a.style.zIndex=String(e.zIndex)),t.anchor?.behindDoc&&(a.style.zIndex="-1"),a.dataset.blockId=String(e.blockId),e.pmStart!==void 0&&(a.dataset.pmStart=String(e.pmStart)),e.pmEnd!==void 0&&(a.dataset.pmEnd=String(e.pmEnd));let l=i.createElement("img");if(l.src=t.src,l.alt=t.alt??"",l.style.width="100%",l.style.height="100%",l.style.objectFit="contain",l.style.display="block",t.transform&&(l.style.transform=t.transform),l.draggable=false,t.hlinkHref){let d=i.createElement("a");d.href=t.hlinkHref,d.target="_blank",d.rel="noopener noreferrer",d.style.display="block",d.style.width="100%",d.style.height="100%",d.appendChild(l),a.appendChild(d);}else a.appendChild(l);return a}function ut(e,t,o){if(t.fontFamily&&(e.style.fontFamily=chunkN3Y5BUKV_js.a(t.fontFamily).cssFallback),t.fontSize){let r=t.fontSize*96/72;e.style.fontSize=`${r}px`;}if(t.bold&&(e.style.fontWeight="bold"),t.italic&&(e.style.fontStyle="italic"),t.color&&(e.style.color=t.color),t.letterSpacing&&(e.style.letterSpacing=`${t.letterSpacing}px`),t.allCaps&&(e.style.textTransform="uppercase"),t.smallCaps&&(e.style.fontVariant="small-caps"),t.positionPx&&(e.style.verticalAlign=`${t.positionPx}px`),t.horizontalScale&&t.horizontalScale!==100&&(e.style.display="inline-block",e.style.transform=`scaleX(${t.horizontalScale/100})`,e.style.transformOrigin="left center"),t.kerningMinPt&&t.kerningMinPt>0&&(t.fontSize??11)>=t.kerningMinPt&&(e.style.fontKerning="normal"),t.emboss&&(e.style.textShadow="1px 1px 1px rgba(255,255,255,0.5), -1px -1px 1px rgba(0,0,0,0.3)"),t.imprint&&(e.style.textShadow="-1px -1px 1px rgba(255,255,255,0.5), 1px 1px 1px rgba(0,0,0,0.3)"),t.textShadow&&!t.emboss&&!t.imprint&&(e.style.textShadow="1px 1px 2px rgba(0,0,0,0.3)"),t.textOutline&&(e.style.webkitTextStroke="1px currentColor",e.style.webkitTextFillColor="transparent"),t.emphasisMark){let r=t.emphasisMark==="comma"?"filled sesame":t.emphasisMark==="circle"?"filled circle":"filled dot",i=t.emphasisMark==="underDot"?"under right":"over right";e.style.textEmphasis=`${r}`,e.style.textEmphasisPosition=i,e.style.webkitTextEmphasis=r,e.style.webkitTextEmphasisPosition=i;}t.highlight&&(e.style.backgroundColor=t.highlight);let n=[];if(t.underline&&(n.push("underline"),typeof t.underline=="object"&&(t.underline.style&&(e.style.textDecorationStyle=t.underline.style),t.underline.color&&(e.style.textDecorationColor=t.underline.color))),t.strike&&n.push("line-through"),t.commentIds&&t.commentIds.length>0){let r=t.commentIds.find(i=>!o||!o.has(i));r!=null&&(e.style.backgroundColor="rgba(255, 212, 0, 0.15)",e.style.borderBottom="1px solid rgba(255, 212, 0, 0.4)",e.dataset.commentId=String(r));}t.isInsertion&&(e.style.backgroundColor="rgba(52, 168, 83, 0.08)",e.style.borderBottom="2px dashed #2e7d32",e.style.paddingBottom="1px",e.classList.add("docx-insertion"),t.changeAuthor&&(e.dataset.changeAuthor=t.changeAuthor),t.changeDate&&(e.dataset.changeDate=t.changeDate),t.changeRevisionId!=null&&(e.dataset.revisionId=String(t.changeRevisionId))),t.isDeletion&&(e.style.backgroundColor="rgba(211, 47, 47, 0.08)",e.style.color="#c62828",n.includes("line-through")||n.push("line-through"),e.style.textDecorationColor="#c62828",e.classList.add("docx-deletion"),t.changeAuthor&&(e.dataset.changeAuthor=t.changeAuthor),t.changeDate&&(e.dataset.changeDate=t.changeDate),t.changeRevisionId!=null&&(e.dataset.revisionId=String(t.changeRevisionId))),n.length>0&&(e.style.textDecorationLine=n.join(" ")),t.superscript&&(e.style.verticalAlign="super",e.style.fontSize="0.75em"),t.subscript&&(e.style.verticalAlign="sub",e.style.fontSize="0.75em"),t.hidden&&(e.classList.add("docx-hidden"),e.style.opacity="0.4",e.style.textDecoration="underline dotted"),t.rtl&&e.setAttribute("dir","rtl"),t.textEffect&&(e.classList.add("docx-text-effect",`docx-text-effect-${t.textEffect}`),e.dataset.effect=t.textEffect);}function G(e,t,o){t!==void 0&&(e.dataset.pmStart=String(t)),o!==void 0&&(e.dataset.pmEnd=String(o));}function Q(e,t,o){let n=t.createElement("span");if(n.className=`${E.run} ${E.text}`,ut(n,e,o),G(n,e.pmStart,e.pmEnd),e.hyperlink){let r=t.createElement("a");r.href=e.hyperlink.href,e.hyperlink.href.startsWith("#")||(r.target="_blank",r.rel="noopener noreferrer"),e.hyperlink.tooltip&&(r.title=e.hyperlink.tooltip),r.textContent=e.text,r.style.color="inherit",r.style.textDecoration="inherit",e.hyperlink.noDefaultStyle||(e.color||(r.style.color="#0563c1",n.style.color="#0563c1"),e.underline||(r.style.textDecoration="underline")),n.appendChild(r);}else n.textContent=e.text;return n}var yt=1e3;function ae(e,t,o,n){let r=t.createElement("span");r.className=`${E.run} ${E.tab}`,r.style.display="inline-block",r.style.width=`${o}px`,G(r,e.pmStart,e.pmEnd);let i=n&&n!=="none"?bt(n):null;if(i){r.style.position="relative",r.textContent="\u200B";let a=t.createElement("span");a.style.position="absolute",a.style.left="0",a.style.right="0",a.style.top="0",a.style.bottom="0",a.style.overflow="hidden",a.style.whiteSpace="nowrap",a.textContent=i.repeat(yt),r.appendChild(a);}else r.textContent="\xA0";return r}function bt(e){switch(e){case "dot":return ".";case "hyphen":return "-";case "underscore":return "_";case "middleDot":return "\xB7";case "heavy":return "_";default:return null}}function Ue(e){if(!e)return 0;let t=e.match(/rotate\(([-\d.]+)deg\)/);return t?(parseFloat(t[1])%360+360)%360:0}function Xe(e,t,o){if(o===0||o===180)return {w:e,h:t};if(o===90||o===270)return {w:t,h:e};let n=o*Math.PI/180,r=Math.abs(Math.sin(n)),i=Math.abs(Math.cos(n));return {w:e*i+t*r,h:e*r+t*i}}function xt(e,t){let o=t.createElement("img");o.className=`${E.run} ${E.image}`,o.src=e.src,o.width=e.width,o.height=e.height,o.style.width=`${e.width}px`,o.style.height=`${e.height}px`,e.alt&&(o.alt=e.alt),e.transform&&(o.style.transform=e.transform,o.style.transformOrigin="center center"),q(e)&&J(o,e);let n=Ue(e.transform);if(n!==0){let r=Xe(e.width,e.height,n),i=t.createElement("span");return i.style.display="inline-block",i.style.position="relative",i.style.width=`${r.w}px`,i.style.height=`${r.h}px`,i.style.verticalAlign="middle",o.style.position="absolute",o.style.left=`${(r.w-e.width)/2}px`,o.style.top=`${(r.h-e.height)/2}px`,G(i,e.pmStart,e.pmEnd),i.appendChild(o),i}return o.style.display="inline-block",o.style.verticalAlign="middle",G(o,e.pmStart,e.pmEnd),o}function Ye(e,t){let o=t.createElement("div");o.className="layout-block-image",o.style.display="block",o.style.textAlign="center",o.style.marginTop=`${e.distTop??6}px`,o.style.marginBottom=`${e.distBottom??6}px`;let n=t.createElement("img");n.src=e.src,n.width=e.width,n.height=e.height,n.style.marginLeft="auto",n.style.marginRight="auto",e.alt&&(n.alt=e.alt),e.transform&&(n.style.transform=e.transform,n.style.transformOrigin="center center"),q(e)&&J(n,e);let r=Ue(e.transform);if(r!==0){let i=Xe(e.width,e.height,r);o.style.height=`${i.h}px`,o.style.position="relative",n.style.position="absolute",n.style.left="50%",n.style.top="50%",n.style.marginLeft=`${-e.width/2}px`,n.style.marginRight="0",n.style.marginTop=`${-e.height/2}px`;}return G(o,e.pmStart,e.pmEnd),o.appendChild(n),o}function se(e,t){return M(e)||e.displayMode==="block"||e.wrapType==="topAndBottom"?Ye(e,t):xt(e,t)}function Fe(e,t){let o=t.createElement("br");return o.className=`${E.run} ${E.lineBreak}`,G(o,e.pmStart,e.pmEnd),o}function le(e,t,o){let n=e.fallback??"";switch(e.fieldType){case "PAGE":n=String(o.pageNumber);break;case "NUMPAGES":n=String(o.totalPages);break;case "DATE":n=new Date().toLocaleDateString();break;case "TIME":n=new Date().toLocaleTimeString();break}let r={text:n,bold:e.bold,italic:e.italic,underline:e.underline,strike:e.strike,color:e.color,highlight:e.highlight,fontFamily:e.fontFamily,fontSize:e.fontSize,pmStart:e.pmStart,pmEnd:e.pmEnd};return Q(r,t,o?.resolvedCommentIds)}function ke(e,t,o){if(A(e))return Q(e,t,o?.resolvedCommentIds);if(z(e))return ae(e,t,48,void 0);if(j(e))return se(e,t);if(W(e))return Fe(e,t);if(K(e)&&o)return le(e,t,o);let n=t.createElement("span");return n.className=E.run,n}function Ie(e){return e/1440*96}function Tt(e){return e/96*1440}function St(e){let{explicitStops:t=[],defaultTabInterval:o=720,leftIndent:n=0}=e,r=t.filter(c=>c.val!=="clear").filter(c=>c.pos>=n),i=t.filter(c=>c.val==="clear").map(c=>c.pos),a=r.reduce((c,T)=>Math.max(c,T.pos),0),l=[...r];n>0&&!r.some(c=>c.pos<=n)&&(i.some(T=>Math.abs(T-n)<20)||l.push({val:"start",pos:n,leader:"none"}));let f=a>0?Math.max(a,n):n,s=n+14400;for(;f<s;){f+=o;let c=r.some(m=>Math.abs(m.pos-f)<20),T=i.some(m=>Math.abs(m-f)<20),b=n>0&&Math.abs(f-n)<20;!c&&!T&&!b&&l.push({val:"start",pos:f,leader:"none"});}return l.sort((c,T)=>c.pos-T.pos)}function Ze(e,t,o="",n,r="."){let{defaultTabInterval:i=720}=t,a=Tt(e),d=St(t).find(c=>c.pos>a);if(!d){let c=Ie(i),T=c-e%c;return T<=0&&(T=c),{width:T,alignment:"default"}}let s=Ie(d.pos)-e;if(d.val==="center"||d.val==="end"){let c=n?n(o):0;d.val==="center"?s-=c/2:s-=c;}else if(d.val==="decimal"){let c=o.indexOf(r);if(c>=0&&n){let T=o.slice(0,c),b=n(T);s-=b;}}else if(d.val==="bar")return {width:0,leader:d.leader,alignment:"bar"};if(s<1){let c=Ie(i),T=c-e%c;return T<=0&&(T=c),{width:T,alignment:"default"}}return {width:s,leader:d.leader,alignment:d.val}}function Je(e,t){let o=[],n=e.runs;for(let r=t.fromRun;r<=t.toRun;r++){let i=n[r];if(i)if(A(i)){let a=r===t.fromRun?t.fromChar:0,l=r===t.toRun?t.toChar:i.text.length;if(a>0||l<i.text.length){let d=i.text.slice(a,l);o.push({...i,text:d,pmStart:i.pmStart!==void 0?i.pmStart+a:void 0,pmEnd:i.pmStart!==void 0?i.pmStart+l:void 0});}else o.push(i);}else o.push(i);}return o}function qe(e){return [e.pmStart??"no-start",e.pmEnd??"no-end",e.src,e.width,e.height,e.displayMode??"inline",e.wrapType??"none"].join("|")}function wt(e){return {val:e.val,pos:e.pos,leader:e.leader}}function Ft(e,t,o){let n="";for(let r=t+1;r<e.length;r++){let i=e[r];if(A(i))n+=i.text;else if(K(i))i.fieldType==="PAGE"&&o?n+=String(o.pageNumber):i.fieldType==="NUMPAGES"&&o?n+=String(o.totalPages):n+=i.fallback??"";else if(z(i)||W(i))break}return n}var kt=.5;function It(e,t,o,n){let r=0;for(let i=t+1;i<e.length;i++){let a=e[i];if(z(a)||W(a))break;if(A(a))r+=o(a.text||"",a.fontSize,a.fontFamily,a.bold,a.italic);else if(K(a)){let l;a.fieldType==="PAGE"&&n?l=String(n.pageNumber):a.fieldType==="NUMPAGES"&&n?l=String(n.totalPages):l=a.fallback??"",r+=o(l,a.fontSize,a.fontFamily,a.bold,a.italic);}else j(a)&&!M(a)&&(r+=a.width||0);}return r}function Ct(e){let o=e.createElement("canvas").getContext("2d");return (n,r=11,i="Calibri",a=false,l=false)=>{if(!o)return n.length*7;let d=chunkN3Y5BUKV_js.a(i).cssFallback,f=r*96/72,s=[];return l&&s.push("italic"),a&&s.push("bold"),s.push(`${f}px`,d),o.font=s.join(" "),o.measureText(n).width}}function de(e,t,o,n,r){let i=n.createElement("div");i.className=E.line,i.style.height=`${t.lineHeight}px`,i.style.lineHeight=`${t.lineHeight}px`;let a=Je(e,t);if(a.length===1&&j(a[0])){let p=a[0].position?.horizontal?.align??o;i.style.display="flex",i.style.alignItems="center",i.style.justifyContent=p==="center"?"center":p==="right"?"flex-end":"flex-start",i.dataset.flexLine="true";}if(a.length===0){let h=n.createElement("span");return h.className=`${E.run} layout-empty-run`,h.innerHTML=" ",i.appendChild(h),i}let l=o==="justify",d=false;l&&r&&(d=!r.isLastLine||r.paragraphEndsWithLineBreak,d&&(i.style.textAlign="justify",i.style.textAlignLast="justify",i.style.width=`${r.availableWidth}px`)),i.style.whiteSpace="pre";let f=a.some(h=>A(h)&&h.highlight);i.style.overflow=f?"hidden":"visible";let s=a.some(z),c,T=Ct(n);if(s){let h=r?.tabStops?.map(wt),g=r?.leftIndentPx?Math.round(r.leftIndentPx*15):0;c={explicitStops:h,leftIndent:g};}let b=0,m=r?.leftIndentPx??0;if(r?.isFirstLine){let h=r?.firstLineIndentPx??0;b=m+h;}else b=m;for(let h=0;h<a.length;h++){let g=a[h];if(z(g)&&c){let p=Ft(a,h,r?.context),y=Ze(b,c,p,T),u=r?.lineRightEdgePx,S=u!==void 0?It(a,h,T,r?.context):0,w=false;for(let x=h+1;x<a.length&&!W(a[x]);x++)if(z(a[x])){w=true;break}if(u!==void 0&&y.alignment==="end"&&!w&&b+y.width+S>=u-kt){i.style.display="flex",i.style.alignItems="baseline",i.style.whiteSpace="nowrap",i.style.textIndent="0",i.dataset.flexLine="true",r?.isFirstLine&&r.firstLineIndentPx&&r.firstLineIndentPx<0&&i.firstElementChild instanceof HTMLElement&&(i.firstElementChild.style.marginLeft=`${r.firstLineIndentPx}px`);let x=ae(g,n,0,y.leader);x.style.flex="1 1 0",x.style.minWidth="0",x.style.width="auto",i.appendChild(x);for(let k=h+1;k<a.length;k++){let P=a[k];if(z(P)||W(P))break;if(A(P))i.appendChild(Q(P,n,r?.context?.resolvedCommentIds));else if(K(P)&&r?.context)i.appendChild(le(P,n,r.context));else if(j(P)){if(M(P))continue;let C=qe(P);r?.renderedInlineImageKeys?.has(C)||(r?.renderedInlineImageKeys?.add(C),i.appendChild(se(P,n)));}else i.appendChild(ke(P,n,r?.context));}break}let I=y.width;u!==void 0&&b+I+S>u&&(I=Math.max(1,u-b-S));let R=ae(g,n,I,y.leader);i.appendChild(R),b+=I;}else if(A(g)){let p=Q(g,n,r?.context?.resolvedCommentIds);if(g.highlight){let w=(g.fontSize?g.fontSize*96/72:14.67)*1.2,F=Math.max(0,t.lineHeight-w);if(F>0){let I=F/2;p.style.paddingTop=`${I}px`,p.style.paddingBottom=`${I}px`;}}i.appendChild(p);let y=g.fontSize||11,u=g.fontFamily||"Calibri";b+=T(g.text,y,u,g.bold,g.italic);}else if(j(g)){if(M(g))continue;let p=qe(g);if(r?.renderedInlineImageKeys?.has(p))continue;r?.renderedInlineImageKeys?.add(p);let y=se(g,n);i.appendChild(y),g.displayMode!=="block"&&g.wrapType!=="topAndBottom"&&(b+=g.width);}else if(W(g)){let p=Fe(g,n);i.appendChild(p);}else if(K(g)&&r?.context){let p=le(g,n,r.context);i.appendChild(p);let y=g.fallback??"";g.fieldType==="PAGE"?y=String(r.context.pageNumber):g.fieldType==="NUMPAGES"&&(y=String(r.context.totalPages));let u=g.fontSize||11,S=g.fontFamily||"Calibri";b+=T(y,u,S,g.bold,g.italic);}else {let p=ke(g,n,r?.context);i.appendChild(p);}}return i}function ee(e,t){return !e&&!t?true:!e||!t?false:e.style===t.style&&e.width===t.width&&e.color===t.color}function Qe(e,t){return !e&&!t||!e||!t?false:ee(e.top,t.top)&&ee(e.bottom,t.bottom)&&ee(e.left,t.left)&&ee(e.right,t.right)&&ee(e.between,t.between)}function $(e,t,o,n,r={}){let i=r.document??document,a=i.createElement("div");a.className=E.fragment,a.style.position=n.positioning==="absolute"?"absolute":"relative",a.dataset.blockId=String(e.blockId),a.dataset.fromLine=String(e.fromLine),a.dataset.toLine=String(e.toLine),G(a,e.pmStart,e.pmEnd),e.continuesFromPrev&&(a.dataset.continuesFromPrev="true"),e.continuesOnNext&&(a.dataset.continuesOnNext="true");let l=o.lines.slice(e.fromLine,e.toLine),d=t.attrs?.alignment;t.attrs?.styleId&&(a.dataset.styleId=t.attrs.styleId);let f=t.attrs?.bidi;f&&(a.dir="rtl"),d?d==="center"?a.style.textAlign="center":d==="right"?a.style.textAlign="right":d==="left"?a.style.textAlign="left":a.style.textAlign=f?"right":"left":f&&(a.style.textAlign="right");let s=t.attrs?.indent,c=0,T=0;s&&(f?(s.left&&s.left>0&&(T=s.left),s.right&&s.right>0&&(c=s.right)):(s.left&&s.left>0&&(c=s.left),s.right&&s.right>0&&(T=s.right)));let b=t.attrs?.borders;if(b){let S=C=>{switch(C){case "single":return "solid";case "double":return "double";case "dotted":return "dotted";case "dashed":return "dashed";case "thick":return "solid";case "wave":return "wavy";case "dashSmallGap":return "dashed";case "nil":case "none":return "none";default:return "solid"}};a.style.boxSizing="border-box";let w=C=>`${C.width}px ${S(C.style)} ${C.color}`,F=Qe(r.prevBorders,b),I=Qe(b,r.nextBorders),R=F?b.between:b.top,x=I?void 0:b.bottom,k=i.createElement("div");if(k.className="layout-paragraph-border",k.style.position="absolute",k.style.pointerEvents="none",k.style.boxSizing="border-box",k.style.left=`${c-(b.left?.space??0)}px`,k.style.right=`${T-(b.right?.space??0)}px`,k.style.top=`${-(R?.space??0)}px`,k.style.bottom=`${-(x?.space??0)}px`,R&&(k.style.borderTop=w(R)),x&&(k.style.borderBottom=w(x)),b.left&&(k.style.borderLeft=w(b.left)),b.right&&(k.style.borderRight=w(b.right)),(R||x||b.left||b.right)&&a.appendChild(k),b.bar){let C=i.createElement("div");C.style.position="absolute",C.style.left="-8px",C.style.top="0",C.style.bottom="0",C.style.borderLeft=w(b.bar),a.style.position="relative",a.appendChild(C);}}t.attrs?.shading&&(a.style.backgroundColor=t.attrs.shading);let m=e.width-c-T,g=t.runs[t.runs.length-1]?.kind==="lineBreak",p=o.lines.length,y=0;s?.hanging&&s.hanging>0?y=-s.hanging:s?.firstLine&&s.firstLine>0&&(y=s.firstLine);let u=r.renderedInlineImageKeys??new Set;for(let S=0;S<l.length;S++){let w=l[S],F=e.fromLine+S,I=F===p-1,R=F===0&&!e.continuesFromPrev,x=w.leftOffset??0,k=w.rightOffset??0,P=m;if(R){let B=s?.hanging&&s.hanging>0,L=s?.firstLine&&s.firstLine>0;B&&s?.hanging?P=m+s.hanging:L&&s?.firstLine&&(P=m-s.firstLine);}if(Rt(w,t)){let B=i.createElement("div");B.className=`${E.line} layout-line-split`,B.style.position="relative",B.style.height=`${w.lineHeight}px`,B.style.lineHeight=`${w.lineHeight}px`;for(let L of w.segments){let be={fromRun:L.fromRun,fromChar:L.fromChar,toRun:L.toRun,toChar:L.toChar,width:L.width,ascent:w.ascent,descent:w.descent,lineHeight:w.lineHeight},D=de(t,be,d,i,{availableWidth:L.availableWidth,isLastLine:I,isFirstLine:R,paragraphEndsWithLineBreak:g,tabStops:t.attrs?.tabs,leftIndentPx:c,firstLineIndentPx:R?y:0,context:n,renderedInlineImageKeys:u});D.className+=" layout-line-segment",D.style.position="absolute",D.style.left=`${L.leftOffset}px`,D.style.top="0",D.style.width=`${L.availableWidth}px`,B.appendChild(D);}a.appendChild(B);continue}let C=de(t,w,d,i,{availableWidth:P-x-k,isLastLine:I,isFirstLine:R,paragraphEndsWithLineBreak:g,tabStops:t.attrs?.tabs,leftIndentPx:c,firstLineIndentPx:R?y:0,context:n,renderedInlineImageKeys:u,lineRightEdgePx:e.width-T-k});if(x>0||k>0){x>0&&(C.style.marginLeft=`${x}px`),k>0&&(C.style.marginRight=`${k}px`);let B=P-x-k;B>0&&(C.style.width=`${B}px`);}let Me=s?.hanging&&s.hanging>0,ve=s?.firstLine&&s.firstLine>0,lt=C.dataset.flexLine==="true";if(R?c>0&&Me?(C.style.paddingLeft=`${c}px`,lt||(C.style.textIndent=`-${s.hanging}px`)):c>0&&ve?(C.style.paddingLeft=`${c}px`,C.style.textIndent=`${s.firstLine}px`):c>0?C.style.paddingLeft=`${c}px`:ve&&(C.style.textIndent=`${s.firstLine}px`):c>0?C.style.paddingLeft=`${c}px`:Me&&(C.style.paddingLeft=`${s.hanging}px`),T>0&&(C.style.paddingRight=`${T}px`),R&&t.attrs?.listMarker&&!t.attrs?.listMarkerHidden){let B=Math.max(0,c-(s?.hanging??0));C.style.paddingLeft=`${B}px`,C.style.textIndent="0";let L;if(!t.attrs.listMarkerFontFamily||!t.attrs.listMarkerFontSize)for(let H=w.fromRun;H<=w.toRun;H++){let xe=t.runs[H];if(xe&&xe.kind==="text"){L=xe;break}}let be=t.attrs.listMarkerFontFamily??L?.fontFamily??t.attrs.defaultFontFamily,D=t.attrs.listMarkerFontSize??L?.fontSize??t.attrs.defaultFontSize,$e=Pt(t.attrs.listMarker,s,i,be,D);if((s?.hanging??0)>0)C.insertBefore($e,C.firstChild);else {let H=i.createElement("div");H.className="layout-line layout-list-marker-line",H.style.height=`${w.lineHeight}px`,H.style.lineHeight=`${w.lineHeight}px`,H.appendChild($e),a.appendChild(H);}}a.appendChild(C);}return a}function Rt(e,t){return (e.segments?.length??0)>1&&!t.attrs?.listMarker}function Pt(e,t,o,n,r){let i=o.createElement("span");if(i.className="layout-list-marker",n&&(i.style.fontFamily=chunkN3Y5BUKV_js.a(n).cssFallback),r){let l=r*96/72;i.style.fontSize=`${l}px`;}i.textContent=e,i.style.textAlign="left",i.style.boxSizing="border-box";let a=t?.hanging??0;return i.style.display="inline-block",a>0&&(i.style.minWidth=`${a}px`),i}function U(e,t,o){let n=t.createElement("div");n.className=o.layerClass,n.style.position="absolute",n.style.top="0",n.style.left="0",o.sizing==="inset0"?(n.style.right="0",n.style.bottom="0"):(n.style.width="100%",n.style.height="100%",n.style.overflow="hidden"),n.style.pointerEvents="none",o.layerMode==="front"&&(n.style.zIndex="10");for(let r of e){let i=t.createElement("div");i.className=o.itemClass,i.style.position="absolute",i.style.pointerEvents="auto",i.style.top=`${r.y}px`,i.style.left=`${r.x}px`,r.pmStart!==void 0&&(i.dataset.pmStart=String(r.pmStart)),r.pmEnd!==void 0&&(i.dataset.pmEnd=String(r.pmEnd));let a=t.createElement("img");a.src=r.src,a.style.width=`${r.width}px`,a.style.height=`${r.height}px`,a.style.display="block",r.alt&&(a.alt=r.alt),r.transform&&(a.style.transform=r.transform,a.style.transformOrigin="center center"),q(r)&&J(a,r),i.appendChild(a),n.appendChild(i);}return n}var O={table:"layout-table",row:"layout-table-row",cell:"layout-table-cell",cellContent:"layout-table-cell-content",resizeHandle:"layout-table-resize-handle",rowResizeHandle:"layout-table-row-resize-handle",tableEdgeHandleBottom:"layout-table-edge-handle-bottom",tableEdgeHandleRight:"layout-table-edge-handle-right"};function Et(e,t,o){let n=[],r=0;for(let i=0;i<e.blocks.length;i++){let a=e.blocks[i];if(a?.kind!=="paragraph"){let f=t.blocks[i];f&&f.kind==="table"&&(r+=f.totalHeight??0);continue}let l=a;for(let f of l.runs){if(f.kind!=="image")continue;let s=f;if(!M(s))continue;let c=s.position,T=s.distTop??0,b=s.distBottom??0,m=s.distLeft??12,h=s.distRight??12,g="left",p=0;if(c?.horizontal){let u=c.horizontal;u.align==="right"?(g="right",p=o-s.width):u.align==="left"?p=0:u.align==="center"?p=(o-s.width)/2:u.posOffset!==void 0&&(p=chunk4Q2IP5FW_js.e(u.posOffset),g=p>o/2?"right":"left");}else s.cssFloat==="right"&&(g="right",p=o-s.width);let y=r;if(c?.vertical){let u=c.vertical;u.posOffset!==void 0?y=r+chunk4Q2IP5FW_js.e(u.posOffset):u.align==="top"&&(y=0);}p=Math.max(0,Math.min(p,o-s.width)),n.push({src:s.src,width:s.width,height:s.height,alt:s.alt,transform:s.transform,x:p,y,side:g,distTop:T,distBottom:b,distLeft:m,distRight:h,wrapText:re(s.cssFloat),wrapType:s.wrapType,pmStart:s.pmStart,pmEnd:s.pmEnd});}let d=t.blocks[i];d&&d.kind==="paragraph"&&(r+=d.totalHeight);}return n}function Lt(e,t,o,n){let r=n.createElement("div");r.className=O.cellContent,r.style.position="relative";let i=e.padding?.left??7,a=e.padding?.right??7,l=Math.max(0,t.width-i-a);r.style.width=`${l}px`;let d=Et(e,t,l),f;if(d.length>0){f=d.filter(Z).map(m=>{let h=m.x+m.width+m.distRight,g=m.y-m.distTop,p=m.y+m.height+m.distBottom,y=0,u=0,S=m.wrapText??"bothSides";return S==="right"?y=h:S==="left"?u=l-(m.x-m.distLeft):m.side==="left"?y=h:u=l-(m.x-m.distLeft),{leftMargin:y,rightMargin:u,topY:g,bottomY:p}});let b=d.filter(Y);b.length>0&&r.appendChild(U(b,n,{layerClass:"layout-cell-floating-images-layer",itemClass:"layout-cell-floating-image",sizing:"fullSize",layerMode:"behind"}));}let s=0,c=0;for(let b=0;b<e.blocks.length;b++){let m=e.blocks[b],h=t.blocks[b];if(m?.kind==="paragraph"&&h?.kind==="paragraph"){let g=m,p=h,y=g.attrs?.spacing,u=Math.max(c,y?.before??0);s+=u,f&&f.length>0&&(p=chunkTZJUO3NW_js.s(g,l,{floatingZones:f,paragraphYOffset:s}));let S={blockId:g.id,width:l,height:p.totalHeight,fromLine:0,toLine:p.lines.length,pmStart:g.pmStart,pmEnd:g.pmEnd},w={...o,insideTableCell:true},F=$(S,g,p,w,{document:n});F.style.position="relative",u>0&&(F.style.marginTop=`${u}px`),r.appendChild(F),s+=p.totalHeight,c=y?.after??0;}else if(m?.kind==="table"&&h?.kind==="table"){let g=m,p=h,y=c,u=Bt(g,p,o,n);u.style.position="relative",y>0&&(u.style.marginTop=`${y}px`),r.appendChild(u),s+=y+(h.totalHeight??0),c=0;}}c>0&&(r.style.paddingBottom=`${c}px`);let T=d.filter(b=>!Y(b));return T.length>0&&r.appendChild(U(T,n,{layerClass:"layout-cell-floating-images-layer",itemClass:"layout-cell-floating-image",sizing:"fullSize",layerMode:"front"})),r}function Bt(e,t,o,n){let r=n.createElement("div");r.className=`${O.table} layout-nested-table`,r.style.position="relative",r.style.width=`${t.totalWidth}px`,r.style.display="block",e.justification==="center"?(r.style.marginLeft="auto",r.style.marginRight="auto"):e.justification==="right"?r.style.marginLeft="auto":e.indent&&(r.style.marginLeft=`${e.indent}px`),r.dataset.blockId=String(e.id),e.pmStart!==void 0&&(r.dataset.pmStart=String(e.pmStart)),e.pmEnd!==void 0&&(r.dataset.pmEnd=String(e.pmEnd));let i=[],a=0;for(let f=0;f<t.rows.length;f++)i.push(a),a+=t.rows[f]?.height??0;i.push(a);let l=new Map,d=0;for(let f=0;f<e.rows.length;f++){let s=e.rows[f],c=t.rows[f];if(!s||!c)continue;let T=Ce(s,c,f,d,t.columnWidths,e.rows.length,o,n,l,i);r.appendChild(T),d+=c.height;}return r.style.height=`${d}px`,r}function pe(e,t,o){let n=`border${t.charAt(0).toUpperCase()+t.slice(1)}`;if(!o||o.style==="none"||o.style==="nil"||o.width===0)e.style[n]="none";else {let r=o.width??1,i=o.color??"#000000",a=o.style??"solid";e.style[n]=`${r}px ${a} ${i}`;}}function Mt(e,t,o,n,r,i,a){let l=a.createElement("div");l.className=O.cell,l.style.position="absolute",l.style.left=`${o}px`,l.style.top="0",l.style.width=`${t.width}px`,l.style.height=`${n}px`,l.style.overflow="hidden",l.style.boxSizing="border-box";let d=e.padding?.top??1,f=e.padding?.right??7,s=e.padding?.bottom??1,c=e.padding?.left??7;if(l.style.padding=`${d}px ${f}px ${s}px ${c}px`,e.borders&&(r.isFirstRow&&pe(l,"top",e.borders.top),pe(l,"right",e.borders.right),pe(l,"bottom",e.borders.bottom),r.isFirstCol&&pe(l,"left",e.borders.left)),e.background&&(l.style.backgroundColor=e.background),e.noWrap&&(l.style.whiteSpace="nowrap"),e.verticalAlign)switch(l.style.display="flex",l.style.flexDirection="column",e.verticalAlign){case "top":l.style.justifyContent="flex-start";break;case "center":l.style.justifyContent="center";break;case "bottom":l.style.justifyContent="flex-end";break}let T=Lt(e,t,i,a);if(l.appendChild(T),e.blocks.length>0){let b=e.blocks[0],m=e.blocks[e.blocks.length-1];b&&"pmStart"in b&&b.pmStart!==void 0&&(l.dataset.pmStart=String(b.pmStart)),m&&"pmEnd"in m&&m.pmEnd!==void 0&&(l.dataset.pmEnd=String(m.pmEnd));}return l}function Ce(e,t,o,n,r,i,a,l,d,f,s){let c=l.createElement("div");c.className=O.row,c.style.position="absolute",c.style.left="0",c.style.top=`${n}px`,c.style.width="100%",c.style.height=`${t.height}px`,c.dataset.rowIndex=String(o);let T=new Set;if(d){for(let[,h]of d)if(h.startRow<o&&h.startRow+h.rowSpan>o)for(let g=0;g<h.colSpan;g++)T.add(h.columnIndex+g);}let b=0,m=0;for(;T.has(m);)b+=r[m]??0,m++;for(let h=0;h<e.cells.length;h++){let g=e.cells[h],p=t.cells[h];if(!g||!p)continue;let y=g.colSpan??1,u=g.rowSpan??1,S=t.height;if(u>1&&f){S=0;for(let k=o;k<o+u&&k<f.length-1;k++)S+=(f[k+1]??0)-(f[k]??0);S===0&&(S=t.height*u);}let w=o===0||s===true,I=m===0;m+y>=r.length;let x=Mt(g,p,b,S,{isFirstRow:w,isFirstCol:I},a,l);if(x.dataset.cellIndex=String(h),x.dataset.columnIndex=String(m),u>1&&(x.dataset.rowSpan=String(u)),c.appendChild(x),u>1&&d){let k=`${o}-${m}`;d.set(k,{cell:g,cellMeasure:p,columnIndex:m,startRow:o,rowSpan:u,colSpan:y,x:b,totalHeight:S});}for(let k=0;k<y&&m+k<r.length;k++)b+=r[m+k]??0;for(m+=y;T.has(m);)b+=r[m]??0,m++;}return c}function X(e,t,o,n,r={}){let i=r.document??document,a=i.createElement("div");a.className=O.table,a.style.position=n.positioning==="flow"?"relative":"absolute",a.style.width=`${e.width}px`,a.style.height=`${e.height}px`,a.style.overflow="hidden",a.dataset.blockId=String(e.blockId),a.dataset.fromRow=String(e.fromRow),a.dataset.toRow=String(e.toRow),e.pmStart!==void 0&&(a.dataset.pmStart=String(e.pmStart)),e.pmEnd!==void 0&&(a.dataset.pmEnd=String(e.pmEnd));let l=0;for(let m=0;m<o.columnWidths.length-1;m++){l+=o.columnWidths[m]??0;let h=i.createElement("div");h.className=O.resizeHandle,h.style.position="absolute",h.style.left=`${l-3}px`,h.style.top="0",h.style.width="6px",h.style.height="100%",h.style.cursor="col-resize",h.style.zIndex="10",h.dataset.columnIndex=String(m),h.dataset.tableBlockId=String(e.blockId),e.pmStart!==void 0&&(h.dataset.tablePmStart=String(e.pmStart)),a.appendChild(h);}let d=[],f=0;for(let m=0;m<o.rows.length;m++)d.push(f),f+=o.rows[m]?.height??0;d.push(f);let s=new Map,c=e.headerRowCount??0,T=0;if(c>0&&e.continuesFromPrev)for(let m=0;m<c;m++){let h=t.rows[m],g=o.rows[m];if(!h||!g)continue;let p=Ce(h,g,m,T,o.columnWidths,t.rows.length,n,i,s,d,m===0);p.dataset.repeatedHeader="true",a.appendChild(p),T+=g.height;}for(let m=e.fromRow;m<e.toRow;m++){let h=t.rows[m],g=o.rows[m];if(!h||!g)continue;let p=c>0&&e.continuesFromPrev?false:e.continuesFromPrev&&m===e.fromRow,y=Ce(h,g,m,T,o.columnWidths,t.rows.length,n,i,s,d,p);a.appendChild(y),T+=g.height;}let b=0;for(let m=e.fromRow;m<e.toRow;m++)if(b+=o.rows[m]?.height??0,m<e.toRow-1){let h=i.createElement("div");h.className=O.rowResizeHandle,h.style.position="absolute",h.style.left="0",h.style.top=`${b-3}px`,h.style.width="100%",h.style.height="6px",h.style.cursor="row-resize",h.style.zIndex="10",h.dataset.rowIndex=String(m),h.dataset.tableBlockId=String(e.blockId),e.pmStart!==void 0&&(h.dataset.tablePmStart=String(e.pmStart)),a.appendChild(h);}if(e.toRow===t.rows.length){let m=i.createElement("div");m.className=O.tableEdgeHandleBottom,m.style.position="absolute",m.style.left="0",m.style.top=`${b-3}px`,m.style.width="100%",m.style.height="6px",m.style.cursor="row-resize",m.style.zIndex="10",m.dataset.rowIndex=String(t.rows.length-1),m.dataset.tableBlockId=String(e.blockId),m.dataset.isEdge="bottom",e.pmStart!==void 0&&(m.dataset.tablePmStart=String(e.pmStart)),a.appendChild(m);}if(e.toRow===t.rows.length){let m=o.columnWidths.reduce((g,p)=>g+p,0),h=i.createElement("div");h.className=O.tableEdgeHandleRight,h.style.position="absolute",h.style.left=`${m-3}px`,h.style.top="0",h.style.width="6px",h.style.height="100%",h.style.cursor="col-resize",h.style.zIndex="10",h.dataset.columnIndex=String(o.columnWidths.length-1),h.dataset.tableBlockId=String(e.blockId),h.dataset.isEdge="right",e.pmStart!==void 0&&(h.dataset.tablePmStart=String(e.pmStart)),a.appendChild(h);}return a}var vt={textBox:"layout-textbox"};function ce(e,t,o,n,r={}){let i=r.document??document,a=i.createElement("div");if(a.className=vt.textBox,a.style.position="absolute",a.style.width=`${e.width}px`,a.style.height=`${e.height}px`,a.style.overflow="hidden",a.style.boxSizing="border-box",$t(a,e),t.fillColor&&(a.style.backgroundColor=t.fillColor),t.outlineWidth&&t.outlineWidth>0){let s=t.outlineStyle||"solid",c=t.outlineColor||"#000000";a.style.border=`${t.outlineWidth}px ${s} ${c}`;}let l=t.margins??chunkDROCYKAR_js.a;a.style.padding=`${l.top}px ${l.right}px ${l.bottom}px ${l.left}px`,a.dataset.blockId=String(e.blockId),e.pmStart!==void 0&&(a.dataset.pmStart=String(e.pmStart)),e.pmEnd!==void 0&&(a.dataset.pmEnd=String(e.pmEnd));let d=e.width-l.left-l.right,f=0;for(let s=0;s<t.content.length;s++){let c=t.content[s],T=o.innerMeasures[s];if(!T)continue;let b={blockId:c.id,width:d,height:T.totalHeight,pmStart:c.pmStart,pmEnd:c.pmEnd,fromLine:0,toLine:T.lines.length},m=$(b,c,T,{...n,positioning:"flow"},{document:i});a.appendChild(m),f+=T.totalHeight;}return a}function $t(e,t){!t.isFloating&&t.zIndex===void 0||(e.style.zIndex=String(t.zIndex??10));}function et(e){return {pageWidth:e.size.w,pageHeight:e.size.h,marginLeft:e.margins.left,marginTop:e.margins.top,contentWidth:e.size.w-e.margins.left-e.margins.right,contentHeight:e.size.h-e.margins.top-e.margins.bottom}}function Re(e,t,o,n){let{x:r,side:i}=Ht(e,o,n),a=zt(e,t,n);return {x:r,y:a,side:i}}function Ht(e,t,o){let n=e.position?.horizontal;if(!n)return e.cssFloat==="right"?{x:t-e.width,side:"right"}:{x:0,side:"left"};let r=At(n.relativeTo,t,o);if(n.align==="right")return {x:r.size?r.base+r.size-e.width:0,side:"right"};if(n.align==="left")return {x:r.base,side:"left"};if(n.align==="center")return {x:r.size?r.base+(r.size-e.width)/2:0,side:"left"};if(n.posOffset!==void 0){let i=r.base+chunk4Q2IP5FW_js.e(n.posOffset);return {x:i,side:i>t/2?"right":"left"}}return {x:r.base,side:"left"}}function At(e,t,o){let n=o?.pageWidth??0,r=o?.marginLeft??0;switch(e){case "page":return {base:-r,size:n};case "leftMargin":return {base:-r,size:r};case "rightMargin":return {base:t,size:r};case "character":return {base:0,size:0};default:return {base:0,size:t}}}function zt(e,t,o){let n=e.position?.vertical;if(!n)return t;let r=Ot(n.relativeTo,t,o);return n.align==="top"?r.base:n.align==="center"?r.size?r.base+(r.size-e.height)/2:t:n.align==="bottom"?r.size?r.base+r.size-e.height:t:n.posOffset!==void 0?r.base+chunk4Q2IP5FW_js.e(n.posOffset):n.relativeTo==="paragraph"||n.relativeTo==="line"?t:r.base}function Ot(e,t,o){let n=o?.pageHeight??0,r=o?.marginTop??0,i=o?.contentHeight??0;switch(e){case "paragraph":case "line":return {base:t,size:0};case "page":return {base:-r,size:n};case "topMargin":return {base:-r,size:r};case "bottomMargin":return {base:i,size:r};default:return {base:0,size:i}}}function tt(e){return e?.align??e?.alignment}function Nt(e,t){let o=e.position.vertical;if(!o)return e.paragraphY;let n=tt(o),r=o.posOffset!==void 0?chunk4Q2IP5FW_js.e(o.posOffset):void 0;if(o.relativeTo==="page"){if(r!==void 0)return r-t.flowTop;if(n==="top")return -t.flowTop;if(n==="bottom")return t.pageHeight-e.height-t.flowTop;if(n==="center")return (t.pageHeight-e.height)/2-t.flowTop}if(o.relativeTo==="margin"){let i=t.margins.top,a=t.pageHeight-t.margins.top-t.margins.bottom;if(r!==void 0)return i+r-t.flowTop;if(n==="top")return i-t.flowTop;if(n==="bottom")return i+a-e.height-t.flowTop;if(n==="center")return i+(a-e.height)/2-t.flowTop}return r!==void 0?e.paragraphY+r:e.paragraphY}function Dt(e,t,o){let n=t.position.horizontal;if(!n){e.style.left="0";return}let r=tt(n);if(n.relativeTo==="page"){if(n.posOffset!==void 0){e.style.left=`${chunk4Q2IP5FW_js.e(n.posOffset)-o.flowLeft}px`;return}if(r==="right"){e.style.left=`${o.pageWidth-t.width-o.flowLeft}px`;return}if(r==="center"){e.style.left=`${(o.pageWidth-t.width)/2-o.flowLeft}px`;return}if(r==="left"){e.style.left=`${-o.flowLeft}px`;return}}if(n.posOffset!==void 0){e.style.left=`${chunk4Q2IP5FW_js.e(n.posOffset)}px`;return}if(r==="right"){e.style.left=`${o.contentWidth-t.width}px`;return}if(r==="center"){e.style.left=`${(o.contentWidth-t.width)/2}px`;return}e.style.left="0";}function nt(e,t){let o=e.tblpY??0;e.vertAnchor==="page"?o-=t.flowTop:e.vertAnchor==="margin"&&(o+=t.margins.top-t.flowTop);let n=e.tblpX??0;return e.horzAnchor==="page"?n-=t.flowLeft:e.horzAnchor==="margin"&&(n+=t.margins.left-t.flowLeft),{left:n,top:o}}function Pe(e,t,o,n){let r=o.document??document,i=r.createElement("div");i.style.position="relative";let a=t.contentWidth??600,l=[],d=0;for(let f=0;f<e.blocks.length;f++){let s=e.blocks[f],c=e.measures[f];if(!(!s||!c)){if(s.kind==="paragraph"&&c.kind==="paragraph"){let T=s,b=c,m=T.attrs?.spacing?.before??0,h=d,g=[];for(let S of T.runs)if(S.kind==="image"&&"position"in S&&S.position){let w=S;l.push({src:w.src,width:w.width,height:w.height,alt:w.alt,paragraphY:h,position:w.position});}else g.push(S);let p={...T,runs:g},y={blockId:T.id,width:a,height:b.totalHeight,fromLine:0,toLine:b.lines.length},u=$(y,p,b,{...t,positioning:"absolute"},{document:r});u.style.top=`${d+m}px`,u.style.left="0",u.style.width=`${a}px`,i.appendChild(u),d+=b.totalHeight;}else if(s.kind==="table"&&c.kind==="table"){let T={blockId:s.id,width:c.totalWidth,height:c.totalHeight,fromRow:0,toRow:c.rows.length,pmStart:s.pmStart,pmEnd:s.pmEnd},b=X(T,s,c,{...t,positioning:"absolute"},{document:r});if(s.floating){let{left:m,top:h}=nt(s.floating,n);b.style.top=`${h}px`,b.style.left=`${m}px`,i.appendChild(b);}else b.style.top=`${d}px`,b.style.left="0",i.appendChild(b),d+=c.totalHeight;}}}for(let f of l){let s=r.createElement("img");s.src=f.src,s.width=f.width,s.height=f.height,f.alt&&(s.alt=f.alt),s.style.position="absolute",s.style.display="block",s.style.width=`${f.width}px`,s.style.height=`${f.height}px`,s.style.maxWidth="none",s.style.maxHeight="none",Dt(s,f,n),s.style.top=`${Nt(f,n)}px`,i.appendChild(s);}return i}var fe=12,ot=6;function _t(e,t){if(e.size!==t.size)return false;for(let[o,n]of e)if(t.get(o)!==n)return false;return true}var Ee=8;function Xn(e){let t=[];for(let o of e)if(o.kind==="paragraph")for(let n of o.runs)n.kind==="text"&&n.footnoteRefId!=null&&t.push({footnoteId:n.footnoteRefId,pmPos:n.pmStart??0});return t}function Le(e,t){let o=new Map;if(t.length===0)return o;for(let n of t)for(let r of e){let i=false;for(let a of r.fragments){let l=a.pmStart??-1,d=a.pmEnd??-1;if(l>=0&&d>=0&&n.pmPos>=l&&n.pmPos<d){let f=o.get(r.number)??[];f.includes(n.footnoteId)||f.push(n.footnoteId),o.set(r.number,f),i=true;break}}if(i)break}return o}function Wt(e,t){if(e.length===0)return [{kind:"paragraph",id:`fn-empty-${t}`,runs:[{kind:"text",text:`${t} `,fontSize:Ee,superscript:true}]}];let o=e.map(r=>{if(r.kind!=="paragraph")return r;let i=r;return {...i,runs:i.runs.map(a=>(a.kind==="text"||a.kind==="tab")&&a.fontSize==null?{...a,fontSize:Ee}:a)}}),n=o[0];if(n.kind==="paragraph"){let r={kind:"text",text:`${t} `,fontSize:Ee,superscript:true};o[0]={...n,runs:[r,...n.runs]};}return o}function Gt(e,t,o,n){let r=chunkHVZMO3BU_js.c(e.content,{styles:n.styles??void 0,theme:n.theme??null}),i=chunkBD4CYYFB_js.d(r,{theme:n.theme??void 0}),a=Wt(i,t),l=n.measureBlocks(a,o),d=l.reduce((f,s)=>s.kind==="paragraph"||s.kind==="table"?f+s.totalHeight:s.kind==="image"||s.kind==="textBox"?f+s.height:f,0);return {id:e.id,displayNumber:t,blocks:a,measures:l,height:d}}function Zn(e,t,o,n){let r=new Map,i=new Map;for(let d of e)(d.noteType==="normal"||d.noteType==null)&&i.set(d.id,d);let a=1,l=new Set;for(let d of t){if(l.has(d.footnoteId))continue;l.add(d.footnoteId);let f=i.get(d.footnoteId);f&&(r.set(d.footnoteId,Gt(f,a,o,n)),a++);}return r}function rt(e,t){let o=new Map;for(let[n,r]of e){let i=0;for(let a of r){let l=t.get(a);l&&(i+=l.height);}i>0&&(i+=fe,o.set(n,i));}return o}function qn(e){let{blocks:t,measures:o,layoutOpts:n,footnoteRefs:r,footnoteContentMap:i,initialLayout:a}=e,l=Le(a.pages,r),d=rt(l,i);if(d.size===0)return {layout:a,pageFootnoteMap:l,converged:true};let f=a,s=false;for(let c=0;c<ot;c++){f=chunk44RUAQA2_js.q(t,o,{...n,footnoteReservedHeights:d});let T=Le(f.pages,r),b=rt(T,i);if(l=T,_t(d,b)){d=b,s=true;break}d=b;}s||(f=chunk44RUAQA2_js.q(t,o,{...n,footnoteReservedHeights:d}),l=Le(f.pages,r),console.warn(`[docx-editor] footnote layout did not stabilize within ${ot} passes; settling with best-effort reservation. If footnotes appear misplaced, please file a bug with the document.`));for(let[c,T]of l){let b=f.pages.find(m=>m.number===c);b&&(b.footnoteIds=T);}return {layout:f,pageFootnoteMap:l,converged:s}}function Jn(e,t,o){let n=new Map;if(!o?.package?.footnotes)return n;let r=new Map;for(let i of o.package.footnotes)i.noteType&&i.noteType!=="normal"||r.set(i.id,i);for(let[i,a]of e){let l=[];for(let d of a){let f=r.get(d);if(!f)continue;let s=t.get(d),c=s?.displayNumber??0;l.push({displayNumber:String(c),text:chunkDV6IEOP5_js.v(f),content:s});}l.length>0&&n.set(i,l);}return n}function Vt(e,t,o,n){let r=n.createElement("div");r.className="layout-footnote-content",r.style.position="relative",r.style.width=`${t}px`,r.style.height=`${e.height}px`;let i=0;for(let a=0;a<e.blocks.length;a++){let l=e.blocks[a],d=e.measures[a];if(!(!l||!d)){if(l.kind==="paragraph"&&d.kind==="paragraph"){let f=l.attrs?.spacing?.before??0,s={blockId:l.id,width:t,height:d.totalHeight,pmStart:l.pmStart,pmEnd:l.pmEnd,fromLine:0,toLine:d.lines.length},c=$(s,l,d,{...o,section:"body",contentWidth:t,positioning:"absolute"},{document:n});c.style.top=`${i+f}px`,c.style.left="0",c.style.width=`${t}px`,c.style.height=`${d.totalHeight}px`,r.appendChild(c),i+=d.totalHeight;}else if(l.kind==="table"&&d.kind==="table"){let f={blockId:l.id,width:d.totalWidth,height:d.totalHeight,pmStart:l.pmStart,pmEnd:l.pmEnd,fromRow:0,toRow:d.rows.length},s=X(f,l,d,{...o,section:"body",contentWidth:t,positioning:"absolute"},{document:n});s.style.top=`${i}px`,s.style.left="0",r.appendChild(s),i+=d.totalHeight;}else if(l.kind==="image"&&d.kind==="image"){let f={blockId:l.id,width:d.width,height:d.height,pmStart:l.pmStart,pmEnd:l.pmEnd},s=ie(f,l,d,{...o},{document:n});s.style.top=`${i}px`,s.style.left="0",r.appendChild(s),i+=d.height;}else if(l.kind==="textBox"&&d.kind==="textBox"){let f={blockId:l.id,width:d.width,height:d.height,pmStart:l.pmStart,pmEnd:l.pmEnd},s=ce(f,l,d,{...o,section:"body",contentWidth:t,positioning:"absolute"},{document:n});s.style.top=`${i}px`,s.style.left="0",r.appendChild(s),i+=d.height;}}}return r}function jt(e,t){let o=t.createElement("div");o.style.fontSize="10px",o.style.lineHeight="1.3",o.style.marginBottom="4px",o.style.color="#000";let n=t.createElement("sup");n.textContent=e.displayNumber,n.style.fontSize="7px",n.style.marginRight="2px",o.appendChild(n);let r=t.createTextNode(" "+e.text);return o.appendChild(r),o}function it(e){let t=fe;for(let o of e)o.content&&(t+=o.content.height);return t}function at(e,t,o,n){let r=n.createElement("div");r.className="layout-footnote-area",r.style.width=`${t}px`;let i=n.createElement("div"),a=.5,l=(fe-a)/2;i.style.width="33%",i.style.height=`${a}px`,i.style.backgroundColor="#000",i.style.marginBottom=`${l}px`,i.style.marginTop=`${l}px`,r.appendChild(i);for(let d of e)r.appendChild(d.content?Vt(d.content,t,o,n):jt(d,n));return r}function Be(e,t,o){let n={pageNumber:e.number,totalPages:t,section:"body",resolvedCommentIds:o.resolvedCommentIds},r={...o};if(o.titlePg&&e.number===1&&(r.headerContent=o.firstPageHeaderContent,r.footerContent=o.firstPageFooterContent),o.footnotesByPage){let i=o.footnotesByPage.get(e.number);i&&i.length>0&&(r.footnoteArea=i);}return {context:n,pageOptions:r}}function st(e){let t=[];t.push(`s:${e.size.w},${e.size.h}`),t.push(`m:${e.margins.top},${e.margins.right},${e.margins.bottom},${e.margins.left}`),t.push(`n:${e.number}`),e.footnoteReservedHeight&&t.push(`fn:${e.footnoteReservedHeight}`);for(let o of e.fragments){let n=`${o.kind}:${o.blockId},${o.x},${o.y},${o.width},${o.height}`;o.pmStart!==void 0&&(n+=`,ps:${o.pmStart}`),o.pmEnd!==void 0&&(n+=`,pe:${o.pmEnd}`),o.kind==="paragraph"?n+=`,fl:${o.fromLine},tl:${o.toLine}`:o.kind==="table"&&(n+=`,fr:${o.fromRow},tr:${o.toRow}`),t.push(n);}return t.join("|")}function Kt(e){let t=[];return e.headerContent&&t.push(`hdr:${e.headerContent.blocks.length},${e.headerContent.height},${e.headerContent.visualTop??0},${e.headerContent.visualBottom??e.headerContent.height}`),e.footerContent&&t.push(`ftr:${e.footerContent.blocks.length},${e.footerContent.height},${e.footerContent.visualTop??0},${e.footerContent.visualBottom??e.footerContent.height}`),e.firstPageHeaderContent&&t.push(`fp-hdr:${e.firstPageHeaderContent.blocks.length},${e.firstPageHeaderContent.height}`),e.firstPageFooterContent&&t.push(`fp-ftr:${e.firstPageFooterContent.blocks.length},${e.firstPageFooterContent.height}`),e.titlePg&&t.push("titlePg"),e.theme&&t.push(`thm:${e.theme.name??"default"}`),e.pageBorders&&t.push(`pb:${JSON.stringify(e.pageBorders)}`),e.headerDistance!==void 0&&t.push(`hd:${e.headerDistance}`),e.footerDistance!==void 0&&t.push(`fd:${e.footerDistance}`),t.join("|")}function Yt(e,t){e.style.display="flex",e.style.flexDirection="column",e.style.alignItems="center",e.style.gap=`${t}px`,e.style.padding=`${t}px`,e.style.backgroundColor="var(--doc-bg, #f8f9fa)";}var ge=2,Ut=8;function Xt(e,t,o={}){let n=e.length,r=o.pageGap??24,i=t,a=i.__pageRenderState,l=Kt(o),d=n>=Ut;if(a&&a.optionsHash===l&&d){let g=a.pageStates,p=a.pageDataMap,y=i.__pageObserver,u=[];for(let F of e)u.push(st(F));let S=a.totalPages!==n,w=Math.min(g.length,e.length);for(let F=0;F<w;F++){let I=g[F],R=u[F];if(I.fingerprint===R&&!S){let P=p.get(I.element);P&&(P.page=e[F]);continue}let x=I.element,k=p.get(x);k&&(k.page=e[F],k.rendered&&Zt(x,p,n,o)),I.fingerprint=R,te(x,e[F].size.w,e[F].size.h,o),x.dataset.pageNumber=String(e[F].number);}if(e.length>g.length){let F=o.document??document;for(let I=g.length;I<e.length;I++){let R=e[I],x=F.createElement("div");x.className=o.pageClassName??N.page,x.dataset.pageNumber=String(R.number),x.dataset.pageIndex=String(I),te(x,R.size.w,R.size.h,o),t.appendChild(x),g.push({element:x,fingerprint:u[I]}),p.set(x,{page:R,index:I,rendered:false}),y&&y.observe(x);}}if(e.length<g.length){for(let F=g.length-1;F>=e.length;F--){let I=g[F].element;y&&y.unobserve(I),p.delete(I),t.removeChild(I);}g.length=e.length;}for(let F=0;F<g.length;F++){let I=p.get(g[F].element);I&&(I.index=F);}return a.totalPages=n,a.currentOptions=o,"incremental"}let s=i.__pageObserver;s&&(s.disconnect(),i.__pageObserver=void 0),t.innerHTML="",i.__pageRenderState=void 0,Yt(t,r);let c=[],T=[];for(let g=0;g<e.length;g++){let p=e[g];if(T.push(st(p)),d){let u=(o.document??document).createElement("div");u.className=o.pageClassName??N.page,u.dataset.pageNumber=String(p.number),u.dataset.pageIndex=String(g),te(u,p.size.w,p.size.h,o),t.appendChild(u),c.push(u);}else {let{context:y,pageOptions:u}=Be(p,n,o),S=he(p,y,u);t.appendChild(S),c.push(S);}}if(!d)return "full";let b=new Map;for(let g=0;g<e.length;g++)b.set(c[g],{page:e[g],index:g,rendered:false});let m=new IntersectionObserver(g=>{let p=i.__pageRenderState;if(!p)return;let{currentOptions:y,totalPages:u,pageDataMap:S}=p;for(let R of g){let x=R.target,k=S.get(x);if(k&&R.isIntersecting){me(x,S,u,y);for(let P=-ge;P<=ge;P++){let C=k.index+P;C>=0&&C<p.pageStates.length&&C!==k.index&&me(p.pageStates[C].element,S,u,y);}}}let w=window.innerHeight,F=w*3,I=new Set;for(let[R,x]of S){if(!x.rendered)continue;let k=R.getBoundingClientRect();k.bottom>-F&&k.top<w+F&&I.add(x.index);}for(let[R,x]of S){if(!x.rendered)continue;let k=false;for(let P of I)if(Math.abs(x.index-P)<=ge+1){k=true;break}!k&&I.size>0&&qt(R,S);}},{root:null,rootMargin:"1500px 0px 1500px 0px"});for(let g of c)m.observe(g);i.__pageObserver=m,i.__pageRenderState={pageStates:c.map((g,p)=>({element:g,fingerprint:T[p]})),totalPages:n,optionsHash:l,pageDataMap:b,currentOptions:o};let h=Math.min(e.length,ge+3);for(let g=0;g<h;g++)me(c[g],b,n,o);return "full"}function me(e,t,o,n){let r=t.get(e);if(!r||r.rendered)return;let{context:i,pageOptions:a}=Be(r.page,o,n),l=he(r.page,i,a);for(;l.firstChild;)e.appendChild(l.firstChild);r.rendered=true;}function Zt(e,t,o,n){let r=t.get(e);if(!r)return;let{context:i,pageOptions:a}=Be(r.page,o,n),d=he(r.page,i,a).querySelector(`.${N.content}`),f=e.querySelector(`.${N.content}`);d&&f?e.replaceChild(d,f):(e.innerHTML="",r.rendered=false,me(e,t,o,n));}function qt(e,t){let o=t.get(e);!o||!o.rendered||(e.innerHTML="",o.rendered=false);}var N={page:"layout-page",content:"layout-page-content",header:"layout-page-header",footer:"layout-page-footer"};function te(e,t,o,n){e.style.position="relative",e.style.width=`${t}px`,e.style.height=`${o}px`,e.style.backgroundColor=n.backgroundColor??"#ffffff",e.style.overflow="hidden",e.style.fontFamily=chunkN3Y5BUKV_js.a("Calibri").cssFallback,e.style.fontSize=`${1056/72}px`,e.style.color="#000000",n.showBorders&&(e.style.border="1px solid #ccc"),n.showShadow&&(e.style.boxShadow="0 2px 8px rgba(0, 0, 0, 0.15)");}function Jt(e,t){switch(t??"allPages"){case "firstPage":return e===1;case "notFirstPage":return e!==1;default:return true}}function ue(e){return e?.space!==void 0?chunk4Q2IP5FW_js.i(e.space):0}function ye(e,t,o,n){if(!t||t.style==="none"||t.style==="nil")return;let r=chunkBHBOAP6Z_js.c(t,o,n);for(let[d,f]of Object.entries(r))e.style[d]=String(f);let i=`border${o}Style`,a=`border${o}Width`;if(e.style[i]==="double"){let d=parseFloat(e.style[a]);(!Number.isFinite(d)||d<3)&&(e.style[a]="3px");}}function Qt(e,t,o){let n=t.pageBorders;if(!n||!Jt(e.number,n.display)||![n.top,n.bottom,n.left,n.right].some(c=>c&&c.style!=="none"&&c.style!=="nil"))return null;let i=n.offsetFrom??"text",a=ue(n.top),l=ue(n.right),d=ue(n.bottom),f=ue(n.left),s=o.createElement("div");return s.className="layout-page-border",s.style.position="absolute",s.style.pointerEvents="none",s.style.boxSizing="border-box",s.style.zIndex=n.zOrder==="back"?"0":"20",i==="page"?(s.style.top=`${a}px`,s.style.right=`${l}px`,s.style.bottom=`${d}px`,s.style.left=`${f}px`):(s.style.top=`${Math.max(0,e.margins.top-a)}px`,s.style.right=`${Math.max(0,e.margins.right-l)}px`,s.style.bottom=`${Math.max(0,e.margins.bottom-d)}px`,s.style.left=`${Math.max(0,e.margins.left-f)}px`),ye(s,n.top,"Top",t.theme),ye(s,n.bottom,"Bottom",t.theme),ye(s,n.left,"Left",t.theme),ye(s,n.right,"Right",t.theme),s}function en(e,t){let o=t.margins;e.style.position="absolute",e.style.top=`${o.top}px`,e.style.left=`${o.left}px`,e.style.right=`${o.right}px`,e.style.bottom=`${o.bottom}px`,e.style.overflow="visible";}function tn(e,t,o){e.style.position="absolute",e.style.left=`${t.x-o.left}px`,e.style.top=`${t.y-o.top}px`,e.style.width=`${t.width}px`,"height"in t&&(e.style.height=`${t.height}px`);}function nn(e,t,o,n){let r=[];for(let i of e.runs){if(i.kind!=="image")continue;let a=i;if(!M(a))continue;let l=a.distTop??0,d=a.distBottom??0,f=a.distLeft??12,s=a.distRight??12,{x:c,y:T,side:b}=Re(a,t,o,n);r.push({src:a.src,width:a.width,height:a.height,alt:a.alt,transform:a.transform,side:b,x:c,y:T,distTop:l,distBottom:d,distLeft:f,distRight:s,pmStart:a.pmStart,pmEnd:a.pmEnd,wrapText:re(a.cssFloat),wrapType:a.wrapType,cropTop:a.cropTop,cropRight:a.cropRight,cropBottom:a.cropBottom,cropLeft:a.cropLeft,opacity:a.opacity});}return r}function he(e,t,o={}){let n=o.document??document,r=n.createElement("div");r.className=o.pageClassName??N.page,r.dataset.pageNumber=String(e.number),te(r,e.size.w,e.size.h,o);let i=Qt(e,o,n);i&&o.pageBorders?.zOrder==="back"&&r.appendChild(i);let a=n.createElement("div");a.className=N.content,en(a,e);let l=et(e),d=l.contentWidth,f=[],s=[];for(let p of e.fragments)if(p.kind==="paragraph"&&o.blockLookup){let y=o.blockLookup.get(String(p.blockId));if(y?.block.kind==="paragraph"){let u=y.block,S=p.y-e.margins.top,w=nn(u,S,d,l);f.push(...w);}}for(let p of f)Z(p)&&s.push({side:p.side,x:p.x,y:p.y,width:p.width,height:p.height,distTop:p.distTop,distBottom:p.distBottom,distLeft:p.distLeft,distRight:p.distRight,wrapText:p.wrapText,wrapType:p.wrapType});if(o.blockLookup)for(let p of e.fragments){if(p.kind!=="table")continue;let y=o.blockLookup.get(String(p.blockId));if(y?.block.kind!=="table")continue;let S=y.block.floating;if(!S)continue;let w=p.x-e.margins.left,F=p.y-e.margins.top,I=S.topFromText??0,R=S.bottomFromText??0,x=S.leftFromText??12,k=S.rightFromText??12,P=w<d/2?"left":"right";s.push({side:P,x:w,y:F,width:p.width,height:p.height,distTop:I,distBottom:R,distLeft:x,distRight:k});}if(o.blockLookup)for(let p of e.fragments){if(p.kind!=="textBox")continue;let y=o.blockLookup.get(String(p.blockId));if(y?.block.kind!=="textBox")continue;let u=y.block;if(!chunk44RUAQA2_js.g(u))continue;let S=p.y-e.margins.top,w=Re({width:p.width,height:p.height,position:u.position,cssFloat:u.cssFloat},S,d,l);p.x=e.margins.left+w.x,p.y=e.margins.top+w.y,chunk44RUAQA2_js.h(u)&&s.push({side:w.side,x:w.x,y:w.y,width:p.width,height:p.height,distTop:u.distTop??0,distBottom:u.distBottom??0,distLeft:u.distLeft??12,distRight:u.distRight??12,wrapText:u.wrapText,wrapType:u.wrapType});}let c=s.length>0?chunkTZJUO3NW_js.p(s,d):[],T=f.filter(Y),b=f.filter(p=>!Y(p));if(T.length>0){let p=U(T,n,{layerClass:"layout-floating-images-layer",itemClass:"layout-page-floating-image",sizing:"inset0",layerMode:"behind"});a.appendChild(p);}let m=p=>{if(p.kind!=="paragraph"||!o.blockLookup||!p.blockId)return;let y=o.blockLookup.get(String(p.blockId));if(y?.block.kind==="paragraph")return y.block.attrs?.borders},h,g=new Map;for(let p=0;p<e.fragments.length;p++){let y=e.fragments[p],u,S={...t,section:"body",contentWidth:d},w=y.y-e.margins.top;if(o.blockLookup&&y.blockId){let F=o.blockLookup.get(String(y.blockId));if(y.kind==="paragraph"&&F?.block.kind==="paragraph"&&F?.measure.kind==="paragraph"){let I=F.block,R=p+1<e.fragments.length?m(e.fragments[p+1]):void 0,x=String(y.blockId),k=g.get(x);k||(k=new Set,g.set(x,k));let P=F.measure;c.length>0&&(P=chunkTZJUO3NW_js.s(I,d,{floatingZones:c,paragraphYOffset:w})),u=$(y,I,P,S,{document:n,prevBorders:h,nextBorders:R,renderedInlineImageKeys:k}),h=I.attrs?.borders;}else y.kind==="table"&&F?.block.kind==="table"&&F?.measure.kind==="table"?(u=X(y,F.block,F.measure,S,{document:n}),h=void 0):y.kind==="image"&&F?.block.kind==="image"&&F?.measure.kind==="image"?(u=ie(y,F.block,F.measure,S,{document:n}),h=void 0):y.kind==="textBox"&&F?.block.kind==="textBox"&&F?.measure.kind==="textBox"?(u=ce(y,F.block,F.measure,S,{document:n}),h=void 0):(u=we(y,S,{document:n}),h=void 0);}else u=we(y,S,{document:n}),h=void 0;tn(u,y,{left:e.margins.left,top:e.margins.top}),a.appendChild(u);}if(b.length>0){let p=U(b,n,{layerClass:"layout-floating-images-layer",itemClass:"layout-page-floating-image",sizing:"inset0",layerMode:"front"});a.appendChild(p);}if(e.columns&&e.columns.separator&&e.columns.count>1){let p=e.columns.count,y=e.columns.gap,u=(d-(p-1)*y)/p,S=e.size.h-e.margins.top-e.margins.bottom;for(let w=0;w<p-1;w++){let F=(w+1)*u+w*y+y/2,I=n.createElement("div");I.style.position="absolute",I.style.left=`${F}px`,I.style.top="0",I.style.height=`${S}px`,I.style.width="0.5px",I.style.backgroundColor="#000",I.style.pointerEvents="none",a.appendChild(I);}}if(o.footnoteArea&&o.footnoteArea.length>0){let p=at(o.footnoteArea,d,t,n);p.style.position="absolute";let y=Math.max(e.footnoteReservedHeight??0,it(o.footnoteArea)),u=e.size.h-e.margins.bottom-e.margins.top;p.style.top=`${Math.max(-e.margins.top,u-y)}px`,p.style.left="0",p.style.right="0",a.appendChild(p);}r.appendChild(a);{let y=o.headerDistance??e.margins.header??48,u=e.size.w-e.margins.left-e.margins.right,S=Math.max(e.margins.top-y,48),w=o.headerContent?.visualTop??0,F=o.headerContent?.visualBottom??o.headerContent?.height??0,I=Math.max(F-w,24),R=F>S,x=n.createElement("div");x.className=N.header,x.style.position="absolute",x.style.top=`${y+w}px`,x.style.left=`${e.margins.left}px`,x.style.right=`${e.margins.right}px`,x.style.width=`${u}px`,x.style.height=`${I}px`,x.style.minHeight=`${I}px`;let k=!R;if(o.headerContent&&o.headerContent.blocks.length>0){let P={flowTop:y,flowLeft:e.margins.left,contentWidth:u,pageWidth:e.size.w,pageHeight:e.size.h,margins:e.margins},C=Pe(o.headerContent,{...t,section:"header",contentWidth:u},o,P);C.style.top=`${-w}px`,C.querySelector("img")&&(k=false),x.appendChild(C);}k&&(x.style.maxHeight=`${S}px`,x.style.overflow="hidden"),r.appendChild(x);}{let y=o.footerDistance??e.margins.footer??48,u=e.size.w-e.margins.left-e.margins.right,S=Math.max(e.margins.bottom-y,48),w=o.footerContent?.visualTop??0,F=o.footerContent?.visualBottom??o.footerContent?.height??0,I=Math.max(F-w,24),R=I>S,x=n.createElement("div");x.className=N.footer,x.style.position="absolute",x.style.top=`${e.size.h-y-I}px`,x.style.left=`${e.margins.left}px`,x.style.right=`${e.margins.right}px`,x.style.width=`${u}px`,x.style.height=`${I}px`,x.style.minHeight=`${I}px`;let k=!R;if(o.footerContent&&o.footerContent.blocks.length>0){let P={flowTop:e.size.h-y-(o.footerContent?.height??0),flowLeft:e.margins.left,contentWidth:u,pageWidth:e.size.w,pageHeight:e.size.h,margins:e.margins},C=Pe(o.footerContent,{...t,section:"footer",contentWidth:u},o,P);C.style.top=`${-w}px`,C.querySelector("img")&&(k=false),x.appendChild(C);}k&&(x.style.maxHeight=`${S}px`,x.style.overflow="hidden"),r.appendChild(x);}return i&&o.pageBorders?.zOrder!=="back"&&r.appendChild(i),r}exports.A=ce;exports.B=nt;exports.C=Xt;exports.D=N;exports.E=te;exports.F=he;exports.a=fe;exports.b=ot;exports.c=_t;exports.d=Xn;exports.e=Le;exports.f=Wt;exports.g=Gt;exports.h=Zn;exports.i=rt;exports.j=qn;exports.k=Jn;exports.l=V;exports.m=we;exports.n=Z;exports.o=Y;exports.p=M;exports.q=ht;exports.r=Ke;exports.s=ie;exports.t=Je;exports.u=de;exports.v=$;exports.w=U;exports.x=O;exports.y=X;exports.z=vt;
|
package/dist/chunk-SUXJX72X.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
'use strict';var chunkDFZTUQ7O_js=require('./chunk-DFZTUQ7O.js');var t=new chunkDFZTUQ7O_js.w(chunkDFZTUQ7O_js.v());t.buildSchema();t.initializeRuntime();var s=t,n=t.getSchema();exports.a=s;exports.b=n;
|
package/dist/chunk-T4CPTPRP.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
'use strict';function t(){return Math.floor(Math.random()*4294967296).toString(16).toUpperCase().padStart(8,"0")}exports.a=t;
|
package/dist/chunk-TZJUO3NW.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
'use strict';var chunkJFZIXFRC_js=require('./chunk-JFZIXFRC.js'),chunkN3Y5BUKV_js=require('./chunk-N3Y5BUKV.js');var Ut=1440,G=96,ct=Ut/G,ft=11,ht="Calibri",Yt=1,Xt=.8,jt=.2,I=null;function Z(){if(!I){let t=typeof document<"u"?document.createElement("canvas"):null;if(!t)throw new Error("Canvas not available. Ensure this runs in a DOM environment.");if(I=t.getContext("2d"),!I)throw new Error("Failed to get 2D context from canvas")}return I}function Gt(){I=null;}var lt=new Map;function gt(t){let e=lt.get(t);if(e===void 0){let n=chunkN3Y5BUKV_js.a(t);e={cssFallback:n.cssFallback,singleLineRatio:n.singleLineRatio},lt.set(t,e);}return e}function Kt(t){return gt(t).cssFallback}function B(t){let e=[];t.italic&&e.push("italic"),t.bold&&e.push("bold");let n=t.fontSize??ft,i=L(n);e.push(`${i}px`);let r=t.fontFamily??ht;return e.push(Kt(r)),e.join(" ")}function H(t){let e=t.fontSize??ft,n=t.fontFamily??ht,i=L(e),r=i*Xt,o=i*jt,g=i*Yt;try{let m=Z();m.font=B(t);let d=m.measureText("Hg");typeof d.actualBoundingBoxAscent=="number"&&typeof d.actualBoundingBoxDescent=="number"&&(r=d.actualBoundingBoxAscent,o=d.actualBoundingBoxDescent);}catch{}g=Math.max(g,r+o);let h=gt(n).singleLineRatio;return {fontSize:e,ascent:r,descent:o,lineHeight:g,fontFamily:n,singleLineRatio:h}}function C(t,e){if(!t)return 0;let n=Z();n.font=B(e);let r=n.measureText(t).width;return e.letterSpacing&&t.length>1&&(r+=e.letterSpacing*(t.length-1)),r}function qt(t,e){let n=C(t,e),i=H(e);return {width:n,height:i.ascent+i.descent,ascent:i.ascent,descent:i.descent}}function K(t,e){let n=H(e);if(!t)return {width:0,charWidths:[],metrics:n};let i=Z();i.font=B(e);let r=e.letterSpacing??0,o=[],g=0;for(let h=0;h<t.length;h++){let m=t[h],y=i.measureText(m).width;r&&h<t.length-1&&(y+=r),o.push(y),g+=y;}return {width:g,charWidths:o,metrics:n}}function Jt(t,e){if(e.length===0||t<=0)return 0;let n=0;for(let i=0;i<e.length;i++){let r=e[i],o=n+r/2;if(t<=o)return i;n+=r;}return e.length}function Qt(t,e){if(t<=0||e.length===0)return 0;let n=Math.min(t,e.length),i=0;for(let r=0;r<n;r++)i+=e[r];return i}function q(t){return t/ct}function Vt(t){return Math.round(t*ct)}function L(t){return t*G/72}function mt(t){return t*72/G}function te(t){return L(t/2)}function ee(t){return mt(t)*2}function ne(t,e){return t.map(n=>{let i=n.x-n.distLeft,r=n.x+n.width+n.distRight,o=n.y-n.distTop,g=n.y+n.height+n.distBottom,h=0,m=0,d,y=n.wrapText??"bothSides";y==="right"?h=J(r):y==="left"?m=Q(i,e):y==="largest"?{leftMargin:h,rightMargin:m}=oe(i,r,e):re(i,r,e)?d=ae(i,r,e):n.side==="left"?h=J(r):m=Q(i,e);let _=tt(h,m,e);return {leftMargin:_.leftMargin,rightMargin:_.rightMargin,topY:o,bottomY:g,segments:d}})}function V(t,e){return t.segments?.reduce((i,r)=>i+r.availableWidth,0)??e-t.leftMargin-t.rightMargin}function $(t,e,n,i){if(!n||n.length===0)return {leftMargin:0,rightMargin:0};let r=0,o=0,g,h=i+t,m=h+e;for(let d of n)if(!(m<=d.topY||h>=d.bottomY)){if(d.segments?.length){g=g?ie(g,d.segments):d.segments;continue}r=Math.max(r,d.leftMargin),o=Math.max(o,d.rightMargin);}return {leftMargin:r,rightMargin:o,segments:g}}function ie(t,e){let n=[];for(let i of t)for(let r of e){let o=Math.max(i.leftOffset,r.leftOffset),g=Math.min(i.leftOffset+i.availableWidth,r.leftOffset+r.availableWidth);g>o&&n.push({leftOffset:o,availableWidth:g-o});}return n}function re(t,e,n){return t>0&&e<n}function ae(t,e,n){return [{leftOffset:0,availableWidth:Math.max(0,t)},{leftOffset:Math.max(0,e),availableWidth:Math.max(0,n-e)}].filter(i=>i.availableWidth>1)}function oe(t,e,n){let i=Math.max(0,t);return Math.max(0,n-e)>=i?{leftMargin:J(e),rightMargin:0}:{leftMargin:0,rightMargin:Q(t,n)}}function J(t){return Math.max(0,t)}function Q(t,e){return Math.max(0,e-t)}var R=11,O="Calibri",se=1.15,N=1,E=.5;function ue(t,e){if(e&&e.length>0)for(let i of e){let r=q(i.pos);if(r>t+.5)return Math.max(1,r-t)}let n=t%et;return Math.max(1,n<.5?et:et-n)}function dt(t,e,n,i=false){let r=1,o=t.length,g=0;for(;r<=o;){let h=r+o>>>1;C(t.slice(0,h),e)<=n?(g=h,r=h+1):o=h-1;}return i&&g===0?1:g}function z(t){return {fontFamily:t.fontFamily??O,fontSize:t.fontSize??R,bold:t.bold,italic:t.italic,letterSpacing:t.letterSpacing}}function bt(t,e,n){let i=L(t),r=n?.ascent??i*.8,o=n?.descent??i*.2,g=n?.singleLineRatio??1.15,h=i*g,m;if(e?.lineRule==="exact"&&e.line!==void 0)m=e.line;else if(e?.lineRule==="atLeast"&&e.line!==void 0){let d=h*N;m=Math.max(e.line,d);}else e?.line!==void 0&&e?.lineUnit==="multiplier"?m=h*e.line:e?.line!==void 0&&e?.lineUnit==="px"?m=e.line:m=h*N;return {ascent:r,descent:o,lineHeight:m}}function pt(t,e,n){let i=H({fontSize:t,fontFamily:n??O}),r=bt(t,e,i),o=e?.lineRule??"auto";if(o==="auto"||o==="atLeast"){let g=L(t),h=Math.max(r.lineHeight,g*se);if(h!==r.lineHeight)return {...r,lineHeight:h}}return r}function D(t){return t.kind==="text"}function xt(t){return t.kind==="tab"}function Ft(t){return t.kind==="image"}function Mt(t){return t.kind==="lineBreak"}function Tt(t){return t.kind==="field"}function le(t){return !t.text||t.text.replace(/\u00a0/g," ").trim().length===0}function ce(t,e){let n=0;for(let i=e+1;i<t.length;i++){let r=t[i];if(xt(r)||Mt(r))break;if(D(r))n+=C(r.text||"",z(r));else if(Tt(r)){let o={fontFamily:r.fontFamily??O,fontSize:r.fontSize??R,bold:r.bold,italic:r.italic};n+=C(r.fallback||"1",o);}else Ft(r)&&(n+=r.width||0);}return n}function fe(t){let e=[];for(let n=0;n<t.length;n++){let i=t[n];(i===" "||i==="-"||i===" ")&&e.push(n+1);}return e}var et=48;function tt(t,e,n){let i=Math.max(1,n),r=Math.max(0,t),o=Math.max(0,e);return r>=i||o>=i||r+o>=i?{leftMargin:0,rightMargin:0}:{leftMargin:r,rightMargin:o}}function Ct(t,e,n){let i=t.runs,r=t.attrs,o=r?.spacing,g=n?.floatingZones,h=n?.paragraphYOffset??0,m=r?.indent,d=m?.left??0,y=m?.right??0,_=(m?.firstLine??0)-(m?.hanging??0),it=Math.max(1,e-d-y),_t=Math.max(1,it-_),rt=0,At=L(R)*N,A=$(0,At,g,h),Zt=Math.max(1,V(A,_t)),T=[];if(i.length===0){if(r?.suppressEmptyParagraphHeight)return T.push({fromRun:0,fromChar:0,toRun:0,toChar:0,width:0,ascent:0,descent:0,lineHeight:0}),{kind:"paragraph",lines:T,totalHeight:0};let s=r?.defaultFontSize??R,u=r?.defaultFontFamily??O,c=pt(s,o,u);T.push({fromRun:0,fromChar:0,toRun:0,toChar:0,width:0,...c});let l=c.lineHeight;return o?.before&&(l+=o.before),o?.after&&(l+=o.after),{kind:"paragraph",lines:T,totalHeight:l}}if(i.length===1&&D(i[0])&&le(i[0])){let s=i[0],u=s.fontSize??r?.defaultFontSize??R,c=s.fontFamily??r?.defaultFontFamily??O,l=pt(u,o,c);T.push({fromRun:0,fromChar:0,toRun:0,toChar:0,width:0,...l});let f=l.lineHeight;return o?.before&&(f+=o.before),o?.after&&(f+=o.after),{kind:"paragraph",lines:T,totalHeight:f}}let a={fromRun:0,fromChar:0,toRun:0,toChar:0,width:0,maxFontSize:R,maxFontMetrics:null,maxImageHeightPx:0,availableWidth:Zt,leftOffset:A.leftMargin,rightOffset:A.rightMargin,segmentZones:A.segments},at=()=>{let s=bt(a.maxFontSize,o,a.maxFontMetrics),u={...s};if(a.maxImageHeightPx>u.lineHeight){let l=a.maxImageHeightPx,f=u.descent;u.lineHeight=l+f*2,u.ascent=l+f;}let c={fromRun:a.fromRun,fromChar:a.fromChar,toRun:a.toRun,toChar:a.toChar,width:a.width,...u};a.leftOffset>0&&(c.leftOffset=a.leftOffset),a.rightOffset>0&&(c.rightOffset=a.rightOffset),a.segmentZones?.length&&(c.segments=Bt(c,a.segmentZones)),T.push(c),rt+=s.lineHeight;},Bt=(s,u)=>{let c=u[0],l=u[1];if(!c)return;if(!l||s.width<=c.availableWidth+E)return [{fromRun:s.fromRun,fromChar:s.fromChar,toRun:s.toRun,toChar:s.toChar,width:s.width,leftOffset:c.leftOffset,availableWidth:c.availableWidth}];if(s.fromRun!==s.toRun)return;let f=i[s.fromRun];if(!f||!D(f))return;let M=f,p=M.text.slice(s.fromChar,s.toChar),b=z(M),x=dt(p,b,c.availableWidth);if(x<=0||x>=p.length)return;let k=s.fromChar+x,F=p.slice(0,x),Y=p.slice(x);return [{fromRun:s.fromRun,fromChar:s.fromChar,toRun:s.toRun,toChar:k,width:C(F,b),leftOffset:c.leftOffset,availableWidth:c.availableWidth},{fromRun:s.fromRun,fromChar:k,toRun:s.toRun,toChar:s.toChar,width:C(Y,b),leftOffset:l.leftOffset,availableWidth:l.availableWidth}]},S=(s,u)=>{at();let c=L(R)*N,l=$(rt,c,g,h),f=Math.max(1,V(l,it));a={fromRun:s,fromChar:u,toRun:s,toChar:u,width:0,maxFontSize:R,maxFontMetrics:null,maxImageHeightPx:0,availableWidth:f,leftOffset:l.leftMargin,rightOffset:l.rightMargin,segmentZones:l.segments};},W=s=>{let u=s.fontSize??R;(!a.maxFontMetrics||u>a.maxFontSize)&&(a.maxFontSize=u,a.maxFontMetrics=H(s));};for(let s=0;s<i.length;s++){let u=i[s];if(Mt(u)){a.toRun=s,a.toChar=0,S(s+1,0);continue}if(xt(u)){let c=z(u);W(c);let l=r?.tabs,f=a.width+(a.leftOffset??0),M=ue(f,l);if(f+M>a.availableWidth+E){let p=ce(i,s),b=a.availableWidth-f-p;b>1&&(M=b);}a.width+M>a.availableWidth+E&&(S(s,0),W(c)),a.width+=M,a.toRun=s,a.toChar=1;continue}if(Ft(u)){let c=u.wrapType,l=u.displayMode==="float"||chunkJFZIXFRC_js.c(c);if(u.position&&l){a.toRun=s,a.toChar=1;continue}if(c==="topAndBottom"||u.displayMode==="block"){a.width>0&&S(s,0);let p=u.height,b=u.distTop??6,x=u.distBottom??6;a.toRun=s,a.toChar=1,a.maxImageHeightPx=p+b+x,S(s+1,0);continue}let f=u.width,M=u.height;M>a.maxImageHeightPx&&(a.maxImageHeightPx=M),a.width+f>a.availableWidth+E&&S(s,0),a.width+=f,a.toRun=s,a.toChar=1;continue}if(Tt(u)){let c=u.fallback||"1",l={fontFamily:u.fontFamily??O,fontSize:u.fontSize??R,bold:u.bold,italic:u.italic};W(l);let f=C(c,l);a.width>0&&a.width+f>a.availableWidth+E&&(S(s,0),W(l)),a.width+=f,a.toRun=s,a.toChar=1;continue}if(D(u)){let c=u,l=c.text,f=z(c);if(W(f),!l||l.length===0){a.toRun=s,a.toChar=0;continue}let M=fe(l),p=0;for(;p<l.length;){let b=l.length;for(let F of M)if(F>p){b=F;break}let x=l.slice(p,b),k=C(x,f);if(k>a.availableWidth+E){let F=0;for(;F<x.length;){let Y=a.availableWidth-a.width+E,$t=x.slice(F),X=dt($t,f,Y);if(X===0){if(a.width>0){S(s,p+F),W(f);continue}X=1;}let j=F+X,Dt=x.slice(F,j),Nt=C(Dt,f);a.width+=Nt,a.toRun=s,a.toChar=p+j,F=j,F<x.length&&(S(s,p+F),W(f));}p=b;continue}a.width>0&&a.width+k>a.availableWidth+E&&(S(s,p),W(f)),a.width+=k,a.toRun=s,a.toChar=b,p=b;}}}at();let ot=T.reduce((s,u)=>s+u.lineHeight,0);r?.listMarker&&!r?.listMarkerHidden&&(m?.hanging??0)===0&&T.length>0&&(ot+=T[0].lineHeight);let U=ot;return o?.before&&(U+=o.before),o?.after&&(U+=o.after),{kind:"paragraph",lines:T,totalHeight:U}}function he(t,e){return t.map(n=>Ct(n,e))}function ge(t){let e=z(t);return K(t.text,e).charWidths}var Rt=2e4,P=new Map;function yt(t,e,n){return `${t}|${e}|${n||0}`}function St(){for(;P.size>Rt;){let t=P.keys().next().value;if(t===void 0)break;P.delete(t);}}function me(t,e,n=0){let i=yt(t,e,n),r=P.get(i);if(r!==void 0)return P.delete(i),P.set(i,r),r.width}function de(t,e,n,i){let r=yt(t,e,n);P.set(r,{width:i}),St();}function Lt(){P.clear();}function pe(t){!Number.isFinite(t)||t<=0||(Rt=t,St());}function Pt(){return P.size}var be=1e3,wt=be,w=new Map;function vt(t,e,n=false,i=false){return `${t}|${e}|${n}|${i}`}function Wt(){for(;w.size>wt;){let t=w.keys().next().value;if(t===void 0)break;w.delete(t);}}function xe(t,e,n=false,i=false){let r=vt(t,e,n,i),o=w.get(r);if(o!==void 0)return w.delete(r),w.set(r,o),o}function Fe(t,e,n,i,r){let o=vt(t,e,n,i);w.set(o,r),Wt();}function Et(){w.clear();}function Me(t){!Number.isFinite(t)||t<=0||(wt=t,Wt());}function kt(){return w.size}var Te=5e3,Ht=Te,v=new Map;function nt(t){let e=[];for(let i of t.runs)i.kind==="text"?e.push(`t:${i.text}|${i.fontFamily}|${i.fontSize}|${i.bold}|${i.italic}`):i.kind==="tab"?e.push(`tab:${i.width}`):i.kind==="image"?e.push(`img:${i.width}x${i.height}`):i.kind==="lineBreak"&&e.push("br");let n=t.attrs;if(n){n.alignment&&e.push(`align:${n.alignment}`),n.indent&&e.push(`indent:${n.indent.left}|${n.indent.right}|${n.indent.firstLine}|${n.indent.hanging}`),n.spacing&&e.push(`spacing:${n.spacing.before}|${n.spacing.after}|${n.spacing.line}|${n.spacing.lineRule}`),n.defaultFontSize!=null&&e.push(`dfs:${n.defaultFontSize}`),n.defaultFontFamily!=null&&e.push(`dff:${n.defaultFontFamily}`);let i=n.borders;if(i){let r=o=>o?`${o.width??""},${o.style??""},${o.color??""}`:"";e.push(`bdr:${r(i.top)}|${r(i.bottom)}|${r(i.left)}|${r(i.right)}`);}n.suppressEmptyParagraphHeight&&e.push("sup");}return e.join("||")}function Ot(){for(;v.size>Ht;){let t=v.keys().next().value;if(t===void 0)break;v.delete(t);}}function Ce(t,e){let n=nt(t),i=v.get(n);if(i!==void 0&&i.maxWidth===e)return v.delete(n),v.set(n,i),i.measure}function Re(t,e,n){let i=nt(t);v.set(i,{measure:n,maxWidth:e}),Ot();}function It(){v.clear();}function ye(t){!Number.isFinite(t)||t<=0||(Ht=t,Ot());}function zt(){return v.size}function Se(){Lt(),Et(),It();}function Le(){return Pt()+kt()+zt()}exports.A=xe;exports.B=Fe;exports.C=Et;exports.D=Me;exports.E=kt;exports.F=nt;exports.G=Ce;exports.H=Re;exports.I=It;exports.J=ye;exports.K=zt;exports.L=Se;exports.M=Le;exports.a=Z;exports.b=Gt;exports.c=B;exports.d=H;exports.e=C;exports.f=qt;exports.g=K;exports.h=Jt;exports.i=Qt;exports.j=q;exports.k=Vt;exports.l=L;exports.m=mt;exports.n=te;exports.o=ee;exports.p=ne;exports.q=$;exports.r=tt;exports.s=Ct;exports.t=he;exports.u=ge;exports.v=me;exports.w=de;exports.x=Lt;exports.y=pe;exports.z=Pt;
|