@eigenpal/docx-js-editor 0.0.7 → 0.0.9
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/README.md +52 -14
- package/dist/{chunk-FOU7PS3K.cjs → chunk-A7VY2V4X.cjs} +1 -1
- package/dist/chunk-GQ4JYQWC.js +58 -0
- package/dist/{chunk-ZRXLWSRP.cjs → chunk-H3JNHCD7.cjs} +4 -4
- package/dist/{chunk-VFBM3YKJ.js → chunk-L2UUZRZI.js} +4 -4
- package/dist/{chunk-AQ35GWDV.js → chunk-MMJD2DLL.js} +1 -1
- package/dist/chunk-PM4Y7OFN.js +12 -0
- package/dist/{chunk-PYAIJMEG.cjs → chunk-QOIY4Y6N.cjs} +2 -2
- package/dist/chunk-QYKJKSKZ.cjs +58 -0
- package/dist/{chunk-NZ7XUW4I.cjs → chunk-S6FZ7HL6.js} +1 -1
- package/dist/{chunk-AEANV5BR.js → chunk-TPUJJJWA.js} +1 -1
- package/dist/chunk-TRAQI6RX.cjs +12 -0
- package/dist/chunk-Y37VT37I.cjs +1 -0
- package/dist/{colorResolver-CQcFBxHC.d.ts → colorResolver-BNj-uZ58.d.ts} +1 -1
- package/dist/{colorResolver-Di-JRsr9.d.cts → colorResolver-DiMquGWR.d.cts} +1 -1
- package/dist/core-plugins.cjs +1 -1
- package/dist/core-plugins.d.cts +3 -3
- package/dist/core-plugins.d.ts +3 -3
- package/dist/core-plugins.js +1 -1
- package/dist/executor-44OB3DFD.js +1 -0
- package/dist/executor-U3BZPPGN.cjs +1 -0
- package/dist/headless.cjs +2 -2
- package/dist/headless.d.cts +4 -4
- package/dist/headless.d.ts +4 -4
- package/dist/headless.js +2 -2
- package/dist/index.cjs +26 -27
- package/dist/index.css +1 -1
- package/dist/index.d.cts +90 -152
- package/dist/index.d.ts +90 -152
- package/dist/index.js +26 -27
- package/dist/mcp-cli.js +21 -20
- package/dist/mcp.cjs +12 -12
- package/dist/mcp.d.cts +2 -2
- package/dist/mcp.d.ts +2 -2
- package/dist/mcp.js +12 -12
- package/dist/{registry-CrAzNdUO.d.cts → registry-BUTMLqSj.d.cts} +1 -1
- package/dist/{registry-aux2uuQs.d.ts → registry-CzqAPdui.d.ts} +1 -1
- package/dist/selectionRects-I5JVL73G.cjs +1 -0
- package/dist/selectionRects-LO3FJT47.js +1 -0
- package/dist/styles.css +1 -1
- package/dist/{types-BnShY2aQ.d.ts → types-BALm1KBi.d.cts} +3 -1
- package/dist/{types-BnShY2aQ.d.cts → types-BALm1KBi.d.ts} +3 -1
- package/package.json +10 -5
- package/dist/chunk-2CFVFSUH.js +0 -57
- package/dist/chunk-CDSUWDYP.cjs +0 -11
- package/dist/chunk-TL3YTVN2.cjs +0 -57
- package/dist/chunk-W2TDS3UO.js +0 -1
- package/dist/chunk-ZZNWTYMW.js +0 -11
- package/dist/executor-7DZMHPUF.js +0 -1
- package/dist/executor-FSMRGT73.cjs +0 -1
- package/dist/selectionRects-5TGQE33Q.cjs +0 -1
- package/dist/selectionRects-JSPKYXPU.js +0 -1
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import Zt from'jszip';import {xml2js,js2xml}from'xml-js';var G=new Set,ne=new Map,be=new Set,ye=false;function Pe(e,t=[400,700],n=["normal","italic"]){let o=encodeURIComponent(e),r=[];for(let a of n){let c=a==="italic"?1:0;for(let f of t)r.push(`${c},${f}`);}r.sort();let i=r.join(";");return `https://fonts.googleapis.com/css2?family=${o}:ital,wght@${i}&display=swap`}async function Be(e,t){let n=e.trim();if(G.has(n))return true;let o=ne.get(n);if(o)return o;let r=(async()=>{ye=true;try{let i=Pe(n,t?.weights,t?.styles),a=document.createElement("link");return a.rel="stylesheet",a.href=i,await new Promise(f=>{a.onload=()=>f(!0),a.onerror=()=>f(!1),document.head.appendChild(a),setTimeout(()=>f(!1),5e3);})?(await Ne(n,3e3),G.add(n),Ae([n]),!0):!1}catch(i){return console.warn(`Failed to load font "${n}":`,i),false}finally{ne.delete(n),ne.size===0&&(ye=false);}})();return ne.set(n,r),r}async function Vt(e,t){let n=e.filter(o=>!G.has(o.trim()));n.length!==0&&await Promise.all(n.map(o=>Be(o,t)));}function Lo(e){return G.has(e.trim())}function Do(){return ye}function Ho(){return Array.from(G)}function Oo(e){return be.add(e),()=>{be.delete(e);}}function Ae(e){for(let t of be)try{t(e);}catch(n){console.warn("Font load callback error:",n);}}async function Ne(e,t){if("fonts"in document)try{let n=`400 16px "${e}"`;return await Promise.race([document.fonts.load(n),new Promise(o=>setTimeout(o,t))]),document.fonts.check(n)}catch{}return await new Promise(n=>setTimeout(n,100)),true}function Wo(e,t="sans-serif"){if(typeof document>"u")return false;let n=(r,i)=>{let c=document.createElement("canvas").getContext("2d");if(!c)return false;c.textBaseline="top";let f="abcdefghijklmnopqrstuvwxyz0123456789";c.font=`72px ${i}`;let u=c.measureText(f).width;return c.font=`72px "${r}", ${i}`,c.measureText(f).width!==u};return n(e,t)?true:n(e,t==="sans-serif"?"serif":"sans-serif")}async function jo(e,t,n){let o=e.trim();if(G.has(o))return true;try{let r=new Blob([t],{type:"font/ttf"}),i=URL.createObjectURL(r),a=document.createElement("style");return a.textContent=`
|
|
2
|
+
@font-face {
|
|
3
|
+
font-family: "${o}";
|
|
4
|
+
src: url(${i}) format('truetype');
|
|
5
|
+
font-weight: ${n?.weight??"normal"};
|
|
6
|
+
font-style: ${n?.style??"normal"};
|
|
7
|
+
font-display: swap;
|
|
8
|
+
}
|
|
9
|
+
`,document.head.appendChild(a),await Ne(o,3e3),G.add(o),Ae([o]),!0}catch(r){return console.warn(`Failed to load font "${o}" from buffer:`,r),false}}var zt={Calibri:"Carlito",Cambria:"Caladea",Arial:"Arimo","Times New Roman":"Tinos","Courier New":"Cousine",Garamond:"EB Garamond","Book Antiqua":"EB Garamond",Georgia:"Tinos",Verdana:"Open Sans",Tahoma:"Open Sans","Trebuchet MS":"Source Sans Pro","Century Gothic":"Poppins","Franklin Gothic":"Libre Franklin",Palatino:"EB Garamond","Palatino Linotype":"EB Garamond","Lucida Sans":"Open Sans","Segoe UI":"Open Sans",Impact:"Anton","Comic Sans MS":"Comic Neue",Consolas:"Inconsolata","Lucida Console":"Inconsolata",Monaco:"Fira Code"};function Ut(e){let t=e.trim();return zt[t]||t}async function $t(e){let t=e.trim(),n=Ut(t);return n!==t?(await _t(t,n),G.add(t),G.add(n),true):Be(n)}async function _t(e,t){let n=`font-alias-${e.toLowerCase().replace(/\s+/g,"-")}`;if(!document.getElementById(n))try{let o=Pe(t,[400,700],["normal","italic"]),r=await fetch(o);if(!r.ok){console.warn(`Failed to fetch Google Fonts CSS for "${t}": ${r.status}`);return}let i=await r.text(),a=new RegExp(`font-family:\\s*['"]${Gt(t)}['"]`,"gi"),c=i.replace(a,`font-family: '${e}'`),f=document.createElement("style");f.id=n,f.textContent=c,document.head.appendChild(f);}catch(o){console.warn(`Failed to create font alias for "${e}":`,o);}}function Gt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}async function xe(e){let t=[...new Set(e.map(n=>n.trim()))];await Promise.all(t.map(n=>$t(n)));}async function Vo(){await Vt(["Carlito","Caladea","Arimo","Tinos","Cousine","EB Garamond"]);}function qt(e){let t=new Set,n=e;if(!n?.package)return t;let o=n.package?.document?.content;if(Array.isArray(o)){for(let i of o)if(i?.type==="paragraph"&&Array.isArray(i.content)){for(let a of i.content)if(a?.type==="run"&&a.formatting?.fontFamily){let{ascii:c,hAnsi:f}=a.formatting.fontFamily;c&&t.add(c),f&&f!==c&&t.add(f);}}}let r=n.package?.styles?.styles;if(Array.isArray(r)){for(let i of r)if(i?.runProperties?.fontFamily){let{ascii:a,hAnsi:c}=i.runProperties.fontFamily;a&&t.add(a),c&&c!==a&&t.add(c);}}return t}async function zo(e){let t=qt(e);t.size!==0&&await xe(Array.from(t));}async function Ie(e){if(e instanceof ArrayBuffer)return e;if(e instanceof Uint8Array){let t=new ArrayBuffer(e.byteLength);return new Uint8Array(t).set(e),t}if(e instanceof Blob)return e.arrayBuffer();throw new TypeError(`Unsupported DocxInput type: ${typeof e}`)}async function Xe(e){let t=await Zt.loadAsync(e),n={documentXml:null,stylesXml:null,themeXml:null,numberingXml:null,fontTableXml:null,settingsXml:null,webSettingsXml:null,headers:new Map,footers:new Map,footnotesXml:null,endnotesXml:null,commentsXml:null,commentsExtensibleXml:null,documentRels:null,packageRels:null,contentTypesXml:null,corePropsXml:null,appPropsXml:null,customPropsXml:null,media:new Map,fonts:new Map,allXml:new Map,originalZip:t,originalBuffer:e};for(let[o,r]of Object.entries(t.files)){if(r.dir)continue;let i=o.toLowerCase();if(i.endsWith(".xml")||i.endsWith(".rels")){let a=await r.async("text");if(n.allXml.set(o,a),i==="word/document.xml")n.documentXml=a;else if(i==="word/styles.xml")n.stylesXml=a;else if(i==="word/theme/theme1.xml")n.themeXml=a;else if(i==="word/numbering.xml")n.numberingXml=a;else if(i==="word/fonttable.xml")n.fontTableXml=a;else if(i==="word/settings.xml")n.settingsXml=a;else if(i==="word/websettings.xml")n.webSettingsXml=a;else if(i==="word/footnotes.xml")n.footnotesXml=a;else if(i==="word/endnotes.xml")n.endnotesXml=a;else if(i==="word/comments.xml")n.commentsXml=a;else if(i==="word/commentsextensible.xml"||i==="word/commentsextended.xml")n.commentsExtensibleXml||(n.commentsExtensibleXml=a);else if(i==="word/_rels/document.xml.rels")n.documentRels=a;else if(i==="_rels/.rels")n.packageRels=a;else if(i==="[content_types].xml")n.contentTypesXml=a;else if(i==="docprops/core.xml")n.corePropsXml=a;else if(i==="docprops/app.xml")n.appPropsXml=a;else if(i==="docprops/custom.xml")n.customPropsXml=a;else if(i.match(/^word\/header\d+\.xml$/)){let c=o.split("/").pop()||o;n.headers.set(c,a);}else if(i.match(/^word\/footer\d+\.xml$/)){let c=o.split("/").pop()||o;n.footers.set(c,a);}}else if(i.startsWith("word/media/")){let a=await r.async("arraybuffer");n.media.set(o,a);}else if(i.startsWith("word/fonts/")){let a=await r.async("arraybuffer");n.fonts.set(o,a);}}return n}function Le(e){switch(e.toLowerCase().split(".").pop()){case "png":return "image/png";case "jpg":case "jpeg":return "image/jpeg";case "gif":return "image/gif";case "bmp":return "image/bmp";case "tif":case "tiff":return "image/tiff";case "wmf":return "image/x-wmf";case "emf":return "image/x-emf";case "svg":return "image/svg+xml";case "webp":return "image/webp";default:return "application/octet-stream"}}function j(e){return xml2js(e,{compact:false,ignoreComment:true,ignoreInstruction:true,ignoreDoctype:true,alwaysArray:false,trim:false,captureSpacesBetweenElements:true,attributesKey:"attributes",textKey:"text"})}function De(e){return js2xml({elements:[e]},{compact:false,spaces:0})}function q(e){try{let t=j(e);return t.elements&&t.elements.length>0?t.elements.find(n=>n.type==="element")??null:t}catch(t){return console.warn("Failed to parse XML:",t),null}}function oe(e){let t=e.indexOf(":");return t>=0?e.substring(t+1):e}function l(e,t,n){if(!e||!e.elements)return null;let o=`${t}:${n}`;for(let r of e.elements)if(r.type==="element"&&(r.name===o||oe(r.name||"")===n))return r;return null}function N(e,t,n){if(!e||!e.elements)return [];let o=`${t}:${n}`,r=[];for(let i of e.elements)i.type==="element"&&(i.name===o||oe(i.name||"")===n)&&r.push(i);return r}function D(e){return !e||!e.elements?[]:e.elements.filter(t=>t.type==="element")}function s(e,t,n){if(!e||!e.attributes)return null;let o=e.attributes;if(t){let r=`${t}:${n}`;if(r in o)return o[r]}return n in o?o[n]:null}function re(e){if(!e)return "";if("text"in e&&typeof e.text=="string")return e.text;if(!e.elements)return "";let t="";for(let n of e.elements)n.type==="text"&&"text"in n?t+=n.text??"":n.type==="element"&&(t+=re(n));return t}function g(e,t,n,o=1){let r=s(e,t,n);if(r===null)return;let i=parseInt(r,10);if(!isNaN(i))return i*o}function F(e,t="w"){if(!e)return false;let n=s(e,t,"val");return n===null?true:!(n==="0"||n==="false"||n==="off")}var ie={image:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",hyperlink:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",header:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/header",footer:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer",footnotes:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/footnotes",endnotes:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/endnotes",styles:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",numbering:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering",fontTable:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable",theme:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme",settings:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings",webSettings:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/webSettings",oleObject:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject",chart:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart",diagramData:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/diagramData",officeDocument:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",coreProperties:"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties",extendedProperties:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties",customProperties:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties",customXml:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXml"};function ae(e){let t=new Map;if(!e||e.trim().length===0)return t;let n=q(e);if(!n)return console.warn("Failed to parse relationships XML"),t;let o=D(n);for(let r of o){let i=r.name||"";if(!i.endsWith("Relationship")&&!i.includes(":Relationship"))continue;let a=s(r,null,"Id"),c=s(r,null,"Type"),f=s(r,null,"Target"),u=s(r,null,"TargetMode");if(!a||!c||!f){console.warn("Relationship missing required attributes:",{id:a,type:c,target:f});continue}let p={id:a,type:c,target:f};u==="External"?p.targetMode="External":u==="Internal"&&(p.targetMode="Internal"),t.set(a,p);}return t}function He(e){return e.type===ie.hyperlink&&e.targetMode==="External"}var je={dk1:"000000",lt1:"FFFFFF",dk2:"44546A",lt2:"E7E6E6",accent1:"4472C4",accent2:"ED7D31",accent3:"A5A5A5",accent4:"FFC000",accent5:"5B9BD5",accent6:"70AD47",hlink:"0563C1",folHlink:"954F72"},se={majorFont:{latin:"Calibri Light",ea:"",cs:"",fonts:{}},minorFont:{latin:"Calibri",ea:"",cs:"",fonts:{}}},Te={name:"Office Theme",colorScheme:je,fontScheme:se},Jt=["dk1","lt1","dk2","lt2","accent1","accent2","accent3","accent4","accent5","accent6","hlink","folHlink"];function Qt(e){if(!e)return null;switch(oe(e.name||"")){case "srgbClr":return s(e,"a","val")??s(e,null,"val")??null;case "sysClr":{let n=s(e,"a","lastClr")??s(e,null,"lastClr");if(n)return n;switch(s(e,"a","val")??s(e,null,"val")){case "windowText":case "menuText":case "captionText":case "btnText":return "000000";case "window":case "menu":case "btnFace":case "btnHighlight":return "FFFFFF";case "highlight":return "0078D7";case "highlightText":return "FFFFFF";case "grayText":return "808080";default:return null}}case "schemeClr":{s(e,"a","val")??s(e,null,"val");return null}default:return null}}function en(e){let t={...je};if(!e)return t;for(let n of Jt){let o=l(e,"a",n);if(o){let r=D(o);if(r.length>0){let i=Qt(r[0]);i&&(t[n]=i);}}}return t}function Oe(e){let t={latin:"",ea:"",cs:"",fonts:{}};if(!e)return t;let n=l(e,"a","latin");n&&(t.latin=s(n,"a","typeface")??s(n,null,"typeface")??"");let o=l(e,"a","ea");o&&(t.ea=s(o,"a","typeface")??s(o,null,"typeface")??"");let r=l(e,"a","cs");r&&(t.cs=s(r,"a","typeface")??s(r,null,"typeface")??"");let i=N(e,"a","font");for(let a of i){let c=s(a,"a","script")??s(a,null,"script"),f=s(a,"a","typeface")??s(a,null,"typeface");c&&f&&(t.fonts=t.fonts||{},t.fonts[c]=f);}return t}function tn(e){let t={...se};if(!e)return t;let n=l(e,"a","majorFont");n&&(t.majorFont=Oe(n));let o=l(e,"a","minorFont");return o&&(t.minorFont=Oe(o)),t}function Ve(e){if(!e)return {...Te};try{let t=q(e);if(!t)return {...Te};let n=s(t,"a","name")??s(t,null,"name")??"Office Theme",o=l(t,"a","themeElements"),r=l(o,"a","clrScheme"),i=en(r),a=l(o,"a","fontScheme"),c=tn(a);return {name:n,colorScheme:i,fontScheme:c}}catch(t){return console.warn("Failed to parse theme:",t),{...Te}}}function nn(e,t="latin"){if(!e?.fontScheme?.majorFont)return se.majorFont?.latin??"Calibri Light";let n=e.fontScheme.majorFont;return t==="latin"?n.latin||"Calibri Light":t==="ea"?n.ea||"":t==="cs"?n.cs||"":n.fonts?.[t]?n.fonts[t]:n.latin||"Calibri Light"}function We(e,t="latin"){if(!e?.fontScheme?.minorFont)return se.minorFont?.latin??"Calibri";let n=e.fontScheme.minorFont;return t==="latin"?n.latin||"Calibri":t==="ea"?n.ea||"":t==="cs"?n.cs||"":n.fonts?.[t]?n.fonts[t]:n.latin||"Calibri"}function _(e,t){if(!t)return "Calibri";let n=t.toLowerCase().includes("major"),o=t.toLowerCase().includes("minor"),r="latin",i=t.toLowerCase();return i.includes("eastasia")?r="ea":(i.includes("bidi")||i.includes("cs"))&&(r="cs"),n?nn(e,r):o?We(e,r):We(e,"latin")}function le(e,t){if(!e)return;let n={},o=l(e,"w","b");o&&(n.bold=F(o));let r=l(e,"w","bCs");r&&(n.boldCs=F(r));let i=l(e,"w","i");i&&(n.italic=F(i));let a=l(e,"w","iCs");a&&(n.italicCs=F(a));let c=l(e,"w","u");if(c){let R=s(c,"w","val");if(R){n.underline={style:R};let M=s(c,"w","color"),L=s(c,"w","themeColor");(M||L)&&(n.underline.color=Fe(M,L,s(c,"w","themeTint"),s(c,"w","themeShade")));}}let f=l(e,"w","strike");f&&(n.strike=F(f));let u=l(e,"w","dstrike");u&&(n.doubleStrike=F(u));let p=l(e,"w","vertAlign");if(p){let R=s(p,"w","val");(R==="superscript"||R==="subscript"||R==="baseline")&&(n.vertAlign=R);}let m=l(e,"w","smallCaps");m&&(n.smallCaps=F(m));let h=l(e,"w","caps");h&&(n.allCaps=F(h));let T=l(e,"w","vanish");T&&(n.hidden=F(T));let d=l(e,"w","color");d&&(n.color=Fe(s(d,"w","val"),s(d,"w","themeColor"),s(d,"w","themeTint"),s(d,"w","themeShade")));let w=l(e,"w","highlight");if(w){let R=s(w,"w","val");R&&(n.highlight=R);}let E=l(e,"w","shd");E&&(n.shading=ce(E));let k=l(e,"w","sz");if(k){let R=g(k,"w","val");R!==void 0&&(n.fontSize=R);}let P=l(e,"w","szCs");if(P){let R=g(P,"w","val");R!==void 0&&(n.fontSizeCs=R);}let C=l(e,"w","rFonts");if(C){n.fontFamily={ascii:s(C,"w","ascii")??void 0,hAnsi:s(C,"w","hAnsi")??void 0,eastAsia:s(C,"w","eastAsia")??void 0,cs:s(C,"w","cs")??void 0};let R=s(C,"w","asciiTheme");R&&(n.fontFamily.asciiTheme=R,t&&!n.fontFamily.ascii&&(n.fontFamily.ascii=_(t,R)));let M=s(C,"w","hAnsiTheme");M&&(n.fontFamily.hAnsiTheme=M,t&&!n.fontFamily.hAnsi&&(n.fontFamily.hAnsi=_(t,M)));let L=s(C,"w","eastAsiaTheme");L&&(n.fontFamily.eastAsiaTheme=L,t&&!n.fontFamily.eastAsia&&(n.fontFamily.eastAsia=_(t,L)));let $=s(C,"w","cstheme");$&&(n.fontFamily.csTheme=$,t&&!n.fontFamily.cs&&(n.fontFamily.cs=_(t,$)));}let b=l(e,"w","spacing");if(b){let R=g(b,"w","val");R!==void 0&&(n.spacing=R);}let x=l(e,"w","position");if(x){let R=g(x,"w","val");R!==void 0&&(n.position=R);}let S=l(e,"w","w");if(S){let R=g(S,"w","val");R!==void 0&&(n.scale=R);}let y=l(e,"w","kern");if(y){let R=g(y,"w","val");R!==void 0&&(n.kerning=R);}let v=l(e,"w","effect");if(v){let R=s(v,"w","val");R&&(n.effect=R);}let B=l(e,"w","em");if(B){let R=s(B,"w","val");R&&(n.emphasisMark=R);}let A=l(e,"w","emboss");A&&(n.emboss=F(A));let I=l(e,"w","imprint");I&&(n.imprint=F(I));let O=l(e,"w","outline");O&&(n.outline=F(O));let U=l(e,"w","shadow");U&&(n.shadow=F(U));let K=l(e,"w","rtl");K&&(n.rtl=F(K));let H=l(e,"w","cs");H&&(n.cs=F(H));let W=l(e,"w","rStyle");if(W){let R=s(W,"w","val");R&&(n.styleId=R);}return Object.keys(n).length>0?n:void 0}function Fe(e,t,n,o){let r={};return e&&e!=="auto"?r.rgb=e:e==="auto"&&(r.auto=true),t&&(r.themeColor=t),n&&(r.themeTint=n),o&&(r.themeShade=o),r}function ce(e){if(!e)return;let t={},n=s(e,"w","color");n&&n!=="auto"&&(t.color={rgb:n});let o=s(e,"w","fill");o&&o!=="auto"&&(t.fill={rgb:o});let r=s(e,"w","themeFill");r&&(t.fill=t.fill||{},t.fill.themeColor=r);let i=s(e,"w","themeFillTint");i&&t.fill&&(t.fill.themeTint=i);let a=s(e,"w","themeFillShade");a&&t.fill&&(t.fill.themeShade=a);let c=s(e,"w","val");return c&&(t.pattern=c),Object.keys(t).length>0?t:void 0}function V(e){if(!e)return;let t=s(e,"w","val");if(!t)return;let n={style:t},o=s(e,"w","color"),r=s(e,"w","themeColor");(o||r)&&(n.color=Fe(o,r,s(e,"w","themeTint"),s(e,"w","themeShade")));let i=g(e,"w","sz");i!==void 0&&(n.size=i);let a=g(e,"w","space");a!==void 0&&(n.space=a);let c=s(e,"w","shadow");c&&(n.shadow=c==="1"||c==="true");let f=s(e,"w","frame");return f&&(n.frame=f==="1"||f==="true"),n}function on(e){if(!e)return;let t=N(e,"w","tab");if(t.length===0)return;let n=[];for(let o of t){let r=g(o,"w","pos"),i=s(o,"w","val");if(r!==void 0&&i){let a={position:r,alignment:i},c=s(o,"w","leader");c&&(a.leader=c),n.push(a);}}return n.length>0?n:void 0}function Se(e,t){if(!e)return;let n={},o=l(e,"w","jc");if(o){let x=s(o,"w","val");x&&(n.alignment=x);}let r=l(e,"w","bidi");r&&(n.bidi=F(r));let i=l(e,"w","spacing");if(i){let x=g(i,"w","before");x!==void 0&&(n.spaceBefore=x);let S=g(i,"w","after");S!==void 0&&(n.spaceAfter=S);let y=g(i,"w","line");y!==void 0&&(n.lineSpacing=y);let v=s(i,"w","lineRule");v&&(n.lineSpacingRule=v);let B=s(i,"w","beforeAutospacing");B&&(n.beforeAutospacing=B==="1"||B==="true");let A=s(i,"w","afterAutospacing");A&&(n.afterAutospacing=A==="1"||A==="true");}let a=l(e,"w","ind");if(a){let x=g(a,"w","left");x!==void 0&&(n.indentLeft=x);let S=g(a,"w","right");S!==void 0&&(n.indentRight=S);let y=g(a,"w","firstLine");y!==void 0&&(n.indentFirstLine=y);let v=g(a,"w","hanging");v!==void 0&&(n.indentFirstLine=-v,n.hangingIndent=true);}let c=l(e,"w","pBdr");if(c){let x={},S=V(l(c,"w","top"));S&&(x.top=S);let y=V(l(c,"w","bottom"));y&&(x.bottom=y);let v=V(l(c,"w","left"));v&&(x.left=v);let B=V(l(c,"w","right"));B&&(x.right=B);let A=V(l(c,"w","between"));A&&(x.between=A);let I=V(l(c,"w","bar"));I&&(x.bar=I),Object.keys(x).length>0&&(n.borders=x);}let f=l(e,"w","shd");f&&(n.shading=ce(f));let u=l(e,"w","tabs");u&&(n.tabs=on(u));let p=l(e,"w","keepNext");p&&(n.keepNext=F(p));let m=l(e,"w","keepLines");m&&(n.keepLines=F(m));let h=l(e,"w","widowControl");h&&(n.widowControl=F(h));let T=l(e,"w","pageBreakBefore");T&&(n.pageBreakBefore=F(T));let d=l(e,"w","contextualSpacing");d&&(n.contextualSpacing=F(d));let w=l(e,"w","numPr");if(w){let x=l(w,"w","numId"),S=l(w,"w","ilvl");if(x||S){if(n.numPr={},x){let y=g(x,"w","val");y!==void 0&&(n.numPr.numId=y);}if(S){let y=g(S,"w","val");y!==void 0&&(n.numPr.ilvl=y);}}}let E=l(e,"w","outlineLvl");if(E){let x=g(E,"w","val");x!==void 0&&(n.outlineLevel=x);}let k=l(e,"w","pStyle");if(k){let x=s(k,"w","val");x&&(n.styleId=x);}let P=l(e,"w","suppressLineNumbers");P&&(n.suppressLineNumbers=F(P));let C=l(e,"w","suppressAutoHyphens");C&&(n.suppressAutoHyphens=F(C));let b=l(e,"w","rPr");return b&&(n.runProperties=le(b,t)),Object.keys(n).length>0?n:void 0}function Z(e){if(!e)return;let t=g(e,"w","w"),n=s(e,"w","type");if(t!==void 0&&n)return {value:t,type:n}}function _e(e){if(!e)return;let t={},n=V(l(e,"w","top"));n&&(t.top=n);let o=V(l(e,"w","bottom"));o&&(t.bottom=o);let r=V(l(e,"w","left"));r&&(t.left=r);let i=V(l(e,"w","right"));i&&(t.right=i);let a=V(l(e,"w","insideH"));a&&(t.insideH=a);let c=V(l(e,"w","insideV"));return c&&(t.insideV=c),Object.keys(t).length>0?t:void 0}function Ge(e){if(!e)return;let t={},n=Z(l(e,"w","top"));n&&(t.top=n);let o=Z(l(e,"w","bottom"));o&&(t.bottom=o);let r=Z(l(e,"w","left"));r&&(t.left=r);let i=Z(l(e,"w","right"));return i&&(t.right=i),Object.keys(t).length>0?t:void 0}function rn(e){if(!e)return;let t={},n=s(e,"w","val");if(n){let u=parseInt(n,16);isNaN(u)||(t.firstRow=(u&32)!==0,t.lastRow=(u&64)!==0,t.firstColumn=(u&128)!==0,t.lastColumn=(u&256)!==0,t.noHBand=(u&512)!==0,t.noVBand=(u&1024)!==0);}let o=s(e,"w","firstColumn");o&&(t.firstColumn=o==="1");let r=s(e,"w","firstRow");r&&(t.firstRow=r==="1");let i=s(e,"w","lastColumn");i&&(t.lastColumn=i==="1");let a=s(e,"w","lastRow");a&&(t.lastRow=a==="1");let c=s(e,"w","noHBand");c&&(t.noHBand=c==="1");let f=s(e,"w","noVBand");return f&&(t.noVBand=f==="1"),Object.keys(t).length>0?t:void 0}function ze(e,t){if(!e)return;let n={},o=l(e,"w","tblW");o&&(n.width=Z(o));let r=l(e,"w","jc");if(r){let d=s(r,"w","val");(d==="left"||d==="center"||d==="right")&&(n.justification=d);}let i=l(e,"w","tblCellSpacing");i&&(n.cellSpacing=Z(i));let a=l(e,"w","tblInd");a&&(n.indent=Z(a));let c=l(e,"w","tblBorders");c&&(n.borders=_e(c));let f=l(e,"w","tblCellMar");f&&(n.cellMargins=Ge(f));let u=l(e,"w","tblLayout");if(u){let d=s(u,"w","type");(d==="fixed"||d==="autofit")&&(n.layout=d);}let p=l(e,"w","tblStyle");if(p){let d=s(p,"w","val");d&&(n.styleId=d);}let m=l(e,"w","tblLook");m&&(n.look=rn(m));let h=l(e,"w","shd");h&&(n.shading=ce(h));let T=l(e,"w","bidiVisual");return T&&(n.bidi=F(T)),Object.keys(n).length>0?n:void 0}function Ue(e){if(!e)return;let t={},n=l(e,"w","trHeight");if(n){t.height=Z(n);let c=s(n,"w","hRule");c&&(t.heightRule=c);}let o=l(e,"w","tblHeader");o&&(t.header=F(o));let r=l(e,"w","cantSplit");r&&(t.cantSplit=F(r));let i=l(e,"w","jc");if(i){let c=s(i,"w","val");(c==="left"||c==="center"||c==="right")&&(t.justification=c);}let a=l(e,"w","hidden");return a&&(t.hidden=F(a)),Object.keys(t).length>0?t:void 0}function $e(e,t){if(!e)return;let n={},o=l(e,"w","tcW");o&&(n.width=Z(o));let r=l(e,"w","tcBorders");r&&(n.borders=_e(r));let i=l(e,"w","tcMar");i&&(n.margins=Ge(i));let a=l(e,"w","shd");a&&(n.shading=ce(a));let c=l(e,"w","vAlign");if(c){let d=s(c,"w","val");(d==="top"||d==="center"||d==="bottom")&&(n.verticalAlign=d);}let f=l(e,"w","textDirection");if(f){let d=s(f,"w","val");d&&(n.textDirection=d);}let u=l(e,"w","gridSpan");if(u){let d=g(u,"w","val");d!==void 0&&(n.gridSpan=d);}let p=l(e,"w","vMerge");if(p){let d=s(p,"w","val");n.vMerge=d==="restart"?"restart":"continue";}let m=l(e,"w","tcFitText");m&&(n.fitText=F(m));let h=l(e,"w","noWrap");h&&(n.noWrap=F(h));let T=l(e,"w","hideMark");return T&&(n.hideMark=F(T)),Object.keys(n).length>0?n:void 0}function an(e,t){let n={styleId:s(e,"w","styleId")??"",type:s(e,"w","type")??"paragraph"},o=s(e,"w","default");o&&(n.default=o==="1"||o==="true");let r=l(e,"w","name");r&&(n.name=s(r,"w","val")??void 0);let i=l(e,"w","basedOn");i&&(n.basedOn=s(i,"w","val")??void 0);let a=l(e,"w","next");a&&(n.next=s(a,"w","val")??void 0);let c=l(e,"w","link");c&&(n.link=s(c,"w","val")??void 0);let f=l(e,"w","uiPriority");if(f){let b=g(f,"w","val");b!==void 0&&(n.uiPriority=b);}let u=l(e,"w","hidden");u&&(n.hidden=F(u));let p=l(e,"w","semiHidden");p&&(n.semiHidden=F(p));let m=l(e,"w","unhideWhenUsed");m&&(n.unhideWhenUsed=F(m));let h=l(e,"w","qFormat");h&&(n.qFormat=F(h));let T=l(e,"w","personal");T&&(n.personal=F(T));let d=l(e,"w","pPr");d&&(n.pPr=Se(d,t));let w=l(e,"w","rPr");w&&(n.rPr=le(w,t));let E=l(e,"w","tblPr");E&&(n.tblPr=ze(E));let k=l(e,"w","trPr");k&&(n.trPr=Ue(k));let P=l(e,"w","tcPr");P&&(n.tcPr=$e(P));let C=N(e,"w","tblStylePr");if(C.length>0){n.tblStylePr=[];for(let b of C){let x=s(b,"w","type");if(x){let S={type:x},y=l(b,"w","pPr");y&&(S.pPr=Se(y,t));let v=l(b,"w","rPr");v&&(S.rPr=le(v,t));let B=l(b,"w","tblPr");B&&(S.tblPr=ze(B));let A=l(b,"w","trPr");A&&(S.trPr=Ue(A));let I=l(b,"w","tcPr");I&&(S.tcPr=$e(I)),n.tblStylePr.push(S);}}}return n}function sn(e,t){if(!e)return;let n={},o=l(e,"w","rPrDefault");if(o){let i=l(o,"w","rPr");i&&(n.rPr=le(i,t));}let r=l(e,"w","pPrDefault");if(r){let i=l(r,"w","pPr");i&&(n.pPr=Se(i,t));}return n.rPr||n.pPr?n:void 0}function qe(e,t){if(!t)return e;if(!e)return t?{...t}:void 0;let n={...e};for(let o of Object.keys(t)){let r=t[o];r!==void 0&&(n[o]=typeof r=="object"&&r!==null?{...n[o]||{},...r}:r);}return n}function ln(e,t){if(!t)return e;if(!e)return t?{...t}:void 0;let n={...e};for(let o of Object.keys(t)){let r=t[o];if(r!==void 0)if(o==="runProperties")n.runProperties=qe(n.runProperties,t.runProperties);else if(o==="borders"||o==="numPr"||o==="frame"){let i=n[o],a=r;n[o]={...i||{},...a||{}};}else o==="tabs"&&Array.isArray(r)?n.tabs=[...r]:n[o]=r;}return n}function Ze(e,t,n,o=new Set){if(o.has(e.styleId)||(o.add(e.styleId),!e.basedOn))return e;let r=t.get(e.basedOn);if(!r)return e;let i=Ze(r,t,n,o),a={...e,pPr:ln(i.pPr,e.pPr),rPr:qe(i.rPr,e.rPr)};return e.type==="table"&&((i.tblPr||e.tblPr)&&(a.tblPr={...i.tblPr||{},...e.tblPr||{}}),(i.trPr||e.trPr)&&(a.trPr={...i.trPr||{},...e.trPr||{}}),(i.tcPr||e.tcPr)&&(a.tcPr={...i.tcPr||{},...e.tcPr||{}})),a}function Ce(e,t){let n=new Map;try{let o=q(e);if(!o)return n;let r=N(o,"w","style");for(let i of r){let a=an(i,t);a.styleId&&n.set(a.styleId,a);}for(let[i,a]of n){let c=Ze(a,n,t);n.set(i,c);}}catch(o){console.warn("Failed to parse styles:",o);}return n}function Ye(e,t){let n={styles:[]};try{let o=q(e);if(!o)return n;let r=l(o,"w","docDefaults");n.docDefaults=sn(r,t);let i=l(o,"w","latentStyles");i&&(n.latentStyles={defLockedState:s(i,"w","defLockedState")==="1",defUIPriority:g(i,"w","defUIPriority"),defSemiHidden:s(i,"w","defSemiHidden")==="1",defUnhideWhenUsed:s(i,"w","defUnhideWhenUsed")==="1",defQFormat:s(i,"w","defQFormat")==="1",count:g(i,"w","count")});let a=Ce(e,t);n.styles=Array.from(a.values());}catch(o){console.warn("Failed to parse style definitions:",o);}return n}function Ke(e){let t={abstractNums:[],nums:[]};if(!e)return ke(t);let n=q(e);if(!n)return ke(t);let o=N(n,"w","abstractNum");for(let i of o){let a=cn(i);a&&t.abstractNums.push(a);}let r=N(n,"w","num");for(let i of r){let a=fn(i);a&&t.nums.push(a);}return ke(t)}function cn(e){let t=s(e,"w","abstractNumId");if(t===null)return null;let n=parseInt(t,10);if(isNaN(n))return null;let o={abstractNumId:n,levels:[]},r=l(e,"w","multiLevelType");if(r){let u=s(r,"w","val");(u==="hybridMultilevel"||u==="multilevel"||u==="singleLevel")&&(o.multiLevelType=u);}let i=l(e,"w","name");i&&(o.name=s(i,"w","val")??void 0);let a=l(e,"w","numStyleLink");a&&(o.numStyleLink=s(a,"w","val")??void 0);let c=l(e,"w","styleLink");c&&(o.styleLink=s(c,"w","val")??void 0);let f=N(e,"w","lvl");for(let u of f){let p=Je(u);p&&o.levels.push(p);}return o.levels.sort((u,p)=>u.ilvl-p.ilvl),o}function fn(e){let t=s(e,"w","numId");if(t===null)return null;let n=parseInt(t,10);if(isNaN(n))return null;let o=l(e,"w","abstractNumId");if(!o)return null;let r=s(o,"w","val");if(r===null)return null;let i=parseInt(r,10);if(isNaN(i))return null;let a={numId:n,abstractNumId:i},c=N(e,"w","lvlOverride");if(c.length>0){a.levelOverrides=[];for(let f of c){let u=s(f,"w","ilvl");if(u===null)continue;let p=parseInt(u,10);if(isNaN(p))continue;let m={ilvl:p},h=l(f,"w","startOverride");if(h){let d=s(h,"w","val");if(d!==null){let w=parseInt(d,10);isNaN(w)||(m.startOverride=w);}}let T=l(f,"w","lvl");T&&(m.lvl=Je(T)??void 0),a.levelOverrides.push(m);}}return a}function Je(e){let t=s(e,"w","ilvl");if(t===null)return null;let n=parseInt(t,10);if(isNaN(n)||n<0||n>8)return null;let o={ilvl:n,numFmt:"decimal",lvlText:""},r=l(e,"w","start");if(r){let d=s(r,"w","val");if(d!==null){let w=parseInt(d,10);isNaN(w)||(o.start=w);}}let i=l(e,"w","numFmt");if(i){let d=s(i,"w","val");d&&(o.numFmt=un(d));}let a=l(e,"w","lvlText");a&&(o.lvlText=s(a,"w","val")??"");let c=l(e,"w","lvlJc");if(c){let d=s(c,"w","val");(d==="left"||d==="center"||d==="right")&&(o.lvlJc=d);}let f=l(e,"w","suff");if(f){let d=s(f,"w","val");(d==="tab"||d==="space"||d==="nothing")&&(o.suffix=d);}let u=l(e,"w","isLgl");u&&(o.isLgl=F(u));let p=l(e,"w","lvlRestart");if(p){let d=s(p,"w","val");if(d!==null){let w=parseInt(d,10);isNaN(w)||(o.lvlRestart=w);}}let m=l(e,"w","legacy");m&&(o.legacy={legacy:F(m),legacySpace:g(m,"w","legacySpace"),legacyIndent:g(m,"w","legacyIndent")});let h=l(e,"w","pPr");h&&(o.pPr=dn(h));let T=l(e,"w","rPr");return T&&(o.rPr=gn(T)),o}function un(e){return {decimal:"decimal",upperRoman:"upperRoman",lowerRoman:"lowerRoman",upperLetter:"upperLetter",lowerLetter:"lowerLetter",ordinal:"ordinal",cardinalText:"cardinalText",ordinalText:"ordinalText",hex:"hex",chicago:"chicago",bullet:"bullet",none:"none",decimalZero:"decimalZero",ganada:"ganada",chosung:"chosung",ideographDigital:"ideographDigital",japaneseCounting:"japaneseCounting",aiueo:"aiueo",iroha:"iroha",decimalFullWidth:"decimalFullWidth",decimalHalfWidth:"decimalHalfWidth",japaneseLegal:"japaneseLegal",japaneseDigitalTenThousand:"japaneseDigitalTenThousand",decimalEnclosedCircle:"decimalEnclosedCircle",decimalFullWidth2:"decimalFullWidth2",aiueoFullWidth:"aiueoFullWidth",irohaFullWidth:"irohaFullWidth",decimalEnclosedFullstop:"decimalEnclosedFullstop",decimalEnclosedParen:"decimalEnclosedParen",decimalEnclosedCircleChinese:"decimalEnclosedCircleChinese",ideographEnclosedCircle:"ideographEnclosedCircle",ideographTraditional:"ideographTraditional",ideographZodiac:"ideographZodiac",ideographZodiacTraditional:"ideographZodiacTraditional",taiwaneseCounting:"taiwaneseCounting",ideographLegalTraditional:"ideographLegalTraditional",taiwaneseCountingThousand:"taiwaneseCountingThousand",taiwaneseDigital:"taiwaneseDigital",chineseCounting:"chineseCounting",chineseLegalSimplified:"chineseLegalSimplified",chineseCountingThousand:"chineseCountingThousand",koreanDigital:"koreanDigital",koreanCounting:"koreanCounting",koreanLegal:"koreanLegal",koreanDigital2:"koreanDigital2",vietnameseCounting:"vietnameseCounting",russianLower:"russianLower",russianUpper:"russianUpper",numberInDash:"numberInDash",hebrew1:"hebrew1",hebrew2:"hebrew2",arabicAlpha:"arabicAlpha",arabicAbjad:"arabicAbjad",hindiVowels:"hindiVowels",hindiConsonants:"hindiConsonants",hindiNumbers:"hindiNumbers",hindiCounting:"hindiCounting",thaiLetters:"thaiLetters",thaiNumbers:"thaiNumbers",thaiCounting:"thaiCounting"}[e]??"decimal"}function dn(e){let t={},n=l(e,"w","ind");if(n){let r=g(n,"w","left"),i=g(n,"w","right"),a=g(n,"w","firstLine"),c=g(n,"w","hanging");r!==void 0&&(t.indentLeft=r),i!==void 0&&(t.indentRight=i),c!==void 0?(t.indentFirstLine=-c,t.hangingIndent=true):a!==void 0&&(t.indentFirstLine=a);}let o=l(e,"w","tabs");if(o){t.tabs=[];let r=N(o,"w","tab");for(let i of r){let a=g(i,"w","pos"),c=s(i,"w","val"),f=s(i,"w","leader");a!==void 0&&c&&t.tabs.push({position:a,alignment:pn(c),leader:mn(f)});}}return t}function pn(e){switch(e){case "left":return "left";case "center":return "center";case "right":return "right";case "decimal":return "decimal";case "bar":return "bar";case "clear":return "clear";case "num":return "num";default:return "left"}}function mn(e){if(e)switch(e){case "none":return "none";case "dot":return "dot";case "hyphen":return "hyphen";case "underscore":return "underscore";case "heavy":return "heavy";case "middleDot":return "middleDot";default:return}}function gn(e){let t={},n=l(e,"w","rFonts");n&&(t.fontFamily={ascii:s(n,"w","ascii")??void 0,hAnsi:s(n,"w","hAnsi")??void 0,eastAsia:s(n,"w","eastAsia")??void 0,cs:s(n,"w","cs")??void 0});let o=l(e,"w","sz");if(o){let c=g(o,"w","val");c!==void 0&&(t.fontSize=c);}let r=l(e,"w","color");if(r){let c=s(r,"w","val"),f=s(r,"w","themeColor");c==="auto"?t.color={auto:true}:f?t.color={themeColor:f,themeTint:s(r,"w","themeTint")??void 0,themeShade:s(r,"w","themeShade")??void 0}:c&&(t.color={rgb:c});}let i=l(e,"w","b");i&&(t.bold=F(i));let a=l(e,"w","i");return a&&(t.italic=F(a)),t}function ke(e){let t=new Map;for(let o of e.abstractNums)t.set(o.abstractNumId,o);let n=new Map;for(let o of e.nums)n.set(o.numId,o);return {definitions:e,getLevel(o,r){let i=n.get(o);if(!i)return null;if(i.levelOverrides){let c=i.levelOverrides.find(f=>f.ilvl===r);if(c){if(c.lvl)return c.lvl;let f=t.get(i.abstractNumId);if(f){let u=f.levels.find(p=>p.ilvl===r);if(u&&c.startOverride!==void 0)return {...u,start:c.startOverride}}}}let a=t.get(i.abstractNumId);return a?a.levels.find(c=>c.ilvl===r)??null:null},getAbstract(o){return t.get(o)??null},hasNumbering(o){return n.has(o)}}}var hn=914400,wn=96;function ar(e){return e==null||isNaN(e)?0:Math.round(e*wn/hn)}function bn(e){if(!e)return;let t=parseInt(e,10);if(!isNaN(t))return t/6e4}function X(e,t){let n=D(e);for(let o of n)if(o.name===t)return o;return null}function yn(e,t){let n=D(e);for(let o of n)if(t.includes(o.name||""))return o;return null}function Qe(e){if(!e)return {width:0,height:0};let t=g(e,null,"cx")??0,n=g(e,null,"cy")??0;return {width:t,height:n}}function et(e){if(!e)return;let t=g(e,null,"l")??0,n=g(e,null,"t")??0,o=g(e,null,"r")??0,r=g(e,null,"b")??0;if(!(t===0&&n===0&&o===0&&r===0))return {left:t,top:n,right:o,bottom:r}}function tt(e){if(!e)return {};let t=s(e,null,"id")??void 0,n=s(e,null,"name")??void 0,o=s(e,null,"descr")??void 0,r=s(e,null,"title")??void 0,i=s(e,null,"decorative")==="1";return {id:t,name:n,alt:o,title:r,decorative:i||void 0}}function xn(e){if(!e)return;let t=s(e,null,"relativeFrom")??"column",n=X(e,"wp:align");if(n){let r=n.elements?.[0]?.text??null;return {relativeTo:t,alignment:r}}let o=X(e,"wp:posOffset");if(o){let r=String(o.elements?.[0]?.text??"0"),i=parseInt(r,10);return {relativeTo:t,posOffset:isNaN(i)?0:i}}return {relativeTo:t}}function Tn(e){if(!e)return;let t=s(e,null,"relativeFrom")??"paragraph",n=X(e,"wp:align");if(n){let r=n.elements?.[0]?.text??null;return {relativeTo:t,alignment:r}}let o=X(e,"wp:posOffset");if(o){let r=String(o.elements?.[0]?.text??"0"),i=parseInt(r,10);return {relativeTo:t,posOffset:isNaN(i)?0:i}}return {relativeTo:t}}var Fn=["wp:wrapNone","wp:wrapSquare","wp:wrapTight","wp:wrapThrough","wp:wrapTopAndBottom"];function Sn(e,t,n){if(!e){let E={type:t?"behind":"inFront"};return n?.distT!==void 0&&(E.distT=n.distT),n?.distB!==void 0&&(E.distB=n.distB),n?.distL!==void 0&&(E.distL=n.distL),n?.distR!==void 0&&(E.distR=n.distR),E}let r=(e.name||"").replace("wp:",""),i=g(e,null,"distT")??void 0,a=g(e,null,"distB")??void 0,c=g(e,null,"distL")??void 0,f=g(e,null,"distR")??void 0,u=i??n?.distT,p=a??n?.distB,m=c??n?.distL,h=f??n?.distR,T=s(e,null,"wrapText")??void 0,d;switch(r){case "wrapNone":d=t?"behind":"inFront";break;case "wrapSquare":d="square";break;case "wrapTight":d="tight";break;case "wrapThrough":d="through";break;case "wrapTopAndBottom":d="topAndBottom";break;default:d="square";}let w={type:d};return T&&(w.wrapText=T),u!==void 0&&(w.distT=u),p!==void 0&&(w.distB=p),m!==void 0&&(w.distL=m),h!==void 0&&(w.distR=h),w}function nt(e){if(!e)return;let t=s(e,null,"rot"),n=s(e,null,"flipH")==="1",o=s(e,null,"flipV")==="1",r=bn(t);if(r===void 0&&!n&&!o)return;let i={};return r!==void 0&&(i.rotation=r),n&&(i.flipH=true),o&&(i.flipV=true),i}function ot(e){let t=X(e,"a:graphic");if(!t)return null;let n=X(t,"a:graphicData");if(!n)return null;let o=X(n,"pic:pic");if(!o)return null;let r=X(o,"pic:blipFill");return r?X(r,"a:blip"):null}function rt(e){if(!e)return "";let t=s(e,"r","embed");if(t)return t;let n=s(e,null,"embed");if(n)return n;let o=s(e,"r","link");return o||""}function it(e){let t=X(e,"a:graphic");if(!t)return null;let n=X(t,"a:graphicData");if(!n)return null;let o=X(n,"pic:pic");if(!o)return null;let r=X(o,"pic:spPr");return r?X(r,"a:xfrm"):null}function Cn(e){if(!e)return e;let t=e.replace(/^\/+/,"");return t.startsWith("media/")?t=`word/${t}`:t.startsWith("word/")||(t=`word/${t}`),t}function kn(e){let t=e.split(".").pop()?.toLowerCase()??"";return {png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",bmp:"image/bmp",tiff:"image/tiff",tif:"image/tiff",webp:"image/webp",svg:"image/svg+xml",emf:"image/x-emf",wmf:"image/x-wmf"}[t]??"application/octet-stream"}function at(e,t,n){if(!e||!t)return {};let o=t.get(e);if(!o)return {};let r=o.target;if(!r)return {};let i=Cn(r),a=r.split("/").pop(),c=(f,u)=>{let p=u.toLowerCase();for(let[m,h]of f.entries())if(m.toLowerCase()===p)return h};if(n){let f=c(n,i);if(f)return {src:f.dataUrl||f.base64,mimeType:f.mimeType,filename:a};let u=r.replace(/^\/+/,""),p=c(n,u);if(p)return {src:p.dataUrl||p.base64,mimeType:p.mimeType,filename:a};let m=`word/${u}`,h=c(n,m);if(h)return {src:h.dataUrl||h.base64,mimeType:h.mimeType,filename:a}}return {mimeType:kn(r),filename:a}}function Mn(e,t,n){let o=X(e,"wp:extent"),r=Qe(o),i=X(e,"wp:effectExtent"),a=et(i),c=X(e,"wp:docPr"),f=tt(c),u=ot(e),p=rt(u),m=at(p,t,n),h=it(e),T=nt(h),d=g(e,null,"distT")??void 0,w=g(e,null,"distB")??void 0,E=g(e,null,"distL")??void 0,k=g(e,null,"distR")??void 0,P={type:"inline"};d!==void 0&&(P.distT=d),w!==void 0&&(P.distB=w),E!==void 0&&(P.distL=E),k!==void 0&&(P.distR=k);let C={type:"image",rId:p,size:r,wrap:P};return f.id&&(C.id=f.id),f.alt&&(C.alt=f.alt),f.title&&(C.title=f.title),f.decorative&&(C.decorative=true),m.src&&(C.src=m.src),m.mimeType&&(C.mimeType=m.mimeType),m.filename&&(C.filename=m.filename),a&&(C.padding=a),T&&(C.transform=T),C}function vn(e,t,n){let o=X(e,"wp:extent"),r=Qe(o),i=X(e,"wp:effectExtent"),a=et(i),c=X(e,"wp:docPr"),f=tt(c),u=s(e,null,"behindDoc")==="1",p={distT:g(e,null,"distT")??void 0,distB:g(e,null,"distB")??void 0,distL:g(e,null,"distL")??void 0,distR:g(e,null,"distR")??void 0},m=yn(e,Fn),h=Sn(m,u,p),T=X(e,"wp:positionH"),d=X(e,"wp:positionV"),w=xn(T),E=Tn(d),k;(w||E)&&(k={horizontal:w??{relativeTo:"column"},vertical:E??{relativeTo:"paragraph"}});let P=ot(e),C=rt(P),b=at(C,t,n),x=it(e),S=nt(x),y={type:"image",rId:C,size:r,wrap:h};return f.id&&(y.id=f.id),f.alt&&(y.alt=f.alt),f.title&&(y.title=f.title),f.decorative&&(y.decorative=true),b.src&&(y.src=b.src),b.mimeType&&(y.mimeType=b.mimeType),b.filename&&(y.filename=b.filename),k&&(y.position=k),a&&(y.padding=a),S&&(y.transform=S),y}function Rn(e,t,n){let o=D(e);for(let r of o){let i=r.name||"";if(i==="wp:inline")return Mn(r,t,n);if(i==="wp:anchor")return vn(r,t,n)}return null}function st(e,t,n){return Rn(e,t,n)}function lt(e,t,n,o){let r={};return e&&e!=="auto"?r.rgb=e:e==="auto"&&(r.auto=true),t&&(r.themeColor=t),n&&(r.themeTint=n),o&&(r.themeShade=o),r}function En(e){if(!e)return;let t={},n=s(e,"w","color");n&&n!=="auto"&&(t.color={rgb:n});let o=s(e,"w","fill");o&&o!=="auto"&&(t.fill={rgb:o});let r=s(e,"w","themeFill");r&&(t.fill=t.fill||{},t.fill.themeColor=r);let i=s(e,"w","themeFillTint");i&&t.fill&&(t.fill.themeTint=i);let a=s(e,"w","themeFillShade");a&&t.fill&&(t.fill.themeShade=a);let c=s(e,"w","val");return c&&(t.pattern=c),Object.keys(t).length>0?t:void 0}function Me(e,t,n){if(!e)return;let o={},r=l(e,"w","b");r&&(o.bold=F(r));let i=l(e,"w","bCs");i&&(o.boldCs=F(i));let a=l(e,"w","i");a&&(o.italic=F(a));let c=l(e,"w","iCs");c&&(o.italicCs=F(c));let f=l(e,"w","u");if(f){let M=s(f,"w","val");if(M){o.underline={style:M};let L=s(f,"w","color"),$=s(f,"w","themeColor");(L||$)&&(o.underline.color=lt(L,$,s(f,"w","themeTint"),s(f,"w","themeShade")));}}let u=l(e,"w","strike");u&&(o.strike=F(u));let p=l(e,"w","dstrike");p&&(o.doubleStrike=F(p));let m=l(e,"w","vertAlign");if(m){let M=s(m,"w","val");(M==="superscript"||M==="subscript"||M==="baseline")&&(o.vertAlign=M);}let h=l(e,"w","smallCaps");h&&(o.smallCaps=F(h));let T=l(e,"w","caps");T&&(o.allCaps=F(T));let d=l(e,"w","vanish");d&&(o.hidden=F(d));let w=l(e,"w","color");w&&(o.color=lt(s(w,"w","val"),s(w,"w","themeColor"),s(w,"w","themeTint"),s(w,"w","themeShade")));let E=l(e,"w","highlight");if(E){let M=s(E,"w","val");M&&(o.highlight=M);}let k=l(e,"w","shd");k&&(o.shading=En(k));let P=l(e,"w","sz");if(P){let M=g(P,"w","val");M!==void 0&&(o.fontSize=M);}let C=l(e,"w","szCs");if(C){let M=g(C,"w","val");M!==void 0&&(o.fontSizeCs=M);}let b=l(e,"w","rFonts");if(b){o.fontFamily={ascii:s(b,"w","ascii")??void 0,hAnsi:s(b,"w","hAnsi")??void 0,eastAsia:s(b,"w","eastAsia")??void 0,cs:s(b,"w","cs")??void 0};let M=s(b,"w","asciiTheme");M&&(o.fontFamily.asciiTheme=M,t&&!o.fontFamily.ascii&&(o.fontFamily.ascii=_(t,M)));let L=s(b,"w","hAnsiTheme");L&&(o.fontFamily.hAnsiTheme=L,t&&!o.fontFamily.hAnsi&&(o.fontFamily.hAnsi=_(t,L)));let $=s(b,"w","eastAsiaTheme");$&&(o.fontFamily.eastAsiaTheme=$,t&&!o.fontFamily.eastAsia&&(o.fontFamily.eastAsia=_(t,$)));let we=s(b,"w","cstheme");we&&(o.fontFamily.csTheme=we,t&&!o.fontFamily.cs&&(o.fontFamily.cs=_(t,we)));}let x=l(e,"w","spacing");if(x){let M=g(x,"w","val");M!==void 0&&(o.spacing=M);}let S=l(e,"w","position");if(S){let M=g(S,"w","val");M!==void 0&&(o.position=M);}let y=l(e,"w","w");if(y){let M=g(y,"w","val");M!==void 0&&(o.scale=M);}let v=l(e,"w","kern");if(v){let M=g(v,"w","val");M!==void 0&&(o.kerning=M);}let B=l(e,"w","effect");if(B){let M=s(B,"w","val");M&&(o.effect=M);}let A=l(e,"w","em");if(A){let M=s(A,"w","val");M&&(o.emphasisMark=M);}let I=l(e,"w","emboss");I&&(o.emboss=F(I));let O=l(e,"w","imprint");O&&(o.imprint=F(O));let U=l(e,"w","outline");U&&(o.outline=F(U));let K=l(e,"w","shadow");K&&(o.shadow=F(K));let H=l(e,"w","rtl");H&&(o.rtl=F(H));let W=l(e,"w","cs");W&&(o.cs=F(W));let R=l(e,"w","rStyle");if(R){let M=s(R,"w","val");M&&(o.styleId=M);}return Object.keys(o).length>0?o:void 0}function Pn(e){let t=re(e),n=s(e,"xml","space")==="preserve";return {type:"text",text:t,preserveSpace:n||void 0}}function Bn(){return {type:"tab"}}function An(e){let t=s(e,"w","type"),n=s(e,"w","clear"),o={type:"break"};return (t==="page"||t==="column"||t==="textWrapping")&&(o.breakType=t),(n==="none"||n==="left"||n==="right"||n==="all")&&(o.clear=n),o}function Nn(e){let t=s(e,"w","font")??"",n=s(e,"w","char")??"";return {type:"symbol",font:t,char:n}}function In(e){return {type:"footnoteRef",id:g(e,"w","id")??0}}function Xn(e){return {type:"endnoteRef",id:g(e,"w","id")??0}}function Ln(e){let t=s(e,"w","fldCharType"),n=s(e,"w","fldLock")==="true"||s(e,"w","fldLock")==="1",o=s(e,"w","dirty")==="true"||s(e,"w","dirty")==="1",r="begin";return t==="separate"?r="separate":t==="end"&&(r="end"),{type:"fieldChar",charType:r,fldLock:n||void 0,dirty:o||void 0}}function Dn(e){return {type:"instrText",text:re(e)}}function Hn(e,t,n){let o=st(e,t??void 0,n??void 0);return o?{type:"drawing",image:o}:null}function On(e){if(!e)return "";let t=e.indexOf(":");return t>=0?e.substring(t+1):e}function Wn(e,t,n){let o=[],r=D(e);for(let i of r)switch(On(i.name)){case "t":o.push(Pn(i));break;case "tab":o.push(Bn());break;case "br":o.push(An(i));break;case "sym":o.push(Nn(i));break;case "footnoteReference":o.push(In(i));break;case "endnoteReference":o.push(Xn(i));break;case "fldChar":o.push(Ln(i));break;case "instrText":o.push(Dn(i));break;case "softHyphen":o.push({type:"softHyphen"});break;case "noBreakHyphen":o.push({type:"noBreakHyphen"});break;case "drawing":let c=Hn(i,t,n);c&&o.push(c);break;case "pict":case "object":break;case "rPr":break;case "lastRenderedPageBreak":break;case "cr":o.push({type:"break",breakType:"textWrapping"});break;}return o}function ee(e,t,n,o=null,r=null){let i={type:"run",content:[]},a=l(e,"w","rPr");return a&&(i.formatting=Me(a,n)),i.content=Wn(e,o,r),i}function jn(e){if(!e)return "";let t=e.indexOf(":");return t>=0?e.substring(t+1):e}function Vn(e){let t=g(e,"w","id")??0,n=s(e,"w","name")??"",o={type:"bookmarkStart",id:t,name:n},r=g(e,"w","colFirst");r!==void 0&&(o.colFirst=r);let i=g(e,"w","colLast");return i!==void 0&&(o.colLast=i),o}function zn(e){return {type:"bookmarkEnd",id:g(e,"w","id")??0}}function ct(e,t,n=null,o=null,r=null){let i={type:"hyperlink",children:[]},a=s(e,"r","id");if(a&&(i.rId=a,t)){let T=t.get(a);T&&(He(T),i.href=T.target);}let c=s(e,"w","anchor");c&&(i.anchor=c,i.href||(i.href=`#${c}`));let f=s(e,"w","tooltip");f&&(i.tooltip=f);let u=s(e,"w","tgtFrame");u&&(i.target=u);let p=s(e,"w","history");(p==="1"||p==="true")&&(i.history=true);let m=s(e,"w","docLocation");m&&(i.docLocation=m);let h=D(e);for(let T of h)switch(jn(T.name)){case "r":i.children.push(ee(T,n,o,t,r));break;case "bookmarkStart":i.children.push(Vn(T));break;case "bookmarkEnd":i.children.push(zn(T));break}return i}function ft(e){let t=g(e,"w","id")??0,n=s(e,"w","name")??"",o={type:"bookmarkStart",id:t,name:n},r=g(e,"w","colFirst");r!==void 0&&(o.colFirst=r);let i=g(e,"w","colLast");return i!==void 0&&(o.colLast=i),o}function ut(e){return {type:"bookmarkEnd",id:g(e,"w","id")??0}}function Un(e){if(!e)return;let t=g(e,"w","w")??0,n=s(e,"w","type")??"dxa",o="dxa";return (n==="auto"||n==="dxa"||n==="nil"||n==="pct")&&(o=n),{value:t,type:o}}function Y(e){return Un(e)}function J(e){if(!e)return;let o={style:s(e,"w","val")??"none"},r=g(e,"w","sz");r!==void 0&&(o.size=r);let i=g(e,"w","space");i!==void 0&&(o.space=i);let a=s(e,"w","color"),c=s(e,"w","themeColor"),f=s(e,"w","themeTint"),u=s(e,"w","themeShade");(a||c||f||u)&&(o.color={rgb:a??void 0,themeColor:c,themeTint:f??void 0,themeShade:u??void 0});let p=s(e,"w","shadow");(p==="1"||p==="true")&&(o.shadow=true);let m=s(e,"w","frame");return (m==="1"||m==="true")&&(o.frame=true),o}function dt(e){if(!e)return;let t={},n=J(l(e,"w","top"));n&&(t.top=n);let o=J(l(e,"w","bottom"));o&&(t.bottom=o);let r=J(l(e,"w","left")??l(e,"w","start"));r&&(t.left=r);let i=J(l(e,"w","right")??l(e,"w","end"));i&&(t.right=i);let a=J(l(e,"w","insideH"));a&&(t.insideH=a);let c=J(l(e,"w","insideV"));if(c&&(t.insideV=c),Object.keys(t).length!==0)return t}function pt(e){if(!e)return;let t={},n=Y(l(e,"w","top"));n&&(t.top=n);let o=Y(l(e,"w","bottom"));o&&(t.bottom=o);let r=Y(l(e,"w","left")??l(e,"w","start"));r&&(t.left=r);let i=Y(l(e,"w","right")??l(e,"w","end"));if(i&&(t.right=i),Object.keys(t).length!==0)return t}function mt(e){if(!e)return;let t={},n=s(e,"w","fill");n&&n!=="auto"&&(t.fill={rgb:n});let o=s(e,"w","themeFill");if(o){t.fill={themeColor:o};let a=s(e,"w","themeFillTint");a&&t.fill&&(t.fill.themeTint=a);let c=s(e,"w","themeFillShade");c&&t.fill&&(t.fill.themeShade=c);}let r=s(e,"w","color");r&&r!=="auto"&&(t.color={rgb:r});let i=s(e,"w","val");if(i&&(t.pattern=i),Object.keys(t).length!==0)return t}function $n(e){if(!e)return;let t={},n=s(e,"w","firstRow");(n==="1"||n==="true")&&(t.firstRow=true);let o=s(e,"w","lastRow");(o==="1"||o==="true")&&(t.lastRow=true);let r=s(e,"w","firstColumn");(r==="1"||r==="true")&&(t.firstColumn=true);let i=s(e,"w","lastColumn");(i==="1"||i==="true")&&(t.lastColumn=true);let a=s(e,"w","noHBand");(a==="1"||a==="true")&&(t.noHBand=true);let c=s(e,"w","noVBand");(c==="1"||c==="true")&&(t.noVBand=true);let f=s(e,"w","val");if(f){let u=parseInt(f,16);isNaN(u)||(u&32&&(t.firstRow=true),u&64&&(t.lastRow=true),u&128&&(t.firstColumn=true),u&256&&(t.lastColumn=true),u&512&&(t.noHBand=true),u&1024&&(t.noVBand=true));}if(Object.keys(t).length!==0)return t}function _n(e){if(!e)return;let t={},n=s(e,"w","horzAnchor");(n==="margin"||n==="page"||n==="text")&&(t.horzAnchor=n);let o=s(e,"w","vertAnchor");(o==="margin"||o==="page"||o==="text")&&(t.vertAnchor=o);let r=g(e,"w","tblpX");r!==void 0&&(t.tblpX=r);let i=s(e,"w","tblpXSpec");i&&(t.tblpXSpec=i);let a=g(e,"w","tblpY");a!==void 0&&(t.tblpY=a);let c=s(e,"w","tblpYSpec");c&&(t.tblpYSpec=c);let f=g(e,"w","topFromText");f!==void 0&&(t.topFromText=f);let u=g(e,"w","bottomFromText");u!==void 0&&(t.bottomFromText=u);let p=g(e,"w","leftFromText");p!==void 0&&(t.leftFromText=p);let m=g(e,"w","rightFromText");if(m!==void 0&&(t.rightFromText=m),Object.keys(t).length!==0)return t}function Gn(e){if(!e)return;let t={},n=Y(l(e,"w","tblW"));n&&(t.width=n);let o=l(e,"w","jc");if(o){let w=s(o,"w","val");(w==="left"||w==="center"||w==="right"||w==="start")&&(t.justification=w==="start"?"left":w);}let r=Y(l(e,"w","tblCellSpacing"));r&&(t.cellSpacing=r);let i=Y(l(e,"w","tblInd"));i&&(t.indent=i);let a=dt(l(e,"w","tblBorders"));a&&(t.borders=a);let c=pt(l(e,"w","tblCellMar"));c&&(t.cellMargins=c);let f=l(e,"w","tblLayout");if(f){let w=s(f,"w","type");(w==="fixed"||w==="autofit")&&(t.layout=w);}let u=l(e,"w","tblStyle");if(u){let w=s(u,"w","val");w&&(t.styleId=w);}let p=$n(l(e,"w","tblLook"));p&&(t.look=p);let m=mt(l(e,"w","shd"));m&&(t.shading=m);let h=l(e,"w","tblOverlap");if(h){let w=s(h,"w","val");(w==="never"||w==="overlap")&&(t.overlap=w);}let T=_n(l(e,"w","tblpPr"));if(T&&(t.floating=T),F(l(e,"w","bidiVisual"))&&(t.bidi=true),Object.keys(t).length!==0)return t}function qn(e){if(!e)return;let t={},n=l(e,"w","trHeight");if(n){let f=Y(n);f&&(t.height=f);let u=s(n,"w","hRule");(u==="auto"||u==="atLeast"||u==="exact")&&(t.heightRule=u);}F(l(e,"w","tblHeader"))&&(t.header=true),F(l(e,"w","cantSplit"))&&(t.cantSplit=true);let i=l(e,"w","jc");if(i){let f=s(i,"w","val");(f==="left"||f==="center"||f==="right")&&(t.justification=f);}F(l(e,"w","hidden"))&&(t.hidden=true);let c=gt(l(e,"w","cnfStyle"));if(c&&(t.conditionalFormat=c),Object.keys(t).length!==0)return t}function gt(e){if(!e)return;let t={},n=s(e,"w","firstRow");(n==="1"||n==="true")&&(t.firstRow=true);let o=s(e,"w","lastRow");(o==="1"||o==="true")&&(t.lastRow=true);let r=s(e,"w","firstColumn");(r==="1"||r==="true")&&(t.firstColumn=true);let i=s(e,"w","lastColumn");(i==="1"||i==="true")&&(t.lastColumn=true);let a=s(e,"w","oddHBand");(a==="1"||a==="true")&&(t.oddHBand=true);let c=s(e,"w","evenHBand");(c==="1"||c==="true")&&(t.evenHBand=true);let f=s(e,"w","oddVBand");(f==="1"||f==="true")&&(t.oddVBand=true);let u=s(e,"w","evenVBand");(u==="1"||u==="true")&&(t.evenVBand=true);let p=s(e,"w","firstRowFirstColumn");(p==="1"||p==="true")&&(t.nwCell=true);let m=s(e,"w","firstRowLastColumn");(m==="1"||m==="true")&&(t.neCell=true);let h=s(e,"w","lastRowFirstColumn");(h==="1"||h==="true")&&(t.swCell=true);let T=s(e,"w","lastRowLastColumn");(T==="1"||T==="true")&&(t.seCell=true);let d=s(e,"w","val");if(d&&d.length===12&&(d[0]==="1"&&(t.firstRow=true),d[1]==="1"&&(t.lastRow=true),d[2]==="1"&&(t.firstColumn=true),d[3]==="1"&&(t.lastColumn=true),d[4]==="1"&&(t.oddVBand=true),d[5]==="1"&&(t.evenVBand=true),d[6]==="1"&&(t.oddHBand=true),d[7]==="1"&&(t.evenHBand=true),d[8]==="1"&&(t.nwCell=true),d[9]==="1"&&(t.neCell=true),d[10]==="1"&&(t.swCell=true),d[11]==="1"&&(t.seCell=true)),Object.keys(t).length!==0)return t}function Zn(e){if(!e)return;let t={},n=Y(l(e,"w","tcW"));n&&(t.width=n);let o=dt(l(e,"w","tcBorders"));o&&(t.borders=o);let r=pt(l(e,"w","tcMar"));r&&(t.margins=r);let i=mt(l(e,"w","shd"));i&&(t.shading=i);let a=l(e,"w","vAlign");if(a){let d=s(a,"w","val");(d==="top"||d==="center"||d==="bottom")&&(t.verticalAlign=d);}let c=l(e,"w","textDirection");if(c){let d=s(c,"w","val");d&&(t.textDirection=d);}let f=l(e,"w","gridSpan");if(f){let d=g(f,"w","val");d!==void 0&&d>1&&(t.gridSpan=d);}let u=l(e,"w","vMerge");u&&(s(u,"w","val")==="restart"?t.vMerge="restart":t.vMerge="continue"),F(l(e,"w","tcFitText"))&&(t.fitText=true),F(l(e,"w","noWrap"))&&(t.noWrap=true),F(l(e,"w","hideMark"))&&(t.hideMark=true);let T=gt(l(e,"w","cnfStyle"));if(T&&(t.conditionalFormat=T),Object.keys(t).length!==0)return t}function Yn(e,t,n,o,r,i){let a=[],c=e.elements||[];for(let f of c){if(!f.name)continue;let u=f.name.split(":").pop();if(u==="p"){let p=z(f,t,n,o,r,i);a.push(p);}else if(u==="tbl"){let p=te(f,t,n,o,r,i);a.push(p);}}return a.length===0&&a.push({type:"paragraph",content:[]}),a}function Kn(e,t,n,o,r,i){let a={type:"tableCell",content:[]},c=Zn(l(e,"w","tcPr"));return c&&(a.formatting=c),a.content=Yn(e,t,n,o,r,i),a}function Jn(e,t,n,o,r,i){let a={type:"tableRow",cells:[]},c=qn(l(e,"w","trPr"));c&&(a.formatting=c);let f=N(e,"w","tc");for(let u of f){let p=Kn(u,t,n,o,r,i);a.cells.push(p);}return a}function Qn(e){if(!e)return;let t=[],n=N(e,"w","gridCol");for(let o of n){let r=g(o,"w","w")??0;t.push(r);}return t.length>0?t:void 0}function te(e,t,n,o,r,i){let a={type:"table",rows:[]},c=Gn(l(e,"w","tblPr"));c&&(a.formatting=c);let f=Qn(l(e,"w","tblGrid"));f&&(a.columnWidths=f);let u=N(e,"w","tr");for(let p of u){let m=Jn(p,t,n,o,r,i);a.rows.push(m);}return a}function ht(e){switch(e){case "first":return "first";case "even":return "even";default:return "default"}}function wt(e){let t=s(e,"w","type"),n=s(e,"r","id")??"";return {type:ht(t),rId:n}}function bt(e){let t=s(e,"w","type"),n=s(e,"r","id")??"";return {type:ht(t),rId:n}}function ve(e,t,n,o,r,i){let a=[],c=e.elements??[];for(let f of c){if(f.type!=="element")continue;let u=f.name??"";if(u==="w:p"||u.endsWith(":p")){let p=z(f,t,n,o,r,i);a.push(p);}else if(u==="w:tbl"||u.endsWith(":tbl")){let p=te(f,t,n,o,r,i);a.push(p);}else if(u==="w:sdt"||u.endsWith(":sdt")){let p=(f.elements??[]).find(m=>m.type==="element"&&(m.name==="w:sdtContent"||m.name?.endsWith(":sdtContent")));if(p){let m=ve(p,t,n,o,r,i);a.push(...m);}}}return a}function yt(e,t="default",n=null,o=null,r=null,i=null,a=null){let c={type:"header",hdrFtrType:t,content:[]};if(!e)return c;let f=j(e);if(!f)return c;let u=f.elements?.find(p=>p.type==="element"&&(p.name==="w:hdr"||p.name?.endsWith(":hdr")));return u&&(c.content=ve(u,n,o,r,i,a)),c}function xt(e,t="default",n=null,o=null,r=null,i=null,a=null){let c={type:"footer",hdrFtrType:t,content:[]};if(!e)return c;let f=j(e);if(!f)return c;let u=f.elements?.find(p=>p.type==="element"&&(p.name==="w:ftr"||p.name?.endsWith(":ftr")));return u&&(c.content=ve(u,n,o,r,i,a)),c}function Tt(e){switch(e){case "separator":return "separator";case "continuationSeparator":return "continuationSeparator";case "continuationNotice":return "continuationNotice";default:return "normal"}}function eo(e,t,n,o,r,i){let a=g(e,"w","id")??0,c=s(e,"w","type"),f=Tt(c),p=N(e,"w","p").map(m=>z(m,t,n,o,r));return {type:"footnote",id:a,noteType:f,content:p}}function Ft(e,t=null,n=null,o=null,r=null,i=null){let a=new Map,c=[];if(!e)return fe(a,c);let f=j(e);if(!f)return fe(a,c);let u=f.elements?.find(m=>m.type==="element"&&(m.name==="w:footnotes"||m.name?.endsWith(":footnotes")));if(!u)return fe(a,c);let p=N(u,"w","footnote");for(let m of p){let h=eo(m,t,n,o,r);a.set(h.id,h),c.push(h);}return fe(a,c)}function fe(e,t){return {byId:e,footnotes:t,getFootnote(n){return e.get(n)},hasFootnote(n){return e.has(n)},getNormalFootnotes(){return t.filter(n=>n.noteType==="normal")},getSeparator(){return t.find(n=>n.noteType==="separator")},getContinuationSeparator(){return t.find(n=>n.noteType==="continuationSeparator")}}}function to(e,t,n,o,r,i){let a=g(e,"w","id")??0,c=s(e,"w","type"),f=Tt(c),p=N(e,"w","p").map(m=>z(m,t,n,o,r));return {type:"endnote",id:a,noteType:f,content:p}}function St(e,t=null,n=null,o=null,r=null,i=null){let a=new Map,c=[];if(!e)return ue(a,c);let f=j(e);if(!f)return ue(a,c);let u=f.elements?.find(m=>m.type==="element"&&(m.name==="w:endnotes"||m.name?.endsWith(":endnotes")));if(!u)return ue(a,c);let p=N(u,"w","endnote");for(let m of p){let h=to(m,t,n,o,r);a.set(h.id,h),c.push(h);}return ue(a,c)}function ue(e,t){return {byId:e,endnotes:t,getEndnote(n){return e.get(n)},hasEndnote(n){return e.has(n)},getNormalEndnotes(){return t.filter(n=>n.noteType==="normal")},getSeparator(){return t.find(n=>n.noteType==="separator")},getContinuationSeparator(){return t.find(n=>n.noteType==="continuationSeparator")}}}function Ct(e){return e?{decimal:"decimal",upperRoman:"upperRoman",lowerRoman:"lowerRoman",upperLetter:"upperLetter",lowerLetter:"lowerLetter",ordinal:"ordinal",cardinalText:"cardinalText",ordinalText:"ordinalText",bullet:"bullet",chicago:"chicago",none:"none"}[e]:void 0}function no(e){switch(e){case "pageBottom":return "pageBottom";case "beneathText":return "beneathText";case "sectEnd":return "sectEnd";case "docEnd":return "docEnd";default:return}}function oo(e){switch(e){case "sectEnd":return "sectEnd";case "docEnd":return "docEnd";default:return}}function kt(e){switch(e){case "continuous":return "continuous";case "eachSect":return "eachSect";case "eachPage":return "eachPage";default:return}}function Mt(e){let t={};if(!e)return t;let n=l(e,"w","pos");if(n){let a=s(n,"w","val");t.position=no(a);}let o=l(e,"w","numFmt");if(o){let a=s(o,"w","val");t.numFmt=Ct(a);}let r=l(e,"w","numStart");r&&(t.numStart=g(r,"w","val")??void 0);let i=l(e,"w","numRestart");if(i){let a=s(i,"w","val");t.numRestart=kt(a);}return t}function vt(e){let t={};if(!e)return t;let n=l(e,"w","pos");if(n){let a=s(n,"w","val");t.position=oo(a);}let o=l(e,"w","numFmt");if(o){let a=s(o,"w","val");t.numFmt=Ct(a);}let r=l(e,"w","numStart");r&&(t.numStart=g(r,"w","val")??void 0);let i=l(e,"w","numRestart");if(i){let a=s(i,"w","val");t.numRestart=kt(a);}return t}function vr(e){let t=[];for(let n of e.content){let o=[];for(let r of n.content)if(r.type==="run")for(let i of r.content)i.type==="text"&&o.push(i.text);t.push(o.join(""));}return t.join(`
|
|
10
|
+
`)}function ro(e,t,n,o){if(!e&&!t)return;let r={};return e&&e!=="auto"?r.rgb=e:e==="auto"&&(r.auto=true),t&&(r.themeColor=t),n&&(r.themeTint=n),o&&(r.themeShade=o),Object.keys(r).length>0?r:void 0}function de(e){if(!e)return;let o={style:s(e,"w","val")??"none"},r=g(e,"w","sz");r!==void 0&&(o.size=r);let i=g(e,"w","space");i!==void 0&&(o.space=i);let a=s(e,"w","color"),c=s(e,"w","themeColor"),f=s(e,"w","themeTint"),u=s(e,"w","themeShade"),p=ro(a,c,f,u);p&&(o.color=p);let m=s(e,"w","shadow");(m==="1"||m==="true")&&(o.shadow=true);let h=s(e,"w","frame");return (h==="1"||h==="true")&&(o.frame=true),o}function io(e){switch(e){case "landscape":return "landscape";case "portrait":return "portrait";default:return}}function ao(e){switch(e){case "continuous":return "continuous";case "nextPage":return "nextPage";case "oddPage":return "oddPage";case "evenPage":return "evenPage";case "nextColumn":return "nextColumn";default:return}}function so(e){switch(e){case "top":return "top";case "center":return "center";case "both":return "both";case "bottom":return "bottom";default:return}}function lo(e){switch(e){case "continuous":return "continuous";case "newPage":return "newPage";case "newSection":return "newSection";default:return}}function pe(e,t){let n={};if(!e)return n;let o=l(e,"w","pgSz");if(o){let b=g(o,"w","w");b!==void 0&&(n.pageWidth=b);let x=g(o,"w","h");x!==void 0&&(n.pageHeight=x);let S=s(o,"w","orient"),y=io(S);y&&(n.orientation=y);}let r=l(e,"w","pgMar");if(r){let b=g(r,"w","top");b!==void 0&&(n.marginTop=b);let x=g(r,"w","bottom");x!==void 0&&(n.marginBottom=x);let S=g(r,"w","left");S!==void 0&&(n.marginLeft=S);let y=g(r,"w","right");y!==void 0&&(n.marginRight=y);let v=g(r,"w","header");v!==void 0&&(n.headerDistance=v);let B=g(r,"w","footer");B!==void 0&&(n.footerDistance=B);let A=g(r,"w","gutter");A!==void 0&&(n.gutter=A);}let i=l(e,"w","cols");if(i){let b=g(i,"w","num");b!==void 0&&(n.columnCount=b);let x=g(i,"w","space");x!==void 0&&(n.columnSpace=x);let S=s(i,"w","equalWidth");S==="1"||S==="true"?n.equalWidth=true:(S==="0"||S==="false")&&(n.equalWidth=false);let y=s(i,"w","sep");(y==="1"||y==="true")&&(n.separator=true);let v=N(i,"w","col");if(v.length>0){n.columns=[];for(let B of v){let A={},I=g(B,"w","w");I!==void 0&&(A.width=I);let O=g(B,"w","space");O!==void 0&&(A.space=O),n.columns.push(A);}}}let a=l(e,"w","type");if(a){let b=s(a,"w","val"),x=ao(b);x&&(n.sectionStart=x);}let c=l(e,"w","vAlign");if(c){let b=s(c,"w","val"),x=so(b);x&&(n.verticalAlign=x);}let f=l(e,"w","bidi");f&&(n.bidi=F(f));let u=N(e,"w","headerReference");u.length>0&&(n.headerReferences=u.map(b=>wt(b)));let p=N(e,"w","footerReference");p.length>0&&(n.footerReferences=p.map(b=>bt(b)));let m=l(e,"w","titlePg");m&&(n.titlePg=F(m));let h=l(e,"w","evenAndOddHeaders");h&&(n.evenAndOddHeaders=F(h));let T=l(e,"w","lnNumType");if(T){n.lineNumbers={};let b=g(T,"w","start");b!==void 0&&(n.lineNumbers.start=b);let x=g(T,"w","countBy");x!==void 0&&(n.lineNumbers.countBy=x);let S=g(T,"w","distance");S!==void 0&&(n.lineNumbers.distance=S);let y=s(T,"w","restart"),v=lo(y);v&&(n.lineNumbers.restart=v);}let d=l(e,"w","pgBorders");if(d){n.pageBorders={};let b=de(l(d,"w","top"));b&&(n.pageBorders.top=b);let x=de(l(d,"w","bottom"));x&&(n.pageBorders.bottom=x);let S=de(l(d,"w","left"));S&&(n.pageBorders.left=S);let y=de(l(d,"w","right"));y&&(n.pageBorders.right=y);let v=s(d,"w","display");(v==="allPages"||v==="firstPage"||v==="notFirstPage")&&(n.pageBorders.display=v);let B=s(d,"w","offsetFrom");(B==="page"||B==="text")&&(n.pageBorders.offsetFrom=B);let A=s(d,"w","zOrder");(A==="front"||A==="back")&&(n.pageBorders.zOrder=A);}let w=l(e,"w","background");if(w){n.background={};let b=s(w,"w","color");b&&b!=="auto"&&(n.background.color={rgb:b});let x=s(w,"w","themeColor");x&&(n.background.themeColor=x);let S=s(w,"w","themeTint");S&&(n.background.themeTint=S);let y=s(w,"w","themeShade");y&&(n.background.themeShade=y);}let E=l(e,"w","footnotePr");if(E){let b=Mt(E);Object.keys(b).length>0&&(n.footnotePr=b);}let k=l(e,"w","endnotePr");if(k){let b=vt(k);Object.keys(b).length>0&&(n.endnotePr=b);}let P=l(e,"w","docGrid");if(P){n.docGrid={};let b=s(P,"w","type");(b==="default"||b==="lines"||b==="linesAndChars"||b==="snapToChars")&&(n.docGrid.type=b);let x=g(P,"w","linePitch");x!==void 0&&(n.docGrid.linePitch=x);let S=g(P,"w","charSpace");S!==void 0&&(n.docGrid.charSpace=S);}let C=l(e,"w","paperSrc");if(C){let b=g(C,"w","first");b!==void 0&&(n.paperSrcFirst=b);let x=g(C,"w","other");x!==void 0&&(n.paperSrcOther=x);}return n}function Rt(){return {pageWidth:12240,pageHeight:15840,orientation:"portrait",marginTop:1440,marginBottom:1440,marginLeft:1440,marginRight:1440,headerDistance:720,footerDistance:720,gutter:0,columnCount:1,columnSpace:720,equalWidth:true,sectionStart:"nextPage",verticalAlign:"top"}}function co(e,t){return !e&&!t?true:!(!e||!t||e.bold!==t.bold||e.boldCs!==t.boldCs||e.italic!==t.italic||e.italicCs!==t.italicCs||e.strike!==t.strike||e.doubleStrike!==t.doubleStrike||e.smallCaps!==t.smallCaps||e.allCaps!==t.allCaps||e.hidden!==t.hidden||e.emboss!==t.emboss||e.imprint!==t.imprint||e.outline!==t.outline||e.shadow!==t.shadow||e.rtl!==t.rtl||e.cs!==t.cs||e.fontSize!==t.fontSize||e.fontSizeCs!==t.fontSizeCs||e.spacing!==t.spacing||e.position!==t.position||e.scale!==t.scale||e.kerning!==t.kerning||e.vertAlign!==t.vertAlign||e.highlight!==t.highlight||e.effect!==t.effect||e.emphasisMark!==t.emphasisMark||e.styleId!==t.styleId||!fo(e.underline,t.underline)||!me(e.color,t.color)||!uo(e.shading,t.shading)||!po(e.fontFamily,t.fontFamily))}function fo(e,t){return !e&&!t?true:!e||!t||e.style!==t.style?false:me(e.color,t.color)}function me(e,t){return !e&&!t?true:!e||!t?false:e.rgb===t.rgb&&e.auto===t.auto&&e.themeColor===t.themeColor&&e.themeTint===t.themeTint&&e.themeShade===t.themeShade}function uo(e,t){return !e&&!t?true:!(!e||!t||e.pattern!==t.pattern||!me(e.color,t.color)||!me(e.fill,t.fill))}function po(e,t){return !e&&!t?true:!e||!t?false:e.ascii===t.ascii&&e.hAnsi===t.hAnsi&&e.eastAsia===t.eastAsia&&e.cs===t.cs&&e.asciiTheme===t.asciiTheme&&e.hAnsiTheme===t.hAnsiTheme&&e.eastAsiaTheme===t.eastAsiaTheme&&e.csTheme===t.csTheme}function mo(e){return e.type==="text"||e.type==="softHyphen"||e.type==="noBreakHyphen"}function Et(e){return e.content.length===0?true:e.content.every(mo)}function go(e,t){let n=[];for(let o of e)n.push(o);if(n.length>0&&t.length>0&&n[n.length-1].type==="text"&&t[0].type==="text"){let o=n[n.length-1],r=t[0];n[n.length-1]={type:"text",text:o.text+r.text,preserveSpace:o.preserveSpace||r.preserveSpace||void 0};for(let i=1;i<t.length;i++)n.push(t[i]);}else for(let o of t)n.push(o);return n}function ho(e){if(e.length<=1)return e;let t=[],n=null;for(let o of e)if(o.content.length!==0){if(n===null){n={...o,content:[...o.content]};continue}Et(n)&&Et(o)&&co(n.formatting,o.formatting)?n={type:"run",formatting:n.formatting,content:go(n.content,o.content)}:(t.push(n),n={...o,content:[...o.content]});}return n!==null&&t.push(n),t}function Re(e){if(e.length<=1)return e;let t=[],n=[];function o(){if(n.length>0){let r=ho(n);t.push(...r),n.length=0;}}for(let r of e)if(r.type==="run")n.push(r);else if(o(),r.type==="hyperlink"){let i={...r,children:Re(r.children)};t.push(i);}else t.push(r);return o(),t}function wo(e){let t={sdtType:"richText"};if(!e||!e.elements)return t;for(let n of e.elements){if(n.type!=="element")continue;switch(n.name?.replace(/^w:/,"")??""){case "alias":t.alias=s(n,"w","val")??void 0;break;case "tag":t.tag=s(n,"w","val")??void 0;break;case "lock":t.lock=s(n,"w","val")??"unlocked";break;case "placeholder":{let r=l(n,"w","docPart");if(r){let i=l(r,"w","val");t.placeholder=i?s(i,"w","val")??void 0:void 0;}break}case "showingPlcHdr":t.showingPlaceholder=true;break;case "text":t.sdtType="plainText";break;case "date":t.sdtType="date",t.dateFormat=s(n,"w","fullDate")??void 0;break;case "dropDownList":t.sdtType="dropdown",t.listItems=Pt(n);break;case "comboBox":t.sdtType="comboBox",t.listItems=Pt(n);break;case "checkbox":{t.sdtType="checkbox";let r=l(n,"w14","checked")??l(n,"w","checked");t.checked=r?s(r,"w14","val")==="1"||s(r,"w","val")==="1":false;break}case "picture":t.sdtType="picture";break;case "docPartObj":t.sdtType="buildingBlockGallery";break;case "group":t.sdtType="group";break}}return t}function Pt(e){let t=[];for(let n of e.elements??[])n.type==="element"&&(n.name==="w:listItem"||n.name?.endsWith(":listItem"))&&t.push({displayText:s(n,"w","displayText")??"",value:s(n,"w","value")??""});return t}function Bt(e){let t="";if(e.type==="text"&&typeof e.text=="string")return e.text;if(e.elements)for(let n of e.elements)if((n.name?.replace(/^.*:/,"")??"")==="t"&&n.elements)for(let r of n.elements)r.type==="text"&&typeof r.text=="string"&&(t+=r.text);else t+=Bt(n);return t}function bo(e,t,n,o){let r={};return e&&e!=="auto"?r.rgb=e:e==="auto"&&(r.auto=true),t&&(r.themeColor=t),n&&(r.themeTint=n),o&&(r.themeShade=o),r}function yo(e){if(!e)return;let t={},n=s(e,"w","color");n&&n!=="auto"&&(t.color={rgb:n});let o=s(e,"w","fill");o&&o!=="auto"&&(t.fill={rgb:o});let r=s(e,"w","themeFill");r&&(t.fill=t.fill||{},t.fill.themeColor=r);let i=s(e,"w","themeFillTint");i&&t.fill&&(t.fill.themeTint=i);let a=s(e,"w","themeFillShade");a&&t.fill&&(t.fill.themeShade=a);let c=s(e,"w","val");return c&&(t.pattern=c),Object.keys(t).length>0?t:void 0}function Q(e){if(!e)return;let t=s(e,"w","val");if(!t)return;let n={style:t},o=s(e,"w","color"),r=s(e,"w","themeColor");(o||r)&&(n.color=bo(o,r,s(e,"w","themeTint"),s(e,"w","themeShade")));let i=g(e,"w","sz");i!==void 0&&(n.size=i);let a=g(e,"w","space");a!==void 0&&(n.space=a);let c=s(e,"w","shadow");c&&(n.shadow=c==="1"||c==="true");let f=s(e,"w","frame");return f&&(n.frame=f==="1"||f==="true"),n}function xo(e){if(!e)return;let t=N(e,"w","tab");if(t.length===0)return;let n=[];for(let o of t){let r=g(o,"w","pos"),i=s(o,"w","val");if(r!==void 0&&i){let a={position:r,alignment:i},c=s(o,"w","leader");c&&(a.leader=c),n.push(a);}}return n.length>0?n:void 0}function To(e){if(!e)return;let t={},n=g(e,"w","w");n!==void 0&&(t.width=n);let o=g(e,"w","h");o!==void 0&&(t.height=o);let r=s(e,"w","hAnchor");(r==="text"||r==="margin"||r==="page")&&(t.hAnchor=r);let i=s(e,"w","vAnchor");(i==="text"||i==="margin"||i==="page")&&(t.vAnchor=i);let a=g(e,"w","x");a!==void 0&&(t.x=a);let c=g(e,"w","y");c!==void 0&&(t.y=c);let f=s(e,"w","xAlign");f&&(t.xAlign=f);let u=s(e,"w","yAlign");u&&(t.yAlign=u);let p=s(e,"w","wrap");return p&&(t.wrap=p),Object.keys(t).length>0?t:void 0}function Fo(e,t,n){if(!e)return;let o={},r=l(e,"w","jc");if(r){let y=s(r,"w","val");y&&(o.alignment=y);}let i=l(e,"w","bidi");i&&(o.bidi=F(i));let a=l(e,"w","spacing");if(a){let y=g(a,"w","before");y!==void 0&&(o.spaceBefore=y);let v=g(a,"w","after");v!==void 0&&(o.spaceAfter=v);let B=g(a,"w","line");B!==void 0&&(o.lineSpacing=B);let A=s(a,"w","lineRule");A&&(o.lineSpacingRule=A);let I=s(a,"w","beforeAutospacing");I&&(o.beforeAutospacing=I==="1"||I==="true");let O=s(a,"w","afterAutospacing");O&&(o.afterAutospacing=O==="1"||O==="true");}let c=l(e,"w","ind");if(c){let y=g(c,"w","left");y!==void 0&&(o.indentLeft=y);let v=g(c,"w","right");v!==void 0&&(o.indentRight=v);let B=g(c,"w","firstLine");B!==void 0&&(o.indentFirstLine=B);let A=g(c,"w","hanging");A!==void 0&&(o.indentFirstLine=-A,o.hangingIndent=true);let I=g(c,"w","start");I!==void 0&&o.indentLeft===void 0&&(o.indentLeft=I);let O=g(c,"w","end");O!==void 0&&o.indentRight===void 0&&(o.indentRight=O);}let f=l(e,"w","pBdr");if(f){let y={},v=Q(l(f,"w","top"));v&&(y.top=v);let B=Q(l(f,"w","bottom"));B&&(y.bottom=B);let A=Q(l(f,"w","left"));A&&(y.left=A);let I=Q(l(f,"w","right"));I&&(y.right=I);let O=Q(l(f,"w","between"));O&&(y.between=O);let U=Q(l(f,"w","bar"));U&&(y.bar=U),Object.keys(y).length>0&&(o.borders=y);}let u=l(e,"w","shd");u&&(o.shading=yo(u));let p=l(e,"w","tabs");p&&(o.tabs=xo(p));let m=l(e,"w","keepNext");m&&(o.keepNext=F(m));let h=l(e,"w","keepLines");h&&(o.keepLines=F(h));let T=l(e,"w","widowControl");T&&(o.widowControl=F(T));let d=l(e,"w","pageBreakBefore");d&&(o.pageBreakBefore=F(d));let w=l(e,"w","contextualSpacing");w&&(o.contextualSpacing=F(w));let E=l(e,"w","numPr");if(E){let y=l(E,"w","numId"),v=l(E,"w","ilvl");if(y||v){if(o.numPr={},y){let B=g(y,"w","val");B!==void 0&&(o.numPr.numId=B);}if(v){let B=g(v,"w","val");B!==void 0&&(o.numPr.ilvl=B);}}}let k=l(e,"w","outlineLvl");if(k){let y=g(k,"w","val");y!==void 0&&(o.outlineLevel=y);}let P=l(e,"w","pStyle");if(P){let y=s(P,"w","val");y&&(o.styleId=y);}let C=l(e,"w","framePr");C&&(o.frame=To(C));let b=l(e,"w","suppressLineNumbers");b&&(o.suppressLineNumbers=F(b));let x=l(e,"w","suppressAutoHyphens");x&&(o.suppressAutoHyphens=F(x));let S=l(e,"w","rPr");return S&&(o.runProperties=Me(S,t)),Object.keys(o).length>0?o:void 0}function At(e){if(!e)return "";let t=e.indexOf(":");return t>=0?e.substring(t+1):e}function So(e,t,n,o,r){return ct(e,t,n,o,r)}function Co(e){return ft(e)}function ko(e){return ut(e)}function Nt(e){let t=e.trim().match(/^\\?([A-Z]+)/i);if(!t)return "UNKNOWN";let n=t[1].toUpperCase();return ["PAGE","NUMPAGES","NUMWORDS","NUMCHARS","DATE","TIME","CREATEDATE","SAVEDATE","PRINTDATE","AUTHOR","TITLE","SUBJECT","KEYWORDS","COMMENTS","FILENAME","FILESIZE","TEMPLATE","DOCPROPERTY","DOCVARIABLE","REF","PAGEREF","NOTEREF","HYPERLINK","TOC","TOA","INDEX","SEQ","STYLEREF","AUTONUM","AUTONUMLGL","AUTONUMOUT","IF","MERGEFIELD","NEXT","NEXTIF","ASK","SET","QUOTE","INCLUDETEXT","INCLUDEPICTURE","SYMBOL","ADVANCE","EDITTIME","REVNUM","SECTION","SECTIONPAGES","USERADDRESS","USERNAME","USERINITIALS"].includes(n)?n:"UNKNOWN"}function Mo(e,t,n,o,r){let i=s(e,"w","instr")??"",a=Nt(i),c={type:"simpleField",instruction:i,fieldType:a,content:[]},f=s(e,"w","fldLock");(f==="1"||f==="true")&&(c.fldLock=true);let u=s(e,"w","dirty");(u==="1"||u==="true")&&(c.dirty=true);let p=D(e);for(let m of p)At(m.name)==="r"&&c.content.push(ee(m,t,n,o,r));return c}function ge(e,t,n,o,r,i){let a=[],c=D(e),f=false,u="",p=[],m=[],h=false,T=false,d=false;for(let w of c){let E=At(w.name);switch(E){case "r":{let k=ee(w,t,n,r,i),P=false,C=false,b=false,x="";for(let S of k.content)S.type==="fieldChar"?S.charType==="begin"?(P=true,S.fldLock&&(T=true),S.dirty&&(d=true)):S.charType==="separate"?C=true:S.charType==="end"&&(b=true):S.type==="instrText"&&(x+=S.text);if(P&&(f=true,h=false,u="",p=[],m=[],T=false,d=false),f){if(x&&(u+=x),C&&(h=true),h&&!b?C||m.push(k):!h&&!P&&p.push(k),b){let S={type:"complexField",instruction:u.trim(),fieldType:Nt(u),fieldCode:p,fieldResult:m};T&&(S.fldLock=true),d&&(S.dirty=true),a.push(S),f=false;}}else a.push(k);break}case "hyperlink":a.push(So(w,r,t,n,i));break;case "bookmarkStart":a.push(Co(w));break;case "bookmarkEnd":a.push(ko(w));break;case "fldSimple":a.push(Mo(w,t,n,r,i));break;case "pPr":break;case "proofErr":case "permStart":case "permEnd":case "customXml":break;case "sdt":{let k=(w.elements??[]).find(C=>C.type==="element"&&(C.name==="w:sdtPr"||C.name?.endsWith(":sdtPr"))),P=(w.elements??[]).find(C=>C.type==="element"&&(C.name==="w:sdtContent"||C.name?.endsWith(":sdtContent")));if(P){let C=ge(P,t,n,null,r,i),x={type:"inlineSdt",properties:wo(k??null),content:C.filter(S=>S.type==="run"||S.type==="hyperlink")};a.push(x);}break}case "ins":{let k={id:parseInt(s(w,"w","id")??"0",10),author:s(w,"w","author")??"Unknown",date:s(w,"w","date")??void 0},P=ge(w,t,n,null,r,i),C={type:"insertion",info:k,content:P.filter(b=>b.type==="run"||b.type==="hyperlink")};a.push(C);break}case "del":{let k={id:parseInt(s(w,"w","id")??"0",10),author:s(w,"w","author")??"Unknown",date:s(w,"w","date")??void 0},P=ge(w,t,n,null,r,i),C={type:"deletion",info:k,content:P.filter(b=>b.type==="run"||b.type==="hyperlink")};a.push(C);break}case "smartTag":case "moveTo":case "moveFrom":break;case "commentRangeStart":{let k=parseInt(s(w,"w","id")??"0",10);a.push({type:"commentRangeStart",id:k});break}case "commentRangeEnd":{let k=parseInt(s(w,"w","id")??"0",10);a.push({type:"commentRangeEnd",id:k});break}case "oMath":case "oMathPara":{let k=E==="oMathPara",P=De(w),C=Bt(w),b={type:"mathEquation",display:k?"block":"inline",ommlXml:P,plainText:C||void 0};a.push(b);break}}}return a}function z(e,t,n,o,r=null,i=null){let a={type:"paragraph",content:[]},c=s(e,"w14","paraId")??s(e,"w","paraId");c&&(a.paraId=c);let f=s(e,"w14","textId")??s(e,"w","textId");f&&(a.textId=f);let u=l(e,"w","pPr");if(u){a.formatting=Fo(u,n);let h=l(u,"w","sectPr");h&&(a.sectionProperties=pe(h));}let p=ge(e,t,n,o,r,i);a.content=Re(p);let m=a.formatting?.numPr;if(!m&&a.formatting?.styleId&&t){let h=t.get(a.formatting.styleId);h?.pPr?.numPr&&(m=h.pPr.numPr,a.formatting||(a.formatting={}),a.formatting.numPr=m);}if(m&&o){let{numId:h,ilvl:T=0}=m;if(h!==void 0&&h!==0){let d=o.getLevel(h,T);if(d&&(a.listRendering={level:T,numId:h,marker:d.lvlText,isBullet:d.numFmt==="bullet",numFmt:d.numFmt},d.pPr)){a.formatting||(a.formatting={});let w=u?l(u,"w","ind"):null,E=w!=null&&(s(w,"w","left")!==null||s(w,"w","start")!==null),k=w!=null&&(s(w,"w","firstLine")!==null||s(w,"w","hanging")!==null);!E&&d.pPr.indentLeft!==void 0&&(a.formatting.indentLeft=d.pPr.indentLeft),k||(d.pPr.indentFirstLine!==void 0&&(a.formatting.indentFirstLine=d.pPr.indentFirstLine),d.pPr.hangingIndent!==void 0&&(a.formatting.hangingIndent=d.pPr.hangingIndent));}}}return a}function Ee(e){let t="";for(let n of e.content)if(n.type==="run")for(let o of n.content)o.type==="text"?t+=o.text:o.type==="tab"?t+=" ":o.type==="break"&&(o.breakType==="page"?t+="\f":t+=`
|
|
11
|
+
`);else if(n.type==="hyperlink"){for(let o of n.children)if(o.type==="run")for(let r of o.content)r.type==="text"&&(t+=r.text);}else if(n.type==="simpleField"){for(let o of n.content)if(o.type==="run")for(let r of o.content)r.type==="text"&&(t+=r.text);}else if(n.type==="complexField")for(let o of n.fieldResult)for(let r of o.content)r.type==="text"&&(t+=r.text);return t}function vo(e){if(!e||e.trim()==="")return "\u2022";let t=e.charCodeAt(0),n={183:"\u2022",111:"\u25CB",167:"\u25A0",252:"\u2713",110:"\u25A0",113:"\u25CB",117:"\u25C6",118:"\u2756",168:"\u2713",251:"\u2713",254:"\u2713",61623:"\u2022",61550:"\u25A0",61551:"\u25CB",61607:"\u25A0",61692:"\u2713",8226:"\u2022",9679:"\u25CF",9675:"\u25CB",9632:"\u25A0",9633:"\u25A1",9670:"\u25C6",9671:"\u25C7",8211:"\u2013",8212:"\u2014",62:">",45:"-"};return n[t]?n[t]:t>=57344&&t<=63743||t<32||t>=127&&t<160?"\u2022":e}function Ro(e,t,n){let o=e.listRendering;if(!o||!t)return;let{numId:r,level:i}=o;if(r===void 0||r===0)return;n.has(r)||n.set(r,new Array(9).fill(0));let a=n.get(r);a[i]=(a[i]||0)+1;for(let u=i+1;u<a.length;u++)a[u]=0;let c=o.marker;if(o.isBullet){let u=c||"";o.marker=vo(u);return}let f=c;for(let u=0;u<=i;u++){let p=`%${u+1}`;if(f.includes(p)){let m=a[u],h=t.getLevel(r,u),T=Eo(m,h?.numFmt||"decimal");f=f.replace(p,T);}}o.marker=f;}function Eo(e,t){switch(t){case "decimal":case "decimalZero":return String(e);case "lowerLetter":return String.fromCharCode(96+(e-1)%26+1);case "upperLetter":return String.fromCharCode(64+(e-1)%26+1);case "lowerRoman":return It(e).toLowerCase();case "upperRoman":return It(e);case "bullet":return "\u2022";default:return String(e)}}function It(e){let t=[[1e3,"M"],[900,"CM"],[500,"D"],[400,"CD"],[100,"C"],[90,"XC"],[50,"L"],[40,"XL"],[10,"X"],[9,"IX"],[5,"V"],[4,"IV"],[1,"I"]],n="";for(let[o,r]of t)for(;e>=o;)n+=r,e-=o;return n}var Xt=/\{\{([^{}]+)\}\}/g;function Lt(e){let t=[],n;for(Xt.lastIndex=0;(n=Xt.exec(e))!==null;){let o=n[1].trim();o&&!t.includes(o)&&t.push(o);}return t}function Dt(e){let t=[];for(let n of e)if(n.type==="paragraph"){let o=Ee(n),r=Lt(o);for(let i of r)t.includes(i)||t.push(i);}else if(n.type==="table"){let o=Ht(n);for(let r of o)t.includes(r)||t.push(r);}return t}function Ht(e){let t=[];for(let n of e.rows)for(let o of n.cells)for(let r of o.content)if(r.type==="paragraph"){let i=Ee(r),a=Lt(i);for(let c of a)t.includes(c)||t.push(c);}else if(r.type==="table"){let i=Ht(r);for(let a of i)t.includes(a)||t.push(a);}return t}function Ot(e,t,n,o,r,i){let a=[],c=D(e),f=new Map;for(let u of c){let p=u.name??"";if(p==="w:p"||p.endsWith(":p")){let m=z(u,t,n,o,r,i);Ro(m,o,f),a.push(m);}else if(p==="w:tbl"||p.endsWith(":tbl")){let m=te(u,t,n,o,r,i);a.push(m);}else if(p==="w:sdt"||p.endsWith(":sdt")){let m=(u.elements??[]).find(h=>h.type==="element"&&(h.name==="w:sdtContent"||h.name?.endsWith(":sdtContent")));if(m){let h=Ot(m,t,n,o,r,i);a.push(...h);}}}return a}function Po(e,t){let n=[],o=[];for(let r of e)o.push(r),r.type==="paragraph"&&r.sectionProperties&&(n.push({properties:r.sectionProperties,content:o}),o=[]);return (o.length>0||n.length===0)&&n.push({properties:t??Rt(),content:o}),n}function Wt(e,t=null,n=null,o=null,r=null,i=null){let a={content:[]};if(!e)return a;let c=j(e);if(!c)return a;let f=(c.elements??[]).find(m=>m.type==="element"&&(m.name==="w:document"||m.name?.endsWith(":document")));if(!f)return a;let u=l(f,"w","body");if(!u)return a;a.content=Ot(u,t,n,o,r,i);let p=l(u,"w","sectPr");return p&&(a.finalSectionProperties=pe(p)),a.sections=Po(a.content,a.finalSectionProperties),a}function Bo(e){let t=new Map,n=j(e);if(!n)return t;let o=l(n,"w16cex","commentsExtensible")??n;for(let r of D(o)){if((r.name?.replace(/^.*:/,"")??"")!=="comment")continue;let a=s(r,"w16cex","paraId")??s(r,"w15","paraId")??r.attributes?.["w16cex:paraId"]??r.attributes?.["w15:paraId"],c=s(r,"w16cex","dateUtc")??s(r,"w15","dateUtc")??r.attributes?.["w16cex:dateUtc"]??r.attributes?.["w15:dateUtc"];a&&c&&t.set(String(a).toUpperCase(),String(c));}return t}function jt(e,t,n,o,r,i){if(!e)return [];let a=j(e);if(!a)return [];let c=i?Bo(i):new Map,f=l(a,"w","comments")??a,u=D(f),p=[];for(let m of u){if((m.name?.replace(/^.*:/,"")??"")!=="comment")continue;let T=parseInt(s(m,"w","id")??"0",10),d=s(m,"w","author")??"Unknown",w=s(m,"w","initials"),E=w!=null?String(w):void 0,k=s(m,"w","date"),P=k!=null?String(k):void 0,C=s(m,"w14","paraId")??m.attributes?.["w14:paraId"]??s(m,"w","paraId"),x=(C?c.get(String(C).toUpperCase()):void 0)??P,S=[];for(let y of D(m))if((y.name?.replace(/^.*:/,"")??"")==="p"){let B=z(y,t,n,null,o,r);S.push(B);}p.push({id:T,author:d,initials:E,date:x,content:S});}return p}async function ai(e,t={}){let n=e instanceof ArrayBuffer?e:await Ie(e),{onProgress:o=()=>{},preloadFonts:r=true,parseHeadersFooters:i=true,parseNotes:a=true,detectVariables:c=true}=t,f=[];try{let h=function(H,W){let R=performance.now(),M=W(),L=performance.now()-R;return m.push({stage:H,ms:L}),L>1e3&&console.warn(`[parseDocx] ${H} took ${Math.round(L)}ms`),M};var u=h;let p=performance.now(),m=[];async function T(H,W){let R=performance.now(),M=await W(),L=performance.now()-R;return m.push({stage:H,ms:L}),L>1e3&&console.warn(`[parseDocx] ${H} took ${Math.round(L)}ms`),M}o("Extracting DOCX...",0);let d=await T("unzip",()=>Xe(n));o("Extracted DOCX",10),o("Parsing relationships...",10);let w=h("relationships",()=>d.documentRels?ae(d.documentRels):new Map);o("Parsed relationships",15),o("Parsing theme...",15);let E=h("theme",()=>Ve(d.themeXml));o("Parsed theme",20),o("Parsing styles...",20);let k=null,P;h("styles",()=>{d.stylesXml&&(k=Ce(d.stylesXml,E),P=Ye(d.stylesXml,E));}),o("Parsed styles",30),o("Parsing numbering...",30);let C=h("numbering",()=>Ke(d.numberingXml));o("Parsed numbering",35),o("Processing media files...",35);let b=h("media",()=>Ao(d,w));o("Processed media",40),o("Parsing document body...",40);let x={content:[]};h("documentBody",()=>{d.documentXml?x=Wt(d.documentXml,k,E,C,w,b):f.push("No document.xml found in DOCX");}),o("Parsed document body",55);let S,y;if(i){o("Parsing headers/footers...",55);let H=h("headersFooters",()=>No(d,k,E,C,w,b));S=H.headers,y=H.footers,o("Parsed headers/footers",65);}else o("Skipping headers/footers",65);let v,B;if(a){o("Parsing footnotes/endnotes...",65);let H=h("footnotesEndnotes",()=>Io(d,k,E,C,w,b));v=H.footnotes,B=H.endnotes,o("Parsed footnotes/endnotes",75);}else o("Skipping footnotes/endnotes",75);o("Parsing comments...",75);let A=h("comments",()=>jt(d.commentsXml,k,E,w,b,d.commentsExtensibleXml));A.length>0&&(x.comments=A);let I;c?(o("Detecting template variables...",75),I=h("variables",()=>Dt(x.content)),o("Detected variables",80)):o("Skipping variable detection",80),r?(o("Loading fonts...",80),await T("fonts",()=>Xo(E,P,x)),o("Loaded fonts",95)):o("Skipping font loading",95),o("Assembling document...",95);let U={package:{document:x,styles:P,theme:E,numbering:C.definitions,headers:S,footers:y,footnotes:v,endnotes:B,relationships:w,media:b},originalBuffer:n,templateVariables:I,warnings:f.length>0?f:void 0},K=performance.now()-p;if(K>2e3){let H=m.filter(W=>W.ms>100).map(W=>`${W.stage}: ${Math.round(W.ms)}ms`).join(", ");console.warn(`[parseDocx] Total: ${Math.round(K)}ms`+(H?` (${H})`:""));}return o("Complete",100),U}catch(p){let m=p instanceof Error?p.message:String(p);throw console.error("[parseDocx] Failed to parse DOCX:",m,p),new Error(`Failed to parse DOCX: ${m}`)}}function Ao(e,t){let n=new Map;for(let[o,r]of e.media.entries()){let i=o.split("/").pop()||o,a=Le(o),c=new Uint8Array(r),f="";for(let T=0;T<c.length;T++)f+=String.fromCharCode(c[T]);let u=btoa(f),p=`data:${a};base64,${u}`,m={path:o,filename:i,mimeType:a,data:r,dataUrl:p};n.set(o,m);let h=o.replace(/^word\//,"");h!==o&&n.set(h,m);}return n}function he(e,t){let n=t.toLowerCase();for(let[o,r]of e.entries())if(o.toLowerCase()===n)return r}function No(e,t,n,o,r,i){let a=new Map,c=new Map;for(let[f,u]of r.entries())if(u.type===ie.header&&u.target){let p=u.target.split("/").pop()||u.target,m=he(e.headers,p);if(m){let h=`word/_rels/${p}.rels`,T=he(e.allXml,h),d=T?ae(T):r,w=yt(m,"default",t,n,o,d,i);a.set(f,w);}}else if(u.type===ie.footer&&u.target){let p=u.target.split("/").pop()||u.target,m=he(e.footers,p);if(m){let h=`word/_rels/${p}.rels`,T=he(e.allXml,h),d=T?ae(T):r,w=xt(m,"default",t,n,o,d,i);c.set(f,w);}}return {headers:a,footers:c}}function Io(e,t,n,o,r,i){let a=Ft(e.footnotesXml,t,n,o,r,i),c=St(e.endnotesXml,t,n,o,r,i);return {footnotes:a.getNormalFootnotes(),endnotes:c.getNormalEndnotes()}}async function Xo(e,t,n){let o=new Set;if(e?.fontScheme){let{majorFont:r,minorFont:i}=e.fontScheme;r?.latin&&o.add(r.latin),i?.latin&&o.add(i.latin);}if(t?.docDefaults?.rPr?.fontFamily?.ascii&&o.add(t.docDefaults.rPr.fontFamily.ascii),t?.styles)for(let r of t.styles)r.rPr?.fontFamily?.ascii&&o.add(r.rPr.fontFamily.ascii),r.rPr?.fontFamily?.hAnsi&&o.add(r.rPr.fontFamily.hAnsi);if(n.content){for(let r of n.content)if(r.type==="paragraph")for(let i of r.content)i.type==="run"&&i.formatting?.fontFamily&&(i.formatting.fontFamily.ascii&&o.add(i.formatting.fontFamily.ascii),i.formatting.fontFamily.hAnsi&&o.add(i.formatting.fontFamily.hAnsi));}if(o.size>0)try{await xe(Array.from(o));}catch(r){console.warn("Failed to load some fonts:",r);}}
|
|
12
|
+
export{ar as a,ie as b,vr as c,Be as d,Vt as e,Lo as f,Do as g,Ho as h,Oo as i,Wo as j,jo as k,Vo as l,zo as m,Ie as n,ai as o};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
'use strict';var chunkZRXLWSRP_cjs=require('./chunk-ZRXLWSRP.cjs'),chunkTL3YTVN2_cjs=require('./chunk-TL3YTVN2.cjs'),chunkCDSUWDYP_cjs=require('./chunk-CDSUWDYP.cjs'),chunkFOU7PS3K_cjs=require('./chunk-FOU7PS3K.cjs'),chunkRTESADL3_cjs=require('./chunk-RTESADL3.cjs');var W={dk1:"000000",lt1:"FFFFFF",dk2:"44546A",lt2:"E7E6E6",accent1:"4472C4",accent2:"ED7D31",accent3:"A5A5A5",accent4:"FFC000",accent5:"5B9BD5",accent6:"70AD47",hlink:"0563C1",folHlink:"954F72"},J={black:"000000",blue:"0000FF",cyan:"00FFFF",darkBlue:"00008B",darkCyan:"008B8B",darkGray:"A9A9A9",darkGreen:"006400",darkMagenta:"8B008B",darkRed:"8B0000",darkYellow:"808000",green:"00FF00",lightGray:"D3D3D3",magenta:"FF00FF",red:"FF0000",white:"FFFFFF",yellow:"FFFF00",none:""},w={dk1:"dk1",lt1:"lt1",dk2:"dk2",lt2:"lt2",accent1:"accent1",accent2:"accent2",accent3:"accent3",accent4:"accent4",accent5:"accent5",accent6:"accent6",hlink:"hlink",folHlink:"folHlink",dark1:"dk1",light1:"lt1",dark2:"dk2",light2:"lt2",hyperlink:"hlink",followedHyperlink:"folHlink",background1:"lt1",text1:"dk1",background2:"lt2",text2:"dk2",tx1:"dk1",tx2:"dk2",bg1:"lt1",bg2:"lt2"};function $(n){if(!n)return 1;let t=parseInt(n,16);return isNaN(t)?1:t/255}function C(n){let t=n.padStart(6,"0").slice(0,6),e=parseInt(t.slice(0,2),16),r=parseInt(t.slice(2,4),16),a=parseInt(t.slice(4,6),16);return {r:isNaN(e)?0:e,g:isNaN(r)?0:r,b:isNaN(a)?0:a}}function E(n,t,e){let r=a=>Math.max(0,Math.min(255,Math.round(a))).toString(16).padStart(2,"0");return `${r(n)}${r(t)}${r(e)}`.toUpperCase()}function U(n,t,e){n/=255,t/=255,e/=255;let r=Math.max(n,t,e),a=Math.min(n,t,e),o=(r+a)/2;if(r===a)return {h:0,s:0,l:o};let i=r-a,s=o>.5?i/(2-r-a):i/(r+a),c;switch(r){case n:c=((t-e)/i+(t<e?6:0))/6;break;case t:c=((e-n)/i+2)/6;break;case e:c=((n-t)/i+4)/6;break;default:c=0;}return {h:c*360,s,l:o}}function G(n,t,e){if(n=n/360,t===0){let i=Math.round(e*255);return {r:i,g:i,b:i}}let r=(i,s,c)=>(c<0&&(c+=1),c>1&&(c-=1),c<1/6?i+(s-i)*6*c:c<1/2?s:c<2/3?i+(s-i)*(2/3-c)*6:i),a=e<.5?e*(1+t):e+t-e*t,o=2*e-a;return {r:Math.round(r(o,a,n+1/3)*255),g:Math.round(r(o,a,n)*255),b:Math.round(r(o,a,n-1/3)*255)}}function q(n,t){if(t<=0||t>=1)return t>=1?"FFFFFF":n;let e=C(n),r=U(e.r,e.g,e.b);r.l=r.l+(1-r.l)*t;let a=G(r.h,r.s,r.l);return E(a.r,a.g,a.b)}function X(n,t){if(t<=0||t>=1)return t<=0?"000000":n;let e=C(n),r=U(e.r,e.g,e.b);r.l=r.l*t;let a=G(r.h,r.s,r.l);return E(a.r,a.g,a.b)}function Q(n,t){let e=w[t]??t,r=["dk1","lt1","dk2","lt2","accent1","accent2","accent3","accent4","accent5","accent6","hlink","folHlink"],a=o=>r.includes(o);return n?.colorScheme?a(e)?n.colorScheme[e]??W[e]??"000000":"000000":a(e)?W[e]??"000000":"000000"}function K(n){if(!n)return null;let t=n.toLowerCase();return w[n]??w[t]??null}function g(n,t,e="000000"){if(!n)return `#${e}`;if(n.auto)return `#${e}`;let r;if(n.themeColor){let a=K(n.themeColor);if(a?r=Q(t,a):r=n.rgb??e,n.themeTint){let o=$(n.themeTint);r=q(r,o);}else if(n.themeShade){let o=$(n.themeShade);r=X(r,o);}}else n.rgb?r=n.rgb:r=e;return `#${r.toUpperCase().replace(/^#/,"")}`}function Et(n){if(!n||n==="none")return "";let t=J[n];return t?`#${t}`:""}function Bt(n,t){return n?n.auto?"transparent":g(n,t):""}function vt(n,t){if(!n)return false;if(n.auto)return true;let r=g(n,t).replace(/^#/,"").toLowerCase(),a=C(r);return (a.r+a.g+a.b)/3<20}function Ot(n,t){if(!n)return false;let r=g(n,t).replace(/^#/,"").toLowerCase(),a=C(r);return (a.r+a.g+a.b)/3>235}function Nt(n,t){if(!n)return "#000000";let r=g(n,t).replace(/^#/,""),a=C(r);return (.299*a.r+.587*a.g+.114*a.b)/255>.5?"#000000":"#FFFFFF"}function Vt(n){if(!n)return;let t=n.trim();if(t.toLowerCase()==="auto")return {auto:true};let e=K(t);if(e)return {themeColor:e};let r=t.replace(/^#/,"").toUpperCase();return /^[0-9A-F]{6}$/i.test(r)?{rgb:r}:/^[0-9A-F]{3}$/i.test(r)?{rgb:r.split("").map(o=>o+o).join("")}:{rgb:r.padStart(6,"0").slice(0,6)}}function Lt(n,t,e){let r={themeColor:n};return t!==void 0&&t>0&&t<1&&(r.themeTint=Math.round(t*255).toString(16).toUpperCase().padStart(2,"0")),e!==void 0&&e>0&&e<1&&(r.themeShade=Math.round(e*255).toString(16).toUpperCase().padStart(2,"0")),r}function Mt(n){return {rgb:n.replace(/^#/,"").toUpperCase()}}function jt(n,t,e){let a=g(n,t).replace(/^#/,""),o=1-e/100;return `#${X(a,o)}`}function zt(n,t,e){let a=g(n,t).replace(/^#/,""),o=e/100;return `#${q(a,o)}`}function Wt(n,t,e,r){let a=g(n,r).replace(/^#/,""),o=g(t,r).replace(/^#/,""),i=C(a),s=C(o),c={r:Math.round(i.r*(1-e)+s.r*e),g:Math.round(i.g*(1-e)+s.g*e),b:Math.round(i.b*(1-e)+s.b*e)};return `#${E(c.r,c.g,c.b)}`}function $t(n,t,e){if(!n&&!t)return true;if(!n||!t)return false;let r=g(n,e).toUpperCase(),a=g(t,e).toUpperCase();return r===a}function Gt(n){return n/1440*96}function qt(n){return n/96*1440}function Xt(n){return n/914400*96}function Kt(n){return n/96*914400}function Yt(n){return n/914400*1440}function Jt(n){return n/1440*914400}function Qt(n){return n/72*96}function Zt(n){return n/144*96}function te(n){return n/2}function ee(n){return n/576*96}function Z(n,t=2){let e=Math.pow(10,t);return Math.round(n*e)/e}function ne(n){return `${Z(n)}px`}var S=class n{constructor(t){chunkRTESADL3_cjs.e(this,"_document");chunkRTESADL3_cjs.e(this,"_pendingVariables");t instanceof ArrayBuffer||ArrayBuffer.isView(t)?this._document={package:{document:{content:[]}},originalBuffer:t instanceof ArrayBuffer?t:t.buffer}:this._document=t,this._pendingVariables={};}static async fromBuffer(t){let e=await chunkCDSUWDYP_cjs.m(t);return new n(e)}static fromDocument(t){return new n(t)}getDocument(){return this._document}getText(){let t=this._document.package.document;return this._getBodyText(t)}getFormattedText(){let t=[],e=this._document.package.document;for(let r of e.content)r.type==="paragraph"&&this._extractParagraphSegments(r,t);return t}getVariables(){return chunkZRXLWSRP_cjs.a(this._document)}getStyles(){let t=this._document.package.styles;if(!t?.styles)return [];let e=[];for(let[r,a]of Object.entries(t.styles))if(typeof a=="object"&&a!==null){let o=a;e.push({id:r,name:o.name||r,type:o.type==="numbering"?"paragraph":o.type||"paragraph",builtIn:o.default});}return e}getPageCount(){let t=this.getWordCount();return Math.max(1,Math.ceil(t/500))}getWordCount(){return this.getText().split(/\s+/).filter(r=>r.length>0).length}getCharacterCount(t=true){let e=this.getText();return t?e.length:e.replace(/\s/g,"").length}getParagraphCount(){return this._document.package.document.content.filter(t=>t.type==="paragraph").length}getTableCount(){return this._document.package.document.content.filter(t=>t.type==="table").length}getAgentContext(t=100){let e=this._document.package.document,r=e.content.filter(i=>i.type==="paragraph"),a=r.map((i,s)=>{let c=this._getParagraphText(i),u=i.formatting?.styleId;return {index:s,preview:c.slice(0,t),style:u,isHeading:u?.toLowerCase().includes("heading")||false,headingLevel:this._parseHeadingLevel(u),isListItem:!!i.listRendering,isEmpty:c.trim().length===0}}),o=(e.sections||[]).map((i,s)=>({index:s,paragraphCount:i.content?.length||0,pageSize:i.properties?.pageWidth&&i.properties?.pageHeight?{width:i.properties.pageWidth,height:i.properties.pageHeight}:void 0,isLandscape:i.properties?.orientation==="landscape",hasHeader:!!i.properties?.headerReferences?.length,hasFooter:!!i.properties?.footerReferences?.length}));return {paragraphCount:r.length,wordCount:this.getWordCount(),characterCount:this.getCharacterCount(),variables:this.getVariables(),variableCount:this.getVariables().length,availableStyles:this.getStyles(),outline:a,sections:o,hasTables:this.getTableCount()>0,hasImages:this._hasImages(),hasHyperlinks:this._hasHyperlinks()}}insertText(t,e,r={}){let a={type:"insertText",position:t,text:e,formatting:r.formatting};return this._executeCommand(a)}replaceRange(t,e,r={}){let a={type:"replaceText",range:t,text:e,formatting:r.formatting};return this._executeCommand(a)}deleteRange(t){let e={type:"deleteText",range:t};return this._executeCommand(e)}applyFormatting(t,e){let r={type:"formatText",range:t,formatting:e};return this._executeCommand(r)}applyStyle(t,e){let r={type:"applyStyle",paragraphIndex:t,styleId:e};return this._executeCommand(r)}applyParagraphFormatting(t,e){let r={type:"formatParagraph",paragraphIndex:t,formatting:e};return this._executeCommand(r)}insertTable(t,e,r,a={}){let o={type:"insertTable",position:t,rows:e,columns:r,data:a.data,hasHeader:a.hasHeader};return this._executeCommand(o)}insertImage(t,e,r={}){let a={type:"insertImage",position:t,src:e,width:r.width,height:r.height,alt:r.alt};return this._executeCommand(a)}insertHyperlink(t,e,r={}){let a={type:"insertHyperlink",range:t,url:e,displayText:r.displayText,tooltip:r.tooltip};return this._executeCommand(a)}removeHyperlink(t){let e={type:"removeHyperlink",range:t};return this._executeCommand(e)}insertParagraphBreak(t){let e={type:"insertParagraphBreak",position:t};return this._executeCommand(e)}mergeParagraphs(t,e){let r={type:"mergeParagraphs",paragraphIndex:t,count:e};return this._executeCommand(r)}setVariable(t,e){return this._pendingVariables[t]=e,this}setVariables(t){for(let[e,r]of Object.entries(t))this._pendingVariables[e]=r;return this}getPendingVariables(){return {...this._pendingVariables}}clearPendingVariables(){return this._pendingVariables={},this}async applyVariables(t){let e={...this._pendingVariables,...t};if(Object.keys(e).length===0)return this;let r=this._document.originalBuffer;if(!r)throw new Error("Cannot apply variables: no original buffer for processing");let a=chunkZRXLWSRP_cjs.n(r,e),o=await chunkCDSUWDYP_cjs.m(a),i=new n(o);return i._pendingVariables={},i}async toBuffer(){return this._document.originalBuffer?chunkTL3YTVN2_cjs.d(this._document):chunkTL3YTVN2_cjs.e(this._document)}async toBlob(t="application/vnd.openxmlformats-officedocument.wordprocessingml.document"){let e=await this.toBuffer();return new Blob([e],{type:t})}executeCommands(t){let e=chunkFOU7PS3K_cjs.b(this._document,t);return new n(e)}_executeCommand(t){let e=chunkFOU7PS3K_cjs.a(this._document,t),r=new n(e);return r._pendingVariables={...this._pendingVariables},r}_getBodyText(t){let e=[];for(let r of t.content)r.type==="paragraph"?e.push(this._getParagraphText(r)):r.type==="table"&&e.push(this._getTableText(r));return e.join(`
|
|
2
|
-
`)}_getParagraphText(t){let e=[];for(let r of t.content)r.type==="run"?e.push(this._getRunText(r)):r.type==="hyperlink"&&e.push(this._getHyperlinkText(r));return e.join("")}_getRunText(t){return t.content.filter(e=>e.type==="text").map(e=>e.text).join("")}_getHyperlinkText(t){let e=[];for(let r of t.children)r.type==="run"&&e.push(this._getRunText(r));return e.join("")}_getTableText(t){let e=[];for(let r of t.rows)for(let a of r.cells)for(let o of a.content)o.type==="paragraph"&&e.push(this._getParagraphText(o));return e.join(" ")}_extractParagraphSegments(t,e){for(let r of t.content)if(r.type==="run"){let a=this._getRunText(r);a&&e.push({text:a,formatting:r.formatting});}else if(r.type==="hyperlink"){let a=r.href||"";for(let o of r.children)if(o.type==="run"){let i=this._getRunText(o);i&&e.push({text:i,formatting:o.formatting,isHyperlink:true,hyperlinkUrl:a});}}}_parseHeadingLevel(t){if(!t)return;let e=t.match(/heading\s*(\d)/i);if(e)return parseInt(e[1],10)}_hasImages(){let t=this._document.package.document;for(let e of t.content)if(e.type==="paragraph"){for(let r of e.content)if(r.type==="run"){for(let a of r.content)if(a.type==="drawing")return true}}return false}_hasHyperlinks(){let t=this._document.package.document;for(let e of t.content)if(e.type==="paragraph"){for(let r of e.content)if(r.type==="hyperlink")return true}return false}};async function ue(n){return S.fromBuffer(n)}function le(n){return S.fromDocument(n)}function tt(n,t={}){let{outlineMaxChars:e=100,maxOutlineParagraphs:r=50}=t,a=n.package.document,o=a.content.filter(y=>y.type==="paragraph"),i=et(o,e,r),s=
|
|
1
|
+
'use strict';var chunkH3JNHCD7_cjs=require('./chunk-H3JNHCD7.cjs'),chunkQYKJKSKZ_cjs=require('./chunk-QYKJKSKZ.cjs'),chunkTRAQI6RX_cjs=require('./chunk-TRAQI6RX.cjs'),chunkA7VY2V4X_cjs=require('./chunk-A7VY2V4X.cjs'),chunkRTESADL3_cjs=require('./chunk-RTESADL3.cjs');var W={dk1:"000000",lt1:"FFFFFF",dk2:"44546A",lt2:"E7E6E6",accent1:"4472C4",accent2:"ED7D31",accent3:"A5A5A5",accent4:"FFC000",accent5:"5B9BD5",accent6:"70AD47",hlink:"0563C1",folHlink:"954F72"},J={black:"000000",blue:"0000FF",cyan:"00FFFF",darkBlue:"00008B",darkCyan:"008B8B",darkGray:"A9A9A9",darkGreen:"006400",darkMagenta:"8B008B",darkRed:"8B0000",darkYellow:"808000",green:"00FF00",lightGray:"D3D3D3",magenta:"FF00FF",red:"FF0000",white:"FFFFFF",yellow:"FFFF00",none:""},w={dk1:"dk1",lt1:"lt1",dk2:"dk2",lt2:"lt2",accent1:"accent1",accent2:"accent2",accent3:"accent3",accent4:"accent4",accent5:"accent5",accent6:"accent6",hlink:"hlink",folHlink:"folHlink",dark1:"dk1",light1:"lt1",dark2:"dk2",light2:"lt2",hyperlink:"hlink",followedHyperlink:"folHlink",background1:"lt1",text1:"dk1",background2:"lt2",text2:"dk2",tx1:"dk1",tx2:"dk2",bg1:"lt1",bg2:"lt2"};function $(n){if(!n)return 1;let t=parseInt(n,16);return isNaN(t)?1:t/255}function C(n){let t=n.padStart(6,"0").slice(0,6),e=parseInt(t.slice(0,2),16),r=parseInt(t.slice(2,4),16),a=parseInt(t.slice(4,6),16);return {r:isNaN(e)?0:e,g:isNaN(r)?0:r,b:isNaN(a)?0:a}}function E(n,t,e){let r=a=>Math.max(0,Math.min(255,Math.round(a))).toString(16).padStart(2,"0");return `${r(n)}${r(t)}${r(e)}`.toUpperCase()}function U(n,t,e){n/=255,t/=255,e/=255;let r=Math.max(n,t,e),a=Math.min(n,t,e),o=(r+a)/2;if(r===a)return {h:0,s:0,l:o};let i=r-a,s=o>.5?i/(2-r-a):i/(r+a),c;switch(r){case n:c=((t-e)/i+(t<e?6:0))/6;break;case t:c=((e-n)/i+2)/6;break;case e:c=((n-t)/i+4)/6;break;default:c=0;}return {h:c*360,s,l:o}}function G(n,t,e){if(n=n/360,t===0){let i=Math.round(e*255);return {r:i,g:i,b:i}}let r=(i,s,c)=>(c<0&&(c+=1),c>1&&(c-=1),c<1/6?i+(s-i)*6*c:c<1/2?s:c<2/3?i+(s-i)*(2/3-c)*6:i),a=e<.5?e*(1+t):e+t-e*t,o=2*e-a;return {r:Math.round(r(o,a,n+1/3)*255),g:Math.round(r(o,a,n)*255),b:Math.round(r(o,a,n-1/3)*255)}}function q(n,t){if(t<=0||t>=1)return t>=1?"FFFFFF":n;let e=C(n),r=U(e.r,e.g,e.b);r.l=r.l+(1-r.l)*t;let a=G(r.h,r.s,r.l);return E(a.r,a.g,a.b)}function X(n,t){if(t<=0||t>=1)return t<=0?"000000":n;let e=C(n),r=U(e.r,e.g,e.b);r.l=r.l*t;let a=G(r.h,r.s,r.l);return E(a.r,a.g,a.b)}function Q(n,t){let e=w[t]??t,r=["dk1","lt1","dk2","lt2","accent1","accent2","accent3","accent4","accent5","accent6","hlink","folHlink"],a=o=>r.includes(o);return n?.colorScheme?a(e)?n.colorScheme[e]??W[e]??"000000":"000000":a(e)?W[e]??"000000":"000000"}function K(n){if(!n)return null;let t=n.toLowerCase();return w[n]??w[t]??null}function g(n,t,e="000000"){if(!n)return `#${e}`;if(n.auto)return `#${e}`;let r;if(n.themeColor){let a=K(n.themeColor);if(a?r=Q(t,a):r=n.rgb??e,n.themeTint){let o=$(n.themeTint);r=q(r,o);}else if(n.themeShade){let o=$(n.themeShade);r=X(r,o);}}else n.rgb?r=n.rgb:r=e;return `#${r.toUpperCase().replace(/^#/,"")}`}function Et(n){if(!n||n==="none")return "";let t=J[n];return t?`#${t}`:""}function Bt(n,t){return n?n.auto?"transparent":g(n,t):""}function vt(n,t){if(!n)return false;if(n.auto)return true;let r=g(n,t).replace(/^#/,"").toLowerCase(),a=C(r);return (a.r+a.g+a.b)/3<20}function Ot(n,t){if(!n)return false;let r=g(n,t).replace(/^#/,"").toLowerCase(),a=C(r);return (a.r+a.g+a.b)/3>235}function Nt(n,t){if(!n)return "#000000";let r=g(n,t).replace(/^#/,""),a=C(r);return (.299*a.r+.587*a.g+.114*a.b)/255>.5?"#000000":"#FFFFFF"}function Vt(n){if(!n)return;let t=n.trim();if(t.toLowerCase()==="auto")return {auto:true};let e=K(t);if(e)return {themeColor:e};let r=t.replace(/^#/,"").toUpperCase();return /^[0-9A-F]{6}$/i.test(r)?{rgb:r}:/^[0-9A-F]{3}$/i.test(r)?{rgb:r.split("").map(o=>o+o).join("")}:{rgb:r.padStart(6,"0").slice(0,6)}}function Lt(n,t,e){let r={themeColor:n};return t!==void 0&&t>0&&t<1&&(r.themeTint=Math.round(t*255).toString(16).toUpperCase().padStart(2,"0")),e!==void 0&&e>0&&e<1&&(r.themeShade=Math.round(e*255).toString(16).toUpperCase().padStart(2,"0")),r}function Mt(n){return {rgb:n.replace(/^#/,"").toUpperCase()}}function jt(n,t,e){let a=g(n,t).replace(/^#/,""),o=1-e/100;return `#${X(a,o)}`}function zt(n,t,e){let a=g(n,t).replace(/^#/,""),o=e/100;return `#${q(a,o)}`}function Wt(n,t,e,r){let a=g(n,r).replace(/^#/,""),o=g(t,r).replace(/^#/,""),i=C(a),s=C(o),c={r:Math.round(i.r*(1-e)+s.r*e),g:Math.round(i.g*(1-e)+s.g*e),b:Math.round(i.b*(1-e)+s.b*e)};return `#${E(c.r,c.g,c.b)}`}function $t(n,t,e){if(!n&&!t)return true;if(!n||!t)return false;let r=g(n,e).toUpperCase(),a=g(t,e).toUpperCase();return r===a}function Gt(n){return n/1440*96}function qt(n){return n/96*1440}function Xt(n){return n/914400*96}function Kt(n){return n/96*914400}function Yt(n){return n/914400*1440}function Jt(n){return n/1440*914400}function Qt(n){return n/72*96}function Zt(n){return n/144*96}function te(n){return n/2}function ee(n){return n/576*96}function Z(n,t=2){let e=Math.pow(10,t);return Math.round(n*e)/e}function ne(n){return `${Z(n)}px`}var S=class n{constructor(t){chunkRTESADL3_cjs.e(this,"_document");chunkRTESADL3_cjs.e(this,"_pendingVariables");t instanceof ArrayBuffer||ArrayBuffer.isView(t)?this._document={package:{document:{content:[]}},originalBuffer:t instanceof ArrayBuffer?t:t.buffer}:this._document=t,this._pendingVariables={};}static async fromBuffer(t){let e=await chunkTRAQI6RX_cjs.o(t);return new n(e)}static fromDocument(t){return new n(t)}getDocument(){return this._document}getText(){let t=this._document.package.document;return this._getBodyText(t)}getFormattedText(){let t=[],e=this._document.package.document;for(let r of e.content)r.type==="paragraph"&&this._extractParagraphSegments(r,t);return t}getVariables(){return chunkH3JNHCD7_cjs.a(this._document)}getStyles(){let t=this._document.package.styles;if(!t?.styles)return [];let e=[];for(let[r,a]of Object.entries(t.styles))if(typeof a=="object"&&a!==null){let o=a;e.push({id:r,name:o.name||r,type:o.type==="numbering"?"paragraph":o.type||"paragraph",builtIn:o.default});}return e}getPageCount(){let t=this.getWordCount();return Math.max(1,Math.ceil(t/500))}getWordCount(){return this.getText().split(/\s+/).filter(r=>r.length>0).length}getCharacterCount(t=true){let e=this.getText();return t?e.length:e.replace(/\s/g,"").length}getParagraphCount(){return this._document.package.document.content.filter(t=>t.type==="paragraph").length}getTableCount(){return this._document.package.document.content.filter(t=>t.type==="table").length}getAgentContext(t=100){let e=this._document.package.document,r=e.content.filter(i=>i.type==="paragraph"),a=r.map((i,s)=>{let c=this._getParagraphText(i),u=i.formatting?.styleId;return {index:s,preview:c.slice(0,t),style:u,isHeading:u?.toLowerCase().includes("heading")||false,headingLevel:this._parseHeadingLevel(u),isListItem:!!i.listRendering,isEmpty:c.trim().length===0}}),o=(e.sections||[]).map((i,s)=>({index:s,paragraphCount:i.content?.length||0,pageSize:i.properties?.pageWidth&&i.properties?.pageHeight?{width:i.properties.pageWidth,height:i.properties.pageHeight}:void 0,isLandscape:i.properties?.orientation==="landscape",hasHeader:!!i.properties?.headerReferences?.length,hasFooter:!!i.properties?.footerReferences?.length}));return {paragraphCount:r.length,wordCount:this.getWordCount(),characterCount:this.getCharacterCount(),variables:this.getVariables(),variableCount:this.getVariables().length,availableStyles:this.getStyles(),outline:a,sections:o,hasTables:this.getTableCount()>0,hasImages:this._hasImages(),hasHyperlinks:this._hasHyperlinks()}}insertText(t,e,r={}){let a={type:"insertText",position:t,text:e,formatting:r.formatting};return this._executeCommand(a)}replaceRange(t,e,r={}){let a={type:"replaceText",range:t,text:e,formatting:r.formatting};return this._executeCommand(a)}deleteRange(t){let e={type:"deleteText",range:t};return this._executeCommand(e)}applyFormatting(t,e){let r={type:"formatText",range:t,formatting:e};return this._executeCommand(r)}applyStyle(t,e){let r={type:"applyStyle",paragraphIndex:t,styleId:e};return this._executeCommand(r)}applyParagraphFormatting(t,e){let r={type:"formatParagraph",paragraphIndex:t,formatting:e};return this._executeCommand(r)}insertTable(t,e,r,a={}){let o={type:"insertTable",position:t,rows:e,columns:r,data:a.data,hasHeader:a.hasHeader};return this._executeCommand(o)}insertImage(t,e,r={}){let a={type:"insertImage",position:t,src:e,width:r.width,height:r.height,alt:r.alt};return this._executeCommand(a)}insertHyperlink(t,e,r={}){let a={type:"insertHyperlink",range:t,url:e,displayText:r.displayText,tooltip:r.tooltip};return this._executeCommand(a)}removeHyperlink(t){let e={type:"removeHyperlink",range:t};return this._executeCommand(e)}insertParagraphBreak(t){let e={type:"insertParagraphBreak",position:t};return this._executeCommand(e)}mergeParagraphs(t,e){let r={type:"mergeParagraphs",paragraphIndex:t,count:e};return this._executeCommand(r)}setVariable(t,e){return this._pendingVariables[t]=e,this}setVariables(t){for(let[e,r]of Object.entries(t))this._pendingVariables[e]=r;return this}getPendingVariables(){return {...this._pendingVariables}}clearPendingVariables(){return this._pendingVariables={},this}async applyVariables(t){let e={...this._pendingVariables,...t};if(Object.keys(e).length===0)return this;let r=this._document.originalBuffer;if(!r)throw new Error("Cannot apply variables: no original buffer for processing");let a=chunkH3JNHCD7_cjs.n(r,e),o=await chunkTRAQI6RX_cjs.o(a),i=new n(o);return i._pendingVariables={},i}async toBuffer(){return this._document.originalBuffer?chunkQYKJKSKZ_cjs.d(this._document):chunkQYKJKSKZ_cjs.e(this._document)}async toBlob(t="application/vnd.openxmlformats-officedocument.wordprocessingml.document"){let e=await this.toBuffer();return new Blob([e],{type:t})}executeCommands(t){let e=chunkA7VY2V4X_cjs.b(this._document,t);return new n(e)}_executeCommand(t){let e=chunkA7VY2V4X_cjs.a(this._document,t),r=new n(e);return r._pendingVariables={...this._pendingVariables},r}_getBodyText(t){let e=[];for(let r of t.content)r.type==="paragraph"?e.push(this._getParagraphText(r)):r.type==="table"&&e.push(this._getTableText(r));return e.join(`
|
|
2
|
+
`)}_getParagraphText(t){let e=[];for(let r of t.content)r.type==="run"?e.push(this._getRunText(r)):r.type==="hyperlink"&&e.push(this._getHyperlinkText(r));return e.join("")}_getRunText(t){return t.content.filter(e=>e.type==="text").map(e=>e.text).join("")}_getHyperlinkText(t){let e=[];for(let r of t.children)r.type==="run"&&e.push(this._getRunText(r));return e.join("")}_getTableText(t){let e=[];for(let r of t.rows)for(let a of r.cells)for(let o of a.content)o.type==="paragraph"&&e.push(this._getParagraphText(o));return e.join(" ")}_extractParagraphSegments(t,e){for(let r of t.content)if(r.type==="run"){let a=this._getRunText(r);a&&e.push({text:a,formatting:r.formatting});}else if(r.type==="hyperlink"){let a=r.href||"";for(let o of r.children)if(o.type==="run"){let i=this._getRunText(o);i&&e.push({text:i,formatting:o.formatting,isHyperlink:true,hyperlinkUrl:a});}}}_parseHeadingLevel(t){if(!t)return;let e=t.match(/heading\s*(\d)/i);if(e)return parseInt(e[1],10)}_hasImages(){let t=this._document.package.document;for(let e of t.content)if(e.type==="paragraph"){for(let r of e.content)if(r.type==="run"){for(let a of r.content)if(a.type==="drawing")return true}}return false}_hasHyperlinks(){let t=this._document.package.document;for(let e of t.content)if(e.type==="paragraph"){for(let r of e.content)if(r.type==="hyperlink")return true}return false}};async function ue(n){return S.fromBuffer(n)}function le(n){return S.fromDocument(n)}function tt(n,t={}){let{outlineMaxChars:e=100,maxOutlineParagraphs:r=50}=t,a=n.package.document,o=a.content.filter(y=>y.type==="paragraph"),i=et(o,e,r),s=chunkH3JNHCD7_cjs.a(n),c=nt(n),u=rt(a),l=at(a),x=ot(a),d=a.content.some(y=>y.type==="table"),b=ct(a),p=ut(a);return {paragraphCount:o.length,wordCount:l,characterCount:x,variables:s,variableCount:s.length,availableStyles:c,outline:i,sections:u,hasTables:d,hasImages:b,hasHyperlinks:p}}function de(n,t,e={}){let{contextChars:r=200,includeSuggestions:a=true}=e,i=n.package.document.content.filter(f=>f.type==="paragraph"),s=i[t.start.paragraphIndex];if(!s)throw new Error(`Paragraph not found at index ${t.start.paragraphIndex}`);let c=m(s),u="";if(t.start.paragraphIndex===t.end.paragraphIndex)u=c.slice(t.start.offset,t.end.offset);else {let f=[];for(let P=t.start.paragraphIndex;P<=t.end.paragraphIndex;P++){let N=i[P];if(!N)continue;let R=m(N);P===t.start.paragraphIndex?f.push(R.slice(t.start.offset)):P===t.end.paragraphIndex?f.push(R.slice(0,t.end.offset)):f.push(R);}u=f.join(`
|
|
3
3
|
`);}let l=mt(i,t.start.paragraphIndex,t.start.offset,r),x=gt(i,t.end.paragraphIndex,t.end.offset,r),d=dt(s,t.start.offset),b=s.formatting||{},p={index:t.start.paragraphIndex,fullText:c,style:s.formatting?.styleId,wordCount:B(c)},y=false,F=ft(s,t.start.offset),_=a?ht(u):[];return {selectedText:u,range:t,formatting:d,paragraphFormatting:b,textBefore:l,textAfter:x,paragraph:p,inTable:y,inHyperlink:F,suggestedActions:_}}function Y(n){let t=tt(n,{outlineMaxChars:50,maxOutlineParagraphs:10}),e=[`Document with ${t.paragraphCount} paragraphs, ${t.wordCount} words.`];t.hasTables&&e.push("Contains tables."),t.hasImages&&e.push("Contains images."),t.hasHyperlinks&&e.push("Contains hyperlinks."),t.variableCount>0&&e.push(`Has ${t.variableCount} template variables: ${t.variables.join(", ")}`);let r=t.outline.filter(a=>a.isHeading);if(r.length>0){e.push(`
|
|
4
4
|
Headings:`);for(let a of r.slice(0,5)){let o=a.headingLevel||1;e.push(`${" ".repeat(o-1)}- ${a.preview}`);}r.length>5&&e.push(` ... and ${r.length-5} more headings`);}return e.join(" ")}function et(n,t,e){let r=[];for(let a=0;a<Math.min(n.length,e);a++){let o=n[a],i=m(o),s=o.formatting?.styleId;r.push({index:a,preview:i.slice(0,t),style:s,isHeading:lt(s),headingLevel:pt(s),isListItem:!!o.listRendering,isEmpty:i.trim().length===0});}return r}function nt(n){let t=n.package.styles;if(!t?.styles)return [];let e=[];for(let[r,a]of Object.entries(t.styles))if(typeof a=="object"&&a!==null){let o=a;e.push({id:r,name:o.name||r,type:o.type==="numbering"?"paragraph":o.type||"paragraph",builtIn:o.default});}return e}function rt(n){return n.sections?n.sections.map((t,e)=>({index:e,paragraphCount:t.content?.length||0,pageSize:t.properties?.pageWidth&&t.properties?.pageHeight?{width:t.properties.pageWidth,height:t.properties.pageHeight}:void 0,isLandscape:t.properties?.orientation==="landscape",hasHeader:!!t.properties?.headerReferences?.length,hasFooter:!!t.properties?.footerReferences?.length})):[]}function at(n){let t=0;for(let e of n.content)if(e.type==="paragraph"){let r=m(e);t+=B(r);}else e.type==="table"&&(t+=it(e));return t}function B(n){return n.split(/\s+/).filter(e=>e.length>0).length}function ot(n){let t=0;for(let e of n.content)if(e.type==="paragraph"){let r=m(e);t+=r.length;}else e.type==="table"&&(t+=st(e));return t}function it(n){let t=0;for(let e of n.rows)for(let r of e.cells)for(let a of r.content)if(a.type==="paragraph"){let o=m(a);t+=B(o);}return t}function st(n){let t=0;for(let e of n.rows)for(let r of e.cells)for(let a of r.content)if(a.type==="paragraph"){let o=m(a);t+=o.length;}return t}function m(n){let t=[];for(let e of n.content)e.type==="run"?t.push(A(e)):e.type==="hyperlink"&&t.push(v(e));return t.join("")}function A(n){return n.content.filter(t=>t.type==="text").map(t=>t.text).join("")}function v(n){let t=[];for(let e of n.children)e.type==="run"&&t.push(A(e));return t.join("")}function ct(n){for(let t of n.content)if(t.type==="paragraph"){for(let e of t.content)if(e.type==="run"){for(let r of e.content)if(r.type==="drawing")return true}}return false}function ut(n){for(let t of n.content)if(t.type==="paragraph"){for(let e of t.content)if(e.type==="hyperlink")return true}return false}function lt(n){return n?n.toLowerCase().includes("heading"):false}function pt(n){if(!n)return;let t=n.match(/heading\s*(\d)/i);if(t)return parseInt(t[1],10)}function mt(n,t,e,r){let a=[],o=0,i=n[t];if(i){let u=m(i).slice(0,e);a.unshift(u),o+=u.length;}for(let c=t-1;c>=0&&o<r;c--){let u=n[c];if(!u)continue;let l=m(u);a.unshift(l),o+=l.length;}let s=a.join(`
|
|
5
5
|
`);return s.length>r?"..."+s.slice(-r):s}function gt(n,t,e,r){let a=[],o=0,i=n[t];if(i){let u=m(i).slice(e);a.push(u),o+=u.length;}for(let c=t+1;c<n.length&&o<r;c++){let u=n[c];if(!u)continue;let l=m(u);a.push(l),o+=l.length;}let s=a.join(`
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
'use strict';var chunkTRAQI6RX_cjs=require('./chunk-TRAQI6RX.cjs'),R=require('jszip');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var R__default=/*#__PURE__*/_interopDefault(R);function u(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Z(e){if(!e)return "";let t=[];return e.auto?t.push('w:val="auto"'):e.rgb&&t.push(`w:val="${e.rgb}"`),e.themeColor&&t.push(`w:themeColor="${e.themeColor}"`),e.themeTint&&t.push(`w:themeTint="${e.themeTint}"`),e.themeShade&&t.push(`w:themeShade="${e.themeShade}"`),t.length===0?"":`<w:color ${t.join(" ")}/>`}function Y(e){if(!e)return "";let t=[];return e.pattern?t.push(`w:val="${e.pattern}"`):t.push('w:val="clear"'),e.color?.rgb?t.push(`w:color="${e.color.rgb}"`):e.color?.auto&&t.push('w:color="auto"'),e.fill?.rgb?t.push(`w:fill="${e.fill.rgb}"`):e.fill?.auto&&t.push('w:fill="auto"'),e.fill?.themeColor&&t.push(`w:themeFill="${e.fill.themeColor}"`),e.fill?.themeTint&&t.push(`w:themeFillTint="${e.fill.themeTint}"`),e.fill?.themeShade&&t.push(`w:themeFillShade="${e.fill.themeShade}"`),t.length===0?"":`<w:shd ${t.join(" ")}/>`}function C(e){if(!e)return "";let t=[];if(e.styleId&&t.push(`<w:rStyle w:val="${u(e.styleId)}"/>`),e.fontFamily){let i=[];e.fontFamily.ascii&&i.push(`w:ascii="${u(e.fontFamily.ascii)}"`),e.fontFamily.hAnsi&&i.push(`w:hAnsi="${u(e.fontFamily.hAnsi)}"`),e.fontFamily.eastAsia&&i.push(`w:eastAsia="${u(e.fontFamily.eastAsia)}"`),e.fontFamily.cs&&i.push(`w:cs="${u(e.fontFamily.cs)}"`),e.fontFamily.asciiTheme&&i.push(`w:asciiTheme="${e.fontFamily.asciiTheme}"`),e.fontFamily.hAnsiTheme&&i.push(`w:hAnsiTheme="${e.fontFamily.hAnsiTheme}"`),e.fontFamily.eastAsiaTheme&&i.push(`w:eastAsiaTheme="${e.fontFamily.eastAsiaTheme}"`),e.fontFamily.csTheme&&i.push(`w:csTheme="${e.fontFamily.csTheme}"`),i.length>0&&t.push(`<w:rFonts ${i.join(" ")}/>`);}e.bold===true?t.push("<w:b/>"):e.bold===false&&t.push('<w:b w:val="0"/>'),e.boldCs===true?t.push("<w:bCs/>"):e.boldCs===false&&t.push('<w:bCs w:val="0"/>'),e.italic===true?t.push("<w:i/>"):e.italic===false&&t.push('<w:i w:val="0"/>'),e.italicCs===true?t.push("<w:iCs/>"):e.italicCs===false&&t.push('<w:iCs w:val="0"/>'),e.allCaps&&t.push("<w:caps/>"),e.smallCaps&&t.push("<w:smallCaps/>"),e.strike&&t.push("<w:strike/>"),e.doubleStrike&&t.push("<w:dstrike/>"),e.outline&&t.push("<w:outline/>"),e.shadow&&t.push("<w:shadow/>"),e.emboss&&t.push("<w:emboss/>"),e.imprint&&t.push("<w:imprint/>"),e.hidden&&t.push("<w:vanish/>");let n=Z(e.color);if(n&&t.push(n),e.spacing!==void 0&&t.push(`<w:spacing w:val="${e.spacing}"/>`),e.scale!==void 0&&t.push(`<w:w w:val="${e.scale}"/>`),e.kerning!==void 0&&t.push(`<w:kern w:val="${e.kerning}"/>`),e.position!==void 0&&t.push(`<w:position w:val="${e.position}"/>`),e.fontSize!==void 0&&t.push(`<w:sz w:val="${e.fontSize}"/>`),e.fontSizeCs!==void 0&&t.push(`<w:szCs w:val="${e.fontSizeCs}"/>`),e.highlight&&e.highlight!=="none"&&new Set(["black","blue","cyan","darkBlue","darkCyan","darkGray","darkGreen","darkMagenta","darkRed","darkYellow","green","lightGray","magenta","red","white","yellow"]).has(e.highlight)&&t.push(`<w:highlight w:val="${e.highlight}"/>`),e.underline){let i=[`w:val="${e.underline.style}"`];e.underline.color&&(e.underline.color.rgb&&i.push(`w:color="${e.underline.color.rgb}"`),e.underline.color.themeColor&&i.push(`w:themeColor="${e.underline.color.themeColor}"`)),t.push(`<w:u ${i.join(" ")}/>`);}e.effect&&e.effect!=="none"&&t.push(`<w:effect w:val="${e.effect}"/>`),e.emphasisMark&&e.emphasisMark!=="none"&&t.push(`<w:em w:val="${e.emphasisMark}"/>`);let r=Y(e.shading);return r&&t.push(r),e.vertAlign&&e.vertAlign!=="baseline"&&t.push(`<w:vertAlign w:val="${e.vertAlign}"/>`),e.rtl&&t.push("<w:rtl/>"),e.cs&&t.push("<w:cs/>"),t.length===0?"":`<w:rPr>${t.join("")}</w:rPr>`}function J(e){return `<w:t${e.preserveSpace||e.text.startsWith(" ")||e.text.endsWith(" ")||e.text.includes(" ")?' xml:space="preserve"':""}>${u(e.text)}</w:t>`}function K(e){return "<w:tab/>"}function Q(e){let t=[];return e.breakType==="page"?t.push('w:type="page"'):e.breakType==="column"?t.push('w:type="column"'):e.breakType==="textWrapping"&&(t.push('w:type="textWrapping"'),e.clear&&e.clear!=="none"&&t.push(`w:clear="${e.clear}"`)),t.length===0?"<w:br/>":`<w:br ${t.join(" ")}/>`}function ee(e){return `<w:sym w:font="${u(e.font)}" w:char="${u(e.char)}"/>`}function te(e){return e.type==="footnoteRef"?`<w:footnoteReference w:id="${e.id}"/>`:`<w:endnoteReference w:id="${e.id}"/>`}function ne(e){let t=[`w:fldCharType="${e.charType}"`];return e.fldLock&&t.push('w:fldLock="true"'),e.dirty&&t.push('w:dirty="true"'),`<w:fldChar ${t.join(" ")}/>`}function re(e){return `<w:instrText${e.text.startsWith(" ")||e.text.endsWith(" ")||e.text.includes(" ")?' xml:space="preserve"':""}>${u(e.text)}</w:instrText>`}function ie(e){return "<w:softHyphen/>"}function se(e){return "<w:noBreakHyphen/>"}function B(e){if(!e)return "";if(e.rgb)return `<a:srgbClr val="${e.rgb.replace("#","")}"/>`;if(e.themeColor){let t=`<a:schemeClr val="${e.themeColor}"`;return e.themeTint?t+=`><a:tint val="${e.themeTint}"/></a:schemeClr>`:e.themeShade?t+=`><a:shade val="${e.themeShade}"/></a:schemeClr>`:t+="/>",t}return ""}function oe(e){if(!e||e.type==="none")return "<a:noFill/>";if(e.type==="solid"&&e.color)return `<a:solidFill>${B(e.color)}</a:solidFill>`;if(e.type==="gradient"&&e.gradient){let t=e.gradient,n=t.stops.map(i=>`<a:gs pos="${i.position}">${B(i.color)}</a:gs>`).join(""),r=t.type==="linear"?`<a:lin ang="${(t.angle||0)*6e4}" scaled="1"/>`:"";return `<a:gradFill><a:gsLst>${n}</a:gsLst>${r}</a:gradFill>`}return ""}function j(e){if(!e)return "";let t=[];e.width!=null&&t.push(`w="${e.width}"`),e.cap&&t.push(`cap="${e.cap}"`);let n=[];return e.color&&n.push(`<a:solidFill>${B(e.color)}</a:solidFill>`),e.style&&e.style!=="solid"&&n.push(`<a:prstDash val="${e.style}"/>`),e.headEnd&&n.push(`<a:headEnd type="${e.headEnd.type}"${e.headEnd.width?` w="${e.headEnd.width}"`:""}${e.headEnd.length?` len="${e.headEnd.length}"`:""}/>`),e.tailEnd&&n.push(`<a:tailEnd type="${e.tailEnd.type}"${e.tailEnd.width?` w="${e.tailEnd.width}"`:""}${e.tailEnd.length?` len="${e.tailEnd.length}"`:""}/>`),n.length===0&&t.length===0?"":`<a:ln${t.length?" "+t.join(" "):""}>${n.join("")}</a:ln>`}function E(e){let t=[],n=e.horizontal;t.push(`<wp:positionH relativeFrom="${n.relativeTo}">`),n.alignment?t.push(`<wp:align>${n.alignment}</wp:align>`):t.push(`<wp:posOffset>${n.posOffset||0}</wp:posOffset>`),t.push("</wp:positionH>");let r=e.vertical;return t.push(`<wp:positionV relativeFrom="${r.relativeTo}">`),r.alignment?t.push(`<wp:align>${r.alignment}</wp:align>`):t.push(`<wp:posOffset>${r.posOffset||0}</wp:posOffset>`),t.push("</wp:positionV>"),t.join("")}function I(e){let t=e.wrapText?` wrapText="${e.wrapText}"`:' wrapText="bothSides"';switch(e.type){case "square":return `<wp:wrapSquare${t}/>`;case "tight":return `<wp:wrapTight${t}><wp:wrapPolygon edited="0"><wp:start x="0" y="0"/><wp:lineTo x="0" y="21600"/><wp:lineTo x="21600" y="21600"/><wp:lineTo x="21600" y="0"/><wp:lineTo x="0" y="0"/></wp:wrapPolygon></wp:wrapTight>`;case "through":return `<wp:wrapThrough${t}><wp:wrapPolygon edited="0"><wp:start x="0" y="0"/><wp:lineTo x="0" y="21600"/><wp:lineTo x="21600" y="21600"/><wp:lineTo x="21600" y="0"/><wp:lineTo x="0" y="0"/></wp:wrapPolygon></wp:wrapThrough>`;case "topAndBottom":return "<wp:wrapTopAndBottom/>";case "behind":case "inFront":return "<wp:wrapNone/>";default:return "<wp:wrapNone/>"}}function ae(e){let t=e.size.width,n=e.size.height,r=e.rId||"rId1",i=e.id||"0",s=e.filename||`image${i}`,o="";return e.transform?.rotation&&(o+=` rot="${Math.round(e.transform.rotation*6e4)}"`),e.transform?.flipH&&(o+=' flipH="1"'),e.transform?.flipV&&(o+=' flipV="1"'),['<a:graphic xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main">','<a:graphicData uri="http://schemas.openxmlformats.org/drawingml/2006/picture">','<pic:pic xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture">',"<pic:nvPicPr>",`<pic:cNvPr id="${i}" name="${u(s)}"${e.alt?` descr="${u(e.alt)}"`:""}/>`,"<pic:cNvPicPr/>","</pic:nvPicPr>","<pic:blipFill>",`<a:blip r:embed="${r}"/>`,"<a:stretch><a:fillRect/></a:stretch>","</pic:blipFill>","<pic:spPr>",`<a:xfrm${o}>`,'<a:off x="0" y="0"/>',`<a:ext cx="${t}" cy="${n}"/>`,"</a:xfrm>",'<a:prstGeom prst="rect"><a:avLst/></a:prstGeom>',e.outline?j(e.outline):"","</pic:spPr>","</pic:pic>","</a:graphicData>","</a:graphic>"].join("")}function ce(e){let t=e.image,n=t.wrap.type!=="inline",r=t.size.width,i=t.size.height,s=t.padding?.top??t.wrap.distT??0,o=t.padding?.bottom??t.wrap.distB??0,a=t.padding?.left??t.wrap.distL??0,l=t.padding?.right??t.wrap.distR??0,c=t.id||"1",p=t.title||t.filename||`Picture ${c}`,m=ae(t);if(!n)return ["<w:drawing>",`<wp:inline distT="${s}" distB="${o}" distL="${a}" distR="${l}">`,`<wp:extent cx="${r}" cy="${i}"/>`,'<wp:effectExtent l="0" t="0" r="0" b="0"/>',`<wp:docPr id="${c}" name="${u(p)}"${t.alt?` descr="${u(t.alt)}"`:""}${t.decorative?' hidden="1"':""}/>`,'<wp:cNvGraphicFramePr><a:graphicFrameLocks xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" noChangeAspect="1"/></wp:cNvGraphicFramePr>',m,"</wp:inline>","</w:drawing>"].join("");let w=t.wrap.type==="behind"?"1":"0",S=t.position?E(t.position):'<wp:positionH relativeFrom="column"><wp:posOffset>0</wp:posOffset></wp:positionH><wp:positionV relativeFrom="paragraph"><wp:posOffset>0</wp:posOffset></wp:positionV>',P=I(t.wrap);return ["<w:drawing>",`<wp:anchor distT="${s}" distB="${o}" distL="${a}" distR="${l}" simplePos="0" relativeHeight="251658240" behindDoc="${w}" locked="0" layoutInCell="1" allowOverlap="1">`,'<wp:simplePos x="0" y="0"/>',S,`<wp:extent cx="${r}" cy="${i}"/>`,'<wp:effectExtent l="0" t="0" r="0" b="0"/>',P,`<wp:docPr id="${c}" name="${u(p)}"${t.alt?` descr="${u(t.alt)}"`:""}/>`,'<wp:cNvGraphicFramePr><a:graphicFrameLocks xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" noChangeAspect="1"/></wp:cNvGraphicFramePr>',m,"</wp:anchor>","</w:drawing>"].join("")}function pe(e){return e.map(t=>y(t)).join("")}function le(e){let t=e.shape,n=t.size.width,r=t.size.height,i=t.shapeType==="textBox",s=t.wrap&&t.wrap.type!=="inline",o=t.wrap?.distT??0,a=t.wrap?.distB??0,l=t.wrap?.distL??0,c=t.wrap?.distR??0,p=t.id||"1",m=t.name||(i?`TextBox ${p}`:`Shape ${p}`),w="";t.transform?.rotation&&(w+=` rot="${Math.round(t.transform.rotation*6e4)}"`),t.transform?.flipH&&(w+=' flipH="1"'),t.transform?.flipV&&(w+=' flipV="1"');let S=["<wps:spPr>",`<a:xfrm${w}>`,'<a:off x="0" y="0"/>',`<a:ext cx="${n}" cy="${r}"/>`,"</a:xfrm>",`<a:prstGeom prst="${t.shapeType==="textBox"?"rect":t.shapeType}"><a:avLst/></a:prstGeom>`,oe(t.fill),j(t.outline),"</wps:spPr>"].join(""),P="";if(t.textBody){let h=t.textBody,g=['rot="0"','vert="horz"'];h.anchor&&g.push(`anchor="${h.anchor==="middle"?"ctr":h.anchor}"`),h.anchorCenter&&g.push('anchorCtr="1"'),h.margins&&(h.margins.left!=null&&g.push(`lIns="${h.margins.left}"`),h.margins.top!=null&&g.push(`tIns="${h.margins.top}"`),h.margins.right!=null&&g.push(`rIns="${h.margins.right}"`),h.margins.bottom!=null&&g.push(`bIns="${h.margins.bottom}"`)),i?P=["<wps:txbx><w:txbxContent>",pe(h.content),"</w:txbxContent></wps:txbx>",`<wps:bodyPr ${g.join(" ")}/>`].join(""):P=[`<wps:bodyPr ${g.join(" ")}/>`].join("");}let k=['<a:graphic xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main">','<a:graphicData uri="http://schemas.microsoft.com/office/word/2010/wordprocessingShape">',["<wps:wsp>",`<wps:cNvSpPr${i?' txBox="1"':""}/>`,S,P,"</wps:wsp>"].join(""),"</a:graphicData>","</a:graphic>"].join("");if(!s)return ["<w:drawing>",`<wp:inline distT="${o}" distB="${a}" distL="${l}" distR="${c}">`,`<wp:extent cx="${n}" cy="${r}"/>`,'<wp:effectExtent l="0" t="0" r="0" b="0"/>',`<wp:docPr id="${p}" name="${u(m)}"/>`,"<wp:cNvGraphicFramePr/>",k,"</wp:inline>","</w:drawing>"].join("");let _=t.wrap?.type==="behind"?"1":"0",q=t.position?E(t.position):'<wp:positionH relativeFrom="column"><wp:posOffset>0</wp:posOffset></wp:positionH><wp:positionV relativeFrom="paragraph"><wp:posOffset>0</wp:posOffset></wp:positionV>',U=I(t.wrap);return ["<w:drawing>",`<wp:anchor distT="${o}" distB="${a}" distL="${l}" distR="${c}" simplePos="0" relativeHeight="251658240" behindDoc="${_}" locked="0" layoutInCell="1" allowOverlap="1">`,'<wp:simplePos x="0" y="0"/>',q,`<wp:extent cx="${n}" cy="${r}"/>`,'<wp:effectExtent l="0" t="0" r="0" b="0"/>',U,`<wp:docPr id="${p}" name="${u(m)}"/>`,"<wp:cNvGraphicFramePr/>",k,"</wp:anchor>","</w:drawing>"].join("")}function ue(e){switch(e.type){case "text":return J(e);case "tab":return K();case "break":return Q(e);case "symbol":return ee(e);case "footnoteRef":case "endnoteRef":return te(e);case "fieldChar":return ne(e);case "instrText":return re(e);case "softHyphen":return ie();case "noBreakHyphen":return se();case "drawing":return ce(e);case "shape":return le(e);default:return ""}}function x(e){let t=[],n=C(e.formatting);n&&t.push(n);for(let r of e.content){let i=ue(r);i&&t.push(i);}return `<w:r>${t.join("")}</w:r>`}function f(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function T(e,t){if(!e||e.style==="none"||e.style==="nil")return "";let n=[`w:val="${e.style}"`];return e.size!==void 0&&n.push(`w:sz="${e.size}"`),e.space!==void 0&&n.push(`w:space="${e.space}"`),e.color&&(e.color.auto?n.push('w:color="auto"'):e.color.rgb&&n.push(`w:color="${e.color.rgb}"`),e.color.themeColor&&n.push(`w:themeColor="${e.color.themeColor}"`),e.color.themeTint&&n.push(`w:themeTint="${e.color.themeTint}"`),e.color.themeShade&&n.push(`w:themeShade="${e.color.themeShade}"`)),e.shadow&&n.push('w:shadow="true"'),e.frame&&n.push('w:frame="true"'),`<w:${t} ${n.join(" ")}/>`}function fe(e){if(!e)return "";let t=[];if(e.top){let n=T(e.top,"top");n&&t.push(n);}if(e.left){let n=T(e.left,"left");n&&t.push(n);}if(e.bottom){let n=T(e.bottom,"bottom");n&&t.push(n);}if(e.right){let n=T(e.right,"right");n&&t.push(n);}if(e.between){let n=T(e.between,"between");n&&t.push(n);}if(e.bar){let n=T(e.bar,"bar");n&&t.push(n);}return t.length===0?"":`<w:pBdr>${t.join("")}</w:pBdr>`}function he(e){if(!e)return "";let t=[];return e.pattern?t.push(`w:val="${e.pattern}"`):t.push('w:val="clear"'),e.color?.rgb?t.push(`w:color="${e.color.rgb}"`):e.color?.auto&&t.push('w:color="auto"'),e.fill?.rgb?t.push(`w:fill="${e.fill.rgb}"`):e.fill?.auto&&t.push('w:fill="auto"'),e.fill?.themeColor&&t.push(`w:themeFill="${e.fill.themeColor}"`),e.fill?.themeTint&&t.push(`w:themeFillTint="${e.fill.themeTint}"`),e.fill?.themeShade&&t.push(`w:themeFillShade="${e.fill.themeShade}"`),t.length===0?"":`<w:shd ${t.join(" ")}/>`}function de(e){return !e||e.length===0?"":`<w:tabs>${e.map(n=>{let r=[`w:val="${n.alignment}"`,`w:pos="${n.position}"`];return n.leader&&n.leader!=="none"&&r.push(`w:leader="${n.leader}"`),`<w:tab ${r.join(" ")}/>`}).join("")}</w:tabs>`}function me(e){let t=[];return e.spaceBefore!==void 0&&t.push(`w:before="${e.spaceBefore}"`),e.spaceAfter!==void 0&&t.push(`w:after="${e.spaceAfter}"`),e.lineSpacing!==void 0&&t.push(`w:line="${e.lineSpacing}"`),e.lineSpacingRule&&t.push(`w:lineRule="${e.lineSpacingRule}"`),e.beforeAutospacing&&t.push('w:beforeAutospacing="1"'),e.afterAutospacing&&t.push('w:afterAutospacing="1"'),t.length===0?"":`<w:spacing ${t.join(" ")}/>`}function we(e){let t=[];return e.indentLeft!==void 0&&t.push(`w:left="${e.indentLeft}"`),e.indentRight!==void 0&&t.push(`w:right="${e.indentRight}"`),e.indentFirstLine!==void 0&&(e.hangingIndent?t.push(`w:hanging="${Math.abs(e.indentFirstLine)}"`):e.indentFirstLine!==0&&t.push(`w:firstLine="${e.indentFirstLine}"`)),t.length===0?"":`<w:ind ${t.join(" ")}/>`}function ge(e){if(!e)return "";let t=[];return e.ilvl!==void 0&&t.push(`<w:ilvl w:val="${e.ilvl}"/>`),e.numId!==void 0&&t.push(`<w:numId w:val="${e.numId}"/>`),t.length===0?"":`<w:numPr>${t.join("")}</w:numPr>`}function xe(e){if(!e)return "";let t=[];return e.width!==void 0&&t.push(`w:w="${e.width}"`),e.height!==void 0&&t.push(`w:h="${e.height}"`),e.hAnchor&&t.push(`w:hAnchor="${e.hAnchor}"`),e.vAnchor&&t.push(`w:vAnchor="${e.vAnchor}"`),e.x!==void 0&&t.push(`w:x="${e.x}"`),e.y!==void 0&&t.push(`w:y="${e.y}"`),e.xAlign&&t.push(`w:xAlign="${e.xAlign}"`),e.yAlign&&t.push(`w:yAlign="${e.yAlign}"`),e.wrap&&t.push(`w:wrap="${e.wrap}"`),t.length===0?"":`<w:framePr ${t.join(" ")}/>`}function ye(e){if(!e)return "";let t=[];e.styleId&&t.push(`<w:pStyle w:val="${f(e.styleId)}"/>`),e.keepNext&&t.push("<w:keepNext/>"),e.keepLines&&t.push("<w:keepLines/>"),e.contextualSpacing&&t.push("<w:contextualSpacing/>"),e.pageBreakBefore&&t.push("<w:pageBreakBefore/>");let n=xe(e.frame);n&&t.push(n),e.widowControl===false?t.push('<w:widowControl w:val="0"/>'):e.widowControl===true&&t.push("<w:widowControl/>");let r=ge(e.numPr);r&&t.push(r);let i=fe(e.borders);i&&t.push(i);let s=he(e.shading);s&&t.push(s);let o=de(e.tabs);o&&t.push(o),e.suppressLineNumbers&&t.push("<w:suppressLineNumbers/>"),e.suppressAutoHyphens&&t.push("<w:suppressAutoHyphens/>");let a=me(e);a&&t.push(a);let l=we(e);if(l&&t.push(l),e.bidi&&t.push("<w:bidi/>"),e.alignment&&t.push(`<w:jc w:val="${e.alignment}"/>`),e.outlineLevel!==void 0&&t.push(`<w:outlineLvl w:val="${e.outlineLevel}"/>`),e.runProperties){let c=C(e.runProperties);c&&t.push(c);}return t.length===0?"":`<w:pPr>${t.join("")}</w:pPr>`}function z(e){let t=[];e.rId&&t.push(`r:id="${e.rId}"`),e.anchor&&t.push(`w:anchor="${f(e.anchor)}"`),e.tooltip&&t.push(`w:tooltip="${f(e.tooltip)}"`),e.target&&t.push(`w:tgtFrame="${f(e.target)}"`),e.history===false&&t.push('w:history="0"'),e.docLocation&&t.push(`w:docLocation="${f(e.docLocation)}"`);let n=e.children.map(i=>i.type==="run"?x(i):i.type==="bookmarkStart"?L(i):i.type==="bookmarkEnd"?O(i):"").join("");return `<w:hyperlink${t.length>0?" "+t.join(" "):""}>${n}</w:hyperlink>`}function L(e){let t=[`w:id="${e.id}"`,`w:name="${f(e.name)}"`];return e.colFirst!==void 0&&t.push(`w:colFirst="${e.colFirst}"`),e.colLast!==void 0&&t.push(`w:colLast="${e.colLast}"`),`<w:bookmarkStart ${t.join(" ")}/>`}function O(e){return `<w:bookmarkEnd w:id="${e.id}"/>`}function $e(e){let t=[],n=e.content.find(a=>a.type==="run"),r=n?.formatting?C(n.formatting):"",i=['w:fldCharType="begin"'];e.fldLock&&i.push('w:fldLock="true"'),t.push(`<w:r>${r}<w:fldChar ${i.join(" ")}/></w:r>`);let o=e.instruction.startsWith(" ")||e.instruction.endsWith(" ")||e.instruction.includes(" ")?' xml:space="preserve"':"";t.push(`<w:r>${r}<w:instrText${o}>${f(e.instruction)}</w:instrText></w:r>`),t.push(`<w:r>${r}<w:fldChar w:fldCharType="separate"/></w:r>`);for(let a of e.content)a.type==="run"&&t.push(x(a));return t.push(`<w:r>${r}<w:fldChar w:fldCharType="end"/></w:r>`),t.join("")}function Te(e){let t=[],n=e.fieldResult?.[0]?.formatting,r=n?C(n):"",i=['w:fldCharType="begin"'];if(e.fldLock&&i.push('w:fldLock="true"'),t.push(`<w:r>${r}<w:fldChar ${i.join(" ")}/></w:r>`),e.fieldCode.length>0)t.push(...e.fieldCode.map(s=>x(s)));else {let o=e.instruction.startsWith(" ")||e.instruction.endsWith(" ")||e.instruction.includes(" ")?' xml:space="preserve"':"";t.push(`<w:r>${r}<w:instrText${o}>${f(e.instruction)}</w:instrText></w:r>`);}return t.push(`<w:r>${r}<w:fldChar w:fldCharType="separate"/></w:r>`),t.push(...e.fieldResult.map(s=>x(s))),t.push(`<w:r>${r}<w:fldChar w:fldCharType="end"/></w:r>`),t.join("")}function be(e){let t=e.properties,n=[];switch(t.alias&&n.push(`<w:alias w:val="${f(t.alias)}"/>`),t.tag&&n.push(`<w:tag w:val="${f(t.tag)}"/>`),t.lock&&t.lock!=="unlocked"&&n.push(`<w:lock w:val="${t.lock}"/>`),t.showingPlaceholder&&n.push("<w:showingPlcHdr/>"),t.sdtType){case "plainText":n.push("<w:text/>");break;case "date":t.dateFormat?n.push(`<w:date w:fullDate="${f(t.dateFormat)}"/>`):n.push("<w:date/>");break;case "dropdown":{let i=(t.listItems??[]).map(s=>`<w:listItem w:displayText="${f(s.displayText)}" w:value="${f(s.value)}"/>`).join("");n.push(`<w:dropDownList>${i}</w:dropDownList>`);break}case "comboBox":{let i=(t.listItems??[]).map(s=>`<w:listItem w:displayText="${f(s.displayText)}" w:value="${f(s.value)}"/>`).join("");n.push(`<w:comboBox>${i}</w:comboBox>`);break}case "checkbox":n.push(`<w14:checkbox><w14:checked w14:val="${t.checked?"1":"0"}"/></w14:checkbox>`);break;case "picture":n.push("<w:picture/>");break}let r=e.content.map(i=>i.type==="run"?x(i):i.type==="hyperlink"?z(i):"").join("");return `<w:sdt><w:sdtPr>${n.join("")}</w:sdtPr><w:sdtContent>${r}</w:sdtContent></w:sdt>`}function X(e,t){let n=t.info,r=[`w:id="${n.id}"`,`w:author="${f(n.author)}"`];n.date&&r.push(`w:date="${f(n.date)}"`);let i=t.content.map(s=>s.type==="run"?x(s):s.type==="hyperlink"?z(s):"").join("");return `<w:${e} ${r.join(" ")}>${i}</w:${e}>`}function Pe(e){switch(e.type){case "run":return x(e);case "hyperlink":return z(e);case "bookmarkStart":return L(e);case "bookmarkEnd":return O(e);case "simpleField":return $e(e);case "complexField":return Te(e);case "inlineSdt":return be(e);case "commentRangeStart":return `<w:commentRangeStart w:id="${e.id}"/>`;case "commentRangeEnd":return `<w:commentRangeEnd w:id="${e.id}"/>`;case "insertion":return X("ins",e);case "deletion":return X("del",e);case "mathEquation":return e.ommlXml||"";default:return ""}}function y(e){let t=[],n=[];e.paraId&&n.push(`w14:paraId="${e.paraId}"`),e.textId&&n.push(`w14:textId="${e.textId}"`);let r=n.length>0?" "+n.join(" "):"",i=ye(e.formatting);i&&t.push(i);for(let s of e.content){let o=Pe(s);o&&t.push(o);}return `<w:p${r}>${t.join("")}</w:p>`}function Ce(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function $(e,t){if(!e)return "";let n=[`w:w="${e.value}"`,`w:type="${e.type}"`];return `<w:${t} ${n.join(" ")}/>`}function b(e,t){if(!e||e.style==="none"||e.style==="nil")return "";let n=[`w:val="${e.style}"`];return e.size!==void 0&&n.push(`w:sz="${e.size}"`),e.space!==void 0&&n.push(`w:space="${e.space}"`),e.color&&(e.color.auto?n.push('w:color="auto"'):e.color.rgb&&n.push(`w:color="${e.color.rgb}"`),e.color.themeColor&&n.push(`w:themeColor="${e.color.themeColor}"`),e.color.themeTint&&n.push(`w:themeTint="${e.color.themeTint}"`),e.color.themeShade&&n.push(`w:themeShade="${e.color.themeShade}"`)),e.shadow&&n.push('w:shadow="true"'),e.frame&&n.push('w:frame="true"'),`<w:${t} ${n.join(" ")}/>`}function H(e,t){if(!e)return "";let n=[];if(e.top){let r=b(e.top,"top");r&&n.push(r);}if(e.left){let r=b(e.left,"left");r&&n.push(r);}if(e.bottom){let r=b(e.bottom,"bottom");r&&n.push(r);}if(e.right){let r=b(e.right,"right");r&&n.push(r);}if(e.insideH){let r=b(e.insideH,"insideH");r&&n.push(r);}if(e.insideV){let r=b(e.insideV,"insideV");r&&n.push(r);}return n.length===0?"":`<w:${t}>${n.join("")}</w:${t}>`}function M(e,t){if(!e)return "";let n=[];return e.top&&n.push($(e.top,"top")),e.left&&n.push($(e.left,"left")),e.bottom&&n.push($(e.bottom,"bottom")),e.right&&n.push($(e.right,"right")),n.length===0?"":`<w:${t}>${n.join("")}</w:${t}>`}function N(e){if(!e)return "";let t=[];return e.pattern?t.push(`w:val="${e.pattern}"`):t.push('w:val="clear"'),e.color?.rgb?t.push(`w:color="${e.color.rgb}"`):e.color?.auto&&t.push('w:color="auto"'),e.fill?.rgb?t.push(`w:fill="${e.fill.rgb}"`):e.fill?.auto&&t.push('w:fill="auto"'),e.fill?.themeColor&&t.push(`w:themeFill="${e.fill.themeColor}"`),e.fill?.themeTint&&t.push(`w:themeFillTint="${e.fill.themeTint}"`),e.fill?.themeShade&&t.push(`w:themeFillShade="${e.fill.themeShade}"`),t.length===0?"":`<w:shd ${t.join(" ")}/>`}function ve(e){if(!e)return "";let t=[];return e.firstRow&&t.push('w:firstRow="1"'),e.lastRow&&t.push('w:lastRow="1"'),e.firstColumn&&t.push('w:firstColumn="1"'),e.lastColumn&&t.push('w:lastColumn="1"'),e.noHBand&&t.push('w:noHBand="1"'),e.noVBand&&t.push('w:noVBand="1"'),t.length===0?"":`<w:tblLook ${t.join(" ")}/>`}function Fe(e){if(!e)return "";let t=[];return e.horzAnchor&&t.push(`w:horzAnchor="${e.horzAnchor}"`),e.vertAnchor&&t.push(`w:vertAnchor="${e.vertAnchor}"`),e.tblpX!==void 0&&t.push(`w:tblpX="${e.tblpX}"`),e.tblpXSpec&&t.push(`w:tblpXSpec="${e.tblpXSpec}"`),e.tblpY!==void 0&&t.push(`w:tblpY="${e.tblpY}"`),e.tblpYSpec&&t.push(`w:tblpYSpec="${e.tblpYSpec}"`),e.topFromText!==void 0&&t.push(`w:topFromText="${e.topFromText}"`),e.bottomFromText!==void 0&&t.push(`w:bottomFromText="${e.bottomFromText}"`),e.leftFromText!==void 0&&t.push(`w:leftFromText="${e.leftFromText}"`),e.rightFromText!==void 0&&t.push(`w:rightFromText="${e.rightFromText}"`),t.length===0?"":`<w:tblpPr ${t.join(" ")}/>`}function Se(e){if(!e)return "";let t=[];e.styleId&&t.push(`<w:tblStyle w:val="${Ce(e.styleId)}"/>`);let n=Fe(e.floating);n&&t.push(n),e.bidi&&t.push("<w:bidiVisual/>");let r=$(e.width,"tblW");r&&t.push(r),e.justification&&t.push(`<w:jc w:val="${e.justification}"/>`);let i=$(e.cellSpacing,"tblCellSpacing");i&&t.push(i);let s=$(e.indent,"tblInd");s&&t.push(s);let o=H(e.borders,"tblBorders");o&&t.push(o);let a=M(e.cellMargins,"tblCellMar");a&&t.push(a),e.layout&&t.push(`<w:tblLayout w:type="${e.layout}"/>`);let l=N(e.shading);l&&t.push(l);let c=ve(e.look);return c&&t.push(c),e.overlap&&t.push(`<w:tblOverlap w:val="${e.overlap}"/>`),t.length===0?"":`<w:tblPr>${t.join("")}</w:tblPr>`}function Ae(e){if(!e)return "";let t=[];if(e.cantSplit&&t.push("<w:cantSplit/>"),e.header&&t.push("<w:tblHeader/>"),e.height){let n=[`w:val="${e.height.value}"`];e.heightRule&&n.push(`w:hRule="${e.heightRule}"`),t.push(`<w:trHeight ${n.join(" ")}/>`);}return e.justification&&t.push(`<w:jc w:val="${e.justification}"/>`),e.hidden&&t.push("<w:hidden/>"),t.length===0?"":`<w:trPr>${t.join("")}</w:trPr>`}function Be(e){if(!e)return "";let n=[e.firstRow?"1":"0",e.lastRow?"1":"0",e.firstColumn?"1":"0",e.lastColumn?"1":"0",e.oddVBand?"1":"0",e.evenVBand?"1":"0",e.oddHBand?"1":"0",e.evenHBand?"1":"0",e.nwCell?"1":"0",e.neCell?"1":"0",e.swCell?"1":"0",e.seCell?"1":"0"].join("");return n==="000000000000"?"":`<w:cnfStyle w:val="${n}"/>`}function ze(e){if(!e)return "";let t=[],n=Be(e.conditionalFormat);n&&t.push(n);let r=$(e.width,"tcW");r&&t.push(r),e.gridSpan&&e.gridSpan>1&&t.push(`<w:gridSpan w:val="${e.gridSpan}"/>`),e.vMerge&&(e.vMerge==="restart"?t.push('<w:vMerge w:val="restart"/>'):t.push("<w:vMerge/>"));let i=H(e.borders,"tcBorders");i&&t.push(i);let s=N(e.shading);s&&t.push(s),e.noWrap&&t.push("<w:noWrap/>");let o=M(e.margins,"tcMar");return o&&t.push(o),e.textDirection&&t.push(`<w:textDirection w:val="${e.textDirection}"/>`),e.fitText&&t.push("<w:tcFitText/>"),e.verticalAlign&&t.push(`<w:vAlign w:val="${e.verticalAlign}"/>`),e.hideMark&&t.push("<w:hideMark/>"),t.length===0?"":`<w:tcPr>${t.join("")}</w:tcPr>`}function De(e){return !e||e.length===0?"":`<w:tblGrid>${e.map(n=>`<w:gridCol w:w="${n}"/>`).join("")}</w:tblGrid>`}function Re(e){let t=[];for(let n of e)n.type==="paragraph"?t.push(y(n)):n.type==="table"&&t.push(v(n));return t.length===0&&t.push("<w:p/>"),t.join("")}function ke(e){let t=[],n=ze(e.formatting);return n&&t.push(n),t.push(Re(e.content)),`<w:tc>${t.join("")}</w:tc>`}function je(e){let t=[],n=Ae(e.formatting);n&&t.push(n);for(let r of e.cells)t.push(ke(r));return `<w:tr>${t.join("")}</w:tr>`}function v(e){let t=[],n=Se(e.formatting);n&&t.push(n);let r=De(e.columnWidths);r&&t.push(r);for(let i of e.rows)t.push(je(i));return `<w:tbl>${t.join("")}</w:tbl>`}var d={wpc:"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas",mc:"http://schemas.openxmlformats.org/markup-compatibility/2006",o:"urn:schemas-microsoft-com:office:office",r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",m:"http://schemas.openxmlformats.org/officeDocument/2006/math",v:"urn:schemas-microsoft-com:vml",wp14:"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing",wp:"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing",w10:"urn:schemas-microsoft-com:office:word",w:"http://schemas.openxmlformats.org/wordprocessingml/2006/main",w14:"http://schemas.microsoft.com/office/word/2010/wordml",w15:"http://schemas.microsoft.com/office/word/2012/wordml",wpg:"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup",wps:"http://schemas.microsoft.com/office/word/2010/wordprocessingShape"};function Ee(){let e={wpc:d.wpc,mc:d.mc,o:d.o,r:d.r,m:d.m,v:d.v,wp14:d.wp14,wp:d.wp,w10:d.w10,w:d.w,w14:d.w14,w15:d.w15,wpg:d.wpg,wps:d.wps};return Object.entries(e).map(([t,n])=>`xmlns:${t}="${n}"`).join(" ")}function F(e,t){if(!e||e.style==="none"||e.style==="nil")return "";let n=[`w:val="${e.style}"`];return e.size!==void 0&&n.push(`w:sz="${e.size}"`),e.space!==void 0&&n.push(`w:space="${e.space}"`),e.color&&(e.color.auto?n.push('w:color="auto"'):e.color.rgb&&n.push(`w:color="${e.color.rgb}"`),e.color.themeColor&&n.push(`w:themeColor="${e.color.themeColor}"`),e.color.themeTint&&n.push(`w:themeTint="${e.color.themeTint}"`),e.color.themeShade&&n.push(`w:themeShade="${e.color.themeShade}"`)),e.shadow&&n.push('w:shadow="true"'),e.frame&&n.push('w:frame="true"'),`<w:${t} ${n.join(" ")}/>`}function Ie(e){return `<w:headerReference ${[`w:type="${e.type}"`,`r:id="${e.rId}"`].join(" ")}/>`}function Xe(e){return `<w:footerReference ${[`w:type="${e.type}"`,`r:id="${e.rId}"`].join(" ")}/>`}function Le(e){if(!e)return "";let t=[];return e.position&&t.push(`<w:pos w:val="${e.position}"/>`),e.numFmt&&t.push(`<w:numFmt w:val="${e.numFmt}"/>`),e.numStart!==void 0&&t.push(`<w:numStart w:val="${e.numStart}"/>`),e.numRestart&&t.push(`<w:numRestart w:val="${e.numRestart}"/>`),t.length===0?"":`<w:footnotePr>${t.join("")}</w:footnotePr>`}function Oe(e){if(!e)return "";let t=[];return e.position&&t.push(`<w:pos w:val="${e.position}"/>`),e.numFmt&&t.push(`<w:numFmt w:val="${e.numFmt}"/>`),e.numStart!==void 0&&t.push(`<w:numStart w:val="${e.numStart}"/>`),e.numRestart&&t.push(`<w:numRestart w:val="${e.numRestart}"/>`),t.length===0?"":`<w:endnotePr>${t.join("")}</w:endnotePr>`}function He(e){let t=[];return e.pageWidth!==void 0&&t.push(`w:w="${e.pageWidth}"`),e.pageHeight!==void 0&&t.push(`w:h="${e.pageHeight}"`),e.orientation==="landscape"&&t.push('w:orient="landscape"'),t.length===0?"":`<w:pgSz ${t.join(" ")}/>`}function Me(e){let t=[];return e.marginTop!==void 0&&t.push(`w:top="${e.marginTop}"`),e.marginRight!==void 0&&t.push(`w:right="${e.marginRight}"`),e.marginBottom!==void 0&&t.push(`w:bottom="${e.marginBottom}"`),e.marginLeft!==void 0&&t.push(`w:left="${e.marginLeft}"`),e.headerDistance!==void 0&&t.push(`w:header="${e.headerDistance}"`),e.footerDistance!==void 0&&t.push(`w:footer="${e.footerDistance}"`),e.gutter!==void 0&&t.push(`w:gutter="${e.gutter}"`),t.length===0?"":`<w:pgMar ${t.join(" ")}/>`}function Ne(e){if(!e.columnCount&&!e.columns?.length)return "";let t=[];e.columnCount!==void 0&&e.columnCount>1&&t.push(`w:num="${e.columnCount}"`),e.columnSpace!==void 0&&t.push(`w:space="${e.columnSpace}"`),e.equalWidth!==void 0&&t.push(`w:equalWidth="${e.equalWidth?"1":"0"}"`),e.separator&&t.push('w:sep="1"');let n="";return e.columns&&e.columns.length>0&&(n=e.columns.map(i=>{let s=[];return i.width!==void 0&&s.push(`w:w="${i.width}"`),i.space!==void 0&&s.push(`w:space="${i.space}"`),`<w:col ${s.join(" ")}/>`}).join("")),t.length===0&&!n?"":`<w:cols${t.length>0?" "+t.join(" "):""}>${n}</w:cols>`}function We(e){if(!e.lineNumbers)return "";let t=e.lineNumbers,n=[];return t.countBy!==void 0&&n.push(`w:countBy="${t.countBy}"`),t.start!==void 0&&n.push(`w:start="${t.start}"`),t.distance!==void 0&&n.push(`w:distance="${t.distance}"`),t.restart&&n.push(`w:restart="${t.restart}"`),n.length===0?"":`<w:lnNumType ${n.join(" ")}/>`}function Ge(e){if(!e.pageBorders)return "";let t=e.pageBorders,n=[],r=[];if(t.display&&n.push(`w:display="${t.display}"`),t.offsetFrom&&n.push(`w:offsetFrom="${t.offsetFrom}"`),t.zOrder&&n.push(`w:zOrder="${t.zOrder}"`),t.top){let s=F(t.top,"top");s&&r.push(s);}if(t.left){let s=F(t.left,"left");s&&r.push(s);}if(t.bottom){let s=F(t.bottom,"bottom");s&&r.push(s);}if(t.right){let s=F(t.right,"right");s&&r.push(s);}return r.length===0?"":`<w:pgBorders${n.length>0?" "+n.join(" "):""}>${r.join("")}</w:pgBorders>`}function Ve(e){if(!e.docGrid)return "";let t=e.docGrid,n=[];return t.type&&n.push(`w:type="${t.type}"`),t.linePitch!==void 0&&n.push(`w:linePitch="${t.linePitch}"`),t.charSpace!==void 0&&n.push(`w:charSpace="${t.charSpace}"`),n.length===0?"":`<w:docGrid ${n.join(" ")}/>`}function _e(e){if(!e)return "";let t=[];if(e.headerReferences)for(let p of e.headerReferences)t.push(Ie(p));if(e.footerReferences)for(let p of e.footerReferences)t.push(Xe(p));let n=Le(e.footnotePr);n&&t.push(n);let r=Oe(e.endnotePr);r&&t.push(r),e.sectionStart&&t.push(`<w:type w:val="${e.sectionStart}"/>`);let i=He(e);i&&t.push(i);let s=Me(e);if(s&&t.push(s),e.paperSrcFirst!==void 0||e.paperSrcOther!==void 0){let p=[];e.paperSrcFirst!==void 0&&p.push(`w:first="${e.paperSrcFirst}"`),e.paperSrcOther!==void 0&&p.push(`w:other="${e.paperSrcOther}"`),t.push(`<w:paperSrc ${p.join(" ")}/>`);}let o=Ge(e);o&&t.push(o);let a=We(e);a&&t.push(a);let l=Ne(e);l&&t.push(l);let c=Ve(e);return c&&t.push(c),e.verticalAlign&&t.push(`<w:vAlign w:val="${e.verticalAlign}"/>`),e.bidi&&t.push("<w:bidi/>"),e.titlePg&&t.push("<w:titlePg/>"),e.evenAndOddHeaders&&t.push("<w:evenAndOddHeaders/>"),t.length===0?"":`<w:sectPr>${t.join("")}</w:sectPr>`}function W(e){if(e.type==="paragraph")return y(e);if(e.type==="table")return v(e);if(e.type==="blockSdt"){let t=e.content.map(i=>W(i)).join(""),n=e.properties,r=[];return n.alias&&r.push(`<w:alias w:val="${n.alias}"/>`),n.tag&&r.push(`<w:tag w:val="${n.tag}"/>`),`<w:sdt><w:sdtPr>${r.join("")}</w:sdtPr><w:sdtContent>${t}</w:sdtContent></w:sdt>`}return ""}function qe(e){return e.map(t=>W(t)).join("")}function Ue(e){let t=[];return t.push(qe(e.content)),e.finalSectionProperties&&t.push(_e(e.finalSectionProperties)),t.join("")}function G(e){let t=[];t.push('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>');let n=Ee();return t.push(`<w:document ${n} mc:Ignorable="w14 w15 wp14">`),t.push("<w:body>"),t.push(Ue(e.package.document)),t.push("</w:body>"),t.push("</w:document>"),t.join("")}var Ze={wpc:"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas",mc:"http://schemas.openxmlformats.org/markup-compatibility/2006",o:"urn:schemas-microsoft-com:office:office",r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",m:"http://schemas.openxmlformats.org/officeDocument/2006/math",v:"urn:schemas-microsoft-com:vml",wp14:"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing",wp:"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing",w10:"urn:schemas-microsoft-com:office:word",w:"http://schemas.openxmlformats.org/wordprocessingml/2006/main",w14:"http://schemas.microsoft.com/office/word/2010/wordml",w15:"http://schemas.microsoft.com/office/word/2012/wordml",wpg:"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup",wps:"http://schemas.microsoft.com/office/word/2010/wordprocessingShape"};function Ye(){return Object.entries(Ze).map(([e,t])=>`xmlns:${e}="${t}"`).join(" ")}function Je(e){return e.type==="paragraph"?y(e):e.type==="table"?v(e):""}function D(e){let t=e.type==="header"?"w:hdr":"w:ftr",n=Ye(),r=e.content.map(i=>Je(i)).join("");return r||(r="<w:p><w:pPr/></w:p>"),`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
2
|
+
<${t} ${n}>${r}</${t}>`}async function Ke(e,t={}){if(!e.originalBuffer)throw new Error("Cannot repack document: no original buffer for round-trip. Use createDocx() for new documents.");let{compressionLevel:n=6,updateModifiedDate:r=true,modifiedBy:i}=t,s=await R__default.default.loadAsync(e.originalBuffer),o=new R__default.default;for(let[c,p]of Object.entries(s.files)){if(p.dir){o.folder(c.replace(/\/$/,""));continue}let m=await p.async("arraybuffer");o.file(c,m,{compression:"DEFLATE",compressionOptions:{level:n}});}let a=G(e);if(o.file("word/document.xml",a,{compression:"DEFLATE",compressionOptions:{level:n}}),Qe(e,o,n),r){let c="docProps/core.xml",p=s.file(c);if(p){let m=await p.async("text"),w=et(m,{updateModifiedDate:r,modifiedBy:i});o.file(c,w,{compression:"DEFLATE",compressionOptions:{level:n}});}}return await o.generateAsync({type:"arraybuffer",compression:"DEFLATE",compressionOptions:{level:n}})}function Qe(e,t,n){let r=e.package.relationships;if(!r)return;let i={level:n};if(e.package.headers)for(let[s,o]of e.package.headers.entries()){let a=r.get(s);if(a&&a.type===chunkTRAQI6RX_cjs.b.header&&a.target){let l=a.target.startsWith("/")?a.target.slice(1):`word/${a.target}`,c=D(o);t.file(l,c,{compression:"DEFLATE",compressionOptions:i});}}if(e.package.footers)for(let[s,o]of e.package.footers.entries()){let a=r.get(s);if(a&&a.type===chunkTRAQI6RX_cjs.b.footer&&a.target){let l=a.target.startsWith("/")?a.target.slice(1):`word/${a.target}`,c=D(o);t.file(l,c,{compression:"DEFLATE",compressionOptions:i});}}}function et(e,t){let n=e;if(t.updateModifiedDate){let r=new Date().toISOString();n.includes("<dcterms:modified")?n=n.replace(/<dcterms:modified[^>]*>[^<]*<\/dcterms:modified>/,`<dcterms:modified xsi:type="dcterms:W3CDTF">${r}</dcterms:modified>`):n=n.replace("</cp:coreProperties>",`<dcterms:modified xsi:type="dcterms:W3CDTF">${r}</dcterms:modified></cp:coreProperties>`);}return t.modifiedBy&&(n.includes("<cp:lastModifiedBy")?n=n.replace(/<cp:lastModifiedBy>[^<]*<\/cp:lastModifiedBy>/,`<cp:lastModifiedBy>${V(t.modifiedBy)}</cp:lastModifiedBy>`):n=n.replace("</cp:coreProperties>",`<cp:lastModifiedBy>${V(t.modifiedBy)}</cp:lastModifiedBy></cp:coreProperties>`)),n}function V(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}async function tt(){let e=new R__default.default;e.file("[Content_Types].xml",`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
3
|
+
<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">
|
|
4
|
+
<Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/>
|
|
5
|
+
<Default Extension="xml" ContentType="application/xml"/>
|
|
6
|
+
<Override PartName="/word/document.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml"/>
|
|
7
|
+
<Override PartName="/word/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml"/>
|
|
8
|
+
<Override PartName="/docProps/core.xml" ContentType="application/vnd.openxmlformats-package.core-properties+xml"/>
|
|
9
|
+
<Override PartName="/docProps/app.xml" ContentType="application/vnd.openxmlformats-officedocument.extended-properties+xml"/>
|
|
10
|
+
</Types>`),e.file("_rels/.rels",`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
11
|
+
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
|
|
12
|
+
<Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="word/document.xml"/>
|
|
13
|
+
<Relationship Id="rId2" Type="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties" Target="docProps/core.xml"/>
|
|
14
|
+
<Relationship Id="rId3" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties" Target="docProps/app.xml"/>
|
|
15
|
+
</Relationships>`),e.file("word/_rels/document.xml.rels",`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
16
|
+
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
|
|
17
|
+
<Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" Target="styles.xml"/>
|
|
18
|
+
</Relationships>`),e.file("word/document.xml",`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
19
|
+
<w:document xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships">
|
|
20
|
+
<w:body>
|
|
21
|
+
<w:p>
|
|
22
|
+
<w:r>
|
|
23
|
+
<w:t></w:t>
|
|
24
|
+
</w:r>
|
|
25
|
+
</w:p>
|
|
26
|
+
<w:sectPr>
|
|
27
|
+
<w:pgSz w:w="12240" w:h="15840"/>
|
|
28
|
+
<w:pgMar w:top="1440" w:right="1440" w:bottom="1440" w:left="1440" w:header="720" w:footer="720" w:gutter="0"/>
|
|
29
|
+
</w:sectPr>
|
|
30
|
+
</w:body>
|
|
31
|
+
</w:document>`),e.file("word/styles.xml",`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
32
|
+
<w:styles xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main">
|
|
33
|
+
<w:docDefaults>
|
|
34
|
+
<w:rPrDefault>
|
|
35
|
+
<w:rPr>
|
|
36
|
+
<w:rFonts w:ascii="Calibri" w:hAnsi="Calibri"/>
|
|
37
|
+
<w:sz w:val="22"/>
|
|
38
|
+
</w:rPr>
|
|
39
|
+
</w:rPrDefault>
|
|
40
|
+
<w:pPrDefault>
|
|
41
|
+
<w:pPr>
|
|
42
|
+
<w:spacing w:after="200" w:line="276" w:lineRule="auto"/>
|
|
43
|
+
</w:pPr>
|
|
44
|
+
</w:pPrDefault>
|
|
45
|
+
</w:docDefaults>
|
|
46
|
+
<w:style w:type="paragraph" w:default="1" w:styleId="Normal">
|
|
47
|
+
<w:name w:val="Normal"/>
|
|
48
|
+
</w:style>
|
|
49
|
+
</w:styles>`);let t=new Date().toISOString();return e.file("docProps/core.xml",`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
50
|
+
<cp:coreProperties xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
|
51
|
+
<dc:creator>EigenPal DOCX Editor</dc:creator>
|
|
52
|
+
<dcterms:created xsi:type="dcterms:W3CDTF">${t}</dcterms:created>
|
|
53
|
+
<dcterms:modified xsi:type="dcterms:W3CDTF">${t}</dcterms:modified>
|
|
54
|
+
</cp:coreProperties>`),e.file("docProps/app.xml",`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
55
|
+
<Properties xmlns="http://schemas.openxmlformats.org/officeDocument/2006/extended-properties">
|
|
56
|
+
<Application>EigenPal DOCX Editor</Application>
|
|
57
|
+
<AppVersion>1.0.0</AppVersion>
|
|
58
|
+
</Properties>`),e.generateAsync({type:"arraybuffer",compression:"DEFLATE",compressionOptions:{level:6}})}async function yt(e){let t=await tt(),n={...e,originalBuffer:t};return Ke(n)}exports.a=_e;exports.b=Ue;exports.c=G;exports.d=Ke;exports.e=yt;
|