@cerefox/memory 1.22.1 → 1.22.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/cerefox.js +3984 -1652
- package/dist/frontend/assets/Courier-tKiTGlNQ.js +2 -0
- package/dist/frontend/assets/Courier-tKiTGlNQ.js.map +1 -0
- package/dist/frontend/assets/docx-CjhuGfqI.js +11 -0
- package/dist/frontend/assets/docx-CjhuGfqI.js.map +1 -0
- package/dist/frontend/assets/{index-nwj65c23.js → index-BI4vv_74.js} +10 -10
- package/dist/frontend/assets/index-BI4vv_74.js.map +1 -0
- package/dist/frontend/assets/{markdown-C3Pl9aLl.js → markdown-D6ZljOkv.js} +2 -2
- package/dist/frontend/assets/{markdown-C3Pl9aLl.js.map → markdown-D6ZljOkv.js.map} +1 -1
- package/dist/frontend/assets/{pdf-nplQ05zY.js → pdf-C3krYx-2.js} +4 -4
- package/dist/frontend/assets/{pdf-nplQ05zY.js.map → pdf-C3krYx-2.js.map} +1 -1
- package/dist/frontend/assets/pdfmake-DHl2b3Ex.js +163 -0
- package/dist/frontend/assets/pdfmake-DHl2b3Ex.js.map +1 -0
- package/dist/frontend/assets/{rolldown-runtime-COiEfhsA.js → rolldown-runtime-XKyaHtl9.js} +1 -1
- package/dist/frontend/assets/{vfs_fonts-D9BViC6C.js → vfs_fonts-BjQxQix9.js} +2 -2
- package/dist/frontend/assets/{vfs_fonts-D9BViC6C.js.map → vfs_fonts-BjQxQix9.js.map} +1 -1
- package/dist/frontend/index.html +2 -2
- package/dist/server-assets/_shared/ef-meta/index.ts +2 -2
- package/package.json +5 -5
- package/dist/frontend/assets/Courier-BRJ-B_ND.js +0 -1370
- package/dist/frontend/assets/Courier-BRJ-B_ND.js.map +0 -1
- package/dist/frontend/assets/docx-BvP4Jo4k.js +0 -29
- package/dist/frontend/assets/docx-BvP4Jo4k.js.map +0 -1
- package/dist/frontend/assets/index-nwj65c23.js.map +0 -1
- package/dist/frontend/assets/pdfmake-L7DGtDcB.js +0 -229
- package/dist/frontend/assets/pdfmake-L7DGtDcB.js.map +0 -1
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import{exportableUrl as e,parseMarkdown as t}from"./markdown-D6ZljOkv.js";var n=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t,t.exports),e=null),t.exports);function r(e){"@babel/helpers - typeof";return r=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},r(e)}function i(e,t){if(r(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,t||`default`);if(r(i)!=`object`)return i;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function a(e){var t=i(e,`string`);return r(t)==`symbol`?t:t+``}function o(e,t,n){return(t=a(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var s=class{constructor(e){o(this,`rootKey`,void 0),this.rootKey=e}get writtenAs(){}},c=e=>e instanceof s||typeof e==`object`&&!!e&&typeof e.prepForXml==`function`,l=e=>c(e)?e.rootKey:void 0,u=Object.seal({}),d=class extends s{constructor(e){super(e),o(this,`root`,void 0),this.root=[]}prepForXml(e){e.stack.push(this);let t=this.root.flatMap(t=>{if(c(t)){let n=t.writtenAs;return n?n.map(t=>t.prepForXml(e)):t.prepForXml(e)}return t}).filter(e=>e!==void 0);return e.stack.pop(),{[this.rootKey]:t.length?t.length===1&&t[0]?._attr?t[0]:t:u}}addChildElement(e){return this.root.push(e),this}},f=class extends d{constructor(e,t){super(e),o(this,`includeIfEmpty`,void 0),this.includeIfEmpty=t}prepForXml(e){let t=super.prepForXml(e);return this.includeIfEmpty||t&&(typeof t[this.rootKey]!=`object`||Object.keys(t[this.rootKey]).length)?t:void 0}};function p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function m(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?p(Object(n),!0).forEach(function(t){o(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var h=class extends s{constructor(e){super(`_attr`),o(this,`root`,void 0),o(this,`xmlKeys`,void 0),this.root=e}prepForXml(e){let t={};return Object.entries(this.root).forEach(([e,n])=>{if(n!==void 0){let r=this.xmlKeys&&this.xmlKeys[e]||e;t[r]=n}}),{_attr:t}}},g=class extends s{constructor(e){super(`_attr`),o(this,`root`,void 0),this.root=e}prepForXml(e){return{_attr:Object.values(this.root).filter(({value:e})=>e!==void 0).reduce((e,{key:t,value:n})=>m(m({},e),{},{[t]:n}),{})}}},_=class extends h{constructor(...e){super(...e),o(this,`xmlKeys`,{val:`w:val`,color:`w:color`,fill:`w:fill`,space:`w:space`,sz:`w:sz`,type:`w:type`,rsidR:`w:rsidR`,rsidRPr:`w:rsidRPr`,rsidSect:`w:rsidSect`,w:`w:w`,h:`w:h`,top:`w:top`,right:`w:right`,bottom:`w:bottom`,left:`w:left`,header:`w:header`,footer:`w:footer`,gutter:`w:gutter`,linePitch:`w:linePitch`,pos:`w:pos`})}};function v(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}function y(e,t){if(e==null)return{};var n,r,i=v(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var b=[`elements`],x=new Map([[`amp`,`&`],[`lt`,`<`],[`gt`,`>`],[`quot`,`"`],[`apos`,`'`]]),S=/&([^;]*);?/g,C=e=>e.indexOf(`&`)===-1?e:e.replace(S,(t,n)=>{if(!t.endsWith(`;`))throw Error(`Invalid XML: "&" that starts no entity, in "${e}"`);let r=x.get(n);if(r!==void 0)return r;let i=/^#x[0-9a-f]+$/i.test(n)?parseInt(n.slice(2),16):/^#[0-9]+$/.test(n)?parseInt(n.slice(1),10):NaN;if(!(i>0&&i<=1114111))throw Error(`Invalid XML: unknown entity "${t}"`);return String.fromCodePoint(i)}),w=e=>e===` `||e===`
|
|
2
|
+
`||e===` `||e===`\r`,T=/([\w:-]+)\s*=\s*(?:"([^"]*)"|'([^']*)')/g,E=e=>Object.fromEntries([...e.matchAll(T)].map(([,e,t,n])=>[e,t??n])),D=(e,{keepWhitespaceText:t=!1}={})=>{let n={},r=[],i=+(e.charCodeAt(0)===65279);for(;i<e.length&&w(e[i]);)i++;let a=e=>{let t=r.length===0?n:r[r.length-1];(t.elements??=[]).push(e)},o=e=>{if(e.trim()===``)e!==``&&t&&a({type:`text`,text:e});else{if(r.length===0)throw Error(`Invalid XML: text outside of the root element, "${e.trim()}"`);a({type:`text`,text:C(e)})}},s=(t,n,r)=>{let i=e.indexOf(t,n);if(i===-1)throw Error(`Invalid XML: ${r} that isn't closed`);return i};for(;i<e.length;){let t=e.indexOf(`<`,i);if(o(e.slice(i,t===-1?e.length:t)),t===-1)break;if(e.startsWith(`<?`,t)){let r=s(`?>`,t+2,`processing instruction`),o=e.slice(t+2,r),c=o.search(/\s/),l=c===-1?o:o.slice(0,c),u=c===-1?``:o.slice(c).trimStart();if(l.toLowerCase()===`xml`){let e=E(u);n.declaration=Object.keys(e).length>0?{attributes:e}:{}}else a({type:`instruction`,name:l,instruction:u});i=r+2}else if(e.startsWith(`<!--`,t)){let n=s(`-->`,t+4,`comment`),r=e.slice(t+4,n);r!==``&&a({type:`comment`,comment:r}),i=n+3}else if(e.startsWith(`<![CDATA[`,t)){let n=s(`]]>`,t+9,`CDATA section`),r=e.slice(t+9,n);r!==``&&a({type:`cdata`,cdata:r}),i=n+3}else if(e.startsWith(`<!DOCTYPE`,t)){let n=t+9,r,o=!1;for(;n<e.length;n++){let t=e[n];if(r!==void 0)r=t===r?void 0:r;else if(t===`"`||t===`'`)r=t;else if(t===`[`)o=!0;else if(t===`]`)o=!1;else if(t===`>`&&!o)break}if(n===e.length)throw Error(`Invalid XML: DOCTYPE that isn't closed`);a({type:`doctype`,doctype:e.slice(t+9,n).replace(/^ /,``)}),i=n+1}else if(e.startsWith(`</`,t)){let n=s(`>`,t+2,`closing tag`),a=e.slice(t+2,n).trimEnd(),o=r.pop();if(o?.name!==a)throw Error(`Invalid XML: closing tag </${a}> doesn't match <${o?.name??``}>`);i=n+1}else i=O(e,t+1,(e,t)=>{a(e),t||r.push(e)})}if(r.length>0)throw Error(`Invalid XML: <${r[r.length-1].name}> isn't closed`);let{elements:c}=n,l=y(n,b);return c===void 0?l:m(m({},l),{},{elements:c})},O=(e,t,n)=>{let r=t;for(;r<e.length&&!w(e[r])&&e[r]!==`/`&&e[r]!==`>`;)r++;let i=e.slice(t,r);if(i===``)throw Error(`Invalid XML: tag without a name`);let a=[],o=r;for(;;){for(;o<e.length&&w(e[o]);)o++;if(o>=e.length)throw Error(`Invalid XML: <${i}> that isn't closed`);if(e[o]===`>`||e.startsWith(`/>`,o)){let t=e[o]===`/`;return n(m({type:`element`,name:i},a.length>0?{attributes:Object.fromEntries(a)}:{}),t),o+(t?2:1)}let t=e.indexOf(`=`,o),r=e.slice(o,t===-1?e.length:t).trimEnd();if(t===-1||r===``||/[\s/>]/.test(r))throw Error(`Invalid XML: attribute of <${i}> without a value`);let s=t+1;for(;s<e.length&&w(e[s]);)s++;let c=e[s];if(c!==`"`&&c!==`'`)throw Error(`Invalid XML: value of ${r} on <${i}> isn't quoted`);let l=e.indexOf(c,s+1);if(l===-1)throw Error(`Invalid XML: value of ${r} on <${i}> isn't closed`);a.some(([e])=>e===r)||a.push([r,C(e.slice(s+1,l))]),o=l+1}},ee=new Map([[`&`,`&`],[`"`,`"`],[`'`,`'`],[`<`,`<`],[`>`,`>`]]),k=e=>e.replace(/[&"'<>\x00-\x08\x0B\x0C\x0E-\x1F]/g,e=>ee.get(e)??``),A=e=>e.replace(/[&<>\x00-\x08\x0B\x0C\x0E-\x1F]/g,e=>ee.get(e)??``),j=e=>typeof e==`string`?k(e):e,M=(e,t,n)=>{let r=Object.keys(e)[0],i=r===void 0?void 0:e[r],a=[],o=[],s=e=>{for(let[t,n]of Object.entries(e))a.push(`${t}="${String(j(n))}"`)};if(typeof i==`object`){if(i!==null){let{_attr:e,_cdata:r}=i;if(e&&s(e),r&&o.push(`<![CDATA[${r.replace(/\]\]>/g,`]]]]><![CDATA[>`)}]]>`),Array.isArray(i)){let e=!1;o.push(``);for(let r of i)typeof r==`object`?Object.keys(r)[0]===`_attr`?s(r._attr):o.push(M(r,t,n+1)):(o.pop(),e=!0,o.push(j(r)));e||o.push(``)}}}else o.push(j(i));return{name:r,attributes:a,content:o,indents:n>1?t.repeat(n-1):``}},N=(e,t,n)=>{if(typeof e!=`object`)return String(e);let{name:r,attributes:i,content:a,indents:o}=e,{length:s}=a,c=o+(r?`<${r}`:``)+(i.length>0?` ${i.join(` `)}`:``)+(s>0?r?`>`:``:`/>`)+(t&&s>1?`
|
|
3
|
+
`:``);return s===0?c+(t?`
|
|
4
|
+
`:``):c+a.map(e=>e===void 0?``:N(e,t,!1)).join(``)+(s>1?o:``)+(r?`</${r}>`:``)+(t&&!n?`
|
|
5
|
+
`:``)},P=(e,{indent:t=``,declaration:n}={})=>{let r=Array.isArray(e)?e:[e],i=+!!t,a=n?.standalone?` standalone="${k(n.standalone)}"`:``;return(n===void 0?``:`<?xml version="1.0" encoding="${k(n.encoding||`UTF-8`)}"${a}?>${t?`
|
|
6
|
+
`:``}`)+r.map((e,n)=>N(M(e,t,i),t,n===r.length-1)).join(``)},te=e=>Object.entries(e??{}).flatMap(([e,t])=>t==null?[]:[` ${e}="${k(String(t))}"`]).join(``),ne=e=>{switch(e.type){case`element`:{let t=e.elements??[],n=`<${e.name}${te(e.attributes)}`;return t.length>0||e.attributes?.[`xml:space`]===`preserve`?`${n}>${t.map(ne).join(``)}</${e.name}>`:`${n}/>`}case`text`:return A(String(e.text));case`cdata`:return`<![CDATA[${String(e.cdata).replace(/\]\]>/g,`]]]]><![CDATA[>`)}]]>`;case`comment`:return`<!--${e.comment}-->`;case`doctype`:return`<!DOCTYPE ${e.doctype}>`;case`instruction`:return`<?${e.name}${e.instruction?` ${e.instruction}`:``}?>`;default:return``}},re=e=>(e.declaration?`<?xml${te(e.declaration.attributes)}?>`:``)+(e.elements??[]).map(ne).join(``),F=e=>{switch(e.type){case void 0:case`element`:let t=new I(e.name,e.attributes),n=e.elements||[];for(let e of n){let n=F(e);n!==void 0&&t.push(n)}return t;case`text`:return e.text;default:return}},ie=class extends h{},I=class extends d{static fromXmlString(e){return F(D(e))}constructor(e,t){super(e),t&&this.root.push(new ie(t))}push(e){this.root.push(e)}},ae=class extends d{constructor(e){super(``),o(this,`_attr`,void 0),this._attr=e}prepForXml(e){return{_attr:this._attr}}},oe=class extends d{constructor(e,t){super(e),t&&(this.root=t.root)}},L=e=>{if(!Number.isFinite(e))throw Error(`Invalid value '${e}' specified. Must be an integer.`);return Math.floor(e)},se=e=>{let t=L(e);if(t<0)throw Error(`Invalid value '${e}' specified. Must be a positive integer.`);return t},ce=(e,t)=>{let n=t*2;if(e.length!==n||isNaN(Number(`0x${e}`)))throw Error(`Invalid hex value '${e}'. Expected ${n} digit hex value`);return e},le=e=>ce(e,1),ue=e=>{let t=e.slice(-2),n=e.substring(0,e.length-2);return`${Number(n)}${t}`},de={in:1440,cm:1440/2.54,mm:1440/25.4,pt:20,pc:240,pi:240},fe=e=>{if(typeof e==`number`)return e;let t=e.slice(-2),n=Number(e.substring(0,e.length-2)),r=de[t];if(r===void 0||Number.isNaN(n))throw Error(`Invalid universal measure '${e}'. Expected a number followed by mm, cm, in, pt, pc or pi.`);return n*r},pe=e=>{let t=ue(e);if(parseFloat(t)<0)throw Error(`Invalid value '${t}' specified. Expected a positive number.`);return t},me=e=>e===`auto`?e:ce(e.charAt(0)===`#`?e.substring(1):e,3),he=e=>typeof e==`string`?ue(e):L(e),ge=e=>typeof e==`string`?pe(e):se(e),R=e=>typeof e==`string`?pe(e):se(e),_e=e=>{let t=e.substring(0,e.length-1);return`${Number(t)}%`},ve=e=>typeof e==`number`?L(e):e.slice(-1)===`%`?_e(e):ue(e),ye=se,be=se,xe=e=>e.toISOString(),z=class extends d{constructor(e,t=!0){super(e),t!==!0&&this.root.push(new _({val:t}))}},Se=class extends d{constructor(e,t){super(e),this.root.push(new _({val:ge(t)}))}},Ce=class extends d{},we=class extends d{constructor(e,t){super(e),this.root.push(new _({val:t}))}},Te=(e,t)=>new B({name:e,attributes:{value:{key:`w:val`,value:t}}}),Ee=class extends d{constructor(e,t){super(e),this.root.push(new _({val:t}))}},De=class extends d{constructor(e,t){super(e),this.root.push(t)}},B=class extends d{constructor({name:e,attributes:t,children:n}){super(e),t&&this.root.push(new g(t)),n&&this.root.push(...n)}},V={START:`start`,CENTER:`center`,END:`end`,BOTH:`both`,MEDIUM_KASHIDA:`mediumKashida`,DISTRIBUTE:`distribute`,NUM_TAB:`numTab`,HIGH_KASHIDA:`highKashida`,LOW_KASHIDA:`lowKashida`,THAI_DISTRIBUTE:`thaiDistribute`,LEFT:`left`,RIGHT:`right`,JUSTIFIED:`both`},Oe=e=>new B({name:`w:jc`,attributes:{val:{key:`w:val`,value:e}}}),ke={dark1:`dk1`,light1:`lt1`,dark2:`dk2`,light2:`lt2`,accent1:`accent1`,accent2:`accent2`,accent3:`accent3`,accent4:`accent4`,accent5:`accent5`,accent6:`accent6`,hyperlink:`hlink`,followedHyperlink:`folHlink`},Ae={dark2:`44546A`,light2:`E7E6E6`,accent1:`4472C4`,accent2:`ED7D31`,accent3:`A5A5A5`,accent4:`FFC000`,accent5:`5B9BD5`,accent6:`70AD47`,hyperlink:`0563C1`,followedHyperlink:`954F72`},je={dark1:{value:`windowText`,lastColor:`000000`},light1:{value:`window`,lastColor:`FFFFFF`}},Me=(e,t)=>{if(t===`auto`)throw Error(`Invalid theme color ${e} 'auto'. Expected 6 digit hex value`);return me(t)},Ne=(e={})=>Object.fromEntries(Object.keys(ke).map(t=>{let n=e[t],r=t===`dark1`||t===`light1`?je[t].lastColor:Ae[t];return[t,n===void 0?r:Me(t,n)]})),Pe=(e,t)=>new B({name:`a:srgbClr`,attributes:{value:{key:`val`,value:Me(e,t)}}}),Fe=(e,t)=>{let n=t[e],r=e===`dark1`||e===`light1`?je[e]:void 0;return new B({name:`a:${ke[e]}`,children:[n===void 0&&r?new B({name:`a:sysClr`,attributes:{value:{key:`val`,value:r.value},lastColor:{key:`lastClr`,value:r.lastColor}}}):Pe(e,n??Ae[e])]})},Ie=(e,t={})=>new B({name:`a:clrScheme`,attributes:{name:{key:`name`,value:e}},children:Object.keys(ke).map(e=>Fe(e,t))}),Le=new Set([`dark1`,`light1`,`dark2`,`light2`,`accent1`,`accent2`,`accent3`,`accent4`,`accent5`,`accent6`,`hyperlink`,`followedHyperlink`]),Re=new Map([[`dk1`,`dark1`],[`lt1`,`light1`],[`dk2`,`dark2`],[`lt2`,`light2`],[`hlink`,`hyperlink`],[`folHlink`,`followedHyperlink`],[`text1`,`dark1`],[`background1`,`light1`],[`text2`,`dark2`],[`background2`,`light2`]]),ze=(e,t)=>{if(!(e>=0&&e<=100))throw Error(`Invalid ${t} ${e}. Expected a number from 0 to 100`);return Math.round(255*(1-e/100))},Be=({theme:e,lighter:t,darker:n})=>{if(!Le.has(e)){let t=Re.get(e);throw Error(`Invalid theme color "${e}". ${t?`Did you mean "${t}"?`:`Expected one of ${[...Le].join(`, `)}`}`)}if(t!==void 0&&n!==void 0)throw Error(`Invalid theme color. Expected lighter or darker, not both`);let r=t===void 0?void 0:ze(t,`lighter`),i=n===void 0?void 0:ze(n,`darker`);return{tint:r===255?void 0:r,shade:i===255?void 0:i}},Ve=e=>{let[t,n,r]=[0,2,4].map(t=>parseInt(e.slice(t,t+2),16)/255),i=Math.max(t,n,r),a=Math.min(t,n,r),o=(i+a)/2,s=i-a;return s===0?{hue:0,saturation:0,lightness:o}:{hue:(i===t?((n-r)/s+6)%6:i===n?(r-t)/s+2:(t-n)/s+4)*60,saturation:s/(1-Math.abs(2*o-1)),lightness:o}},He=({hue:e,saturation:t,lightness:n})=>{let r=(1-Math.abs(2*n-1))*t,i=r*(1-Math.abs(e/60%2-1)),[a,o,s]=e<60?[r,i,0]:e<120?[i,r,0]:e<180?[0,r,i]:e<240?[0,i,r]:e<300?[i,0,r]:[r,0,i],c=n-r/2;return[a,o,s].map(e=>Math.floor((e+c)*255+1e-9).toString(16).padStart(2,`0`)).join(``).toUpperCase()},Ue=(e,{tint:t,shade:n})=>{if(t===void 0&&n===void 0)return e;let r=Ve(e),i=t===void 0?r.lightness*n/255:r.lightness*t/255+(1-t/255);return He(m(m({},r),{},{lightness:i}))},We=e=>e===void 0?void 0:e.toString(16).padStart(2,`0`).toUpperCase(),Ge=e=>typeof e==`string`?{type:`hex`,value:me(e)}:{type:`theme`,color:e,change:Be(e)},Ke=(e,t)=>e.type===`hex`?{color:e.value}:{color:Ue(t[e.color.theme],e.change),theme:e.color.theme,tint:We(e.change.tint),shade:We(e.change.shade)},qe=Ne(),Je=class extends s{constructor(e){super(`_attr`),o(this,`attributes`,void 0),this.attributes=e.map(e=>`keys`in e?{keys:e.keys,color:e.color===void 0?void 0:Ge(e.color)}:e)}prepForXml(e){var t;let n=((t=e.file)==null||(t=t.Theme)==null?void 0:t.Colors)??qe,r=this.attributes.flatMap(e=>{if(!(`keys`in e))return[[e.key,e.value]];if(e.color===void 0)return[];let{keys:t}=e,r=Ke(e.color,n);return[[t.color,r.color],[t.theme,r.theme],[t.tint,r.tint],[t.shade,r.shade]]});return{_attr:Object.fromEntries(r.filter(([,e])=>e!==void 0))}}},Ye=class extends d{constructor(e,t){super(e),this.root.push(new Je(t))}},Xe=(e,t)=>new Ye(e,t),Ze={color:`w:color`,theme:`w:themeColor`,tint:`w:themeTint`,shade:`w:themeShade`},H=(e,{color:t,size:n,space:r,style:i})=>Xe(e,[{key:`w:val`,value:i},{keys:Ze,color:t},{key:`w:sz`,value:n===void 0?void 0:ye(n)},{key:`w:space`,value:r===void 0?void 0:be(r)}]),Qe={SINGLE:`single`,DASH_DOT_STROKED:`dashDotStroked`,DASHED:`dashed`,DASH_SMALL_GAP:`dashSmallGap`,DOT_DASH:`dotDash`,DOT_DOT_DASH:`dotDotDash`,DOTTED:`dotted`,DOUBLE:`double`,DOUBLE_WAVE:`doubleWave`,INSET:`inset`,NIL:`nil`,NONE:`none`,OUTSET:`outset`,THICK:`thick`,THICK_THIN_LARGE_GAP:`thickThinLargeGap`,THICK_THIN_MEDIUM_GAP:`thickThinMediumGap`,THICK_THIN_SMALL_GAP:`thickThinSmallGap`,THIN_THICK_LARGE_GAP:`thinThickLargeGap`,THIN_THICK_MEDIUM_GAP:`thinThickMediumGap`,THIN_THICK_SMALL_GAP:`thinThickSmallGap`,THIN_THICK_THIN_LARGE_GAP:`thinThickThinLargeGap`,THIN_THICK_THIN_MEDIUM_GAP:`thinThickThinMediumGap`,THIN_THICK_THIN_SMALL_GAP:`thinThickThinSmallGap`,THREE_D_EMBOSS:`threeDEmboss`,THREE_D_ENGRAVE:`threeDEngrave`,TRIPLE:`triple`,WAVE:`wave`},$e=class extends f{constructor(e){super(`w:pBdr`),e.top&&this.root.push(H(`w:top`,e.top)),e.left&&this.root.push(H(`w:left`,e.left)),e.bottom&&this.root.push(H(`w:bottom`,e.bottom)),e.right&&this.root.push(H(`w:right`,e.right)),e.between&&this.root.push(H(`w:between`,e.between))}},et=class extends d{constructor(){super(`w:pBdr`);let e=H(`w:bottom`,{color:`auto`,space:1,style:Qe.SINGLE,size:6});this.root.push(e)}},tt=({start:e,end:t,left:n,right:r,hanging:i,firstLine:a,firstLineChars:o})=>new B({name:`w:ind`,attributes:{start:{key:`w:start`,value:e===void 0?void 0:he(e)},end:{key:`w:end`,value:t===void 0?void 0:he(t)},left:{key:`w:left`,value:n===void 0?void 0:he(n)},right:{key:`w:right`,value:r===void 0?void 0:he(r)},hanging:{key:`w:hanging`,value:i===void 0?void 0:R(i)},firstLine:{key:`w:firstLine`,value:a===void 0?void 0:R(a)},firstLineChars:{key:`w:firstLineChars`,value:o===void 0?void 0:L(o)}}}),nt=()=>new B({name:`w:br`}),rt={BEGIN:`begin`,END:`end`,SEPARATE:`separate`},it=(e,t,n)=>new B({name:`w:fldChar`,attributes:{type:{key:`w:fldCharType`,value:e},dirty:{key:`w:dirty`,value:t},locked:{key:`w:fldLock`,value:n}}}),at=(e,t)=>it(rt.BEGIN,e,t),ot=new WeakSet,st=class extends B{constructor(){super({name:`w:fldChar`,attributes:{type:{key:`w:fldCharType`,value:rt.BEGIN},dirty:{key:`w:dirty`,value:!0}}})}prepForXml(e){let t=super.prepForXml(e);return ot.add(t),t}},ct=()=>new st,lt=e=>typeof e==`object`&&!!e&&ot.has(e),ut=e=>it(rt.SEPARATE,e),dt=e=>it(rt.END,e),ft={DEFAULT:`default`,PRESERVE:`preserve`},pt=class extends h{constructor(...e){super(...e),o(this,`xmlKeys`,{space:`xml:space`})}},mt=class extends d{constructor(){super(`w:instrText`),this.root.push(new pt({space:ft.PRESERVE})),this.root.push(`PAGE`)}},ht=class extends d{constructor(){super(`w:instrText`),this.root.push(new pt({space:ft.PRESERVE})),this.root.push(`NUMPAGES`)}},gt=class extends d{constructor(){super(`w:instrText`),this.root.push(new pt({space:ft.PRESERVE})),this.root.push(`SECTIONPAGES`)}},_t=class extends d{constructor(){super(`w:instrText`),this.root.push(new pt({space:ft.PRESERVE})),this.root.push(`SECTION`)}},vt=({fill:e,color:t,type:n})=>Xe(`w:shd`,[{keys:{color:`w:fill`,theme:`w:themeFill`,tint:`w:themeFillTint`,shade:`w:themeFillShade`},color:e},{keys:Ze,color:t},{key:`w:val`,value:n??yt.CLEAR}]),yt={CLEAR:`clear`,DIAGONAL_CROSS:`diagCross`,DIAGONAL_STRIPE:`diagStripe`,HORIZONTAL_CROSS:`horzCross`,HORIZONTAL_STRIPE:`horzStripe`,NIL:`nil`,PERCENT_5:`pct5`,PERCENT_10:`pct10`,PERCENT_12:`pct12`,PERCENT_15:`pct15`,PERCENT_20:`pct20`,PERCENT_25:`pct25`,PERCENT_30:`pct30`,PERCENT_35:`pct35`,PERCENT_37:`pct37`,PERCENT_40:`pct40`,PERCENT_45:`pct45`,PERCENT_50:`pct50`,PERCENT_55:`pct55`,PERCENT_60:`pct60`,PERCENT_62:`pct62`,PERCENT_65:`pct65`,PERCENT_70:`pct70`,PERCENT_75:`pct75`,PERCENT_80:`pct80`,PERCENT_85:`pct85`,PERCENT_87:`pct87`,PERCENT_90:`pct90`,PERCENT_95:`pct95`,REVERSE_DIAGONAL_STRIPE:`reverseDiagStripe`,SOLID:`solid`,THIN_DIAGONAL_CROSS:`thinDiagCross`,THIN_DIAGONAL_STRIPE:`thinDiagStripe`,THIN_HORIZONTAL_CROSS:`thinHorzCross`,THIN_REVERSE_DIAGONAL_STRIPE:`thinReverseDiagStripe`,THIN_VERTICAL_STRIPE:`thinVertStripe`,VERTICAL_STRIPE:`vertStripe`},bt=class extends h{constructor(...e){super(...e),o(this,`xmlKeys`,{id:`w:id`,author:`w:author`,date:`w:date`})}},xt=class extends d{constructor(e){super(`w:del`),this.root.push(new bt({id:e.id,author:e.author,date:e.date}))}},St=class extends d{constructor(e){super(`w:ins`),this.root.push(new bt({id:e.id,author:e.author,date:e.date}))}},Ct=({twoLinesInOne:e,brackets:t,horizontalInVertical:n,fitToLine:r,group:i})=>new B({name:`w:eastAsianLayout`,attributes:{id:{key:`w:id`,value:i===void 0?void 0:L(i)},combine:{key:`w:combine`,value:e},combineBrackets:{key:`w:combineBrackets`,value:t},vert:{key:`w:vert`,value:n},vertCompress:{key:`w:vertCompress`,value:r}}}),wt={DOT:`dot`},Tt=(e=wt.DOT)=>new B({name:`w:em`,attributes:{val:{key:`w:val`,value:e}}}),Et=`57X6y3wQZNzYjJB2L_10pxbackgroundhimselfUTF-8DEMOGRAPHICSVqvt4KW9`,Dt=(e,t=21)=>(n=t)=>{let r=``,i=n|0;for(;i-->0;)r+=e[Math.random()*e.length|0];return r},Ot=(e=21)=>{let t=``,n=e|0;for(;n-->0;)t+=Et[Math.random()*64|0];return t},kt=e=>{let t=new Int32Array(Math.ceil((e.length+9)/64)*16);for(let n=0;n<e.length;n++)t[n>>2]|=e[n]<<24-(n&3)*8;return t[e.length>>2]|=128<<24-(e.length&3)*8,t[t.length-2]=Math.floor(e.length/536870912),t[t.length-1]=e.length*8,t},At=e=>{let t=new Uint8Array(e.length*4);for(let n=0;n<t.length;n++)t[n]=e[n>>2]>>>24-(n&3)*8;return t},jt=(e,t)=>e>>>t|e<<32-t,Mt=Int32Array.of(1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298),Nt=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],Pt=new Int32Array(64),Ft=e=>{let t=kt(e),n=Pt,[r,i,a,o,s,c,l,u]=Nt;for(let e=0;e<t.length;e+=16){n.set(t.subarray(e,e+16));for(let e=16;e<64;e++){let t=n[e-15],r=n[e-2];n[e]=n[e-16]+(jt(t,7)^jt(t,18)^t>>>3)+n[e-7]+(jt(r,17)^jt(r,19)^r>>>10)}let[d,f,p,m,h,g,_,v]=[r,i,a,o,s,c,l,u];for(let e=0;e<64;e++){let t=v+(jt(h,6)^jt(h,11)^jt(h,25))+(h&g^~h&_)+Mt[e]+n[e]|0,r=(jt(d,2)^jt(d,13)^jt(d,22))+(d&f^d&p^f&p)|0;v=_,_=g,g=h,h=m+t|0,m=p,p=f,f=d,d=t+r|0}[r,i,a,o,s,c,l,u]=[r+d|0,i+f|0,a+p|0,o+m|0,s+h|0,c+g|0,l+_|0,u+v|0]}return At([r,i,a,o,s,c,l,u])},It=e=>Math.floor(e*72*20),Lt=(e=0)=>{let t=e;return()=>++t},Rt=()=>Lt(),zt=()=>Lt(1),Bt=Lt(),Vt=Lt(),Ht=()=>-Vt(),Ut=()=>Ot().toLowerCase(),Wt=e=>Dt(`1234567890abcdef`,e)(),Gt=()=>`${Wt(8)}-${Wt(4)}-${Wt(4)}-${Wt(4)}-${Wt(12)}`,Kt=e=>new Uint8Array(new TextEncoder().encode(e)),qt=({width:e,group:t})=>new B({name:`w:fitText`,attributes:{val:{key:`w:val`,value:Math.round(fe(R(e)))},id:{key:`w:id`,value:t===void 0?Ht():L(t)}}}),Jt=class extends d{constructor(e){super(`w:spacing`),this.root.push(new _({val:he(e)}))}},Yt=class extends d{constructor(e){super(`w:color`),this.root.push(new Je([{keys:m(m({},Ze),{},{color:`w:val`}),color:e}]))}},Xt=class extends d{constructor(e){super(`w:highlight`),this.root.push(new _({val:e}))}},Zt=e=>new B({name:`w:lang`,attributes:{value:{key:`w:val`,value:e.value},eastAsia:{key:`w:eastAsia`,value:e.eastAsia},bidirectional:{key:`w:bidi`,value:e.bidirectional}}}),Qt=(e,t)=>{if(typeof e==`string`){let n=e;return new B({name:`w:rFonts`,attributes:{ascii:{key:`w:ascii`,value:n},cs:{key:`w:cs`,value:n},eastAsia:{key:`w:eastAsia`,value:n},hAnsi:{key:`w:hAnsi`,value:n},hint:{key:`w:hint`,value:t}}})}if(`theme`in e){let t=e.theme===`headings`?`major`:`minor`;return new B({name:`w:rFonts`,attributes:{ascii:{key:`w:asciiTheme`,value:`${t}HAnsi`},eastAsia:{key:`w:eastAsiaTheme`,value:`${t}EastAsia`},hAnsi:{key:`w:hAnsiTheme`,value:`${t}HAnsi`},cs:{key:`w:cstheme`,value:`${t}Bidi`}}})}let n=e;return new B({name:`w:rFonts`,attributes:{ascii:{key:`w:ascii`,value:n.ascii},cs:{key:`w:cs`,value:n.cs},eastAsia:{key:`w:eastAsia`,value:n.eastAsia},hAnsi:{key:`w:hAnsi`,value:n.hAnsi},hint:{key:`w:hint`,value:n.hint}}})},$t=e=>new B({name:`w:vertAlign`,attributes:{val:{key:`w:val`,value:e}}}),en=()=>$t(`superscript`),tn=()=>$t(`subscript`),nn={SINGLE:`single`,WORDS:`words`,DOUBLE:`double`,THICK:`thick`,DOTTED:`dotted`,DOTTEDHEAVY:`dottedHeavy`,DASH:`dash`,DASHEDHEAVY:`dashedHeavy`,DASHLONG:`dashLong`,DASHLONGHEAVY:`dashLongHeavy`,DOTDASH:`dotDash`,DASHDOTHEAVY:`dashDotHeavy`,DOTDOTDASH:`dotDotDash`,DASHDOTDOTHEAVY:`dashDotDotHeavy`,WAVE:`wave`,WAVYHEAVY:`wavyHeavy`,WAVYDOUBLE:`wavyDouble`,NONE:`none`},rn=(e=nn.SINGLE,t)=>Xe(`w:u`,[{key:`w:val`,value:e},{keys:Ze,color:t}]),an=class extends f{constructor(e){if(super(`w:rPr`),!e)return;e.style&&this.push(new we(`w:rStyle`,e.style)),e.font&&(typeof e.font==`string`?this.push(Qt(e.font)):`name`in e.font?this.push(Qt(e.font.name,e.font.hint)):this.push(Qt(e.font))),e.bold!==void 0&&this.push(new z(`w:b`,e.bold)),(e.boldComplexScript===void 0&&e.bold!==void 0||e.boldComplexScript)&&this.push(new z(`w:bCs`,e.boldComplexScript??e.bold)),e.italics!==void 0&&this.push(new z(`w:i`,e.italics)),(e.italicsComplexScript===void 0&&e.italics!==void 0||e.italicsComplexScript)&&this.push(new z(`w:iCs`,e.italicsComplexScript??e.italics)),e.smallCaps===void 0?e.allCaps!==void 0&&this.push(new z(`w:caps`,e.allCaps)):this.push(new z(`w:smallCaps`,e.smallCaps)),e.strike!==void 0&&this.push(new z(`w:strike`,e.strike)),e.doubleStrike!==void 0&&this.push(new z(`w:dstrike`,e.doubleStrike)),e.emboss!==void 0&&this.push(new z(`w:emboss`,e.emboss)),e.imprint!==void 0&&this.push(new z(`w:imprint`,e.imprint)),e.noProof!==void 0&&this.push(new z(`w:noProof`,e.noProof)),e.snapToGrid!==void 0&&this.push(new z(`w:snapToGrid`,e.snapToGrid)),e.vanish!==void 0&&this.push(new z(`w:vanish`,e.vanish)),e.color&&this.push(new Yt(e.color)),e.characterSpacing&&this.push(new Jt(e.characterSpacing)),e.scale!==void 0&&this.push(new Ee(`w:w`,e.scale)),e.kern&&this.push(new Se(`w:kern`,e.kern)),e.position&&this.push(new we(`w:position`,e.position)),e.size!==void 0&&this.push(new Se(`w:sz`,e.size));let t=e.sizeComplexScript===void 0||e.sizeComplexScript===!0?e.size:e.sizeComplexScript;t&&this.push(new Se(`w:szCs`,t)),e.highlight&&this.push(new Xt(e.highlight)),e.underline&&this.push(rn(e.underline.type,e.underline.color)),e.effect&&this.push(new we(`w:effect`,e.effect)),e.border&&this.push(H(`w:bdr`,e.border)),e.shading&&this.push(vt(e.shading)),e.fitText&&this.push(qt(e.fitText)),e.subScript&&this.push(tn()),e.superScript&&this.push(en()),e.rightToLeft!==void 0&&this.push(new z(`w:rtl`,e.rightToLeft)),e.emphasisMark&&this.push(Tt(e.emphasisMark.type)),e.language&&this.push(Zt(e.language)),e.eastAsianLayout&&this.push(Ct(e.eastAsianLayout)),e.specVanish!==void 0&&this.push(new z(`w:specVanish`,e.specVanish)),e.math!==void 0&&this.push(new z(`w:oMath`,e.math)),e.revision&&this.push(new sn(e.revision))}push(e){this.root.push(e)}},on=class extends an{constructor(e){super(e),e?.insertion&&this.push(new St(e.insertion)),e?.deletion&&this.push(new xt(e.deletion))}},sn=class extends d{constructor(e){super(`w:rPrChange`),this.root.push(new bt({id:e.id,author:e.author,date:e.date})),this.addChildElement(new an(e))}},cn=class extends d{constructor(e){super(`w:t`),typeof e==`string`?(this.root.push(new pt({space:ft.PRESERVE})),this.root.push(e)):(this.root.push(new pt({space:e.space??ft.DEFAULT})),this.root.push(e.text))}},ln={CURRENT:`CURRENT`,TOTAL_PAGES:`TOTAL_PAGES`,TOTAL_PAGES_IN_SECTION:`TOTAL_PAGES_IN_SECTION`,CURRENT_SECTION:`SECTION`},un=e=>{switch(e){case ln.CURRENT:return[at(),new mt,ut(),dt()];case ln.TOTAL_PAGES:return[at(),new ht,ut(),dt()];case ln.TOTAL_PAGES_IN_SECTION:return[at(),new gt,ut(),dt()];case ln.CURRENT_SECTION:return[at(),new _t,ut(),dt()];default:return}},dn=class e extends d{constructor(t){if(super(`w:r`),o(this,`properties`,void 0),o(this,`following`,[]),this.properties=new an(t),this.root.push(this.properties),t.break)for(let e=0;e<t.break;e++)this.root.push(nt());if(t.children)for(let[n,r]of t.children.entries()){if(l(r)===`w:r`){let i=t.children.slice(n+1);this.following=[r,...i.length>0?[new e(m(m({},t),{},{break:void 0,children:i}))]:[]];break}if(typeof r==`string`){let i=un(r);if(i){let r=t.children.slice(n+1),a=n=>new e(m(m({},t),{},{break:void 0,children:n})),o=this.root.length===1;o&&this.root.push(i[0]);let s=o?i.slice(1):i;this.following=[...s.map(e=>a([e])),...r.length>0?[a(r)]:[]];break}this.root.push(new cn(r))}else this.root.push(r)}else t.text!==void 0&&this.root.push(new cn(t.text))}get writtenAs(){return this.following.length>0?[this,...this.following.flatMap(e=>e.writtenAs??e)]:void 0}},U=class extends dn{constructor(e){super(typeof e==`string`?{text:e}:e)}},fn={EXTERNAL:`External`},pn=(e,t,n,r)=>new B({name:`Relationship`,attributes:{id:{key:`Id`,value:e},type:{key:`Type`,value:t},target:{key:`Target`,value:n},targetMode:{key:`TargetMode`,value:r}}}),mn=(e,t)=>new B({name:`a:hlinkClick`,attributes:m(m({},t?{xmlns:{key:`xmlns:a`,value:`http://schemas.openxmlformats.org/drawingml/2006/main`}}:{}),{},{id:{key:`r:id`,value:`rId${e}`}})}),hn=class{constructor(e){o(this,`link`,void 0),o(this,`linkId`,Ut()),o(this,`addedTo`,new WeakSet),this.link=e}createClick(e){return mn(this.linkId,e)}addRelationship(e){let t=e.viewWrapper.Relationships;this.addedTo.has(t)||(this.addedTo.add(t),t.addRelationship(this.linkId,`http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink`,this.link,fn.EXTERNAL))}},gn=32767,_n=780,vn=[[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`]],yn=e=>e<=gn?vn.reduce(({rest:e,text:t},[n,r])=>({rest:e%n,text:t+r.repeat(Math.floor(e/n))}),{rest:e,text:``}).text:void 0,bn=e=>e===0?``:e<=_n?String.fromCharCode(65+(e-1)%26).repeat(Math.ceil(e/26)):void 0,xn=e=>`${e}${e%100>=11&&e%100<=13?`th`:[`th`,`st`,`nd`,`rd`][e%10]??`th`}`,Sn=e=>{let t=e.charAt(0)!==e.charAt(0).toUpperCase(),n=e=>n=>t?e(n)?.toLowerCase():e(n);switch(e.toLowerCase()){case`arabic`:return String;case`roman`:return n(yn);case`alphabetic`:return n(bn);case`ordinal`:return e=>e>0?xn(e):void 0;case`arabicdash`:return e=>`- ${e} -`;default:return}},Cn=new Set([`mergeformat`,`charformat`,`mergeformatinet`]),wn=new Set([`upper`,`lower`,`firstcap`,`caps`]),Tn=e=>/^[#0,]*[#0][#0,]*$/.test(e),En=(e,t)=>{let n=[...t].filter(e=>e===`0`).length,r=n+[...t].filter(e=>e===`#`).length,i=String(e).padStart(n,`0`);if(!(i.length<r||n===0&&e===0))return t.includes(`,`)?i.replace(/\B(?=(\d{3})+$)/g,`,`):i},Dn=(e,t)=>{switch(t){case`upper`:return e.toUpperCase();case`lower`:return e.toLowerCase();case`firstcap`:return e.charAt(0).toUpperCase()+e.slice(1);default:return e}},On=e=>{let t=RegExp(`^\\s*(PAGEREF|NUMPAGES|SECTIONPAGES)\\b(.*)$`,`is`).exec(e),n=t?.[1].toUpperCase()===`PAGEREF`?RegExp(`^\\s*("?)([^\\s"\\\\]+)\\1(.*)$`,`s`).exec(t[2]):void 0;if(!t||t[1].toUpperCase()===`PAGEREF`&&!n)return;let r=(n?n[3]:t[2]).match(/"[^"]*"|\S+/g)??[],i,a,o=[],s=!1,c=!0;for(let e=0;e<r.length;e++){let t=r[e],n=()=>(t.length>2?t.slice(2):r[++e]??``).replace(/^"(.*)"$/,`$1`);if(/^\\p$/i.test(t))s=!0;else if(t.startsWith(`\\#`)){let e=n();c&&=a===void 0&&Tn(e),a??=e}else if(t.startsWith(`\\*`)){let e=n(),t=e.toLowerCase();wn.has(t)?o.push(t):e!==``&&!Cn.has(t)&&(c&&=i===void 0&&Sn(e)!==void 0,i??=e)}}let l=m(m(m(m({},i===void 0?{}:{numberFormat:i}),a===void 0?{}:{picture:a}),o.length===0?{}:{capitals:o[0]}),{},{written:c&&o.length<=1&&o[0]!==`caps`&&(i===void 0||a===void 0)});return m(n?{type:`pageReference`,bookmark:n[2],relative:s}:{type:`pageCount`,scope:t[1].toUpperCase()===`NUMPAGES`?`document`:`section`},l)},kn=e=>RegExp(`^\\s*TOC\\b.*\\\\s\\b`,`is`).test(e),An=(e,{enclosing:t,within:n,inTextBox:r},{estimate:i,sectionPageCount:a,blank:o,relativeTo:s})=>{let c=On(e);if(c===void 0)return;let{bookmarks:l,pageCount:u,bookmarkPageNumbers:d}=i,{numberFormat:f,picture:p,capitals:m,written:h}=c,g=f!==void 0||p!==void 0,_=e=>e===void 0?void 0:p===void 0?Sn(f??`arabic`)(e):En(e,p),v=c.type===`pageReference`&&c.relative&&n===`counted`&&!r?s?.(c.bookmark):void 0,y;return y=h?c.type===`pageCount`?_(c.scope===`document`?u:a):t.some(kn)?void 0:g?_(d?.get(c.bookmark)):c.relative?v:l.get(c.bookmark):void 0,y===void 0?o?``:void 0:Dn(y,m)},jn=(e,t)=>e===`mc:Fallback`||t===`fallback`?`fallback`:e===`w:del`||e===`w:moveFrom`?`deleted`:t,Mn=(e,t,n,r,i=`counted`,a=!1)=>{for(let s=0;s<t.length;s++){let c=t[s],l=e.nameOf(c);if(l===void 0)continue;let u=n[n.length-1];if(l===`w:fldChar`){let o=e.attributeOf(c,`w:fldCharType`);o===`begin`?n.push({begin:c,instruction:``,inResult:!1}):o===`separate`&&u?(e.writeClean(u.begin,u.instruction),u.inResult=!0,u.result=r.resultOf(u.instruction,{within:i,enclosing:n.slice(0,-1).map(e=>e.instruction),inTextBox:a}),u.result!==void 0&&(t.splice(s+1,0,e.textElement(u.result)),s++)):o===`end`&&n.pop()}else if(l===`w:instrText`&&u&&!u.inResult)u.instruction+=e.textOf(c);else if((l===`w:t`||l===`w:tab`||l===`w:br`||l===`w:cr`)&&u?.result!==void 0)t.splice(s,1),s--;else if(l===`w:fldSimple`){let t=r.resultOf(String(e.attributeOf(c,`w:instr`)),{within:i,enclosing:n.map(e=>e.instruction),inTextBox:a});t===void 0?Mn(e,e.contentOf(c)??[],[],r,i,a):e.setSimpleFieldResult(c,t)}else{if(l===`w:p`){var o;(o=r.beforeParagraph)==null||o.call(r,c)}Mn(e,e.contentOf(c)??[],n,r,jn(l,i),a||l===`w:txbxContent`),l===`w:p`&&r.afterParagraph(c)}}},Nn=(e,t)=>t.flatMap(t=>{let n=e.nameOf(t);return n===void 0?[]:n===`w:sectPr`?[t]:Nn(e,e.contentOf(t)??[])}),Pn=(e,t)=>(e.contentOf(t)??[]).some(t=>e.nameOf(t)===`w:pPr`&&(e.contentOf(t)??[]).some(t=>e.nameOf(t)===`w:sectPr`)),Fn=(e,t,n)=>{let r=Nn(e,[t]).reduce((t,n)=>{let r=(e.contentOf(n)??[]).flatMap(t=>{let n=e.nameOf(t);return n===`w:headerReference`||n===`w:footerReference`?[[`${n} ${String(e.attributeOf(t,`w:type`))}`,String(e.attributeOf(t,`r:id`))]]:[]});return[...t,new Map([...t[t.length-1]??[],...r])]},[]).reduce((e,t,r)=>{for(let i of t.values())e.set(i,[...e.get(i)??[],n[r]]);return e},new Map);return new Map([...r].flatMap(([e,[t,...n]])=>t!==void 0&&n.every(e=>e===t)?[[e,t]]:[]))},In=(e,t,n,{blank:r})=>{let{sectionPageCounts:i=[],relativePositions:a}=n,o=0,s=new Map,c=e=>{var t;let n=s.get(e)??0;return s.set(e,n+1),a==null||(t=a.get(e))==null?void 0:t[n]};return Mn(e,[t],[],{resultOf:(e,t)=>An(e,t,{estimate:n,sectionPageCount:i[o],blank:r,relativeTo:c}),afterParagraph:t=>{o+=+!!Pn(e,t)}}),Fn(e,t,i)},Ln=(e,t,n,{blank:r,sectionPageCount:i,notes:a=!1})=>{let o=e=>{let t=n.bookmarks.get(e);return t===void 0?void 0:`on page ${t}`};Mn(e,[t],[],{resultOf:(e,t)=>An(e,t,m({estimate:n,sectionPageCount:i,blank:r},a?{relativeTo:o}:{})),afterParagraph:()=>void 0})},Rn=(e,t,{beforeParagraph:n,resultOf:r})=>Mn(e,[t],[],{resultOf:(e,{within:t})=>r(e,t),beforeParagraph:n,afterParagraph:()=>void 0}),zn=class extends d{constructor(e={}){super(`w:instrText`),o(this,`properties`,void 0),this.properties=e,this.root.push(new pt({space:ft.PRESERVE}));let t=`TOC`;if(this.properties.captionLabel&&(t=`${t} \\a "${this.properties.captionLabel}"`),this.properties.entriesFromBookmark&&(t=`${t} \\b "${this.properties.entriesFromBookmark}"`),this.properties.captionLabelIncludingNumbers&&(t=`${t} \\c "${this.properties.captionLabelIncludingNumbers}"`),this.properties.sequenceAndPageNumbersSeparator&&(t=`${t} \\d "${this.properties.sequenceAndPageNumbersSeparator}"`),this.properties.tcFieldIdentifier&&(t=`${t} \\f "${this.properties.tcFieldIdentifier}"`),this.properties.hyperlink&&(t=`${t} \\h`),this.properties.tcFieldLevelRange&&(t=`${t} \\l "${this.properties.tcFieldLevelRange}"`),this.properties.pageNumbersEntryLevelsRange&&(t=`${t} \\n "${this.properties.pageNumbersEntryLevelsRange}"`),this.properties.headingStyleRange&&(t=`${t} \\o "${this.properties.headingStyleRange}"`),this.properties.entryAndPageNumberSeparator&&(t=`${t} \\p "${this.properties.entryAndPageNumberSeparator}"`),this.properties.seqFieldIdentifierForPrefix&&(t=`${t} \\s "${this.properties.seqFieldIdentifierForPrefix}"`),this.properties.stylesWithLevels&&this.properties.stylesWithLevels.length){let e=this.properties.stylesWithLevels.map(e=>`${e.styleName},${e.level}`).join(`,`);t=`${t} \\t "${e}"`}this.properties.useAppliedParagraphOutlineLevel&&(t=`${t} \\u`),this.properties.preserveTabInEntries&&(t=`${t} \\w`),this.properties.preserveNewLineInEntries&&(t=`${t} \\x`),this.properties.hideTabAndPageNumbersInWebView&&(t=`${t} \\z`),this.root.push(t)}},Bn=class extends d{constructor(){super(`w:sdtContent`)}},Vn=e=>e===void 0?ct():at(e),Hn=new WeakMap,Un=class{constructor(){o(this,`ids`,[])}get(e){var t;return(t=this.ids)[e]??(t[e]=Bt()),this.ids[e]}},Wn=e=>typeof e==`object`&&e?Object.keys(e)[0]:void 0,Gn=e=>{let t=Wn(e),n=t===void 0?void 0:e[t];return Array.isArray(n)?n:n===void 0?[]:[n]},Kn=(e,t)=>Gn(e).find(e=>Wn(e)===t),qn=(e,t)=>{var n;return(n=Kn(e,`_attr`))==null||(n=n._attr)==null?void 0:n[t]},Jn=(e,t)=>{let n=qn(e,t);return n===void 0?void 0:Number(n)},Yn=new Set([`w:tbl`,`w:tr`,`w:tc`,`w:sdt`,`w:sdtContent`,`w:customXml`]),Xn=e=>e.flatMap(e=>{let t=Wn(e);return t===`w:p`||Hn.has(e)?[e]:t!==void 0&&Yn.has(t)?Xn(Gn(e)):[]}),Zn=new Set([`w:r`,`w:hyperlink`,`w:ins`,`w:moveTo`,`w:smartTag`,`w:customXml`,`w:sdt`,`w:sdtContent`,`w:fldSimple`,`w:dir`,`w:bdo`]),Qn=e=>{switch(Wn(e)){case`w:t`:return Gn(e).filter(e=>typeof e==`string`).join(``);case`w:tab`:return` `;case`w:br`:return[void 0,`textWrapping`].includes(qn(e,`w:type`))?`
|
|
7
|
+
`:``;case`w:cr`:return`
|
|
8
|
+
`;case`w:noBreakHyphen`:return`-`;default:return``}},$n=e=>{let t=[],n=e=>{let r=Wn(e);if(r!==void 0&&Zn.has(r))return Gn(e).map(n).join(``);if(r===`w:fldChar`){let n=qn(e,`w:fldCharType`);return n===`begin`?t.push(!1):n===`separate`?t[t.length-1]=!0:t.pop(),``}return t.every(Boolean)?Qn(e):``};return Gn(e).map(n).join(``)},er=e=>{let t=Wn(e);return t===`w:bookmarkStart`?[{start:!0,id:qn(e,`w:id`),name:qn(e,`w:name`)}]:t===`w:bookmarkEnd`?[{start:!1,id:qn(e,`w:id`)}]:t===void 0||t===`_attr`?[]:Gn(e).flatMap(er)},tr=e=>{let t=new Map;return e.map(e=>{let n=er(e),r=new Set([...t.values(),...n.flatMap(e=>e.start?[e.name]:[])]);for(let e of n)e.start?t.set(e.id,e.name):t.delete(e.id);return r})},nr=(e,t)=>{let n=t?tr(e):[];return e.map((e,t)=>{let r=Kn(e,`w:pPr`);return{element:e,styleId:qn(Kn(r,`w:pStyle`),`w:val`),outlineLevel:Jn(Kn(r,`w:outlineLvl`),`w:val`),text:$n(e),bookmarks:n[t]??new Set}})},rr=e=>{var t;let n=(t=e.file)==null||(t=t.Styles)==null?void 0:t.prepForXml(e);return new Map(Gn(n).filter(e=>Wn(e)===`w:style`&&[`paragraph`,void 0].includes(qn(e,`w:type`))).map(e=>[qn(e,`w:styleId`),{name:qn(Kn(e,`w:name`),`w:val`),basedOn:qn(Kn(e,`w:basedOn`),`w:val`),outlineLevel:Jn(Kn(Kn(e,`w:pPr`),`w:outlineLvl`),`w:val`)}]))},ir=e=>{let t=/^\s*(\d+)\s*-\s*(\d+)\s*$/.exec(e);return t?[Number(t[1]),Number(t[2])]:void 0},ar=(e,[t,n])=>e>=t&&e<=n,or=(e,t)=>{if(e===void 0)return;let n=/^heading ?([1-9])$/i.exec(t.get(e)?.name??e);return n?Number(n[1]):void 0},sr=(e,t,n=0)=>{if(e===void 0||n>t.size)return;let r=t.get(e),i=or(e,t);return r?.outlineLevel??(i===void 0?sr(r?.basedOn,t,n+1):i-1)},cr=e=>{let t=rr(e);return e=>{let n=Kn(e,`w:pPr`),r=qn(Kn(n,`w:pStyle`),`w:val`),i=or(r,t),a=lr({styleId:r,outlineLevel:Jn(Kn(n,`w:outlineLvl`),`w:val`)},t),o=a===void 0||a>=9?void 0:a+1;return i!==void 0&&(o===void 0||o===i)?i:o===void 0?void 0:`unclear`}},lr=(e,t)=>e.outlineLevel??sr(e.styleId,t),ur=(e,t,n)=>{let{entriesFromBookmark:r,headingStyleRange:i,stylesWithLevels:a=[],useAppliedParagraphOutlineLevel:o}=e;if(t.text.trim()===``||r&&!t.bookmarks.has(r))return;let s=[t.styleId,t.styleId===void 0?void 0:n.get(t.styleId)?.name].filter(e=>e!==void 0).map(e=>e.toLowerCase()),c=a.find(e=>s.includes(e.styleName.toLowerCase()));if(c)return c.level;let l=!!i||a.length>0||!!o||!!e.tcFieldIdentifier||!!e.tcFieldLevelRange||!!e.captionLabel||!!e.captionLabelIncludingNumbers,u=i?ir(i):l?void 0:[1,9],d=or(t.styleId,n);if(u&&d!==void 0&&ar(d,u))return d;let f=o?lr(t,n):void 0;return f!==void 0&&ar(f+1,u??[1,9])?f+1:void 0},dr=(e,t)=>{let n=t.preserveTabInEntries?e:e.replace(/\t/g,` `);return(t.preserveNewLineInEntries?n.split(`
|
|
9
|
+
`):[n.replace(/\n/g,` `)]).map((e,t)=>new U({break:t>0?1:void 0,children:e.split(` `).flatMap((e,t)=>[...t>0?[new qr]:[],...e===``?[]:[e]])}))},fr=({text:e,separator:t})=>t===`tab`?[new U(e),new U({children:[new qr]})]:[new U(`${e} `)],pr=(e,t)=>{let n=240*(e-1)+t+240;return n<=1920?Math.ceil(n/240)*240:Math.round(n)},mr=(e,t)=>[...t].find(([,t])=>t.name?.toLowerCase()===`toc ${e}`)?.[0]??`TOC${e}`,hr=({properties:e,beginDirty:t,textWidth:n,tabLeader:r},i,a,o)=>{let s=e.pageNumbersEntryLevelsRange?ir(e.pageNumbersEntryLevelsRange)??[1,9]:void 0,c=new Bn;return i.forEach((i,o)=>{let l=s===void 0||!ar(i.level,s),u=[...i.listNumber?fr(i.listNumber):[],...dr(i.title,e),...l?[new U({children:[e.entryAndPageNumberSeparator||new qr]}),new _i(i.bookmark,{hyperlink:e.hyperlink})]:[]];c.addChildElement(new G({style:mr(i.level,a),tabStops:[...i.listNumber?.separator===`tab`?[{type:`left`,position:pr(i.level,i.listNumber.width)}]:[],{type:`right`,position:n,leader:r}],children:[...o===0?[new dn({children:[Vn(t),new zn(e),ut()]})]:[],...e.hyperlink?[new ci({anchor:i.bookmark,children:u})]:u]}))}),c.addChildElement(new G({children:[new dn({children:[dt()]})]})),c.prepForXml(o)},gr=(e,t,n,r)=>{let i=Gn(e),a=i.findIndex(e=>Wn(e)===`w:pPr`)+1;e[`w:p`]=[...i.slice(0,a),new pi(t,n).prepForXml(r),...i.slice(a),new mi(n).prepForXml(r)]},_r=(e,t,n,r)=>{let i=Xn(Gn(e)),a=i.flatMap(e=>{let t=Hn.get(e);return t?[[e,t]]:[]});if(a.length===0)return;let o=rr(t),s=a.some(([,{properties:e}])=>!!e.entriesFromBookmark),c=nr(i.filter(e=>Wn(e)===`w:p`),s).map(e=>({paragraph:e,levels:a.map(([,{properties:t}])=>ur(t,e,o))})).filter(({levels:e})=>e.some(e=>e!==void 0)).map((e,t)=>m(m({},e),{},{id:n.get(t)}));for(let{paragraph:e,id:n}of c)gr(e.element,`_Toc${n}`,n,t);let l=c.length>0?r?.(e):void 0;a.forEach(([e,n],r)=>{let i=c.flatMap(({paragraph:e,levels:t,id:n})=>{let i=t[r],a=l?.get(`_Toc${n}`);return i===void 0?[]:[m({title:e.text,level:i,bookmark:`_Toc${n}`},a?{listNumber:a}:{})]});i.length!==0&&(e[`w:sdt`]=Gn(e).map(e=>Wn(e)===`w:sdtContent`?hr(n,i,o,t):e))})},vr=RegExp(`^\\p{L}[\\p{L}\\p{N}_]*$`,`u`),yr=e=>{let t,n=!1,r,i=!1,a=!1;for(let o=0;o<e.length;o++){let s=e[o],c=e[o+1]??``,l;if(o===0&&!s.startsWith(`\\`))l={type:`bookmark`};else if(s===`\\c`||s===`\\n`)l={type:s===`\\c`?`repeat`:`next`};else if((s===`\\r`||s===`\\s`)&&/^\d+$/.test(c))o++,l=s===`\\r`?{type:`reset`,to:Number(c)}:{type:`heading`,level:Number(c)};else if(s===`\\h`)n=!0;else if(s===`\\#`&&o+1<e.length)o++,a=!0;else if(s===`\\*`&&o+1<e.length){let t=e[++o];if(wn.has(t.toLowerCase()))i=!0;else if(!Cn.has(t.toLowerCase())){if(r!==void 0)return;r=t}}else return;if(l&&t)return;t=l??t}if(t?.type===`bookmark`&&e.length>1)return;let o=!a&&!(i&&r!==void 0&&r.toLowerCase()!==`arabic`);return{step:t??{type:`next`},hidden:n&&r===void 0,format:o?r??`ARABIC`:``}},br=e=>{let t=RegExp(`^\\s*SEQ\\b(.*)$`,`is`).exec(e);if(!t)return;let[n,...r]=t[1].match(/"[^"]*"|\S+/g)??[];if(n===void 0)return{};let i=n.replace(/^"(.*)"$/,`$1`);return vr.test(i)?{identifier:i,sequence:yr(r)}:{identifier:i}},xr=e=>br(e)!==void 0,Sr=e=>typeof e!=`object`||!e?[]:Array.isArray(e)?e.flatMap(Sr):Object.entries(e).flatMap(([e,t])=>[...(e===`w:instrText`&&Array.isArray(t)?t:e===`_attr`?[t[`w:instr`]]:[]).flatMap(e=>{let t=typeof e==`string`?br(e):void 0;return t?.identifier===void 0?[]:[t.identifier.toLowerCase()]}),...Sr(t)]),Cr=e=>{let t=e.file?.Comments;if(!t)return new Set;let n={View:t,Relationships:t.Relationships};return new Set(Sr(t.prepForXml(m(m({},e),{},{viewWrapper:n,stack:[]}))))},wr=e=>{let t=cr(e),n=new Map,r=new Map,i=[],a=-1,o=-1,s,c=(e,t)=>{let n=Math.max(-1,...i.slice(1,t+1).filter(e=>e!==void 0)),o=(r.get(e)??[]).filter(e=>e.paragraph>=n),s=o.every(({step:e})=>e?.type===`next`||e?.type===`heading`&&e.level===t);return a>n||!s?void 0:o.length+1};return{startParagraph:e=>{o++;let n=t(e);n===`unclear`?a=o:n!==void 0&&(i[n]=o)},numberOf:(t,i)=>{let{identifier:a,sequence:l}=br(t);if(a===void 0||i===`fallback`)return;s??=Cr(e);let u=a.toLowerCase();if(l?.step.type===`bookmark`&&i===`counted`&&!s.has(u))return;let d=n.has(u)?n.get(u):0,f=s.has(u)||i===`deleted`?void 0:l?.step,p=f?.type===`reset`?f.to:f?.type===`repeat`?d:f?.type===`heading`?c(u,f.level):f?.type===`next`&&d!==void 0?d+1:void 0;return n.set(u,p),r.set(u,[...r.get(u)??[],m({paragraph:o},p===void 0?{}:{step:f})]),p===void 0||l===void 0?void 0:l.hidden?``:Sn(l.format)?.(p)}}},Tr=e=>{let t=typeof e==`object`&&e&&!Array.isArray(e)?Object.keys(e)[0]:void 0;return t===`_attr`?void 0:t},Er=e=>({"w:t":[{_attr:{"xml:space":`preserve`}},e]}),Dr={nameOf:Tr,contentOf:e=>{let t=e[Tr(e)];return Array.isArray(t)?t:void 0},attributeOf:(e,t)=>{var n;let r=e[Tr(e)],i=Array.isArray(r)?r.find(e=>typeof e==`object`&&!!e&&`_attr`in e):r;return i==null||(n=i._attr)==null?void 0:n[t]},textOf:e=>Dr.contentOf(e).filter(e=>typeof e==`string`).join(``),textElement:Er,writeClean:e=>{if(lt(e)){let t=e[`w:fldChar`]._attr;e[`w:fldChar`]={_attr:Object.fromEntries(Object.entries(t).filter(([e])=>e!==`w:dirty`))}}},setSimpleFieldResult:(e,t)=>{let n=e[`w:fldSimple`];e[`w:fldSimple`]=[...(Array.isArray(n)?n:[n]).filter(e=>typeof e==`object`&&!!e&&`_attr`in e),{"w:r":[Er(t)]}]}},Or=new WeakMap,kr=(e,t)=>{let{startParagraph:n,numberOf:r}=wr(t);Rn(Dr,e,{beforeParagraph:e=>n(e),resultOf:(e,t)=>xr(e)?r(e,t):void 0})},Ar=(e,t,n)=>{let r=n(e,t),i=In(Dr,e,r,{blank:!1});t.file&&Or.set(t.file,{estimate:r,partPageCounts:i})},jr=(e,t,n)=>{let r=t.file&&Or.get(t.file);if(!e||!r)return;let i=n===void 0?void 0:r.partPageCounts.get(`rId${n}`),a=`w:footnotes`in e||`w:endnotes`in e;Ln(Dr,e,r.estimate,{blank:!1,sectionPageCount:i,notes:a})},Mr=class extends h{constructor(...e){super(...e),o(this,`xmlKeys`,{xmlns:`xmlns`})}},W=class e extends d{constructor(){super(`Relationships`),this.root.push(new Mr({xmlns:`http://schemas.openxmlformats.org/package/2006/relationships`}))}addRelationship(e,t,n,r){this.root.push(pn(`rId${e}`,t,n,r))}static copy(t){let n=new e;return n.root.push(...t.root.slice(1)),n}get RelationshipCount(){return this.root.length-1}},Nr=class extends h{constructor(...e){super(...e),o(this,`xmlKeys`,{id:`w:id`,initials:`w:initials`,author:`w:author`,date:`w:date`})}},Pr=class extends h{constructor(...e){super(...e),o(this,`xmlKeys`,{"xmlns:wpc":`xmlns:wpc`,"xmlns:cx":`xmlns:cx`,"xmlns:cx1":`xmlns:cx1`,"xmlns:cx2":`xmlns:cx2`,"xmlns:cx3":`xmlns:cx3`,"xmlns:cx4":`xmlns:cx4`,"xmlns:cx5":`xmlns:cx5`,"xmlns:cx6":`xmlns:cx6`,"xmlns:cx7":`xmlns:cx7`,"xmlns:cx8":`xmlns:cx8`,"xmlns:mc":`xmlns:mc`,"xmlns:aink":`xmlns:aink`,"xmlns:am3d":`xmlns:am3d`,"xmlns:o":`xmlns:o`,"xmlns:r":`xmlns:r`,"xmlns:m":`xmlns:m`,"xmlns:v":`xmlns:v`,"xmlns:wp14":`xmlns:wp14`,"xmlns:wp":`xmlns:wp`,"xmlns:w10":`xmlns:w10`,"xmlns:w":`xmlns:w`,"xmlns:w14":`xmlns:w14`,"xmlns:w15":`xmlns:w15`,"xmlns:w16cex":`xmlns:w16cex`,"xmlns:w16cid":`xmlns:w16cid`,"xmlns:w16":`xmlns:w16`,"xmlns:w16sdtdh":`xmlns:w16sdtdh`,"xmlns:w16se":`xmlns:w16se`,"xmlns:wpg":`xmlns:wpg`,"xmlns:wpi":`xmlns:wpi`,"xmlns:wne":`xmlns:wne`,"xmlns:wps":`xmlns:wps`,"mc:Ignorable":`mc:Ignorable`})}},Fr=class extends d{constructor({id:e,initials:t,author:n,date:r=new Date,children:i},a){super(`w:comment`),o(this,`paraId`,void 0),this.paraId=a,this.root.push(new Nr({id:e,initials:t,author:n,date:r.toISOString()}));for(let e of i)this.root.push(e)}prepForXml(e){let t=super.prepForXml(e);if(!t||!this.paraId)return t;let n=t[`w:comment`];if(!Array.isArray(n))return t;for(let e=n.length-1;e>=0;e--){let t=n[e];if(t&&typeof t==`object`&&`w:p`in t){let e=t[`w:p`];Array.isArray(e)&&e.unshift({_attr:{"w14:paraId":this.paraId,"w14:textId":this.paraId}});break}}return t}},Ir=e=>(e+1).toString(16).toUpperCase().padStart(8,`0`),Lr=class extends d{constructor({children:e}){super(`w:comments`),o(this,`relationships`,void 0),o(this,`threadData`,void 0),o(this,`commentIdsData`,void 0),o(this,`isEmpty`,void 0),this.isEmpty=e.length===0,this.root.push(new Pr({"xmlns:wpc":`http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas`,"xmlns:cx":`http://schemas.microsoft.com/office/drawing/2014/chartex`,"xmlns:cx1":`http://schemas.microsoft.com/office/drawing/2015/9/8/chartex`,"xmlns:cx2":`http://schemas.microsoft.com/office/drawing/2015/10/21/chartex`,"xmlns:cx3":`http://schemas.microsoft.com/office/drawing/2016/5/9/chartex`,"xmlns:cx4":`http://schemas.microsoft.com/office/drawing/2016/5/10/chartex`,"xmlns:cx5":`http://schemas.microsoft.com/office/drawing/2016/5/11/chartex`,"xmlns:cx6":`http://schemas.microsoft.com/office/drawing/2016/5/12/chartex`,"xmlns:cx7":`http://schemas.microsoft.com/office/drawing/2016/5/13/chartex`,"xmlns:cx8":`http://schemas.microsoft.com/office/drawing/2016/5/14/chartex`,"xmlns:mc":`http://schemas.openxmlformats.org/markup-compatibility/2006`,"xmlns:aink":`http://schemas.microsoft.com/office/drawing/2016/ink`,"xmlns:am3d":`http://schemas.microsoft.com/office/drawing/2017/model3d`,"xmlns:o":`urn:schemas-microsoft-com:office:office`,"xmlns:r":`http://schemas.openxmlformats.org/officeDocument/2006/relationships`,"xmlns:m":`http://schemas.openxmlformats.org/officeDocument/2006/math`,"xmlns:v":`urn:schemas-microsoft-com:vml`,"xmlns:wp14":`http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing`,"xmlns:wp":`http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing`,"xmlns:w10":`urn:schemas-microsoft-com:office:word`,"xmlns:w":`http://schemas.openxmlformats.org/wordprocessingml/2006/main`,"xmlns:w14":`http://schemas.microsoft.com/office/word/2010/wordml`,"xmlns:w15":`http://schemas.microsoft.com/office/word/2012/wordml`,"xmlns:w16cex":`http://schemas.microsoft.com/office/word/2018/wordml/cex`,"xmlns:w16cid":`http://schemas.microsoft.com/office/word/2016/wordml/cid`,"xmlns:w16":`http://schemas.microsoft.com/office/word/2018/wordml`,"xmlns:w16sdtdh":`http://schemas.microsoft.com/office/word/2020/wordml/sdtdatahash`,"xmlns:w16se":`http://schemas.microsoft.com/office/word/2015/wordml/symex`,"xmlns:wpg":`http://schemas.microsoft.com/office/word/2010/wordprocessingGroup`,"xmlns:wpi":`http://schemas.microsoft.com/office/word/2010/wordprocessingInk`,"xmlns:wne":`http://schemas.microsoft.com/office/word/2006/wordml`,"xmlns:wps":`http://schemas.microsoft.com/office/word/2010/wordprocessingShape`,"mc:Ignorable":`w14 w15 wp14`}));let t=e.some(e=>e.parentId!==void 0),n=e.some(e=>e.durableId!==void 0);if(t||n){let r=new Map(e.map(e=>[e.id,Ir(e.id)]));for(let t of e)this.root.push(new Fr(t,r.get(t.id)));t&&(this.threadData=e.map(e=>({paraId:r.get(e.id),parentParaId:e.parentId===void 0?void 0:r.get(e.parentId),done:e.resolved}))),n&&(this.commentIdsData=e.map(e=>({paraId:r.get(e.id),durableId:e.durableId??r.get(e.id)})))}else for(let t of e)this.root.push(new Fr(t));this.relationships=new W}get Relationships(){return this.relationships}get ThreadData(){return this.threadData}get CommentIdsData(){return this.commentIdsData}get IsEmpty(){return this.isEmpty}prepForXml(e){let t=super.prepForXml(e);return jr(t,e),t}},Rr=class extends h{constructor(...e){super(...e),o(this,`xmlKeys`,{"xmlns:wpc":`xmlns:wpc`,"xmlns:mc":`xmlns:mc`,"xmlns:w15":`xmlns:w15`,"mc:Ignorable":`mc:Ignorable`})}},zr=class extends h{constructor(...e){super(...e),o(this,`xmlKeys`,{paraId:`w15:paraId`,paraIdParent:`w15:paraIdParent`,done:`w15:done`})}},Br=class extends d{constructor(e){super(`w15:commentEx`),this.root.push(new zr({paraId:e.paraId,paraIdParent:e.parentParaId,done:e.done===void 0?void 0:e.done?`1`:`0`}))}},Vr=class extends d{constructor(e){super(`w15:commentsEx`),this.root.push(new Rr({"xmlns:wpc":`http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas`,"xmlns:mc":`http://schemas.openxmlformats.org/markup-compatibility/2006`,"xmlns:w15":`http://schemas.microsoft.com/office/word/2012/wordml`,"mc:Ignorable":`w15`}));for(let t of e)this.root.push(new Br(t))}},Hr=class extends h{constructor(...e){super(...e),o(this,`xmlKeys`,{paraId:`w16cid:paraId`,durableId:`w16cid:durableId`})}},Ur=class extends d{constructor(e){super(`w16cid:commentId`),this.root.push(new Hr({paraId:e.paraId,durableId:e.durableId}))}},Wr=class extends h{constructor(...e){super(...e),o(this,`xmlKeys`,{"xmlns:w16cid":`xmlns:w16cid`,"xmlns:mc":`xmlns:mc`,"mc:Ignorable":`mc:Ignorable`})}},Gr=class extends d{constructor(e){super(`w16cid:commentsIds`),this.root.push(new Wr({"xmlns:w16cid":`http://schemas.microsoft.com/office/word/2016/wordml/cid`,"xmlns:mc":`http://schemas.openxmlformats.org/markup-compatibility/2006`,"mc:Ignorable":`w16cid`}));for(let t of e)this.root.push(new Ur(t))}},Kr=class extends Ce{constructor(){super(`w:endnoteRef`)}},qr=class extends Ce{constructor(){super(`w:tab`)}},Jr=class extends d{constructor(){super(`w:pageBreakBefore`)}},Yr={AT_LEAST:`atLeast`,EXACTLY:`exactly`,EXACT:`exact`,AUTO:`auto`},Xr=({after:e,before:t,line:n,lineRule:r,beforeAutoSpacing:i,afterAutoSpacing:a})=>new B({name:`w:spacing`,attributes:{after:{key:`w:after`,value:e},before:{key:`w:before`,value:t},line:{key:`w:line`,value:n},lineRule:{key:`w:lineRule`,value:r},beforeAutoSpacing:{key:`w:beforeAutospacing`,value:i},afterAutoSpacing:{key:`w:afterAutospacing`,value:a}}}),Zr={HEADING_1:`Heading1`,HEADING_2:`Heading2`,HEADING_3:`Heading3`,HEADING_4:`Heading4`,HEADING_5:`Heading5`,HEADING_6:`Heading6`,TITLE:`Title`},Qr=e=>new B({name:`w:pStyle`,attributes:{val:{key:`w:val`,value:e}}}),$r={LEFT:`left`,RIGHT:`right`,CENTER:`center`,BAR:`bar`,CLEAR:`clear`,DECIMAL:`decimal`,END:`end`,NUM:`num`,START:`start`},ei=({type:e,position:t,leader:n})=>new B({name:`w:tab`,attributes:{val:{key:`w:val`,value:e},pos:{key:`w:pos`,value:he(t)},leader:{key:`w:leader`,value:n}}}),ti=e=>new B({name:`w:tabs`,children:e.map(e=>ei(e))}),ni=class extends d{constructor(e,t){super(`w:numPr`),this.root.push(new ri(t)),this.root.push(new ii(e))}},ri=class extends d{constructor(e){if(super(`w:ilvl`),e>9)throw Error(`Level cannot be greater than 9. Read more here: https://answers.microsoft.com/en-us/msoffice/forum/all/does-word-support-more-than-9-list-levels/d130fdcd-1781-446d-8c84-c6c79124e4d7`);this.root.push(new _({val:e}))}},ii=class extends d{constructor(e){super(`w:numId`),this.root.push(new _({val:typeof e==`string`?`{${e}}`:e}))}},ai=class extends d{constructor(...e){super(...e),o(this,`fileChild`,Symbol())}},oi=class extends h{constructor(...e){super(...e),o(this,`xmlKeys`,{id:`r:id`,history:`w:history`,anchor:`w:anchor`})}},si=class extends d{constructor(e,t,n,r){super(`w:hyperlink`),o(this,`linkId`,void 0),o(this,`drawingLink`,void 0),this.linkId=t,this.drawingLink=n&&r!==void 0?new hn(r):void 0;let i=new oi({history:1,anchor:n||void 0,id:!n||r!==void 0?`rId${this.linkId}`:void 0});this.root.push(i),e.forEach(e=>{this.root.push(e)})}createDrawingClick(e,t){return this.drawingLink?(this.drawingLink.addRelationship(e),this.drawingLink.createClick(t)):mn(this.linkId,t)}},ci=class extends si{constructor(e){super(e.children,Ut(),e.anchor)}},li=class extends d{constructor(e){super(`w:externalHyperlink`),o(this,`options`,void 0),this.options=e}},ui=class extends h{constructor(...e){super(...e),o(this,`xmlKeys`,{id:`w:id`,name:`w:name`})}},di=class extends h{constructor(...e){super(...e),o(this,`xmlKeys`,{id:`w:id`})}},fi=class e{constructor(e){o(this,`start`,void 0),o(this,`children`,void 0),o(this,`end`,void 0);let t=Bt();this.start=new pi(e.id,t),this.children=e.children,this.end=new mi(t)}get writtenAs(){return[this.start,...this.children.flatMap(t=>t instanceof e?t.writtenAs:[t]),this.end]}},pi=class extends d{constructor(e,t){super(`w:bookmarkStart`);let n=new ui({name:e,id:t});this.root.push(n)}},mi=class extends d{constructor(e){super(`w:bookmarkEnd`);let t=new di({id:e});this.root.push(t)}},hi=e=>new B({name:`w:outlineLvl`,attributes:{val:{key:`w:val`,value:e}}}),gi=class extends d{constructor(e,t={}){super(`w:instrText`),this.root.push(new pt({space:ft.PRESERVE}));let n=`PAGEREF ${e}`;t.hyperlink&&(n=`${n} \\h`),t.useRelativePosition&&(n=`${n} \\p`),this.root.push(n)}},_i=class extends dn{constructor(e,t={}){super({children:[ct(),new gi(e,t),ut(),dt()]})}},vi=255,yi=e=>{let t=e.indexOf(`#`),n=e.length-t-1;return t>0&&n>0&&n<=vi?{target:e.slice(0,t),anchor:e.slice(t+1)}:{target:e}},bi=(e,t,n)=>n===void 0?`${e}-${t}`:`${e}-restart ${n}`,xi=({id:e,fontKey:t,subsetted:n},r)=>new B({name:r,attributes:m({id:{key:`r:id`,value:e}},t?{fontKey:{key:`w:fontKey`,value:`{${t.toUpperCase()}}`}}:{}),children:[...n?[new z(`w:subsetted`,n)]:[]]}),Si=({name:e,altName:t,panose1:n,charset:r,family:i,notTrueType:a,pitch:o,sig:s,embedRegular:c,embedBold:l,embedItalic:u,embedBoldItalic:d})=>new B({name:`w:font`,attributes:{name:{key:`w:name`,value:e}},children:[...t?[Te(`w:altName`,t)]:[],...n?[Te(`w:panose1`,n)]:[],...r?[Te(`w:charset`,r)]:[],...i?[Te(`w:family`,i)]:[],...a?[new z(`w:notTrueType`,a)]:[],...o?[Te(`w:pitch`,o)]:[],...s?[new B({name:`w:sig`,attributes:{usb0:{key:`w:usb0`,value:s.usb0},usb1:{key:`w:usb1`,value:s.usb1},usb2:{key:`w:usb2`,value:s.usb2},usb3:{key:`w:usb3`,value:s.usb3},csb0:{key:`w:csb0`,value:s.csb0},csb1:{key:`w:csb1`,value:s.csb1}}})]:[],...c?[xi(c,`w:embedRegular`)]:[],...l?[xi(l,`w:embedBold`)]:[],...u?[xi(u,`w:embedItalic`)]:[],...d?[xi(d,`w:embedBoldItalic`)]:[]]}),Ci=({name:e,characterSet:t,embedRegular:n,embedBold:r,embedItalic:i,embedBoldItalic:a})=>Si({name:e,sig:{usb0:`E0002AFF`,usb1:`C000247B`,usb2:`00000009`,usb3:`00000000`,csb0:`000001FF`,csb1:`00000000`},charset:t,family:`auto`,pitch:`variable`,embedRegular:n,embedBold:r,embedItalic:i,embedBoldItalic:a}),wi=e=>new B({name:`w:fonts`,attributes:{mc:{key:`xmlns:mc`,value:`http://schemas.openxmlformats.org/markup-compatibility/2006`},r:{key:`xmlns:r`,value:`http://schemas.openxmlformats.org/officeDocument/2006/relationships`},w:{key:`xmlns:w`,value:`http://schemas.openxmlformats.org/wordprocessingml/2006/main`},w14:{key:`xmlns:w14`,value:`http://schemas.microsoft.com/office/word/2010/wordml`},w15:{key:`xmlns:w15`,value:`http://schemas.microsoft.com/office/word/2012/wordml`},w16cex:{key:`xmlns:w16cex`,value:`http://schemas.microsoft.com/office/word/2018/wordml/cex`},w16cid:{key:`xmlns:w16cid`,value:`http://schemas.microsoft.com/office/word/2016/wordml/cid`},w16:{key:`xmlns:w16`,value:`http://schemas.microsoft.com/office/word/2018/wordml`},w16sdtdh:{key:`xmlns:w16sdtdh`,value:`http://schemas.microsoft.com/office/word/2020/wordml/sdtdatahash`},w16se:{key:`xmlns:w16se`,value:`http://schemas.microsoft.com/office/word/2015/wordml/symex`},Ignorable:{key:`mc:Ignorable`,value:`w14 w15 w16se w16cid w16 w16cex w16sdtdh`}},children:e.map(Ci)}),Ti=[{option:`data`,element:`embedRegular`,bold:!1,italic:!1},{option:`bold`,element:`embedBold`,bold:!0,italic:!1},{option:`italic`,element:`embedItalic`,bold:!1,italic:!0},{option:`boldItalic`,element:`embedBoldItalic`,bold:!0,italic:!0}],Ei=class{constructor(e){o(this,`options`,void 0),o(this,`fontTable`,void 0),o(this,`relationships`,void 0),o(this,`fontOptionsWithKey`,[]),o(this,`files`,[]),this.options=e;let t=e.map(e=>Ti.flatMap(({option:t,element:n,bold:r,italic:i})=>{let a=e[t];return a?[{element:n,file:{name:e.name,data:a,bold:r,italic:i,fontKey:Gt()}}]:[]}));this.files=t.flatMap(e=>e.map(({file:e})=>e)),this.fontOptionsWithKey=e.map((e,n)=>m(m({},e),{},{fontKey:t[n][0].file.fontKey})),this.fontTable=wi(e.map((e,n)=>m({name:e.name,characterSet:e.characterSet},Object.fromEntries(t[n].map(({element:e,file:t})=>[e,{id:`rId${this.files.indexOf(t)+1}`,fontKey:t.fontKey}]))))),this.relationships=new W;for(let e=0;e<this.files.length;e++)this.relationships.addRelationship(e+1,`http://schemas.openxmlformats.org/officeDocument/2006/relationships/font`,`fonts/font${e+1}.odttf`)}get View(){return this.fontTable}get Relationships(){return this.relationships}},Di=()=>new B({name:`w:wordWrap`,attributes:{val:{key:`w:val`,value:0}}}),Oi=e=>new B({name:`w:framePr`,attributes:{anchorLock:{key:`w:anchorLock`,value:e.anchorLock},dropCap:{key:`w:dropCap`,value:e.dropCap},width:{key:`w:w`,value:e.width},height:{key:`w:h`,value:e.height},x:{key:`w:x`,value:e.position?e.position.x:void 0},y:{key:`w:y`,value:e.position?e.position.y:void 0},anchorHorizontal:{key:`w:hAnchor`,value:e.anchor.horizontal},anchorVertical:{key:`w:vAnchor`,value:e.anchor.vertical},spaceHorizontal:{key:`w:hSpace`,value:e.space?.horizontal},spaceVertical:{key:`w:vSpace`,value:e.space?.vertical},rule:{key:`w:hRule`,value:e.rule},alignmentX:{key:`w:xAlign`,value:e.alignment?e.alignment.x:void 0},alignmentY:{key:`w:yAlign`,value:e.alignment?e.alignment.y:void 0},lines:{key:`w:lines`,value:e.lines},wrap:{key:`w:wrap`,value:e.wrap}}}),ki=new WeakMap,Ai=Lt(),ji={left:`right`,right:`left`},Mi=class extends f{constructor(e,{implicitListParagraphStyle:t=!0,inListOrder:n=!0}={}){if(super(`w:pPr`,e?.includeIfEmpty),o(this,`numbering`,void 0),o(this,`numberProperties`,void 0),!e)return this;if(e.heading&&this.push(Qr(e.heading)),t&&(e.bullet&&this.push(Qr(`ListParagraph`)),e.numbering&&!e.numbering.custom&&!e.style&&!e.heading&&this.push(Qr(`ListParagraph`))),e.style&&this.push(Qr(e.style)),e.keepNext!==void 0&&this.push(new z(`w:keepNext`,e.keepNext)),e.keepLines!==void 0&&this.push(new z(`w:keepLines`,e.keepLines)),e.pageBreakBefore&&this.push(new Jr),e.frame&&this.push(Oi(e.frame)),e.widowControl!==void 0&&this.push(new z(`w:widowControl`,e.widowControl)),e.bullet&&this.push(new ni(1,e.bullet.level)),e.numbering){let{reference:t,instance:r,level:i,restart:a}=e.numbering,o=typeof t==`string`?t:t.reference,s=new ni(bi(o,r??0),i);this.numbering={reference:o,level:i,instance:r,restartedListId:a&&n&&r===void 0?Ai():void 0,definition:typeof t==`string`?void 0:t},this.numberProperties=s,this.push(s)}else e.numbering===!1&&this.push(new ni(0,0));e.border&&this.push(new $e(e.border)),e.thematicBreak&&this.push(new et),e.shading&&this.push(vt(e.shading)),e.wordWrap&&this.push(Di()),e.overflowPunctuation&&this.push(new z(`w:overflowPunct`,e.overflowPunctuation));let r=[...e.rightTabStop===void 0?[]:[{type:$r.RIGHT,position:e.rightTabStop}],...e.tabStops?e.tabStops:[],...e.leftTabStop===void 0?[]:[{type:$r.LEFT,position:e.leftTabStop}]];r.length>0&&this.push(ti(r)),e.bidirectional!==void 0&&this.push(new z(`w:bidi`,e.bidirectional)),e.spacing&&this.push(Xr(e.spacing)),e.indent&&this.push(tt(e.indent)),e.contextualSpacing!==void 0&&this.push(new z(`w:contextualSpacing`,e.contextualSpacing)),e.alignment&&this.push(Oe(e.bidirectional&&ji[e.alignment]||e.alignment)),e.outlineLevel!==void 0&&this.push(hi(e.outlineLevel)),e.suppressLineNumbers!==void 0&&this.push(new z(`w:suppressLineNumbers`,e.suppressLineNumbers)),e.autoSpaceEastAsianText!==void 0&&this.push(new z(`w:autoSpaceDN`,e.autoSpaceEastAsianText)),e.run&&this.push(new on(e.run)),e.revision&&this.push(new Ni(e.revision))}push(e){this.root.push(e)}addSectionProperties(e){let t=this.root.findIndex(e=>e instanceof Ni);t===-1?this.root.push(e):this.root.splice(t,0,e)}removeSectionProperties(e){let t=this.root.indexOf(e);t!==-1&&this.root.splice(t,1)}prepForXml(e){if(this.numbering){let{reference:t,level:n,instance:r=0,definition:i}=this.numbering,a=this.numbering.instance===void 0?this.numbering.restartedListId??ki.get(e)?.get(t):void 0;e.viewWrapper instanceof Ei||e.file.Numbering.createConcreteNumberingInstance(t,r,i,a);let o=new ni(bi(t,r,a),n);this.root.splice(this.root.indexOf(this.numberProperties),1,o),this.numberProperties=o}let t=super.prepForXml(e);return this.numbering?.restartedListId!==void 0&&ki.set(e,new Map([...ki.get(e)??[],[this.numbering.reference,this.numbering.restartedListId]])),t}},Ni=class extends d{constructor(e){super(`w:pPrChange`),this.root.push(new bt({id:e.id,author:e.author,date:e.date})),this.root.push(new Mi(m(m({},e),{},{includeIfEmpty:!0}),{inListOrder:!1}))}},G=class e extends ai{constructor(e){if(super(`w:p`),o(this,`options`,void 0),o(this,`properties`,void 0),o(this,`alignment`,void 0),this.options=typeof e==`string`?{text:e}:e,typeof e==`string`)return this.alignment={},this.properties=new Mi({}),this.root.push(this.properties),this.root.push(new U(e)),this;if(this.alignment={alignment:e.alignment,bidirectional:e.bidirectional},this.properties=new Mi(e),this.root.push(this.properties),e.text&&this.root.push(new U(e.text)),e.children)for(let t of e.children)t instanceof fi?this.root.push(...t.writtenAs):this.root.push(t)}prepForXml(e){for(let t of this.root)if(l(t)===`w:externalHyperlink`){let n=this.root.indexOf(t),{options:r}=t,{target:i,anchor:a}=yi(r.link),o=new si(r.children,Ut(),a,r.link);e.viewWrapper.Relationships.addRelationship(o.linkId,`http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink`,i,fn.EXTERNAL),this.root[n]=o}return super.prepForXml(e)}addSectionProperties(e){this.properties.addSectionProperties(e)}removeSectionProperties(e){this.properties.removeSectionProperties(e)}get Alignment(){return this.alignment}with(t){return new e(m(m({},this.options),t))}addRunToFront(e){return this.root.splice(1,0,e),this}};m(m({},{TOP:`top`,CENTER:`center`,BOTTOM:`bottom`}),{},{BOTH:`both`});var Pi=e=>new B({name:`w:vAlign`,attributes:{verticalAlign:{key:`w:val`,value:e}}}),Fi=({space:e,count:t,separate:n,equalWidth:r,children:i})=>new B({name:`w:cols`,attributes:{space:{key:`w:space`,value:e===void 0?void 0:R(e)},count:{key:`w:num`,value:t===void 0?void 0:L(t)},separate:{key:`w:sep`,value:n},equalWidth:{key:`w:equalWidth`,value:r}},children:!r&&i?i:void 0}),Ii=({type:e,linePitch:t,charSpace:n})=>new B({name:`w:docGrid`,attributes:{type:{key:`w:type`,value:e},linePitch:{key:`w:linePitch`,value:L(t)},charSpace:{key:`w:charSpace`,value:n?L(n):void 0}}}),Li={DEFAULT:`default`,FIRST:`first`,EVEN:`even`},Ri={HEADER:`w:headerReference`,FOOTER:`w:footerReference`},zi=(e,t)=>new B({name:e,attributes:{type:{key:`w:type`,value:t.type||Li.DEFAULT},id:{key:`r:id`,value:`rId${t.id}`}}}),Bi=({countBy:e,start:t,restart:n,distance:r})=>new B({name:`w:lnNumType`,attributes:{countBy:{key:`w:countBy`,value:e===void 0?void 0:L(e)},start:{key:`w:start`,value:t===void 0?void 0:L(t)},restart:{key:`w:restart`,value:n},distance:{key:`w:distance`,value:r===void 0?void 0:R(r)}}}),Vi=({name:e,position:t,numberFormat:n,start:r,restart:i})=>new B({name:e,children:[...t===void 0?[]:[new B({name:`w:pos`,attributes:{val:{key:`w:val`,value:t}}})],...n?[new B({name:`w:numFmt`,attributes:{val:{key:`w:val`,value:n.type},format:{key:`w:format`,value:n.format}}})]:[],...r===void 0?[]:[new B({name:`w:numStart`,attributes:{val:{key:`w:val`,value:L(r)}}})],...i===void 0?[]:[new B({name:`w:numRestart`,attributes:{val:{key:`w:val`,value:i}}})]]}),Hi=e=>Vi(m({name:`w:footnotePr`},e)),Ui=e=>Vi(m({name:`w:endnotePr`},e)),Wi=class extends h{constructor(...e){super(...e),o(this,`xmlKeys`,{display:`w:display`,offsetFrom:`w:offsetFrom`,zOrder:`w:zOrder`})}},Gi=class extends f{constructor(e){if(super(`w:pgBorders`),!e)return this;e.pageBorders?this.root.push(new Wi({display:e.pageBorders.display,offsetFrom:e.pageBorders.offsetFrom,zOrder:e.pageBorders.zOrder})):this.root.push(new Wi({})),e.pageBorderTop&&this.root.push(H(`w:top`,e.pageBorderTop)),e.pageBorderLeft&&this.root.push(H(`w:left`,e.pageBorderLeft)),e.pageBorderBottom&&this.root.push(H(`w:bottom`,e.pageBorderBottom)),e.pageBorderRight&&this.root.push(H(`w:right`,e.pageBorderRight))}},Ki=(e,t,n,r,i,a,o)=>new B({name:`w:pgMar`,attributes:{top:{key:`w:top`,value:he(e)},right:{key:`w:right`,value:R(t)},bottom:{key:`w:bottom`,value:he(n)},left:{key:`w:left`,value:R(r)},header:{key:`w:header`,value:R(i)},footer:{key:`w:footer`,value:R(a)},gutter:{key:`w:gutter`,value:R(o)}}}),qi={HYPHEN:`hyphen`,PERIOD:`period`,COLON:`colon`,EM_DASH:`emDash`,EN_DASH:`endash`},Ji=({start:e,formatType:t,separator:n,chapterHeadingLevel:r})=>new B({name:`w:pgNumType`,attributes:{start:{key:`w:start`,value:e===void 0?void 0:L(e)},formatType:{key:`w:fmt`,value:t},separator:{key:`w:chapSep`,value:n===qi.EN_DASH?`enDash`:n},chapterHeadingLevel:{key:`w:chapStyle`,value:r===void 0?void 0:L(r)}}}),Yi={PORTRAIT:`portrait`,LANDSCAPE:`landscape`},Xi=({width:e,height:t,orientation:n,code:r})=>{let i=R(e),a=R(t);return new B({name:`w:pgSz`,attributes:{width:{key:`w:w`,value:n===Yi.LANDSCAPE?a:i},height:{key:`w:h`,value:n===Yi.LANDSCAPE?i:a},orientation:{key:`w:orient`,value:n},code:{key:`w:code`,value:r}}})},Zi=class extends h{constructor(...e){super(...e),o(this,`xmlKeys`,{val:`w:val`})}},Qi=class extends d{constructor(e){super(`w:textDirection`),this.root.push(new Zi({val:e}))}},$i=e=>new B({name:`w:type`,attributes:{val:{key:`w:val`,value:e}}}),ea={TOP:1440,RIGHT:1440,BOTTOM:1440,LEFT:1440,HEADER:708,FOOTER:708,GUTTER:0},ta={WIDTH:11906,HEIGHT:16838,ORIENTATION:Yi.PORTRAIT},na=class e extends d{constructor({page:{size:{width:t=ta.WIDTH,height:n=ta.HEIGHT,orientation:r=ta.ORIENTATION,code:i}={},margin:{top:a=ea.TOP,right:s=ea.RIGHT,bottom:c=ea.BOTTOM,left:l=ea.LEFT,header:u=ea.HEADER,footer:d=ea.FOOTER,gutter:f=ea.GUTTER}={},pageNumbers:p={},borders:m,textDirection:h}={},grid:{linePitch:g=360,charSpace:_,type:v}={},headerWrapperGroup:y={},footerWrapperGroup:b={},lineNumbers:x,titlePage:S,verticalAlign:C,column:w,type:T,footnoteProperties:E,endnoteProperties:D,revision:O}={}){super(`w:sectPr`),o(this,`availableTextWidth`,void 0),this.availableTextWidth=e.calculateAvailableTextWidth({pageWidth:r===Yi.LANDSCAPE?n:t,left:l,right:s,gutter:f,column:w}),this.addHeaderFooterGroup(Ri.HEADER,y),this.addHeaderFooterGroup(Ri.FOOTER,b),E&&this.root.push(Hi(E)),D&&this.root.push(Ui(D)),T&&this.root.push($i(T)),this.root.push(Xi({width:t,height:n,orientation:r,code:i})),this.root.push(Ki(a,s,c,l,u,d,f)),m&&this.root.push(new Gi(m)),x&&this.root.push(Bi(x)),this.root.push(Ji(p)),w&&this.root.push(Fi(w)),C&&this.root.push(Pi(C)),S!==void 0&&this.root.push(new z(`w:titlePg`,S)),h&&this.root.push(new Qi(h)),this.root.push(Ii({linePitch:g,charSpace:_,type:v})),O&&this.root.push(new ra(O))}get AvailableTextWidth(){return this.availableTextWidth}static calculateAvailableTextWidth({pageWidth:e,left:t,right:n,gutter:r,column:i}){let a=fe(e)-fe(t)-fe(n)-fe(r),o=i?.count??1;return o<=1?a:(a-fe(i?.space??720)*(o-1))/o}addHeaderFooterGroup(e,t){t.default&&this.root.push(zi(e,{type:Li.DEFAULT,id:t.default.View.ReferenceId})),t.first&&this.root.push(zi(e,{type:Li.FIRST,id:t.first.View.ReferenceId})),t.even&&this.root.push(zi(e,{type:Li.EVEN,id:t.even.View.ReferenceId}))}},ra=class extends d{constructor(e){super(`w:sectPrChange`),this.root.push(new bt({id:e.id,author:e.author,date:e.date})),this.root.push(new na(e))}},ia=class extends d{constructor({pageNumbers:e}={}){super(`w:body`),o(this,`sections`,[]),o(this,`sectionParagraphs`,new Map),o(this,`headingBookmarkIds`,new Un),o(this,`pageNumbers`,void 0),this.pageNumbers=e}getSectionPropertiesFor(e){let t=e?Math.max(this.root.indexOf(e),0):0;for(let e=t;e<this.root.length;e++){let t=this.root[e];if(t instanceof na)return t;let n=this.sectionParagraphs.get(t);if(n)return n}return this.sections[this.sections.length-1]}addSection(e){let t=this.sections.pop(),n=this.lastParagraphOfSection();if(t&&n)this.sectionParagraphs.set(n,t);else{let e=this.createSectionParagraph();this.root.push(e),t&&this.sectionParagraphs.set(e,t)}this.sections.push(new na(e))}prepForXml(e){this.sections.length===1&&(this.root.splice(0,1),this.root.push(this.sections.pop()));for(let[e,t]of this.sectionParagraphs)e.addSectionProperties(t);let t;try{t=super.prepForXml(e)}finally{for(let[e,t]of this.sectionParagraphs)e.removeSectionProperties(t)}let n=this.pageNumbers?.listNumbers;return _r(t,e,this.headingBookmarkIds,n&&(t=>n(t,e))),this.pageNumbers&&(kr(t,e),Ar(t,e,this.pageNumbers)),t}push(e){let t=e instanceof G?this.sectionParagraphs.get(e):void 0;if(t){let n=this.createSectionParagraph();this.root.splice(this.root.indexOf(e)+1,0,n),this.sectionParagraphs.delete(e),this.sectionParagraphs.set(n,t)}this.root.push(e)}lastParagraphOfSection(){let e=this.root[this.root.length-1];return e instanceof G&&e!==this.root[0]&&!this.sectionParagraphs.has(e)&&this.root.indexOf(e)===this.root.length-1?e:void 0}createSectionParagraph(){return new G({})}},aa={AUTO:`auto`,DXA:`dxa`,NIL:`nil`,PERCENTAGE:`pct`},oa=(e,{type:t=aa.AUTO,size:n})=>{let r=n;return t===aa.PERCENTAGE&&typeof n==`number`&&(r=Math.round(n*50)),new B({name:e,attributes:{type:{key:`w:type`,value:t},size:{key:`w:w`,value:ve(r)}}})},sa=ta.WIDTH-ea.LEFT-ea.RIGHT-ea.GUTTER,ca=e=>e.options.columnSpan||1,la=(e,t)=>{if(!e)return;let{type:n=aa.AUTO,size:r}=e;if(n!==aa.PERCENTAGE&&n!==aa.DXA)return;let i=typeof r==`number`?n===aa.PERCENTAGE?r/100*t:r:r.endsWith(`%`)?Number(r.slice(0,-1))/100*t:fe(r);return i>0?i:void 0},ua=(e,t)=>la(e,t)??t,da=e=>Math.max(0,...e.map(e=>e.cells.reduce((e,t)=>e+ca(t),0))),fa=({rows:e,width:t,availableWidth:n})=>{let r=da(e);if(r===0)return[];let i=ua(t,n),a=Array.from({length:r},()=>void 0),o=[];for(let t of e){let e=0;for(let n of t.cells){let t=ca(n),r=la(n.options.width,i);if(r!==void 0){if(t===1){var s;a[s=e]??(a[s]=r)}else o.push({start:e,span:t,width:r})}e+=t}}for(let{start:e,span:t,width:n}of o){let i=Array.from({length:t},(t,n)=>e+n).filter(e=>e<r),o=i.filter(e=>a[e]===void 0),s=n-i.reduce((e,t)=>e+(a[t]??0),0);if(o.length>0&&s>0)for(let e of o)a[e]=s/o.length}let c=a.flatMap((e,t)=>e===void 0?[t]:[]);if(c.length>0){let e=i-a.reduce((e,t)=>e+(t??0),0),t=e>0?e/c.length:i/r;for(let e of c)a[e]=t}return a.map(e=>Math.round(e))},pa=e=>new B({name:`w:gridCol`,attributes:e===void 0?void 0:{width:{key:`w:w`,value:R(e)}}}),ma=class extends d{constructor(e,t){super(`w:tblGrid`);for(let t of e)this.root.push(pa(t));t&&this.root.push(new ga(t))}},ha=class extends h{constructor(...e){super(...e),o(this,`xmlKeys`,{id:`w:id`})}},ga=class extends d{constructor(e){super(`w:tblGridChange`),this.root.push(new ha({id:e.id})),this.root.push(new ma(e.columnWidths))}},_a=class extends d{constructor(e){super(`w:ins`),this.root.push(new bt({id:e.id,author:e.author,date:e.date}))}},va=class extends d{constructor(e){super(`w:del`),this.root.push(new bt({id:e.id,author:e.author,date:e.date}))}},ya=class extends d{constructor(e){super(`w:cellIns`),this.root.push(new bt({id:e.id,author:e.author,date:e.date}))}},ba=class extends d{constructor(e){super(`w:cellDel`),this.root.push(new bt({id:e.id,author:e.author,date:e.date}))}},xa=class extends h{constructor(...e){super(...e),o(this,`xmlKeys`,{id:`w:id`,author:`w:author`,date:`w:date`,verticalMerge:`w:vMerge`,verticalMergeOriginal:`w:vMergeOrig`})}},Sa=class extends d{constructor(e){super(`w:cellMerge`),this.root.push(new xa(e))}},Ca=({marginUnitType:e=aa.DXA,top:t,left:n,bottom:r,right:i})=>[{name:`w:top`,size:t},{name:`w:left`,size:n},{name:`w:bottom`,size:r},{name:`w:right`,size:i}].filter(e=>e.size!==void 0).map(({name:t,size:n})=>oa(t,{type:e,size:n})),wa=e=>{let t=Ca(e);if(t.length!==0)return new B({name:`w:tblCellMar`,children:t})},Ta=e=>{let t=Ca(e);if(t.length!==0)return new B({name:`w:tcMar`,children:t})},Ea=class extends f{constructor(e){super(`w:tcBorders`),e.top&&this.root.push(H(`w:top`,e.top)),e.start&&this.root.push(H(`w:start`,e.start)),e.left&&this.root.push(H(`w:left`,e.left)),e.bottom&&this.root.push(H(`w:bottom`,e.bottom)),e.end&&this.root.push(H(`w:end`,e.end)),e.right&&this.root.push(H(`w:right`,e.right)),e.diagonalDown&&this.root.push(H(`w:tl2br`,e.diagonalDown)),e.diagonalUp&&this.root.push(H(`w:tr2bl`,e.diagonalUp))}},Da=class extends h{constructor(...e){super(...e),o(this,`xmlKeys`,{val:`w:val`})}},Oa=class extends d{constructor(e){super(`w:gridSpan`),this.root.push(new Da({val:L(e)}))}},ka={CONTINUE:`continue`,RESTART:`restart`},Aa=class extends h{constructor(...e){super(...e),o(this,`xmlKeys`,{val:`w:val`})}},ja=class extends d{constructor(e){super(`w:vMerge`),this.root.push(new Aa({val:e}))}},Ma=class extends h{constructor(...e){super(...e),o(this,`xmlKeys`,{val:`w:val`})}},Na=class extends d{constructor(e){super(`w:textDirection`),this.root.push(new Ma({val:e}))}},Pa=class extends f{constructor(e){if(super(`w:tcPr`,e.includeIfEmpty),o(this,`hasWidth`,void 0),o(this,`hasColumnWidth`,!1),this.hasWidth=e.width!==void 0,e.width&&this.root.push(oa(`w:tcW`,e.width)),e.columnSpan&&this.root.push(new Oa(e.columnSpan)),e.verticalMerge?this.root.push(new ja(e.verticalMerge)):e.rowSpan&&e.rowSpan>1&&this.root.push(new ja(ka.RESTART)),e.borders&&this.root.push(new Ea(e.borders)),e.shading&&this.root.push(vt(e.shading)),e.margins){let t=Ta(e.margins);t&&this.root.push(t)}e.textDirection&&this.root.push(new Na(e.textDirection)),e.verticalAlign&&this.root.push(Pi(e.verticalAlign)),e.insertion&&this.root.push(new ya(e.insertion)),e.deletion&&this.root.push(new ba(e.deletion)),e.cellMerge&&this.root.push(new Sa(e.cellMerge)),e.revision&&this.root.push(new Fa(e.revision))}setColumnWidth(e){this.hasWidth||(this.root.splice(0,+!!this.hasColumnWidth,oa(`w:tcW`,{size:e,type:aa.DXA})),this.hasColumnWidth=!0)}},Fa=class extends d{constructor(e){super(`w:tcPrChange`),this.root.push(new bt({id:e.id,author:e.author,date:e.date})),this.root.push(new Pa(m(m({},e),{},{includeIfEmpty:!0})))}},Ia=class extends d{constructor(e){super(`w:tc`),o(this,`options`,void 0),o(this,`properties`,void 0),this.options=e,this.properties=new Pa(e),this.root.push(this.properties);for(let t of e.children)this.root.push(t)}setColumnWidth(e){this.properties.setColumnWidth(e)}prepForXml(e){return l(this.root[this.root.length-1])!==`w:p`&&this.root.push(new G({})),super.prepForXml(e)}},La=(e,t)=>t?new z(e):new we(e,`off`),Ra={style:Qe.NONE,size:0,color:`auto`},za={style:Qe.SINGLE,size:4,color:`auto`},Ba=class extends f{constructor(e,{fillMissingSides:t=!0}={}){super(`w:tblBorders`);let n=[[`w:top`,e.top],[`w:left`,e.left],[`w:bottom`,e.bottom],[`w:right`,e.right],[`w:insideH`,e.insideHorizontal],[`w:insideV`,e.insideVertical]];for(let[e,r]of n){let n=r??(t?za:void 0);n&&this.root.push(H(e,n))}}};o(Ba,`NONE`,{top:Ra,bottom:Ra,left:Ra,right:Ra,insideHorizontal:Ra,insideVertical:Ra});var Va={CENTER:`center`,INSIDE:`inside`,LEFT:`left`,OUTSIDE:`outside`,RIGHT:`right`},Ha={CENTER:`center`,INSIDE:`inside`,BOTTOM:`bottom`,OUTSIDE:`outside`,INLINE:`inline`,TOP:`top`},Ua=({horizontalAnchor:e,verticalAnchor:t,absoluteHorizontalPosition:n,relativeHorizontalPosition:r,absoluteVerticalPosition:i,relativeVerticalPosition:a,bottomFromText:o,topFromText:s,leftFromText:c,rightFromText:l})=>new B({name:`w:tblpPr`,attributes:{leftFromText:{key:`w:leftFromText`,value:c===void 0?void 0:R(c)},rightFromText:{key:`w:rightFromText`,value:l===void 0?void 0:R(l)},topFromText:{key:`w:topFromText`,value:s===void 0?void 0:R(s)},bottomFromText:{key:`w:bottomFromText`,value:o===void 0?void 0:R(o)},absoluteHorizontalPosition:{key:`w:tblpX`,value:n===void 0?void 0:he(n)},absoluteVerticalPosition:{key:`w:tblpY`,value:i===void 0?void 0:he(i)},horizontalAnchor:{key:`w:horzAnchor`,value:e},relativeHorizontalPosition:{key:`w:tblpXSpec`,value:r},relativeVerticalPosition:{key:`w:tblpYSpec`,value:a},verticalAnchor:{key:`w:vertAnchor`,value:t}}}),Wa=e=>new B({name:`w:tblLayout`,attributes:{type:{key:`w:type`,value:e}}}),Ga={DXA:`dxa`,NIL:`nil`},Ka=({type:e=Ga.DXA,value:t})=>new B({name:`w:tblCellSpacing`,attributes:{type:{key:`w:type`,value:e},value:{key:`w:w`,value:ve(t)}}}),qa=({firstRow:e,lastRow:t,firstColumn:n,lastColumn:r,noHBand:i,noVBand:a})=>new B({name:`w:tblLook`,attributes:{firstRow:{key:`w:firstRow`,value:e},lastRow:{key:`w:lastRow`,value:t},firstColumn:{key:`w:firstColumn`,value:n},lastColumn:{key:`w:lastColumn`,value:r},noHBand:{key:`w:noHBand`,value:i},noVBand:{key:`w:noVBand`,value:a}}}),Ja=e=>new B({name:`w:tblOverlap`,attributes:{val:{key:`w:val`,value:e}}}),Ya={[Va.LEFT]:V.LEFT,[Va.CENTER]:V.CENTER,[Va.RIGHT]:V.RIGHT},Xa=class extends f{constructor(e){super(`w:tblPr`,e.includeIfEmpty),e.style&&this.root.push(new we(`w:tblStyle`,e.style));let t=e.float?.relativeVerticalPosition===Ha.INLINE,n=t?void 0:e.float;n&&this.root.push(Ua(n)),n?.overlap&&this.root.push(Ja(n.overlap)),e.visuallyRightToLeft!==void 0&&this.root.push(La(`w:bidiVisual`,e.visuallyRightToLeft)),e.width&&this.root.push(oa(`w:tblW`,e.width));let r=e.alignment??(t&&e.float?.relativeHorizontalPosition?Ya[e.float.relativeHorizontalPosition]:void 0);if(r&&this.root.push(Oe(r)),e.cellSpacing&&this.root.push(Ka(e.cellSpacing)),e.indent&&this.root.push(oa(`w:tblInd`,e.indent)),e.borders&&this.root.push(new Ba(e.borders,{fillMissingSides:!e.style})),e.shading&&this.root.push(vt(e.shading)),e.layout&&this.root.push(Wa(e.layout)),e.cellMargin){let t=wa(e.cellMargin);t&&this.root.push(t)}e.tableLook&&this.root.push(qa(e.tableLook)),e.revision&&this.root.push(new Za(e.revision))}},Za=class extends d{constructor(e){super(`w:tblPrChange`),this.root.push(new bt({id:e.id,author:e.author,date:e.date})),this.root.push(new Xa(m(m({},e),{},{includeIfEmpty:!0})))}},Qa=(e,t)=>new B({name:`w:trHeight`,attributes:{value:{key:`w:val`,value:R(e)},rule:{key:`w:hRule`,value:t}}}),$a=class extends f{constructor(e){super(`w:trPr`,e.includeIfEmpty),e.cantSplit!==void 0&&this.root.push(La(`w:cantSplit`,e.cantSplit)),e.tableHeader!==void 0&&this.root.push(La(`w:tblHeader`,e.tableHeader)),e.height&&this.root.push(Qa(e.height.value,e.height.rule)),e.cellSpacing&&this.root.push(Ka(e.cellSpacing)),e.insertion&&this.root.push(new _a(e.insertion)),e.deletion&&this.root.push(new va(e.deletion)),e.revision&&this.root.push(new eo(e.revision))}},eo=class extends d{constructor(e){super(`w:trPrChange`),this.root.push(new bt({id:e.id,author:e.author,date:e.date})),this.root.push(new $a(m(m({},e),{},{includeIfEmpty:!0})))}},to=(e,t)=>{let n=e[t];return Array.isArray(n)?n:[]},no=e=>Object.keys(e)[0],ro=(e,t)=>{let n=to(e,`w:p`),r=n.find(e=>no(e)===`w:pPr`);if(!r)return{"w:p":[{"w:pPr":[t]},...n]};let i=to(r,`w:pPr`);if(i.some(e=>no(e)===`w:keepNext`))return e;let a=i.filter(e=>no(e)===`w:pStyle`).length,o={"w:pPr":[...i.slice(0,a),t,...i.slice(a)]};return{"w:p":n.map(e=>e===r?o:e)}},io=class extends d{constructor(e){super(`w:tr`),o(this,`options`,void 0),this.options=e,this.root.push(new $a(e));for(let t of e.children)this.root.push(t)}prepForXml(e){if(this.cells.length===0)return;let t=super.prepForXml(e);if(!t||this.options.keepNext===void 0)return t;let n=new z(`w:keepNext`,this.options.keepNext).prepForXml(e);return{"w:tr":to(t,`w:tr`).map(e=>no(e)===`w:tc`?{"w:tc":to(e,`w:tc`).map(e=>no(e)===`w:p`?ro(e,n):e)}:e)}}get CellCount(){return this.options.children.length}get cells(){return this.root.filter(e=>l(e)===`w:tc`)}addCellToIndex(e,t){this.root.splice(t+1,0,e)}addCellToColumnIndex(e,t){let n=this.columnIndexToRootIndex(t,!0);this.addCellToIndex(e,n-1)}rootIndexToColumnIndex(e){if(e<1||e>=this.root.length)throw Error(`cell 'rootIndex' should between 1 to ${this.root.length-1}`);let t=0;for(let n=1;n<e;n++){let e=this.root[n];t+=e.options.columnSpan||1}return t}columnIndexToRootIndex(e,t=!1){if(e<0)throw Error(`cell 'columnIndex' should not less than zero`);let n=0,r=1;for(;n<=e;){if(r>=this.root.length){if(t)return this.root.length;throw Error(`cell 'columnIndex' should not great than ${n-1}`)}let e=this.root[r];r+=1,n+=e&&e.options.columnSpan||1}return r-1}},ao=class e extends ai{constructor({rows:e,width:t,columnWidths:n,columnWidthsRevision:r,margins:i,indent:a,float:s,layout:c,style:l,borders:u,alignment:d,visuallyRightToLeft:f,tableLook:p,cellSpacing:m,revision:h}){super(`w:tbl`),o(this,`rows`,void 0),o(this,`width`,void 0),o(this,`columnWidths`,void 0),o(this,`columnWidthsRevision`,void 0),o(this,`resolvedColumnWidths`,void 0),this.rows=e,this.width=t??{size:100},this.columnWidths=n,this.columnWidthsRevision=r,e.forEach((t,n)=>{if(n===e.length-1)return;let r=0;t.cells.forEach(t=>{if(t.options.rowSpan&&t.options.rowSpan>1){let i=t.options.children[t.options.children.length-1],a=new Ia({rowSpan:t.options.rowSpan-1,columnSpan:t.options.columnSpan,width:t.options.width,borders:t.options.borders,shading:t.options.shading,margins:t.options.margins,textDirection:t.options.textDirection,verticalAlign:t.options.verticalAlign,children:i instanceof G?[new G(i.Alignment)]:[],verticalMerge:ka.CONTINUE});e[n+1].addCellToColumnIndex(a,r)}r+=t.options.columnSpan||1})}),this.setCellWidths(sa),this.resolvedColumnWidths=n??fa({rows:e,width:this.width,availableWidth:sa}),this.root.push(new Xa({borders:l?u:u??{},width:this.width,indent:a,float:s,layout:c,style:l,alignment:d,cellMargin:i,visuallyRightToLeft:f,tableLook:p,cellSpacing:m,revision:h})),this.root.push(new ma(this.resolvedColumnWidths,r));for(let t of e)this.root.push(t)}get ColumnWidths(){return this.resolvedColumnWidths}getCellWidth(e,t){let{cells:n}=e,r=n.indexOf(t);if(r===-1)return;let i=n.slice(0,r).reduce((e,t)=>e+(t.options.columnSpan||1),0),a=this.resolvedColumnWidths.slice(i,i+(t.options.columnSpan||1));return a.length===0?void 0:a.reduce((e,t)=>e+t,0)}prepForXml(e){if(this.setCellWidths(this.resolveAvailableWidth(e)),this.columnWidths===void 0){this.resolvedColumnWidths=fa({rows:this.rows,width:this.width,availableWidth:this.resolveAvailableWidth(e)});let t=this.root.findIndex(e=>e instanceof ma);this.root[t]=new ma(this.resolvedColumnWidths,this.columnWidthsRevision)}return super.prepForXml(e)}setCellWidths(e){if(this.columnWidths===void 0)return;let t=this.columnWidths.reduce((e,t)=>e+t,0),n=la(this.width,e)??0,r=t>0&&n>t?n/t:1;for(let e of this.rows){let t=0;for(let n of e.cells){let e=n.options.columnSpan||1,i=this.columnWidths.slice(t,t+e),a=Math.round(i.reduce((e,t)=>e+t,0)*r);i.length===e&&a>0&&n.setColumnWidth(a),t+=e}}}resolveAvailableWidth(t){var n;let{stack:r}=t,i=r[r.length-1],a=r[r.length-2],o=r[r.length-3];if(i instanceof Ia&&a instanceof io&&o instanceof e){let e=o.getCellWidth(a,i);if(e!==void 0)return e}let s=r.findIndex(e=>e instanceof ia),c=(n=t.file)==null||(n=n.Document)==null?void 0:n.View.Body;return(s>=0?r[s].getSectionPropertiesFor(r[s+1]??this):c?.getSectionPropertiesFor())?.AvailableTextWidth??sa}},oo=class extends h{constructor(...e){super(...e),o(this,`xmlKeys`,{xmlns:`xmlns`,vt:`xmlns:vt`})}},so=class extends d{constructor(){super(`Properties`),this.root.push(new oo({xmlns:`http://schemas.openxmlformats.org/officeDocument/2006/extended-properties`,vt:`http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes`}))}},co=class extends h{constructor(...e){super(...e),o(this,`xmlKeys`,{xmlns:`xmlns`})}},lo=(e,t)=>new B({name:`Default`,attributes:{contentType:{key:`ContentType`,value:e},extension:{key:`Extension`,value:t}}}),K=(e,t)=>new B({name:`Override`,attributes:{contentType:{key:`ContentType`,value:e},partName:{key:`PartName`,value:t}}}),uo=class extends d{constructor({macros:e=!1}={}){super(`Types`),this.root.push(new co({xmlns:`http://schemas.openxmlformats.org/package/2006/content-types`})),this.root.push(lo(`image/png`,`png`)),this.root.push(lo(`image/jpeg`,`jpeg`)),this.root.push(lo(`image/jpeg`,`jpg`)),this.root.push(lo(`image/bmp`,`bmp`)),this.root.push(lo(`image/gif`,`gif`)),this.root.push(lo(`image/svg+xml`,`svg`)),this.root.push(lo(`application/vnd.openxmlformats-package.relationships+xml`,`rels`)),this.root.push(lo(`application/xml`,`xml`)),this.root.push(lo(`application/vnd.openxmlformats-officedocument.obfuscatedFont`,`odttf`)),this.root.push(K(e?`application/vnd.ms-word.document.macroEnabled.main+xml`:`application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml`,`/word/document.xml`)),this.root.push(K(`application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml`,`/word/styles.xml`)),this.root.push(K(`application/vnd.openxmlformats-package.core-properties+xml`,`/docProps/core.xml`)),this.root.push(K(`application/vnd.openxmlformats-officedocument.custom-properties+xml`,`/docProps/custom.xml`)),this.root.push(K(`application/vnd.openxmlformats-officedocument.extended-properties+xml`,`/docProps/app.xml`)),this.root.push(K(`application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml`,`/word/numbering.xml`)),this.root.push(K(`application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml`,`/word/footnotes.xml`)),this.root.push(K(`application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml`,`/word/endnotes.xml`)),this.root.push(K(`application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml`,`/word/settings.xml`)),this.root.push(K(`application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml`,`/word/fontTable.xml`)),this.root.push(K(`application/vnd.openxmlformats-officedocument.theme+xml`,`/word/theme/theme1.xml`)),e&&this.root.push(K(`application/vnd.ms-office.vbaProject`,`/word/vbaProject.bin`))}addComments(){this.root.push(K(`application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml`,`/word/comments.xml`))}addCommentsExtended(){this.root.push(K(`application/vnd.openxmlformats-officedocument.wordprocessingml.commentsExtended+xml`,`/word/commentsExtended.xml`))}addCommentsIds(){this.root.push(K(`application/vnd.openxmlformats-officedocument.wordprocessingml.commentsIds+xml`,`/word/commentsIds.xml`))}addFooter(e){this.root.push(K(`application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml`,`/word/footer${e}.xml`))}addOverride(e,t){this.root.push(K(e,t))}addHeader(e){this.root.push(K(`application/vnd.openxmlformats-officedocument.wordprocessingml.header+xml`,`/word/header${e}.xml`))}},fo={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`,wpi:`http://schemas.microsoft.com/office/word/2010/wordprocessingInk`,wne:`http://schemas.microsoft.com/office/word/2006/wordml`,wps:`http://schemas.microsoft.com/office/word/2010/wordprocessingShape`,cp:`http://schemas.openxmlformats.org/package/2006/metadata/core-properties`,dc:`http://purl.org/dc/elements/1.1/`,dcterms:`http://purl.org/dc/terms/`,dcmitype:`http://purl.org/dc/dcmitype/`,xsi:`http://www.w3.org/2001/XMLSchema-instance`,cx:`http://schemas.microsoft.com/office/drawing/2014/chartex`,cx1:`http://schemas.microsoft.com/office/drawing/2015/9/8/chartex`,cx2:`http://schemas.microsoft.com/office/drawing/2015/10/21/chartex`,cx3:`http://schemas.microsoft.com/office/drawing/2016/5/9/chartex`,cx4:`http://schemas.microsoft.com/office/drawing/2016/5/10/chartex`,cx5:`http://schemas.microsoft.com/office/drawing/2016/5/11/chartex`,cx6:`http://schemas.microsoft.com/office/drawing/2016/5/12/chartex`,cx7:`http://schemas.microsoft.com/office/drawing/2016/5/13/chartex`,cx8:`http://schemas.microsoft.com/office/drawing/2016/5/14/chartex`,aink:`http://schemas.microsoft.com/office/drawing/2016/ink`,am3d:`http://schemas.microsoft.com/office/drawing/2017/model3d`,w16cex:`http://schemas.microsoft.com/office/word/2018/wordml/cex`,w16cid:`http://schemas.microsoft.com/office/word/2016/wordml/cid`,w16:`http://schemas.microsoft.com/office/word/2018/wordml`,w16sdtdh:`http://schemas.microsoft.com/office/word/2020/wordml/sdtdatahash`,w16se:`http://schemas.microsoft.com/office/word/2015/wordml/symex`},po=class extends h{constructor(e,t){super(m({Ignorable:t},Object.fromEntries(e.map(e=>[e,fo[e]])))),o(this,`xmlKeys`,m({Ignorable:`mc:Ignorable`},Object.fromEntries(Object.keys(fo).map(e=>[e,`xmlns:${e}`]))))}},mo=class extends d{constructor(e){super(`cp:coreProperties`),this.root.push(new po([`cp`,`dc`,`dcterms`,`dcmitype`,`xsi`])),e.title&&this.root.push(new De(`dc:title`,e.title)),e.subject&&this.root.push(new De(`dc:subject`,e.subject)),e.creator&&this.root.push(new De(`dc:creator`,e.creator)),e.keywords&&this.root.push(new De(`cp:keywords`,e.keywords)),e.description&&this.root.push(new De(`dc:description`,e.description)),e.lastModifiedBy&&this.root.push(new De(`cp:lastModifiedBy`,e.lastModifiedBy)),e.revision&&this.root.push(new De(`cp:revision`,String(e.revision))),this.root.push(new go(`dcterms:created`)),this.root.push(new go(`dcterms:modified`))}},ho=class extends h{constructor(...e){super(...e),o(this,`xmlKeys`,{type:`xsi:type`})}},go=class extends d{constructor(e){super(e),this.root.push(new ho({type:`dcterms:W3CDTF`})),this.root.push(xe(new Date))}},_o=class extends h{constructor(...e){super(...e),o(this,`xmlKeys`,{xmlns:`xmlns`,vt:`xmlns:vt`})}},vo=class extends h{constructor(...e){super(...e),o(this,`xmlKeys`,{formatId:`fmtid`,pid:`pid`,name:`name`})}},yo=class extends d{constructor(e,t){super(`property`),this.root.push(new vo({formatId:`{D5CDD505-2E9C-101B-9397-08002B2CF9AE}`,pid:e.toString(),name:t.name})),this.root.push(new bo(t.value))}},bo=class extends d{constructor(e){super(`vt:lpwstr`),this.root.push(e)}},xo=class extends d{constructor(e){super(`Properties`),o(this,`nextId`,void 0),o(this,`properties`,[]),this.root.push(new _o({xmlns:`http://schemas.openxmlformats.org/officeDocument/2006/custom-properties`,vt:`http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes`})),this.nextId=2;for(let t of e)this.addCustomProperty(t)}prepForXml(e){return this.root.splice(1,this.root.length-1,...this.properties),super.prepForXml(e)}addCustomProperty(e){this.properties.push(new yo(this.nextId++,e))}},So=e=>new B({name:`ds:datastoreItem`,attributes:{itemId:{key:`ds:itemID`,value:e},namespace:{key:`xmlns:ds`,value:`http://schemas.openxmlformats.org/officeDocument/2006/customXml`}},children:[new B({name:`ds:schemaRefs`,children:[new B({name:`ds:schemaRef`,attributes:{uri:{key:`ds:uri`,value:`http://schemas.openxmlformats.org/officeDocument/2006/bibliography`}}})]})]}),Co={new:`wne:eventDocNew`,open:`wne:eventDocOpen`,close:`wne:eventDocClose`,sync:`wne:eventDocSync`,xmlAfterInsert:`wne:eventDocXmlAfterInsert`,xmlBeforeDelete:`wne:eventDocXmlBeforeDelete`,contentControlAfterAdd:`wne:eventDocContentControlAfterInsert`,contentControlBeforeDelete:`wne:eventDocContentControlBeforeDelete`,contentControlOnExit:`wne:eventDocContentControlOnExit`,contentControlOnEnter:`wne:eventDocContentControlOnEnter`,contentControlBeforeStoreUpdate:`wne:eventDocStoreUpdate`,contentControlBeforeContentUpdate:`wne:eventDocContentControlContentUpdate`,buildingBlockInsert:`wne:eventDocBuildingBlockAfterInsert`},wo=e=>new B({name:`wne:vbaSuppData`,attributes:{namespace:{key:`xmlns:wne`,value:`http://schemas.microsoft.com/office/word/2006/wordml`}},children:[new B({name:`wne:docEvents`,children:Object.entries(Co).filter(([t])=>e.includes(t)).map(([,e])=>new B({name:e}))})]}),To=class extends d{constructor({color:e,themeColor:t,themeShade:n,themeTint:r}){if(super(`w:background`),typeof e==`object`&&(t!==void 0||n!==void 0||r!==void 0))throw Error(`Invalid background. Expected a theme color in color, or themeColor, themeShade and themeTint, not both`);this.root.push(new Je([{keys:Ze,color:e},{key:`w:themeColor`,value:t},{key:`w:themeShade`,value:n===void 0?void 0:le(n)},{key:`w:themeTint`,value:r===void 0?void 0:le(r)}]))}},Eo=class extends d{constructor(e){super(`w:document`),o(this,`body`,void 0),this.root.push(new po(`wpc.mc.o.r.m.v.wp14.wp.w10.w.w14.w15.wpg.wpi.wne.wps.cx.cx1.cx2.cx3.cx4.cx5.cx6.cx7.cx8.aink.am3d.w16cex.w16cid.w16.w16sdtdh.w16se`.split(`.`),`w14 w15 wp14`)),this.body=new ia({pageNumbers:e.pageNumbers}),e.background&&this.root.push(new To(e.background)),this.root.push(this.body)}add(e){return this.body.push(e),this}get Body(){return this.body}},Do=class{constructor(e){o(this,`document`,void 0),o(this,`relationships`,void 0),this.document=new Eo(e),this.relationships=new W}get View(){return this.document}get Relationships(){return this.relationships}},Oo=class extends h{constructor(...e){super(...e),o(this,`xmlKeys`,{wpc:`xmlns:wpc`,mc:`xmlns:mc`,o:`xmlns:o`,r:`xmlns:r`,m:`xmlns:m`,v:`xmlns:v`,wp14:`xmlns:wp14`,wp:`xmlns:wp`,w10:`xmlns:w10`,w:`xmlns:w`,w14:`xmlns:w14`,w15:`xmlns:w15`,wpg:`xmlns:wpg`,wpi:`xmlns:wpi`,wne:`xmlns:wne`,wps:`xmlns:wps`,Ignorable:`mc:Ignorable`})}},ko=class extends d{constructor(e,t){super(`w:p`),o(this,`paragraph`,void 0),o(this,`mark`,void 0),this.paragraph=e,this.mark=t}prepForXml(e){let t=this.paragraph.prepForXml(e)[`w:p`],n=Array.isArray(t)?t:[],r=+(n.length>0&&`w:pPr`in n[0]);return{"w:p":[...n.slice(0,r),this.mark.prepForXml(e),...n.slice(r)]}}},Ao=class extends h{constructor(...e){super(...e),o(this,`xmlKeys`,{type:`w:type`,id:`w:id`})}},jo=class extends dn{constructor(){super({style:`EndnoteReference`}),this.root.push(new Kr)}},Mo={SEPARATOR:`separator`,CONTINUATION_SEPARATOR:`continuationSeparator`},No=class extends d{constructor(e){super(`w:endnote`),this.root.push(new Ao({type:e.type,id:e.id}));for(let[t,n]of e.children.entries())this.root.push(t===0?new ko(n,new jo):n)}},Po=class extends d{constructor(){super(`w:continuationSeparator`)}},Fo=class extends dn{constructor(){super({}),this.root.push(new Po)}},Io=class extends d{constructor(){super(`w:separator`)}},Lo=class extends dn{constructor(){super({}),this.root.push(new Io)}},Ro=class extends d{constructor(){super(`w:endnotes`),o(this,`ownNotes`,new Map),o(this,`highestId`,0),this.root.push(new Oo({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`,wpi:`http://schemas.microsoft.com/office/word/2010/wordprocessingInk`,wne:`http://schemas.microsoft.com/office/word/2006/wordml`,wps:`http://schemas.microsoft.com/office/word/2010/wordprocessingShape`,Ignorable:`w14 w15 wp14`}));let e=new No({id:-1,type:Mo.SEPARATOR,children:[new G({spacing:{after:0,line:240,lineRule:Yr.AUTO},children:[new Lo]})]});this.root.push(e);let t=new No({id:0,type:Mo.CONTINUATION_SEPARATOR,children:[new G({spacing:{after:0,line:240,lineRule:Yr.AUTO},children:[new Fo]})]});this.root.push(t)}createEndnote(e,t){let n=new No({id:e,children:t});this.root.push(n),Number.isFinite(e)&&(this.highestId=Math.max(this.highestId,Math.floor(e)))}idOf(e,t,n){if(n.viewWrapper!==n.file.Document)return;let r=this.ownNotes.get(e);if(r!==void 0)return r;let i=this.highestId+1;return this.createEndnote(i,t.children),this.ownNotes.set(e,i),i}prepForXml(e){let t=super.prepForXml(e);return jr(t,e),t}},zo=class{constructor(){o(this,`endnotes`,void 0),o(this,`relationships`,void 0),this.endnotes=new Ro,this.relationships=new W}get View(){return this.endnotes}get Relationships(){return this.relationships}},Bo=class extends h{constructor(...e){super(...e),o(this,`xmlKeys`,{wpc:`xmlns:wpc`,mc:`xmlns:mc`,o:`xmlns:o`,r:`xmlns:r`,m:`xmlns:m`,v:`xmlns:v`,wp14:`xmlns:wp14`,wp:`xmlns:wp`,w10:`xmlns:w10`,w:`xmlns:w`,w14:`xmlns:w14`,w15:`xmlns:w15`,wpg:`xmlns:wpg`,wpi:`xmlns:wpi`,wne:`xmlns:wne`,wps:`xmlns:wps`,cp:`xmlns:cp`,dc:`xmlns:dc`,dcterms:`xmlns:dcterms`,dcmitype:`xmlns:dcmitype`,xsi:`xmlns:xsi`,type:`xsi:type`})}},Vo=class extends oe{constructor(e,t){super(`w:ftr`,t),o(this,`refId`,void 0),this.refId=e,t||this.root.push(new Bo({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`,wpi:`http://schemas.microsoft.com/office/word/2010/wordprocessingInk`,wne:`http://schemas.microsoft.com/office/word/2006/wordml`,wps:`http://schemas.microsoft.com/office/word/2010/wordprocessingShape`}))}get ReferenceId(){return this.refId}add(e){this.root.push(e)}prepForXml(e){let t=super.prepForXml(e);return jr(t,e,this.refId),t}},Ho=class{constructor(e,t,n){o(this,`media`,void 0),o(this,`footer`,void 0),o(this,`relationships`,void 0),this.media=e,this.footer=new Vo(t,n),this.relationships=new W}add(e){this.footer.add(e)}addChildElement(e){this.footer.addChildElement(e)}get View(){return this.footer}get Relationships(){return this.relationships}get Media(){return this.media}},Uo=class extends h{constructor(...e){super(...e),o(this,`xmlKeys`,{type:`w:type`,id:`w:id`})}},Wo=class extends d{constructor(){super(`w:footnoteRef`)}},Go=class extends dn{constructor(){super({style:`FootnoteReference`}),this.root.push(new Wo)}},Ko={SEPERATOR:`separator`,CONTINUATION_SEPERATOR:`continuationSeparator`},qo=class extends d{constructor(e){super(`w:footnote`),this.root.push(new Uo({type:e.type,id:e.id}));for(let[t,n]of e.children.entries())this.root.push(t===0?new ko(n,new Go):n)}},Jo=class extends h{constructor(...e){super(...e),o(this,`xmlKeys`,{wpc:`xmlns:wpc`,mc:`xmlns:mc`,o:`xmlns:o`,r:`xmlns:r`,m:`xmlns:m`,v:`xmlns:v`,wp14:`xmlns:wp14`,wp:`xmlns:wp`,w10:`xmlns:w10`,w:`xmlns:w`,w14:`xmlns:w14`,w15:`xmlns:w15`,wpg:`xmlns:wpg`,wpi:`xmlns:wpi`,wne:`xmlns:wne`,wps:`xmlns:wps`,Ignorable:`mc:Ignorable`})}},Yo=class extends d{constructor(){super(`w:footnotes`),o(this,`ownNotes`,new Map),o(this,`highestId`,0),this.root.push(new Jo({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`,wpi:`http://schemas.microsoft.com/office/word/2010/wordprocessingInk`,wne:`http://schemas.microsoft.com/office/word/2006/wordml`,wps:`http://schemas.microsoft.com/office/word/2010/wordprocessingShape`,Ignorable:`w14 w15 wp14`}));let e=new qo({id:-1,type:Ko.SEPERATOR,children:[new G({spacing:{after:0,line:240,lineRule:Yr.AUTO},children:[new Lo]})]});this.root.push(e);let t=new qo({id:0,type:Ko.CONTINUATION_SEPERATOR,children:[new G({spacing:{after:0,line:240,lineRule:Yr.AUTO},children:[new Fo]})]});this.root.push(t)}createFootNote(e,t){let n=new qo({id:e,children:t});this.root.push(n),Number.isFinite(e)&&(this.highestId=Math.max(this.highestId,Math.floor(e)))}idOf(e,t,n){if(n.viewWrapper!==n.file.Document)return;let r=this.ownNotes.get(e);if(r!==void 0)return r;let i=this.highestId+1;return this.createFootNote(i,t.children),this.ownNotes.set(e,i),i}prepForXml(e){let t=super.prepForXml(e);return jr(t,e),t}},Xo=class{constructor(){o(this,`footnotess`,void 0),o(this,`relationships`,void 0),this.footnotess=new Yo,this.relationships=new W}get View(){return this.footnotess}get Relationships(){return this.relationships}},Zo=class extends h{constructor(...e){super(...e),o(this,`xmlKeys`,{wpc:`xmlns:wpc`,mc:`xmlns:mc`,o:`xmlns:o`,r:`xmlns:r`,m:`xmlns:m`,v:`xmlns:v`,wp14:`xmlns:wp14`,wp:`xmlns:wp`,w10:`xmlns:w10`,w:`xmlns:w`,w14:`xmlns:w14`,w15:`xmlns:w15`,wpg:`xmlns:wpg`,wpi:`xmlns:wpi`,wne:`xmlns:wne`,wps:`xmlns:wps`,cp:`xmlns:cp`,dc:`xmlns:dc`,dcterms:`xmlns:dcterms`,dcmitype:`xmlns:dcmitype`,xsi:`xmlns:xsi`,type:`xsi:type`,cx:`xmlns:cx`,cx1:`xmlns:cx1`,cx2:`xmlns:cx2`,cx3:`xmlns:cx3`,cx4:`xmlns:cx4`,cx5:`xmlns:cx5`,cx6:`xmlns:cx6`,cx7:`xmlns:cx7`,cx8:`xmlns:cx8`,w16cid:`xmlns:w16cid`,w16se:`xmlns:w16se`})}},Qo=class extends oe{constructor(e,t){super(`w:hdr`,t),o(this,`refId`,void 0),this.refId=e,t||this.root.push(new Zo({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`,wpi:`http://schemas.microsoft.com/office/word/2010/wordprocessingInk`,wne:`http://schemas.microsoft.com/office/word/2006/wordml`,wps:`http://schemas.microsoft.com/office/word/2010/wordprocessingShape`,cx:`http://schemas.microsoft.com/office/drawing/2014/chartex`,cx1:`http://schemas.microsoft.com/office/drawing/2015/9/8/chartex`,cx2:`http://schemas.microsoft.com/office/drawing/2015/10/21/chartex`,cx3:`http://schemas.microsoft.com/office/drawing/2016/5/9/chartex`,cx4:`http://schemas.microsoft.com/office/drawing/2016/5/10/chartex`,cx5:`http://schemas.microsoft.com/office/drawing/2016/5/11/chartex`,cx6:`http://schemas.microsoft.com/office/drawing/2016/5/12/chartex`,cx7:`http://schemas.microsoft.com/office/drawing/2016/5/13/chartex`,cx8:`http://schemas.microsoft.com/office/drawing/2016/5/14/chartex`,w16cid:`http://schemas.microsoft.com/office/word/2016/wordml/cid`,w16se:`http://schemas.microsoft.com/office/word/2015/wordml/symex`}))}get ReferenceId(){return this.refId}add(e){this.root.push(e)}prepForXml(e){let t=super.prepForXml(e);return jr(t,e,this.refId),t}},$o=class{constructor(e,t,n){o(this,`media`,void 0),o(this,`header`,void 0),o(this,`relationships`,void 0),this.media=e,this.header=new Qo(t,n),this.relationships=new W}add(e){return this.header.add(e),this}addChildElement(e){this.header.addChildElement(e)}get View(){return this.header}get Relationships(){return this.relationships}get Media(){return this.media}},es=class{constructor(){o(this,`map`,void 0),this.map=new Map}addImage(e,t){this.map.set(e,t)}get Array(){return Array.from(this.map.values())}},ts={DECIMAL:`decimal`,UPPER_ROMAN:`upperRoman`,LOWER_ROMAN:`lowerRoman`,UPPER_LETTER:`upperLetter`,LOWER_LETTER:`lowerLetter`,ORDINAL:`ordinal`,CARDINAL_TEXT:`cardinalText`,ORDINAL_TEXT:`ordinalText`,HEX:`hex`,CHICAGO:`chicago`,IDEOGRAPH__DIGITAL:`ideographDigital`,JAPANESE_COUNTING:`japaneseCounting`,AIUEO:`aiueo`,IROHA:`iroha`,DECIMAL_FULL_WIDTH:`decimalFullWidth`,DECIMAL_HALF_WIDTH:`decimalHalfWidth`,JAPANESE_LEGAL:`japaneseLegal`,JAPANESE_DIGITAL_TEN_THOUSAND:`japaneseDigitalTenThousand`,DECIMAL_ENCLOSED_CIRCLE:`decimalEnclosedCircle`,DECIMAL_FULL_WIDTH2:`decimalFullWidth2`,AIUEO_FULL_WIDTH:`aiueoFullWidth`,IROHA_FULL_WIDTH:`irohaFullWidth`,DECIMAL_ZERO:`decimalZero`,BULLET:`bullet`,GANADA:`ganada`,CHOSUNG:`chosung`,DECIMAL_ENCLOSED_FULLSTOP:`decimalEnclosedFullstop`,DECIMAL_ENCLOSED_PARENTHESES:`decimalEnclosedParen`,DECIMAL_ENCLOSED_CIRCLE_CHINESE:`decimalEnclosedCircleChinese`,IDEOGRAPH_ENCLOSED_CIRCLE:`ideographEnclosedCircle`,IDEOGRAPH_TRADITIONAL:`ideographTraditional`,IDEOGRAPH_ZODIAC:`ideographZodiac`,IDEOGRAPH_ZODIAC_TRADITIONAL:`ideographZodiacTraditional`,TAIWANESE_COUNTING:`taiwaneseCounting`,IDEOGRAPH_LEGAL_TRADITIONAL:`ideographLegalTraditional`,TAIWANESE_COUNTING_THOUSAND:`taiwaneseCountingThousand`,TAIWANESE_DIGITAL:`taiwaneseDigital`,CHINESE_COUNTING:`chineseCounting`,CHINESE_LEGAL_SIMPLIFIED:`chineseLegalSimplified`,CHINESE_COUNTING_THOUSAND:`chineseCountingThousand`,KOREAN_DIGITAL:`koreanDigital`,KOREAN_COUNTING:`koreanCounting`,KOREAN_LEGAL:`koreanLegal`,KOREAN_DIGITAL2:`koreanDigital2`,VIETNAMESE_COUNTING:`vietnameseCounting`,RUSSIAN_LOWER:`russianLower`,RUSSIAN_UPPER:`russianUpper`,NONE:`none`,NUMBER_IN_DASH:`numberInDash`,HEBREW1:`hebrew1`,HEBREW2:`hebrew2`,ARABIC_ALPHA:`arabicAlpha`,ARABIC_ABJAD:`arabicAbjad`,HINDI_VOWELS:`hindiVowels`,HINDI_CONSONANTS:`hindiConsonants`,HINDI_NUMBERS:`hindiNumbers`,HINDI_COUNTING:`hindiCounting`,THAI_LETTERS:`thaiLetters`,THAI_NUMBERS:`thaiNumbers`,THAI_COUNTING:`thaiCounting`,BAHT_TEXT:`bahtText`,DOLLAR_TEXT:`dollarText`,CUSTOM:`custom`},ns=class extends h{constructor(...e){super(...e),o(this,`xmlKeys`,{ilvl:`w:ilvl`,tentative:`w:tentative`})}},rs=class extends d{constructor(e){super(`w:numFmt`),this.root.push(new _({val:e}))}},is=class extends d{constructor(e){super(`w:lvlText`),this.root.push(new _({val:e}))}},as=e=>{switch(e){case V.CENTER:return`center`;case V.END:case V.RIGHT:return`right`;default:return`left`}},os=class extends d{constructor(e){super(`w:lvlJc`),this.root.push(new _({val:as(e)}))}},ss=class extends d{constructor(e){super(`w:suff`),this.root.push(new _({val:e}))}},cs=class extends d{constructor(){super(`w:isLgl`)}},ls=class extends d{constructor({level:e,format:t,text:n,alignment:r=V.START,start:i=1,style:a,suffix:s,isLegalNumberingStyle:c}){if(super(`w:lvl`),o(this,`paragraphProperties`,void 0),o(this,`runProperties`,void 0),this.root.push(new Ee(`w:start`,L(i))),t&&this.root.push(new rs(t)),a?.style&&this.root.push(Qr(a.style)),c&&this.root.push(new cs),s&&this.root.push(new ss(s)),n&&this.root.push(new is(n)),this.root.push(new os(r)),this.paragraphProperties=new Mi(a&&a.paragraph,{implicitListParagraphStyle:!1,inListOrder:!1}),this.runProperties=new an(a?.run&&m(m({},a.run),{},{highlight:void 0,math:void 0,revision:void 0})),this.root.push(this.paragraphProperties),this.root.push(this.runProperties),e>9)throw Error(`Level cannot be greater than 9. Read more here: https://answers.microsoft.com/en-us/msoffice/forum/all/does-word-support-more-than-9-list-levels/d130fdcd-1781-446d-8c84-c6c79124e4d7`);this.root.push(new ns({ilvl:L(e),tentative:1}))}},us=class extends ls{},ds=class extends d{constructor(e){super(`w:multiLevelType`),this.root.push(new _({val:e}))}},fs=class extends h{constructor(...e){super(...e),o(this,`xmlKeys`,{abstractNumId:`w:abstractNumId`,restartNumberingAfterBreak:`w15:restartNumberingAfterBreak`})}},ps=class extends d{constructor(e,t){super(`w:abstractNum`),o(this,`id`,void 0),this.root.push(new fs({abstractNumId:L(e),restartNumberingAfterBreak:0})),this.root.push(new ds(`hybridMultilevel`)),this.id=e;for(let e of t)this.root.push(new us(e))}},ms=class extends d{constructor(e){super(`w:abstractNumId`),this.root.push(new _({val:e}))}},hs=class extends h{constructor(...e){super(...e),o(this,`xmlKeys`,{numId:`w:numId`})}},gs=class extends d{constructor(e){if(super(`w:num`),o(this,`numId`,void 0),o(this,`reference`,void 0),o(this,`instance`,void 0),o(this,`restartedListId`,void 0),this.numId=e.numId,this.reference=e.reference,this.instance=e.instance,this.restartedListId=e.restartedListId,this.root.push(new hs({numId:L(e.numId)})),this.root.push(new ms(L(e.abstractNumId))),e.overrideLevels&&e.overrideLevels.length)for(let t of e.overrideLevels)this.root.push(new vs(t.num,t.start))}},_s=class extends h{constructor(...e){super(...e),o(this,`xmlKeys`,{ilvl:`w:ilvl`})}},vs=class extends d{constructor(e,t){super(`w:lvlOverride`),this.root.push(new _s({ilvl:e})),t!==void 0&&this.root.push(new bs(t))}},ys=class extends h{constructor(...e){super(...e),o(this,`xmlKeys`,{val:`w:val`})}},bs=class extends d{constructor(e){super(`w:startOverride`),this.root.push(new ys({val:e}))}},xs=class extends d{constructor(e){super(`w:numbering`),o(this,`abstractNumberingMap`,new Map),o(this,`concreteNumberingMap`,new Map),o(this,`referenceConfigMap`,new Map),o(this,`abstractNumUniqueNumericId`,Rt()),o(this,`concreteNumUniqueNumericId`,zt()),this.root.push(new po([`wpc`,`mc`,`o`,`r`,`m`,`v`,`wp14`,`wp`,`w10`,`w`,`w14`,`w15`,`wpg`,`wpi`,`wne`,`wps`],`w14 w15 wp14`));let t=new ps(this.abstractNumUniqueNumericId(),[{level:0,format:ts.BULLET,text:`●`,alignment:V.LEFT,style:{paragraph:{indent:{left:It(.5),hanging:It(.25)}}}},{level:1,format:ts.BULLET,text:`○`,alignment:V.LEFT,style:{paragraph:{indent:{left:It(1),hanging:It(.25)}}}},{level:2,format:ts.BULLET,text:`■`,alignment:V.LEFT,style:{paragraph:{indent:{left:2160,hanging:It(.25)}}}},{level:3,format:ts.BULLET,text:`●`,alignment:V.LEFT,style:{paragraph:{indent:{left:2880,hanging:It(.25)}}}},{level:4,format:ts.BULLET,text:`○`,alignment:V.LEFT,style:{paragraph:{indent:{left:3600,hanging:It(.25)}}}},{level:5,format:ts.BULLET,text:`■`,alignment:V.LEFT,style:{paragraph:{indent:{left:4320,hanging:It(.25)}}}},{level:6,format:ts.BULLET,text:`●`,alignment:V.LEFT,style:{paragraph:{indent:{left:5040,hanging:It(.25)}}}},{level:7,format:ts.BULLET,text:`●`,alignment:V.LEFT,style:{paragraph:{indent:{left:5760,hanging:It(.25)}}}},{level:8,format:ts.BULLET,text:`●`,alignment:V.LEFT,style:{paragraph:{indent:{left:6480,hanging:It(.25)}}}}]);this.concreteNumberingMap.set(`default-bullet-numbering`,new gs({numId:1,abstractNumId:t.id,reference:`default-bullet-numbering`,instance:0,overrideLevels:[{num:0,start:1}]})),this.abstractNumberingMap.set(`default-bullet-numbering`,t);for(let t of e.config)this.abstractNumberingMap.set(t.reference,new ps(this.abstractNumUniqueNumericId(),t.levels)),this.referenceConfigMap.set(t.reference,t.levels)}prepForXml(e){return this.root.splice(1,this.root.length-1,...this.abstractNumberingMap.values(),...this.concreteNumberingMap.values()),super.prepForXml(e)}createConcreteNumberingInstance(e,t,n,r){n&&!this.abstractNumberingMap.has(n.reference)&&(this.abstractNumberingMap.set(n.reference,new ps(this.abstractNumUniqueNumericId(),n.levels)),this.referenceConfigMap.set(n.reference,n.levels));let i=this.abstractNumberingMap.get(e);if(!i)return;let a=bi(e,t,r);if(this.concreteNumberingMap.has(a))return;let o=this.referenceConfigMap.get(e)??[{level:0}],s={numId:this.concreteNumUniqueNumericId(),abstractNumId:i.id,reference:e,instance:t,restartedListId:r,overrideLevels:o.map(({level:e,start:t=1})=>({num:e,start:L(t)}))};this.concreteNumberingMap.set(a,new gs(s))}get ConcreteNumbering(){return Array.from(this.concreteNumberingMap.values())}get ReferenceConfig(){return Array.from(this.referenceConfigMap.values())}},Ss=class{constructor(e,t=new Set){o(this,`contentTypes`,void 0),o(this,`existingPaths`,void 0),o(this,`paths`,new Map),o(this,`folders`,new WeakMap),this.contentTypes=e,this.existingPaths=t}add(e){let t=this.paths.get(e);if(t!==void 0)return t;let{folder:n,name:r,extension:i,contentType:a}=e.options,o=new Set([...this.existingPaths,...this.paths.values()]),s=1;for(;o.has(`${n}/${r}${s}.${i}`);)s++;let c=`${n}/${r}${s}.${i}`;return this.paths.set(e,c),this.contentTypes.addOverride(a,`/word/${c}`),c}get Array(){return[...this.paths].map(([e,t])=>({part:e,path:t}))}createRelationships(e){let t=new W;return this.folders.set(t,e.slice(0,e.indexOf(`/`))),t}getTarget(e,t){let n=this.folders.get(e);return n===void 0?t:t.startsWith(`${n}/`)?t.slice(n.length+1):`../${t}`}},Cs=e=>new B({name:`w:compatSetting`,attributes:{version:{key:`w:val`,value:e},name:{key:`w:name`,value:`compatibilityMode`},uri:{key:`w:uri`,value:`http://schemas.microsoft.com/office/word`}}}),ws=class extends d{constructor(e){super(`w:compat`),e.useSingleBorderforContiguousCells&&this.root.push(new z(`w:useSingleBorderforContiguousCells`,e.useSingleBorderforContiguousCells)),e.wordPerfectJustification&&this.root.push(new z(`w:wpJustification`,e.wordPerfectJustification)),e.noTabStopForHangingIndent&&this.root.push(new z(`w:noTabHangInd`,e.noTabStopForHangingIndent)),e.noLeading&&this.root.push(new z(`w:noLeading`,e.noLeading)),e.spaceForUnderline&&this.root.push(new z(`w:spaceForUL`,e.spaceForUnderline)),e.noColumnBalance&&this.root.push(new z(`w:noColumnBalance`,e.noColumnBalance)),e.balanceSingleByteDoubleByteWidth&&this.root.push(new z(`w:balanceSingleByteDoubleByteWidth`,e.balanceSingleByteDoubleByteWidth)),e.noExtraLineSpacing&&this.root.push(new z(`w:noExtraLineSpacing`,e.noExtraLineSpacing)),e.doNotLeaveBackslashAlone&&this.root.push(new z(`w:doNotLeaveBackslashAlone`,e.doNotLeaveBackslashAlone)),e.underlineTrailingSpaces&&this.root.push(new z(`w:ulTrailSpace`,e.underlineTrailingSpaces)),e.doNotExpandShiftReturn&&this.root.push(new z(`w:doNotExpandShiftReturn`,e.doNotExpandShiftReturn)),e.spacingInWholePoints&&this.root.push(new z(`w:spacingInWholePoints`,e.spacingInWholePoints)),e.lineWrapLikeWord6&&this.root.push(new z(`w:lineWrapLikeWord6`,e.lineWrapLikeWord6)),e.printBodyTextBeforeHeader&&this.root.push(new z(`w:printBodyTextBeforeHeader`,e.printBodyTextBeforeHeader)),e.printColorsBlack&&this.root.push(new z(`w:printColBlack`,e.printColorsBlack)),e.spaceWidth&&this.root.push(new z(`w:wpSpaceWidth`,e.spaceWidth)),e.showBreaksInFrames&&this.root.push(new z(`w:showBreaksInFrames`,e.showBreaksInFrames)),e.subFontBySize&&this.root.push(new z(`w:subFontBySize`,e.subFontBySize)),e.suppressBottomSpacing&&this.root.push(new z(`w:suppressBottomSpacing`,e.suppressBottomSpacing)),e.suppressTopSpacing&&this.root.push(new z(`w:suppressTopSpacing`,e.suppressTopSpacing)),e.suppressSpacingAtTopOfPage&&this.root.push(new z(`w:suppressSpacingAtTopOfPage`,e.suppressSpacingAtTopOfPage)),e.suppressTopSpacingWP&&this.root.push(new z(`w:suppressTopSpacingWP`,e.suppressTopSpacingWP)),e.suppressSpBfAfterPgBrk&&this.root.push(new z(`w:suppressSpBfAfterPgBrk`,e.suppressSpBfAfterPgBrk)),e.swapBordersFacingPages&&this.root.push(new z(`w:swapBordersFacingPages`,e.swapBordersFacingPages)),e.convertMailMergeEsc&&this.root.push(new z(`w:convMailMergeEsc`,e.convertMailMergeEsc)),e.truncateFontHeightsLikeWP6&&this.root.push(new z(`w:truncateFontHeightsLikeWP6`,e.truncateFontHeightsLikeWP6)),e.macWordSmallCaps&&this.root.push(new z(`w:mwSmallCaps`,e.macWordSmallCaps)),e.usePrinterMetrics&&this.root.push(new z(`w:usePrinterMetrics`,e.usePrinterMetrics)),e.doNotSuppressParagraphBorders&&this.root.push(new z(`w:doNotSuppressParagraphBorders`,e.doNotSuppressParagraphBorders)),e.wrapTrailSpaces&&this.root.push(new z(`w:wrapTrailSpaces`,e.wrapTrailSpaces)),e.footnoteLayoutLikeWW8&&this.root.push(new z(`w:footnoteLayoutLikeWW8`,e.footnoteLayoutLikeWW8)),e.shapeLayoutLikeWW8&&this.root.push(new z(`w:shapeLayoutLikeWW8`,e.shapeLayoutLikeWW8)),e.alignTablesRowByRow&&this.root.push(new z(`w:alignTablesRowByRow`,e.alignTablesRowByRow)),e.forgetLastTabAlignment&&this.root.push(new z(`w:forgetLastTabAlignment`,e.forgetLastTabAlignment)),e.adjustLineHeightInTable&&this.root.push(new z(`w:adjustLineHeightInTable`,e.adjustLineHeightInTable)),e.autoSpaceLikeWord95&&this.root.push(new z(`w:autoSpaceLikeWord95`,e.autoSpaceLikeWord95)),e.noSpaceRaiseLower&&this.root.push(new z(`w:noSpaceRaiseLower`,e.noSpaceRaiseLower)),e.doNotUseHTMLParagraphAutoSpacing&&this.root.push(new z(`w:doNotUseHTMLParagraphAutoSpacing`,e.doNotUseHTMLParagraphAutoSpacing)),e.layoutRawTableWidth&&this.root.push(new z(`w:layoutRawTableWidth`,e.layoutRawTableWidth)),e.layoutTableRowsApart&&this.root.push(new z(`w:layoutTableRowsApart`,e.layoutTableRowsApart)),e.useWord97LineBreakRules&&this.root.push(new z(`w:useWord97LineBreakRules`,e.useWord97LineBreakRules)),e.doNotBreakWrappedTables&&this.root.push(new z(`w:doNotBreakWrappedTables`,e.doNotBreakWrappedTables)),e.doNotSnapToGridInCell&&this.root.push(new z(`w:doNotSnapToGridInCell`,e.doNotSnapToGridInCell)),e.selectFieldWithFirstOrLastCharacter&&this.root.push(new z(`w:selectFldWithFirstOrLastChar`,e.selectFieldWithFirstOrLastCharacter)),e.applyBreakingRules&&this.root.push(new z(`w:applyBreakingRules`,e.applyBreakingRules)),e.doNotWrapTextWithPunctuation&&this.root.push(new z(`w:doNotWrapTextWithPunct`,e.doNotWrapTextWithPunctuation)),e.doNotUseEastAsianBreakRules&&this.root.push(new z(`w:doNotUseEastAsianBreakRules`,e.doNotUseEastAsianBreakRules)),e.useWord2002TableStyleRules&&this.root.push(new z(`w:useWord2002TableStyleRules`,e.useWord2002TableStyleRules)),e.growAutofit&&this.root.push(new z(`w:growAutofit`,e.growAutofit)),e.useFELayout&&this.root.push(new z(`w:useFELayout`,e.useFELayout)),e.useNormalStyleForList&&this.root.push(new z(`w:useNormalStyleForList`,e.useNormalStyleForList)),e.doNotUseIndentAsNumberingTabStop&&this.root.push(new z(`w:doNotUseIndentAsNumberingTabStop`,e.doNotUseIndentAsNumberingTabStop)),e.useAlternateEastAsianLineBreakRules&&this.root.push(new z(`w:useAltKinsokuLineBreakRules`,e.useAlternateEastAsianLineBreakRules)),e.allowSpaceOfSameStyleInTable&&this.root.push(new z(`w:allowSpaceOfSameStyleInTable`,e.allowSpaceOfSameStyleInTable)),e.doNotSuppressIndentation&&this.root.push(new z(`w:doNotSuppressIndentation`,e.doNotSuppressIndentation)),e.doNotAutofitConstrainedTables&&this.root.push(new z(`w:doNotAutofitConstrainedTables`,e.doNotAutofitConstrainedTables)),e.autofitToFirstFixedWidthCell&&this.root.push(new z(`w:autofitToFirstFixedWidthCell`,e.autofitToFirstFixedWidthCell)),e.underlineTabInNumberingList&&this.root.push(new z(`w:underlineTabInNumList`,e.underlineTabInNumberingList)),e.displayHangulFixedWidth&&this.root.push(new z(`w:displayHangulFixedWidth`,e.displayHangulFixedWidth)),e.splitPgBreakAndParaMark&&this.root.push(new z(`w:splitPgBreakAndParaMark`,e.splitPgBreakAndParaMark)),e.doNotVerticallyAlignCellWithSp&&this.root.push(new z(`w:doNotVertAlignCellWithSp`,e.doNotVerticallyAlignCellWithSp)),e.doNotBreakConstrainedForcedTable&&this.root.push(new z(`w:doNotBreakConstrainedForcedTable`,e.doNotBreakConstrainedForcedTable)),e.ignoreVerticalAlignmentInTextboxes&&this.root.push(new z(`w:doNotVertAlignInTxbx`,e.ignoreVerticalAlignmentInTextboxes)),e.useAnsiKerningPairs&&this.root.push(new z(`w:useAnsiKerningPairs`,e.useAnsiKerningPairs)),e.cachedColumnBalance&&this.root.push(new z(`w:cachedColBalance`,e.cachedColumnBalance)),e.version&&this.root.push(Cs(e.version))}},Ts=1e5,Es=15,Ds=[57840,7439,52380,33984,4364,3600,61902,12606,6258,57657,54287,34041,10252,43370,20163],Os=[[44796,19929,39858,10053,20106,40212,10761],[31585,63170,64933,60267,50935,40399,11199],[17763,35526,1453,2906,5812,11624,23248],[885,1770,3540,7080,14160,28320,56640],[55369,41139,20807,41614,21821,43642,17621],[28485,56970,44341,19019,38038,14605,29210],[60195,50791,40175,10751,21502,43004,24537],[18387,36774,3949,7898,15796,31592,63184],[47201,24803,49606,37805,14203,28406,56812],[17824,35648,1697,3394,6788,13576,27152],[43601,17539,35078,557,1114,2228,4456],[30388,60776,51953,34243,7079,14158,28316],[14128,28256,56512,43425,17251,34502,7597],[13105,26210,52420,35241,883,1766,3532],[4129,8258,16516,33032,4657,9314,18628]],ks=e=>e>>14&1|e<<1&32767,As=e=>{let t=e.slice(0,Es).split(``).map(e=>{let t=e.charCodeAt(0);return t&255?t&255:t>>8&255}),n=t.reduce((e,n,r)=>Os[Es-t.length+r].reduce((e,t,r)=>n>>r&1?e^t:e,e),Ds[t.length-1]),r=(ks(t.reduceRight((e,t)=>ks(e)^t,0))^t.length^52811)&65535;return[r&255,r>>8,n&255,n>>8].map(e=>e.toString(16).toUpperCase().padStart(2,`0`)).join(``)},js=(e,t,n)=>{let r=[...As(e)].flatMap(e=>[e.charCodeAt(0),0]),i=Ft(Uint8Array.from([...t,...r])),a=new Uint8Array(i.length+4),o=new DataView(a.buffer);for(let e=0;e<n;e++)a.set(i),o.setUint32(i.length,e,!0),i=Ft(a);return Array.from(i)},Ms=e=>{let t=new Uint8Array(e);return typeof globalThis.crypto?.getRandomValues==`function`?(globalThis.crypto.getRandomValues(t),[...t]):[...t].map(()=>Math.floor(Math.random()*256))},Ns=class extends h{constructor(...e){super(...e),o(this,`xmlKeys`,{edit:`w:edit`,enforcement:`w:enforcement`,cryptProviderType:`w:cryptProviderType`,cryptAlgorithmClass:`w:cryptAlgorithmClass`,cryptAlgorithmType:`w:cryptAlgorithmType`,cryptAlgorithmSid:`w:cryptAlgorithmSid`,cryptSpinCount:`w:cryptSpinCount`,hash:`w:hash`,salt:`w:salt`})}},Ps=e=>btoa(String.fromCharCode(...e)),Fs=class extends d{constructor({type:e,password:t}){if(super(`w:documentProtection`),t===void 0||t===``){this.root.push(new Ns({edit:e,enforcement:!0}));return}let n=Ms(16);this.root.push(new Ns({edit:e,enforcement:!0,cryptProviderType:`rsaAES`,cryptAlgorithmClass:`hash`,cryptAlgorithmType:`typeAny`,cryptAlgorithmSid:12,cryptSpinCount:Ts,hash:Ps(js(t,n,Ts)),salt:Ps(n)}))}},Is=class extends h{constructor(...e){super(...e),o(this,`xmlKeys`,{wpc:`xmlns:wpc`,mc:`xmlns:mc`,o:`xmlns:o`,r:`xmlns:r`,m:`xmlns:m`,v:`xmlns:v`,wp14:`xmlns:wp14`,wp:`xmlns:wp`,w10:`xmlns:w10`,w:`xmlns:w`,w14:`xmlns:w14`,w15:`xmlns:w15`,wpg:`xmlns:wpg`,wpi:`xmlns:wpi`,wne:`xmlns:wne`,wps:`xmlns:wps`,Ignorable:`mc:Ignorable`})}},Ls=class extends d{constructor(e){super(`w:settings`),this.root.push(new Is({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`,wpi:`http://schemas.microsoft.com/office/word/2010/wordprocessingInk`,wne:`http://schemas.microsoft.com/office/word/2006/wordml`,wps:`http://schemas.microsoft.com/office/word/2010/wordprocessingShape`,Ignorable:`w14 w15 wp14`})),this.root.push(new z(`w:displayBackgroundShape`,!0)),e.embedFonts!==void 0&&this.root.push(new z(`w:embedTrueTypeFonts`,e.embedFonts)),e.trackRevisions!==void 0&&this.root.push(new z(`w:trackRevisions`,e.trackRevisions)),e.protection!==void 0&&this.root.push(new Fs(e.protection)),this.root.push(new Ee(`w:defaultTabStop`,e.defaultTabStop??720)),e.hyphenation?.autoHyphenation!==void 0&&this.root.push(new z(`w:autoHyphenation`,e.hyphenation.autoHyphenation)),e.hyphenation?.consecutiveHyphenLimit!==void 0&&this.root.push(new Ee(`w:consecutiveHyphenLimit`,e.hyphenation.consecutiveHyphenLimit)),e.hyphenation?.hyphenationZone!==void 0&&this.root.push(new Ee(`w:hyphenationZone`,e.hyphenation.hyphenationZone)),e.hyphenation?.doNotHyphenateCaps!==void 0&&this.root.push(new z(`w:doNotHyphenateCaps`,e.hyphenation.doNotHyphenateCaps)),e.evenAndOddHeaders!==void 0&&this.root.push(new z(`w:evenAndOddHeaders`,e.evenAndOddHeaders)),e.updateFields!==void 0&&this.root.push(new z(`w:updateFields`,e.updateFields)),this.root.push(new ws(m(m({},e.compatibility??{}),{},{version:e.compatibility?.version??e.compatibilityModeVersion??15})))}},Rs=class extends h{constructor(...e){super(...e),o(this,`xmlKeys`,{val:`w:val`})}},zs=class extends d{constructor(e){super(`w:name`),this.root.push(new Rs({val:e}))}},Bs=class extends d{constructor(e){super(`w:uiPriority`),this.root.push(new Rs({val:L(e)}))}},Vs=class extends h{constructor(...e){super(...e),o(this,`xmlKeys`,{type:`w:type`,styleId:`w:styleId`,default:`w:default`,customStyle:`w:customStyle`})}},Hs=class extends d{constructor(e,t){super(`w:style`),this.root.push(new Vs(e)),t.name&&this.root.push(new zs(t.name)),t.basedOn&&t.basedOn!==e.styleId&&this.root.push(new we(`w:basedOn`,t.basedOn)),t.next&&this.root.push(new we(`w:next`,t.next)),t.link&&this.root.push(new we(`w:link`,t.link)),t.uiPriority!==void 0&&this.root.push(new Bs(t.uiPriority)),t.semiHidden!==void 0&&this.root.push(new z(`w:semiHidden`,t.semiHidden)),t.unhideWhenUsed!==void 0&&this.root.push(new z(`w:unhideWhenUsed`,t.unhideWhenUsed)),t.quickFormat!==void 0&&this.root.push(new z(`w:qFormat`,t.quickFormat))}},Us=class extends Hs{constructor(e){super({type:`paragraph`,styleId:e.id},e),o(this,`paragraphProperties`,void 0),o(this,`runProperties`,void 0),this.paragraphProperties=new Mi(e.paragraph,{implicitListParagraphStyle:!1,inListOrder:!1}),this.runProperties=new an(e.run),this.root.push(this.paragraphProperties),this.root.push(this.runProperties)}},Ws=class extends Hs{constructor(e){super({type:`character`,styleId:e.id},m({uiPriority:99,unhideWhenUsed:!0},e)),o(this,`runProperties`,void 0),this.runProperties=new an(e.run),this.root.push(this.runProperties)}},Gs=class extends Us{constructor(e){super(m({basedOn:`Normal`,next:`Normal`,quickFormat:!0},e))}},Ks=class extends Gs{constructor(e){super(m({id:`Title`,name:`Title`},e))}},qs=class extends Gs{constructor(e){super(m({id:`Heading1`,name:`Heading 1`},e))}},Js=class extends Gs{constructor(e){super(m({id:`Heading2`,name:`Heading 2`},e))}},Ys=class extends Gs{constructor(e){super(m({id:`Heading3`,name:`Heading 3`},e))}},Xs=class extends Gs{constructor(e){super(m({id:`Heading4`,name:`Heading 4`},e))}},Zs=class extends Gs{constructor(e){super(m({id:`Heading5`,name:`Heading 5`},e))}},Qs=class extends Gs{constructor(e){super(m({id:`Heading6`,name:`Heading 6`},e))}},$s=class extends Gs{constructor(e){super(m({id:`Strong`,name:`Strong`},e))}},ec=class extends Us{constructor(e){super(m({id:`ListParagraph`,name:`List Paragraph`,basedOn:`Normal`,quickFormat:!0},e))}},tc=class extends Us{constructor(e){super(m({id:`Caption`,name:`caption`,basedOn:`Normal`,next:`Normal`,uiPriority:35,semiHidden:!0,unhideWhenUsed:!0,quickFormat:!0,paragraph:{spacing:{after:200}},run:{italics:!0,color:{theme:`dark2`},size:18}},e))}},nc=class extends Us{constructor(e){super(m({id:`Bibliography`,name:`Bibliography`,basedOn:`Normal`,next:`Normal`,uiPriority:37,unhideWhenUsed:!0},e))}},rc=new WeakSet,ic=e=>rc.has(e),ac=class extends Us{constructor(e,t){super({id:`TOC${e}`,name:`toc ${e}`,basedOn:`Normal`,next:`Normal`,uiPriority:39,semiHidden:!0,unhideWhenUsed:!0,paragraph:m({spacing:{after:100}},e>1?{indent:{left:(e-1)*t}}:{})})}prepForXml(e){let t=super.prepForXml(e);return rc.add(t),t}},oc=class extends Us{constructor(e){super(m({id:`FootnoteText`,name:`footnote text`,link:`FootnoteTextChar`,basedOn:`Normal`,uiPriority:99,semiHidden:!0,unhideWhenUsed:!0,paragraph:{spacing:{after:0,line:240,lineRule:Yr.AUTO}},run:{size:20}},e))}},sc=class extends Ws{constructor(e){super(m({id:`FootnoteReference`,name:`footnote reference`,basedOn:`DefaultParagraphFont`,semiHidden:!0,run:{superScript:!0}},e))}},cc=class extends Ws{constructor(e){super(m({id:`FootnoteTextChar`,name:`Footnote Text Char`,basedOn:`DefaultParagraphFont`,link:`FootnoteText`,semiHidden:!0,run:{size:20}},e))}},lc=class extends Us{constructor(e){super(m({id:`EndnoteText`,name:`endnote text`,link:`EndnoteTextChar`,basedOn:`Normal`,uiPriority:99,semiHidden:!0,unhideWhenUsed:!0,paragraph:{spacing:{after:0,line:240,lineRule:Yr.AUTO}},run:{size:20}},e))}},uc=class extends Ws{constructor(e){super(m({id:`EndnoteReference`,name:`endnote reference`,basedOn:`DefaultParagraphFont`,semiHidden:!0,run:{superScript:!0}},e))}},dc=class extends Ws{constructor(e){super(m({id:`EndnoteTextChar`,name:`Endnote Text Char`,basedOn:`DefaultParagraphFont`,link:`EndnoteText`,semiHidden:!0,run:{size:20}},e))}},fc=class extends Ws{constructor(e){super(m({id:`Hyperlink`,name:`Hyperlink`,basedOn:`DefaultParagraphFont`,run:{color:`0563C1`,underline:{type:nn.SINGLE}}},e))}},pc=class extends Ws{constructor(e){super(m({id:`LineNumber`,name:`line number`,basedOn:`DefaultParagraphFont`,semiHidden:!0},e))}},mc=class extends Hs{constructor(){super({type:`table`,styleId:`TableNormal`,default:!0},{name:`Normal Table`,uiPriority:99,semiHidden:!0,unhideWhenUsed:!0}),this.root.push(new Xa({indent:{size:0,type:aa.DXA},cellMargin:{top:0,left:108,bottom:0,right:108}}))}},hc=e=>typeof e==`object`?Object.keys(e)[0]:void 0,gc=e=>[e[`w:style`]].flat().find(e=>e._attr)?._attr,_c=e=>gc(e)?.[`w:styleId`],vc=e=>{var t;let n=(t=[e[`w:style`]].flat().find(e=>hc(e)===`w:name`))==null||(t=t[`w:name`])==null||(t=t._attr)==null?void 0:t[`w:val`];return n===void 0?void 0:String(n).toLowerCase()},yc=e=>hc(e)===`w:style`&&(gc(e)?.[`w:type`]??`paragraph`)===`paragraph`,bc=e=>{let t=yc(e)?gc(e):void 0;return t?.[`w:default`]!==void 0&&![`0`,`false`,`off`].includes(String(t[`w:default`]))},xc=e=>({"w:style":[e[`w:style`]].flat().map(e=>e._attr?{_attr:m(m({},e._attr),{},{"w:default":`1`})}:e)}),Sc=class extends d{constructor(e){if(super(`w:styles`),e.initialStyles&&this.root.push(e.initialStyles),e.importedStyles)for(let t of e.importedStyles)this.root.push(t);if(e.paragraphStyles)for(let t of e.paragraphStyles)this.root.push(new Us(t));if(e.characterStyles)for(let t of e.characterStyles)this.root.push(new Ws(t))}prepForXml(e){let t=super.prepForXml(e),n=t[`w:styles`];if(!Array.isArray(n))return t;let r=e=>n.filter(t=>hc(t)===e),i=n.map(e=>hc(e)===`w:style`?_c(e):void 0),a=n.filter((e,t)=>![`_attr`,`w:docDefaults`,`w:latentStyles`].includes(hc(e))&&(i[t]===void 0||i.lastIndexOf(i[t])===t)),o=new Set(a.filter(e=>yc(e)&&!ic(e)).map(vc)),s=a.filter(e=>!ic(e)||!o.has(vc(e))),c=s.some(bc)?s:s.map(e=>yc(e)&&_c(e)===`Normal`?xc(e):e);return{"w:styles":[...r(`_attr`),...r(`w:docDefaults`).slice(-1),...r(`w:latentStyles`).slice(-1),...c]}}},Cc=class extends d{constructor(e){super(`w:pPrDefault`),this.root.push(new Mi(e,{implicitListParagraphStyle:!1,inListOrder:!1}))}},wc=class extends d{constructor(e){super(`w:rPrDefault`),this.root.push(new an(e))}},Tc=class extends d{constructor(e){super(`w:docDefaults`),o(this,`runPropertiesDefaults`,void 0),o(this,`paragraphPropertiesDefaults`,void 0),this.runPropertiesDefaults=new wc(e.run),this.paragraphPropertiesDefaults=new Cc(e.paragraph),this.root.push(this.runPropertiesDefaults),this.root.push(this.paragraphPropertiesDefaults)}},Ec=class{newInstance(e){let t=D(e),n;for(let e of t.elements||[])e.name===`w:styles`&&(n=e);if(n===void 0)throw Error(`can not find styles element`);let r=n.elements||[];return{initialStyles:new ae(n.attributes),importedStyles:r.map(e=>F(e))}}},Dc=e=>{var t;let n=(t=e.document)==null||(t=t.run)==null?void 0:t.size;return n===void 0?200:Math.round(typeof n==`number`?n*10:fe(n))},Oc=e=>({tableOfContents1:new ac(1,e),tableOfContents2:new ac(2,e),tableOfContents3:new ac(3,e),tableOfContents4:new ac(4,e),tableOfContents5:new ac(5,e),tableOfContents6:new ac(6,e),tableOfContents7:new ac(7,e),tableOfContents8:new ac(8,e),tableOfContents9:new ac(9,e)}),kc=(e={})=>m(m({normal:new Us({id:`Normal`,name:`Normal`,quickFormat:!0}),normalTable:new mc,document:new Tc(e.document??{}),title:new Ks(m({run:{size:56}},e.title)),heading1:new qs(m({run:{color:`2E74B5`,size:32}},e.heading1)),heading2:new Js(m({run:{color:`2E74B5`,size:26}},e.heading2)),heading3:new Ys(m({run:{color:`1F4D78`,size:24}},e.heading3)),heading4:new Xs(m({run:{color:`2E74B5`,italics:!0}},e.heading4)),heading5:new Zs(m({run:{color:`2E74B5`}},e.heading5)),heading6:new Qs(m({run:{color:`1F4D78`}},e.heading6)),strong:new $s(m({run:{bold:!0}},e.strong)),listParagraph:new ec(e.listParagraph||{}),caption:new tc(e.caption||{}),bibliography:new nc(e.bibliography||{})},Oc(Dc(e))),{},{hyperlink:new fc(e.hyperlink||{}),footnoteReference:new sc(e.footnoteReference||{}),footnoteText:new oc(e.footnoteText||{}),footnoteTextChar:new cc(e.footnoteTextChar||{}),endnoteReference:new uc(e.endnoteReference||{}),endnoteText:new lc(e.endnoteText||{}),endnoteTextChar:new dc(e.endnoteTextChar||{}),lineNumber:new pc(e.lineNumber||{})}),Ac=class{newInstance(e={}){return{initialStyles:new po([`mc`,`r`,`w`,`w14`,`w15`],`w14 w15`),importedStyles:Object.values(kc(e))}}},jc={headings:{latin:`Calibri Light`,panose:`020F0302020204030204`},body:{latin:`Calibri`,panose:`020F0502020204030204`}},Mc=[[`Jpan`,`游ゴシック Light`,`游明朝`],[`Hang`,`맑은 고딕`],[`Hans`,`等线 Light`,`等线`],[`Hant`,`新細明體`],[`Arab`,`Times New Roman`,`Arial`],[`Hebr`,`Times New Roman`,`Arial`],[`Thai`,`Angsana New`,`Cordia New`],[`Ethi`,`Nyala`],[`Beng`,`Vrinda`],[`Gujr`,`Shruti`],[`Khmr`,`MoolBoran`,`DaunPenh`],[`Knda`,`Tunga`],[`Guru`,`Raavi`],[`Cans`,`Euphemia`],[`Cher`,`Plantagenet Cherokee`],[`Yiii`,`Microsoft Yi Baiti`],[`Tibt`,`Microsoft Himalaya`],[`Thaa`,`MV Boli`],[`Deva`,`Mangal`],[`Telu`,`Gautami`],[`Taml`,`Latha`],[`Syrc`,`Estrangelo Edessa`],[`Orya`,`Kalinga`],[`Mlym`,`Kartika`],[`Laoo`,`DokChampa`],[`Sinh`,`Iskoola Pota`],[`Mong`,`Mongolian Baiti`],[`Viet`,`Times New Roman`,`Arial`],[`Uigh`,`Microsoft Uighur`],[`Geor`,`Sylfaen`],[`Armn`,`Arial`],[`Bugi`,`Leelawadee UI`],[`Bopo`,`Microsoft JhengHei`],[`Java`,`Javanese Text`],[`Lisu`,`Segoe UI`],[`Mymr`,`Myanmar Text`],[`Nkoo`,`Ebrima`],[`Olck`,`Nirmala UI`],[`Osma`,`Ebrima`],[`Phag`,`Phagspa`],[`Syrn`,`Estrangelo Edessa`],[`Syrj`,`Estrangelo Edessa`],[`Syre`,`Estrangelo Edessa`],[`Sora`,`Nirmala UI`],[`Tale`,`Microsoft Tai Le`],[`Talu`,`Microsoft New Tai Lue`],[`Tfng`,`Ebrima`]],Nc=(e,t,n)=>new B({name:e,attributes:{typeface:{key:`typeface`,value:t},panose:{key:`panose`,value:n}}}),Pc=(e,t)=>{let n=t[e];return(typeof n==`string`?n:n?.latin)??jc[e].latin},Fc=(e,t={})=>{let n=Mc.map(([n,r,i=r])=>[n,t[n]??(e===`headings`?r:i)]),r=new Set(n.map(([e])=>e));return[...n,...Object.entries(t).filter(([e])=>!r.has(e))]},Ic=(e,t)=>{let n=t[e],{eastAsia:r=``,complexScript:i=``,scripts:a}=typeof n==`object`?n:{},o=Pc(e,t),s=jc[e];return new B({name:e===`headings`?`a:majorFont`:`a:minorFont`,children:[Nc(`a:latin`,o,o===s.latin?s.panose:void 0),Nc(`a:ea`,r),Nc(`a:cs`,i),...Fc(e,a).map(([e,t])=>new B({name:`a:font`,attributes:{script:{key:`script`,value:e},typeface:{key:`typeface`,value:t}}}))]})},Lc=(e,t={})=>new B({name:`a:fontScheme`,attributes:{name:{key:`name`,value:e}},children:[Ic(`headings`,t),Ic(`body`,t)]}),Rc=(e=[])=>new B({name:`a:schemeClr`,attributes:{value:{key:`val`,value:`phClr`}},children:e.map(([e,t])=>new B({name:`a:${e}`,attributes:{value:{key:`val`,value:t}}}))}),zc=e=>new B({name:`a:solidFill`,children:[Rc(e)]}),Bc=e=>new B({name:`a:gradFill`,attributes:{rotateWithShape:{key:`rotWithShape`,value:!0}},children:[new B({name:`a:gsLst`,children:e.map((e,t)=>new B({name:`a:gs`,attributes:{position:{key:`pos`,value:t*5e4}},children:[Rc(e)]}))}),new B({name:`a:lin`,attributes:{angle:{key:`ang`,value:54e5},scaled:{key:`scaled`,value:!1}}})]}),Vc=e=>new B({name:`a:ln`,attributes:{width:{key:`w`,value:e},cap:{key:`cap`,value:`flat`},compound:{key:`cmpd`,value:`sng`},alignment:{key:`algn`,value:`ctr`}},children:[zc(),new B({name:`a:prstDash`,attributes:{value:{key:`val`,value:`solid`}}}),new B({name:`a:miter`,attributes:{limit:{key:`lim`,value:8e5}}})]}),Hc=e=>new B({name:`a:effectStyle`,children:[new B({name:`a:effectLst`,children:e})]}),Uc=()=>new B({name:`a:outerShdw`,attributes:{blurRadius:{key:`blurRad`,value:57150},distance:{key:`dist`,value:19050},direction:{key:`dir`,value:54e5},alignment:{key:`algn`,value:`ctr`},rotateWithShape:{key:`rotWithShape`,value:!1}},children:[new B({name:`a:srgbClr`,attributes:{value:{key:`val`,value:`000000`}},children:[new B({name:`a:alpha`,attributes:{value:{key:`val`,value:63e3}}})]})]}),Wc=()=>new B({name:`a:fmtScheme`,attributes:{name:{key:`name`,value:`Office`}},children:[new B({name:`a:fillStyleLst`,children:[zc(),Bc([[[`lumMod`,11e4],[`satMod`,105e3],[`tint`,67e3]],[[`lumMod`,105e3],[`satMod`,103e3],[`tint`,73e3]],[[`lumMod`,105e3],[`satMod`,109e3],[`tint`,81e3]]]),Bc([[[`satMod`,103e3],[`lumMod`,102e3],[`tint`,94e3]],[[`satMod`,11e4],[`lumMod`,1e5],[`shade`,1e5]],[[`lumMod`,99e3],[`satMod`,12e4],[`shade`,78e3]]])]}),new B({name:`a:lnStyleLst`,children:[Vc(6350),Vc(12700),Vc(19050)]}),new B({name:`a:effectStyleLst`,children:[Hc([]),Hc([]),Hc([Uc()])]}),new B({name:`a:bgFillStyleLst`,children:[zc(),zc([[`tint`,95e3],[`satMod`,17e4]]),Bc([[[`tint`,93e3],[`satMod`,15e4],[`shade`,98e3],[`lumMod`,102e3]],[[`tint`,98e3],[`satMod`,13e4],[`shade`,9e4],[`lumMod`,103e3]],[[`shade`,63e3],[`satMod`,12e4]]])]})]}),Gc=class extends d{constructor({name:e=`Office Theme`,colors:t,fonts:n}={}){super(`a:theme`),o(this,`colors`,void 0),this.colors=Ne(t),this.root.push(new g({namespace:{key:`xmlns:a`,value:`http://schemas.openxmlformats.org/drawingml/2006/main`},name:{key:`name`,value:e}})),this.root.push(new B({name:`a:themeElements`,children:[Ie(t?e:`Office`,t),Lc(n?e:`Office`,n),Wc()]})),this.root.push(new B({name:`a:objectDefaults`})),this.root.push(new B({name:`a:extraClrSchemeLst`}))}get Colors(){return this.colors}},Kc=e=>{let t=e.lastIndexOf(`/`);return`${e.slice(0,t+1)}_rels/${e.slice(t+1)}.rels`},qc=e=>e.replace(/(^|\/)_rels\/([^/]*)\.rels$/,`$1$2`),Jc=e=>e.slice(0,e.lastIndexOf(`/`)+1),Yc=(e,t)=>{let n=t.replace(/\\/g,`/`);return(n.startsWith(`/`)?n:`${Jc(e)}${n}`).split(`/`).reduce((e,t)=>t===``||t===`.`?e:t===`..`?e.slice(0,-1):[...e,t],[]).join(`/`)},Xc=(e,t)=>{let n=Jc(e).split(`/`).filter(Boolean),r=t.split(`/`),i=n.findIndex((e,t)=>t>=r.length-1||r[t]!==e),a=i===-1?n.length:i;return[...n.slice(a).map(()=>`..`),...r.slice(a)].join(`/`)},Zc=(e,t)=>e.toLowerCase()===t.toLowerCase(),q=Uint8Array,J=Uint16Array,Qc=Int32Array,$c=new q([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),el=new q([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),tl=new q([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),nl=function(e,t){for(var n=new J(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];for(var i=new Qc(n[30]),r=1;r<30;++r)for(var a=n[r];a<n[r+1];++a)i[a]=a-n[r]<<5|r;return{b:n,r:i}},rl=nl($c,2),il=rl.b,al=rl.r;il[28]=258,al[258]=28;for(var ol=nl(el,0),sl=ol.b,cl=ol.r,ll=new J(32768),Y=0;Y<32768;++Y){var ul=(Y&43690)>>1|(Y&21845)<<1;ul=(ul&52428)>>2|(ul&13107)<<2,ul=(ul&61680)>>4|(ul&3855)<<4,ll[Y]=((ul&65280)>>8|(ul&255)<<8)>>1}for(var dl=(function(e,t,n){for(var r=e.length,i=0,a=new J(t);i<r;++i)e[i]&&++a[e[i]-1];var o=new J(t);for(i=1;i<t;++i)o[i]=o[i-1]+a[i-1]<<1;var s;if(n){s=new J(1<<t);var c=15-t;for(i=0;i<r;++i)if(e[i])for(var l=i<<4|e[i],u=t-e[i],d=o[e[i]-1]++<<u,f=d|(1<<u)-1;d<=f;++d)s[ll[d]>>c]=l}else for(s=new J(r),i=0;i<r;++i)e[i]&&(s[i]=ll[o[e[i]-1]++]>>15-e[i]);return s}),fl=new q(288),Y=0;Y<144;++Y)fl[Y]=8;for(var Y=144;Y<256;++Y)fl[Y]=9;for(var Y=256;Y<280;++Y)fl[Y]=7;for(var Y=280;Y<288;++Y)fl[Y]=8;for(var pl=new q(32),Y=0;Y<32;++Y)pl[Y]=5;var ml=dl(fl,9,0),hl=dl(fl,9,1),gl=dl(pl,5,0),_l=dl(pl,5,1),vl=function(e){for(var t=e[0],n=1;n<e.length;++n)e[n]>t&&(t=e[n]);return t},yl=function(e,t,n){var r=t/8|0;return(e[r]|e[r+1]<<8)>>(t&7)&n},bl=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(t&7)},xl=function(e){return(e+7)/8|0},Sl=function(e,t,n){return(t==null||t<0)&&(t=0),(n==null||n>e.length)&&(n=e.length),new q(e.subarray(t,n))},Cl=[`unexpected EOF`,`invalid block type`,`invalid length/literal`,`invalid distance`,`stream finished`,`no stream handler`,,`no callback`,`invalid UTF-8 data`,`extra field too long`,`date not in range 1980-2099`,`filename too long`,`stream finishing`,`invalid zip data`],X=function(e,t,n){var r=Error(t||Cl[e]);if(r.code=e,Error.captureStackTrace&&Error.captureStackTrace(r,X),!n)throw r;return r},wl=function(e,t,n,r){var i=e.length,a=r?r.length:0;if(!i||t.f&&!t.l)return n||new q(0);var o=!n,s=o||t.i!=2,c=t.i;o&&(n=new q(i*3));var l=function(e){var t=n.length;if(e>t){var r=new q(Math.max(t*2,e));r.set(n),n=r}},u=t.f||0,d=t.p||0,f=t.b||0,p=t.l,m=t.d,h=t.m,g=t.n,_=i*8;do{if(!p){u=yl(e,d,1);var v=yl(e,d+1,3);if(d+=3,!v){var y=xl(d)+4,b=e[y-4]|e[y-3]<<8,x=y+b;if(x>i){c&&X(0);break}s&&l(f+b),n.set(e.subarray(y,x),f),t.b=f+=b,t.p=d=x*8,t.f=u;continue}if(v==1)p=hl,m=_l,h=9,g=5;else if(v==2){var S=yl(e,d,31)+257,C=yl(e,d+10,15)+4,w=S+yl(e,d+5,31)+1;d+=14;for(var T=new q(w),E=new q(19),D=0;D<C;++D)E[tl[D]]=yl(e,d+D*3,7);d+=C*3;for(var O=vl(E),ee=(1<<O)-1,k=dl(E,O,1),D=0;D<w;){var A=k[yl(e,d,ee)];d+=A&15;var y=A>>4;if(y<16)T[D++]=y;else{var j=0,M=0;for(y==16?(M=3+yl(e,d,3),d+=2,j=T[D-1]):y==17?(M=3+yl(e,d,7),d+=3):y==18&&(M=11+yl(e,d,127),d+=7);M--;)T[D++]=j}}var N=T.subarray(0,S),P=T.subarray(S);h=vl(N),g=vl(P),p=dl(N,h,1),m=dl(P,g,1)}else X(1);if(d>_){c&&X(0);break}}s&&l(f+131072);for(var te=(1<<h)-1,ne=(1<<g)-1,re=d;;re=d){var j=p[bl(e,d)&te],F=j>>4;if(d+=j&15,d>_){c&&X(0);break}if(j||X(2),F<256)n[f++]=F;else if(F==256){re=d,p=null;break}else{var ie=F-254;if(F>264){var D=F-257,I=$c[D];ie=yl(e,d,(1<<I)-1)+il[D],d+=I}var ae=m[bl(e,d)&ne],oe=ae>>4;ae||X(3),d+=ae&15;var P=sl[oe];if(oe>3){var I=el[oe];P+=bl(e,d)&(1<<I)-1,d+=I}if(d>_){c&&X(0);break}s&&l(f+131072);var L=f+ie;if(f<P){var se=a-P,ce=Math.min(P,L);for(se+f<0&&X(3);f<ce;++f)n[f]=r[se+f]}for(;f<L;++f)n[f]=n[f-P]}}t.l=p,t.p=re,t.b=f,t.f=u,p&&(u=1,t.m=h,t.d=m,t.n=g)}while(!u);return f!=n.length&&o?Sl(n,0,f):n.subarray(0,f)},Tl=function(e,t,n){n<<=t&7;var r=t/8|0;e[r]|=n,e[r+1]|=n>>8},El=function(e,t,n){n<<=t&7;var r=t/8|0;e[r]|=n,e[r+1]|=n>>8,e[r+2]|=n>>16},Dl=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var i=n.length,a=n.slice();if(!i)return{t:Pl,l:0};if(i==1){var o=new q(n[0].s+1);return o[n[0].s]=1,{t:o,l:1}}n.sort(function(e,t){return e.f-t.f}),n.push({s:-1,f:25001});var s=n[0],c=n[1],l=0,u=1,d=2;for(n[0]={s:-1,f:s.f+c.f,l:s,r:c};u!=i-1;)s=n[n[l].f<n[d].f?l++:d++],c=n[l!=u&&n[l].f<n[d].f?l++:d++],n[u++]={s:-1,f:s.f+c.f,l:s,r:c};for(var f=a[0].s,r=1;r<i;++r)a[r].s>f&&(f=a[r].s);var p=new J(f+1),m=Ol(n[u-1],p,0);if(m>t){var r=0,h=0,g=m-t,_=1<<g;for(a.sort(function(e,t){return p[t.s]-p[e.s]||e.f-t.f});r<i;++r){var v=a[r].s;if(p[v]>t)h+=_-(1<<m-p[v]),p[v]=t;else break}for(h>>=g;h>0;){var y=a[r].s;p[y]<t?h-=1<<t-p[y]++-1:++r}for(;r>=0&&h;--r){var b=a[r].s;p[b]==t&&(--p[b],++h)}m=t}return{t:new q(p),l:m}},Ol=function(e,t,n){return e.s==-1?Math.max(Ol(e.l,t,n+1),Ol(e.r,t,n+1)):t[e.s]=n},kl=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new J(++t),r=0,i=e[0],a=1,o=function(e){n[r++]=e},s=1;s<=t;++s)if(e[s]==i&&s!=t)++a;else{if(!i&&a>2){for(;a>138;a-=138)o(32754);a>2&&(o(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(o(i),--a;a>6;a-=6)o(8304);a>2&&(o(a-3<<5|8208),a=0)}for(;a--;)o(i);a=1,i=e[s]}return{c:n.subarray(0,r),n:t}},Al=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},jl=function(e,t,n){var r=n.length,i=xl(t+2);e[i]=r&255,e[i+1]=r>>8,e[i+2]=e[i]^255,e[i+3]=e[i+1]^255;for(var a=0;a<r;++a)e[i+a+4]=n[a];return(i+4+r)*8},Ml=function(e,t,n,r,i,a,o,s,c,l,u){Tl(t,u++,n),++i[256];for(var d=Dl(i,15),f=d.t,p=d.l,m=Dl(a,15),h=m.t,g=m.l,_=kl(f),v=_.c,y=_.n,b=kl(h),x=b.c,S=b.n,C=new J(19),w=0;w<v.length;++w)++C[v[w]&31];for(var w=0;w<x.length;++w)++C[x[w]&31];for(var T=Dl(C,7),E=T.t,D=T.l,O=19;O>4&&!E[tl[O-1]];--O);var ee=l+5<<3,k=Al(i,fl)+Al(a,pl)+o,A=Al(i,f)+Al(a,h)+o+14+3*O+Al(C,E)+2*C[16]+3*C[17]+7*C[18];if(c>=0&&ee<=k&&ee<=A)return jl(t,u,e.subarray(c,c+l));var j,M,N,P;if(Tl(t,u,1+(A<k)),u+=2,A<k){j=dl(f,p,0),M=f,N=dl(h,g,0),P=h;var te=dl(E,D,0);Tl(t,u,y-257),Tl(t,u+5,S-1),Tl(t,u+10,O-4),u+=14;for(var w=0;w<O;++w)Tl(t,u+3*w,E[tl[w]]);u+=3*O;for(var ne=[v,x],re=0;re<2;++re)for(var F=ne[re],w=0;w<F.length;++w){var ie=F[w]&31;Tl(t,u,te[ie]),u+=E[ie],ie>15&&(Tl(t,u,F[w]>>5&127),u+=F[w]>>12)}}else j=ml,M=fl,N=gl,P=pl;for(var w=0;w<s;++w){var I=r[w];if(I>255){var ie=I>>18&31;El(t,u,j[ie+257]),u+=M[ie+257],ie>7&&(Tl(t,u,I>>23&31),u+=$c[ie]);var ae=I&31;El(t,u,N[ae]),u+=P[ae],ae>3&&(El(t,u,I>>5&8191),u+=el[ae])}else El(t,u,j[I]),u+=M[I]}return El(t,u,j[256]),u+M[256]},Nl=new Qc([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Pl=new q(0),Fl=function(e,t,n,r,i,a){var o=a.z||e.length,s=new q(r+o+5*(1+Math.ceil(o/7e3))+i),c=s.subarray(r,s.length-i),l=a.l,u=(a.r||0)&7;if(t){u&&(c[0]=a.r>>3);for(var d=Nl[t-1],f=d>>13,p=d&8191,m=(1<<n)-1,h=a.p||new J(32768),g=a.h||new J(m+1),_=Math.ceil(n/3),v=2*_,y=function(t){return(e[t]^e[t+1]<<_^e[t+2]<<v)&m},b=new Qc(25e3),x=new J(288),S=new J(32),C=0,w=0,T=a.i||0,E=0,D=a.w||0,O=0;T+2<o;++T){var ee=y(T),k=T&32767,A=g[ee];if(h[k]=A,g[ee]=k,D<=T){var j=o-T;if((C>7e3||E>24576)&&(j>423||!l)){u=Ml(e,c,0,b,x,S,w,E,O,T-O,u),E=C=w=0,O=T;for(var M=0;M<286;++M)x[M]=0;for(var M=0;M<30;++M)S[M]=0}var N=2,P=0,te=p,ne=k-A&32767;if(j>2&&ee==y(T-ne))for(var re=Math.min(f,j)-1,F=Math.min(32767,T),ie=Math.min(258,j);ne<=F&&--te&&k!=A;){if(e[T+N]==e[T+N-ne]){for(var I=0;I<ie&&e[T+I]==e[T+I-ne];++I);if(I>N){if(N=I,P=ne,I>re)break;for(var ae=Math.min(ne,I-2),oe=0,M=0;M<ae;++M){var L=T-ne+M&32767,se=L-h[L]&32767;se>oe&&(oe=se,A=L)}}}k=A,A=h[k],ne+=k-A&32767}if(P){b[E++]=268435456|al[N]<<18|cl[P];var ce=al[N]&31,le=cl[P]&31;w+=$c[ce]+el[le],++x[257+ce],++S[le],D=T+N,++C}else b[E++]=e[T],++x[e[T]]}}for(T=Math.max(T,D);T<o;++T)b[E++]=e[T],++x[e[T]];u=Ml(e,c,l,b,x,S,w,E,O,T-O,u),l||(a.r=u&7|c[u/8|0]<<3,u-=7,a.h=g,a.p=h,a.i=T,a.w=D)}else{for(var T=a.w||0;T<o+l;T+=65535){var ue=T+65535;ue>=o&&(c[u/8|0]=l,ue=o),u=jl(c,u+1,e.subarray(T,ue))}a.i=o}return Sl(s,0,r+xl(u)+i)},Il=(function(){for(var e=new Int32Array(256),t=0;t<256;++t){for(var n=t,r=9;--r;)n=(n&1&&-306674912)^n>>>1;e[t]=n}return e})(),Ll=function(){var e=-1;return{p:function(t){for(var n=e,r=0;r<t.length;++r)n=Il[n&255^t[r]]^n>>>8;e=n},d:function(){return~e}}},Rl=function(e,t,n,r,i){if(!i&&(i={l:1},t.dictionary)){var a=t.dictionary.subarray(-32768),o=new q(a.length+e.length);o.set(a),o.set(e,a.length),e=o,i.w=a.length}return Fl(e,t.level==null?6:t.level,t.mem==null?i.l?Math.ceil(Math.max(8,Math.min(13,Math.log(e.length)))*1.5):20:12+t.mem,n,r,i)},zl=function(e,t){var n={};for(var r in e)n[r]=e[r];for(var r in t)n[r]=t[r];return n},Bl=function(e,t){return e[t]|e[t+1]<<8},Vl=function(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0},Hl=function(e,t){return Vl(e,t)+Vl(e,t+4)*4294967296},Z=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8};function Ul(e,t){return Rl(e,t||{},0,0)}function Wl(e,t){return wl(e,{i:2},t&&t.out,t&&t.dictionary)}var Gl=function(e,t,n,r){for(var i in e){var a=e[i],o=t+i,s=r;Array.isArray(a)&&(s=zl(r,a[1]),a=a[0]),ArrayBuffer.isView(a)?n[o]=[a,s]:(n[o+=`/`]=[new q(0),s],Gl(a,o,n,r))}},Kl=typeof TextEncoder<`u`&&new TextEncoder,ql=typeof TextDecoder<`u`&&new TextDecoder;try{ql.decode(Pl,{stream:!0})}catch{}var Jl=function(e){for(var t=``,n=0;;){var r=e[n++],i=(r>127)+(r>223)+(r>239);if(n+i>e.length)return{s:t,r:Sl(e,n-1)};i?i==3?(r=((r&15)<<18|(e[n++]&63)<<12|(e[n++]&63)<<6|e[n++]&63)-65536,t+=String.fromCharCode(55296|r>>10,56320|r&1023)):i&1?t+=String.fromCharCode((r&31)<<6|e[n++]&63):t+=String.fromCharCode((r&15)<<12|(e[n++]&63)<<6|e[n++]&63):t+=String.fromCharCode(r)}};function Yl(e,t){if(t){for(var n=new q(e.length),r=0;r<e.length;++r)n[r]=e.charCodeAt(r);return n}if(Kl)return Kl.encode(e);for(var i=e.length,a=new q(e.length+(e.length>>1)),o=0,s=function(e){a[o++]=e},r=0;r<i;++r){if(o+5>a.length){var c=new q(o+8+(i-r<<1));c.set(a),a=c}var l=e.charCodeAt(r);l<128||t?s(l):l<2048?(s(192|l>>6),s(128|l&63)):l>55295&&l<57344?(l=65536+(l&1047552)|e.charCodeAt(++r)&1023,s(240|l>>18),s(128|l>>12&63),s(128|l>>6&63),s(128|l&63)):(s(224|l>>12),s(128|l>>6&63),s(128|l&63))}return Sl(a,0,o)}function Xl(e,t){if(t){for(var n=``,r=0;r<e.length;r+=16384)n+=String.fromCharCode.apply(null,e.subarray(r,r+16384));return n}if(ql)return ql.decode(e);var i=Jl(e),a=i.s,n=i.r;return n.length&&X(8),a}var Zl=function(e,t){return t+30+Bl(e,t+26)+Bl(e,t+28)},Ql=function(e,t,n){var r=Bl(e,t+28),i=Bl(e,t+30),a=Xl(e.subarray(t+46,t+46+r),!(Bl(e,t+8)&2048)),o=t+46+r,s=$l(e,o,i,n,Vl(e,t+20),Vl(e,t+24),Vl(e,t+42)),c=s[0],l=s[1],u=s[2];return[Bl(e,t+10),c,l,a,o+i+Bl(e,t+32),u]},$l=function(e,t,n,r,i,a,o){var s=i==4294967295,c=a==4294967295,l=o==4294967295,u=t+n,d=s+c+l;if(r&&d){for(;t+4<u;t+=4+Bl(e,t+2))if(Bl(e,t)==1)return[s?Hl(e,t+4+8*c):i,c?Hl(e,t+4):a,l?Hl(e,t+4+8*(c+s)):o,1];r<2&&X(13)}return[i,a,o,0]},eu=function(e){var t=0;if(e)for(var n in e){var r=e[n].length;r>65535&&X(9),t+=r+4}return t},tu=function(e,t,n,r,i,a,o,s){var c=r.length,l=n.extra,u=s&&s.length,d=eu(l);Z(e,t,o==null?67324752:33639248),t+=4,o!=null&&(e[t++]=20,e[t++]=n.os),e[t]=20,t+=2,e[t++]=n.flag<<1|(a<0&&8),e[t++]=i&&8,e[t++]=n.compression&255,e[t++]=n.compression>>8;var f=new Date(n.mtime==null?Date.now():n.mtime),p=f.getFullYear()-1980;if((p<0||p>119)&&X(10),Z(e,t,p<<25|f.getMonth()+1<<21|f.getDate()<<16|f.getHours()<<11|f.getMinutes()<<5|f.getSeconds()>>1),t+=4,a!=-1&&(Z(e,t,n.crc),Z(e,t+4,a<0?-a-2:a),Z(e,t+8,n.size)),Z(e,t+12,c),Z(e,t+14,d),t+=16,o!=null&&(Z(e,t,u),Z(e,t+6,n.attrs),Z(e,t+10,o),t+=14),e.set(r,t),t+=c,d)for(var m in l){var h=l[m],g=h.length;Z(e,t,+m),Z(e,t+2,g),e.set(h,t+4),t+=4+g}return u&&(e.set(s,t),t+=u),t},nu=function(e,t,n,r,i){Z(e,t,101010256),Z(e,t+8,n),Z(e,t+10,n),Z(e,t+12,r),Z(e,t+16,i)};function ru(e,t){t||={};var n={},r=[];Gl(e,``,n,t);var i=0,a=0;for(var o in n){var s=n[o],c=s[0],l=s[1],u=l.level==0?0:8,d=Yl(o),f=d.length,p=l.comment,m=p&&Yl(p),h=m&&m.length,g=eu(l.extra);f>65535&&X(11);var _=u?Ul(c,l):c,v=_.length,y=Ll();y.p(c),r.push(zl(l,{size:c.length,crc:y.d(),c:_,f:d,m,u:f!=o.length||m&&p.length!=h,o:i,compression:u})),i+=30+f+g+v,a+=76+2*(f+g)+(h||0)+v}for(var b=new q(a+22),x=i,S=a-i,C=0;C<r.length;++C){var d=r[C];tu(b,d.o,d,d.f,d.u,d.c.length);var w=30+d.f.length+eu(d.extra);b.set(d.c,d.o+w),tu(b,i,d,d.f,d.u,d.c.length,d.o,d.m),i+=16+w+(d.m?d.m.length:0)}return nu(b,i,r.length,S,x),b}function iu(e,t){for(var n={},r=e.length-22;Vl(e,r)!=101010256;--r)(!r||e.length-r>65558)&&X(13);var i=Bl(e,r+8);if(!i)return{};var a=Vl(e,r+16),o=Vl(e,r-20)==117853008;if(o){var s=Vl(e,r-12);o=Vl(e,s)==101075792,o&&(i=Vl(e,s+32),a=Vl(e,s+48))}for(var c=t&&t.filter,l=0;l<i;++l){var u=Ql(e,a,o),d=u[0],f=u[1],p=u[2],m=u[3],h=u[4],g=u[5],_=Zl(e,g);a=h,(!c||c({name:m,size:f,originalSize:p,compression:d}))&&(d?d==8?n[m]=Wl(e.subarray(_,_+f),{out:new q(p)}):X(14,`unknown compression type `+d):n[m]=Sl(e,_,_+f))}return n}var au=e=>typeof e==`string`?Kt(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(e),ou=e=>ru(Object.fromEntries([...e].map(([e,t])=>[e,au(t)]))),su=1032,cu=e=>Error(`Corrupted zip: ${e} isn't the size the zip file gives it`),lu=(e,t=()=>!0)=>{let n=new Map,r=0,i=iu(e,{filter:({name:i,size:a,originalSize:o})=>{if(i.endsWith(`/`)||!t(i))return!1;if(r+=a,r>e.length||o>a*su)throw cu(i);return n.set(i,o),!0}}),a=Object.entries(i).find(([e,t])=>t.length!==n.get(e));if(a!==void 0)throw cu(a[0]);return new Map(Object.entries(i))},uu=e=>{let t=``;for(let n=0;n<e.length;n+=32768)t+=String.fromCharCode(...e.subarray(n,n+32768));return t},du=e=>Error(`${e} is not supported by this platform`),fu={uint8array:e=>e,arraybuffer:e=>e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength),array:e=>Array.from(e),string:uu,binarystring:uu,base64:e=>btoa(uu(e)),blob:(e,t)=>{if(typeof Blob>`u`)throw du(`blob`);return new Blob([e],{type:t})},nodebuffer:e=>{if(typeof Buffer>`u`)throw du(`nodebuffer`);return Buffer.from(e.buffer,e.byteOffset,e.byteLength)},text:()=>{throw du(`text`)}},pu=(e,t,n)=>{let r=Object.prototype.hasOwnProperty.call(fu,t.toLowerCase())?fu[t.toLowerCase()]:void 0;if(r===void 0)throw du(t);return r(e,n)},mu=new Map([[`dk1`,`dark1`],[`lt1`,`light1`],[`dk2`,`dark2`],[`lt2`,`light2`],[`accent1`,`accent1`],[`accent2`,`accent2`],[`accent3`,`accent3`],[`accent4`,`accent4`],[`accent5`,`accent5`],[`accent6`,`accent6`],[`hlink`,`hyperlink`],[`folHlink`,`followedHyperlink`]]),hu=new Map([[`dark1`,`windowText`],[`light1`,`window`]]),gu=new Set([`http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme`,`http://purl.oclc.org/ooxml/officeDocument/relationships/theme`]),_u=e=>{var t;return(e==null||(t=e.name)==null?void 0:t.slice(e.name.indexOf(`:`)+1))??``},vu=e=>{var t;return(e==null||(t=e.elements)==null?void 0:t.filter(e=>e.type===`element`))??[]},yu=(e,t)=>vu(e).find(e=>_u(e)===t),bu=(e,t)=>{var n;let r=e==null||(n=e.attributes)==null?void 0:n[t];return r===void 0?void 0:String(r)},xu=e=>new TextDecoder(e[0]===255&&e[1]===254?`utf-16le`:e[0]===254&&e[1]===255?`utf-16be`:`utf-8`).decode(e),Su=(e,t,n)=>{let r=e.get(Kc(t)),i=bu(r&&vu(yu(D(xu(r)),`Relationships`)).find(e=>n.has(bu(e,`Type`)??``)),`Target`);return i===void 0?void 0:Yc(t,i)},Cu=(e,t)=>Su(e,t,gu),wu=(e,t,n)=>{let[r]=vu(t),i=_u(r)===`srgbClr`?bu(r,`val`):_u(r)===`sysClr`&&(n||bu(r,`val`)!==hu.get(e))?bu(r,`lastClr`):void 0;return i!==void 0&&/^[0-9A-Fa-f]{6}$/.test(i)?i.toUpperCase():void 0},Tu=(e,t=!1)=>Object.fromEntries(vu(e).flatMap(e=>{let n=mu.get(_u(e)),r=n&&wu(n,e,t);return n&&r?[[n,r]]:[]})),Eu=e=>{let[t]=vu(D(e)),n=_u(t)===`theme`?yu(yu(t,`themeElements`),`clrScheme`):void 0;return n?Tu(n,!0):{}},Du=[208,207,17,224,161,177,26,225],Ou=class{constructor(e){if(o(this,`currentRelationshipId`,1),o(this,`documentWrapper`,void 0),o(this,`headers`,[]),o(this,`footers`,[]),o(this,`coreProperties`,void 0),o(this,`numbering`,void 0),o(this,`media`,void 0),o(this,`fileRelationships`,void 0),o(this,`footnotesWrapper`,void 0),o(this,`endnotesWrapper`,void 0),o(this,`settings`,void 0),o(this,`contentTypes`,void 0),o(this,`customProperties`,void 0),o(this,`appProperties`,void 0),o(this,`styles`,void 0),o(this,`comments`,void 0),o(this,`commentsExtended`,void 0),o(this,`commentsIds`,void 0),o(this,`fontWrapper`,void 0),o(this,`theme`,void 0),o(this,`packageParts`,void 0),o(this,`macros`,void 0),o(this,`bibliography`,void 0),e.macros!==void 0){let{project:t,events:n=[]}=e.macros,r=t instanceof Uint8Array?t:new Uint8Array(t);if(!Du.every((e,t)=>r[t]===e))throw Error(`macros.project isn't a VBA project. Use createMacros from docx/macros, or the word/vbaProject.bin in a .docm rather than the .docm itself`);let i=new W;n.length>0&&i.addRelationship(1,`http://schemas.microsoft.com/office/2006/relationships/wordVbaData`,`vbaData.xml`),this.macros={project:r,events:n.length>0?wo(n):void 0,relationships:i}}if(this.coreProperties=new mo(m(m({},e),{},{creator:e.creator??`Un-named`,revision:e.revision??1,lastModifiedBy:e.lastModifiedBy??`Un-named`})),this.numbering=new xs(e.numbering?e.numbering:{config:[]}),this.comments=new Lr(e.comments??{children:[]}),this.comments.ThreadData&&(this.commentsExtended=new Vr(this.comments.ThreadData)),this.comments.CommentIdsData&&(this.commentsIds=new Gr(this.comments.CommentIdsData)),this.fileRelationships=new W,this.customProperties=new xo(e.customProperties??[]),this.appProperties=new so,this.footnotesWrapper=new Xo,this.endnotesWrapper=new zo,this.contentTypes=new uo({macros:this.macros!==void 0}),this.macros?.events!==void 0&&this.contentTypes.addOverride(`application/vnd.ms-word.vbaData+xml`,`/word/vbaData.xml`),e.bibliography!==void 0){let t=new W;t.addRelationship(1,`http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXmlProps`,`itemProps1.xml`),this.bibliography={sources:e.bibliography.sources,properties:So(`{${Gt().toUpperCase()}}`),relationships:t},this.contentTypes.addOverride(`application/vnd.openxmlformats-officedocument.customXmlProperties+xml`,`/customXml/itemProps1.xml`)}if(this.packageParts=new Ss(this.contentTypes),this.documentWrapper=new Do({background:e.background,pageNumbers:e.pageNumbers}),this.settings=new Ls({compatibilityModeVersion:e.compatabilityModeVersion,compatibility:e.compatibility,evenAndOddHeaders:!!e.evenAndOddHeaderAndFooters,trackRevisions:e.features?.trackRevisions,updateFields:e.features?.updateFields,embedFonts:e.fonts?.length?!0:void 0,defaultTabStop:e.defaultTabStop,protection:e.protection,hyphenation:{autoHyphenation:e.hyphenation?.autoHyphenation,hyphenationZone:e.hyphenation?.hyphenationZone,consecutiveHyphenLimit:e.hyphenation?.consecutiveHyphenLimit,doNotHyphenateCaps:e.hyphenation?.doNotHyphenateCaps}}),this.media=new es,e.externalStyles!==void 0){let t=e.styles?.default??{},n=Object.entries(kc(t)),r=([e])=>t[e]!==void 0,i=new Ec().newInstance(e.externalStyles);this.styles=new Sc(m(m({},i),{},{paragraphStyles:e.styles?.paragraphStyles,characterStyles:e.styles?.characterStyles,importedStyles:[...n.filter(e=>!r(e)).map(([,e])=>e),...i.importedStyles,...n.filter(r).map(([,e])=>e)]}))}else if(e.styles){let t=new Ac().newInstance(e.styles.default);this.styles=new Sc(m(m({},t),e.styles))}else{let e=new Ac;this.styles=new Sc(e.newInstance())}this.addDefaultRelationships();for(let t of e.sections)this.addSection(t);if(e.footnotes)for(let t in e.footnotes)this.footnotesWrapper.View.createFootNote(parseFloat(t),e.footnotes[t].children);if(e.endnotes)for(let t in e.endnotes)this.endnotesWrapper.View.createEndnote(parseFloat(t),e.endnotes[t].children);this.fontWrapper=new Ei(e.fonts??[]),this.theme=new Gc(e.theme),this.documentWrapper.Relationships.addRelationship(this.currentRelationshipId++,`http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme`,`theme/theme1.xml`),this.macros!==void 0&&this.documentWrapper.Relationships.addRelationship(this.currentRelationshipId++,`http://schemas.microsoft.com/office/2006/relationships/vbaProject`,`vbaProject.bin`),this.bibliography!==void 0&&this.documentWrapper.Relationships.addRelationship(this.currentRelationshipId++,`http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXml`,`../customXml/item1.xml`)}addSection({headers:e={},footers:t={},children:n,properties:r}){this.documentWrapper.View.Body.addSection(m(m({},r),{},{headerWrapperGroup:{default:e.default?this.createHeader(e.default):void 0,first:e.first?this.createHeader(e.first):void 0,even:e.even?this.createHeader(e.even):void 0},footerWrapperGroup:{default:t.default?this.createFooter(t.default):void 0,first:t.first?this.createFooter(t.first):void 0,even:t.even?this.createFooter(t.even):void 0}}));for(let e of n)this.documentWrapper.View.add(e)}createHeader(e){let t=new $o(this.media,this.currentRelationshipId++);for(let n of e.options.children)t.add(n);return this.addHeaderToDocument(t),t}createFooter(e){let t=new Ho(this.media,this.currentRelationshipId++);for(let n of e.options.children)t.add(n);return this.addFooterToDocument(t),t}addHeaderToDocument(e,t=Li.DEFAULT){this.headers.push({header:e,type:t}),this.documentWrapper.Relationships.addRelationship(e.View.ReferenceId,`http://schemas.openxmlformats.org/officeDocument/2006/relationships/header`,`header${this.headers.length}.xml`),this.contentTypes.addHeader(this.headers.length)}addFooterToDocument(e,t=Li.DEFAULT){this.footers.push({footer:e,type:t}),this.documentWrapper.Relationships.addRelationship(e.View.ReferenceId,`http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer`,`footer${this.footers.length}.xml`),this.contentTypes.addFooter(this.footers.length)}addDefaultRelationships(){this.fileRelationships.addRelationship(1,`http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument`,`word/document.xml`),this.fileRelationships.addRelationship(2,`http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties`,`docProps/core.xml`),this.fileRelationships.addRelationship(3,`http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties`,`docProps/app.xml`),this.fileRelationships.addRelationship(4,`http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties`,`docProps/custom.xml`),this.documentWrapper.Relationships.addRelationship(this.currentRelationshipId++,`http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles`,`styles.xml`),this.documentWrapper.Relationships.addRelationship(this.currentRelationshipId++,`http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering`,`numbering.xml`),this.documentWrapper.Relationships.addRelationship(this.currentRelationshipId++,`http://schemas.openxmlformats.org/officeDocument/2006/relationships/footnotes`,`footnotes.xml`),this.documentWrapper.Relationships.addRelationship(this.currentRelationshipId++,`http://schemas.openxmlformats.org/officeDocument/2006/relationships/endnotes`,`endnotes.xml`),this.documentWrapper.Relationships.addRelationship(this.currentRelationshipId++,`http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings`,`settings.xml`),this.comments.IsEmpty||(this.documentWrapper.Relationships.addRelationship(this.currentRelationshipId++,`http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments`,`comments.xml`),this.contentTypes.addComments()),this.commentsExtended&&(this.documentWrapper.Relationships.addRelationship(this.currentRelationshipId++,`http://schemas.microsoft.com/office/2011/relationships/commentsExtended`,`commentsExtended.xml`),this.contentTypes.addCommentsExtended()),this.commentsIds&&(this.documentWrapper.Relationships.addRelationship(this.currentRelationshipId++,`http://schemas.microsoft.com/office/2016/09/relationships/commentsIds`,`commentsIds.xml`),this.contentTypes.addCommentsIds())}get Document(){return this.documentWrapper}get Styles(){return this.styles}get CoreProperties(){return this.coreProperties}get Numbering(){return this.numbering}get Media(){return this.media}get FileRelationships(){return this.fileRelationships}get Headers(){return this.headers.map(e=>e.header)}get Footers(){return this.footers.map(e=>e.footer)}get ContentTypes(){return this.contentTypes}get CustomProperties(){return this.customProperties}get AppProperties(){return this.appProperties}get FootNotes(){return this.footnotesWrapper}get Endnotes(){return this.endnotesWrapper}get Settings(){return this.settings}get Comments(){return this.comments}get CommentsExtended(){return this.commentsExtended}get CommentsIds(){return this.commentsIds}get FontTable(){return this.fontWrapper}get Theme(){return this.theme}get PackageParts(){return this.packageParts}get Macros(){return this.macros}get Bibliography(){return this.bibliography}},ku=0,Au=32,ju=32,Mu=(e,t)=>{let n=t.replace(/-/g,``);if(n.length!==ju)throw Error(`Error: Cannot extract GUID from font filename: ${t}`);let r=n.replace(/(..)/g,`$1 `).trim().split(` `).map(e=>parseInt(e,16));r.reverse();let i=e.slice(ku,Au).map((e,t)=>e^r[t%r.length]),a=new Uint8Array(ku+i.length+Math.max(0,e.length-Au));return a.set(e.slice(0,ku)),a.set(i,ku),a.set(e.slice(Au),ku+i.length),a},Nu=class{format(e,t={stack:[]}){let n=e.prepForXml(t);if(n)return n;throw Error(`XMLComponent did not format correctly`)}},Pu=/\{([^{}]+)\}/g,Fu=(e,t)=>t.size===0?e:e.replace(Pu,(e,n)=>t.get(n)??e),Iu=e=>new Set(Array.from(e.matchAll(Pu),([,e])=>e)),Lu=class{replace(e,t,n){return Fu(e,new Map(t.map((e,t)=>[e.fileName,(n+t).toString()])))}getMediaData(e,t){let n=Iu(e);return t.Array.filter(e=>n.has(e.fileName))}},Ru=class{replace(e,t){return Fu(e,new Map(t.map(({reference:e,instance:t,restartedListId:n,numId:r})=>[bi(e,t,n),r.toString()])))}},zu=new Nu,Bu=(e,t,n,r,i=!0)=>P(zu.format(t,{viewWrapper:{View:t,Relationships:r},file:e,stack:[]}),{indent:n,declaration:i?{standalone:`yes`,encoding:`UTF-8`}:{encoding:`UTF-8`}}),Vu=(e,t,n,r)=>{let{content:i}=t.options;if(i instanceof Uint8Array)return[{data:i,path:`word/${n}`}];if(`files`in i)return[{data:ou(i.files.map(({path:t,content:n})=>[t,n instanceof Uint8Array?n:Bu(e,n,r,new W)])),path:`word/${n}`}];let a=e.PackageParts.createRelationships(n),o=Bu(e,i,r,a),s=n.slice(0,n.lastIndexOf(`/`)),c=n.slice(n.lastIndexOf(`/`)+1);return[{data:o,path:`word/${n}`},...a.RelationshipCount>0?[{data:Bu(e,a,r,a,!1),path:`word/${s}/_rels/${c}.rels`}]:[]]},Hu=(e,t,n=0)=>{let r=e.PackageParts.Array.slice(n);return r.length===0?[]:[...r.flatMap(({part:n,path:r})=>Vu(e,n,r,t)),...Hu(e,t,n+r.length)]},Uu=[`PackageParts`],Wu=class{constructor(){o(this,`formatter`,void 0),o(this,`imageReplacer`,void 0),o(this,`numberingReplacer`,void 0),this.formatter=new Nu,this.imageReplacer=new Lu,this.numberingReplacer=new Ru}compile(e,t,n=[]){let r=this.xmlifyFile(e,t),{PackageParts:i}=r,a=y(r,Uu),o=Object.values(a).flatMap(e=>Array.isArray(e)?e:[e]);return new Map([...o.map(({path:e,data:t})=>[e,t]),...i.map(({path:e,data:t})=>[e,t]),...n.map(({path:e,data:t})=>[e,t]),...e.Macros===void 0?[]:[[`word/vbaProject.bin`,e.Macros.project]],...e.Media.Array.flatMap(e=>e.type===`svg`?[[`word/media/${e.fileName}`,e.data],[`word/media/${e.fallback.fileName}`,e.fallback.data]]:[[`word/media/${e.fileName}`,e.data]]),...e.FontTable.files.map(({data:e,fontKey:t},n)=>[`word/fonts/font${n+1}.odttf`,Mu(e,t)])])}xmlifyFile(e,t){let n=P(this.formatter.format(e.Document.View,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:`yes`,encoding:`UTF-8`}}),r=P(this.formatter.format(e.Comments,{viewWrapper:{View:e.Comments,Relationships:e.Comments.Relationships},file:e,stack:[]}),{indent:t,declaration:{standalone:`yes`,encoding:`UTF-8`}}),i=P(this.formatter.format(e.FootNotes.View,{viewWrapper:e.FootNotes,file:e,stack:[]}),{indent:t,declaration:{standalone:`yes`,encoding:`UTF-8`}}),a=P(this.formatter.format(e.Endnotes.View,{viewWrapper:e.Endnotes,file:e,stack:[]}),{indent:t,declaration:{encoding:`UTF-8`}}),o=e.Document.Relationships.RelationshipCount+1,s=e.Comments.Relationships.RelationshipCount+1,c=e.FootNotes.Relationships.RelationshipCount+1,l=e.Endnotes.Relationships.RelationshipCount+1,u=this.imageReplacer.getMediaData(n,e.Media),d=this.imageReplacer.getMediaData(r,e.Media),f=this.imageReplacer.getMediaData(i,e.Media),p=this.imageReplacer.getMediaData(a,e.Media);return m(m(m(m(m(m({Relationships:{data:(()=>{let n=W.copy(e.Document.Relationships);return u.forEach((e,t)=>{n.addRelationship(o+t,`http://schemas.openxmlformats.org/officeDocument/2006/relationships/image`,`media/${e.fileName}`)}),n.addRelationship(n.RelationshipCount+1,`http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable`,`fontTable.xml`),P(this.formatter.format(n,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{encoding:`UTF-8`}})})(),path:`word/_rels/document.xml.rels`},Document:{data:(()=>{let t=this.imageReplacer.replace(n,u,o);return this.numberingReplacer.replace(t,e.Numbering.ConcreteNumbering)})(),path:`word/document.xml`},Styles:{data:(()=>{let n=P(this.formatter.format(e.Styles,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:`yes`,encoding:`UTF-8`}});return this.numberingReplacer.replace(n,e.Numbering.ConcreteNumbering)})(),path:`word/styles.xml`},Properties:{data:P(this.formatter.format(e.CoreProperties,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:`yes`,encoding:`UTF-8`}}),path:`docProps/core.xml`},FileRelationships:{data:P(this.formatter.format(e.FileRelationships,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{encoding:`UTF-8`}}),path:`_rels/.rels`},HeaderRelationships:e.Headers.map((n,r)=>{let i=P(this.formatter.format(n.View,{viewWrapper:n,file:e,stack:[]}),{indent:t,declaration:{encoding:`UTF-8`}}),a=this.imageReplacer.getMediaData(i,e.Media),o=W.copy(n.Relationships);return a.forEach((e,t)=>{o.addRelationship(t,`http://schemas.openxmlformats.org/officeDocument/2006/relationships/image`,`media/${e.fileName}`)}),{data:P(this.formatter.format(o,{viewWrapper:n,file:e,stack:[]}),{indent:t,declaration:{encoding:`UTF-8`}}),path:`word/_rels/header${r+1}.xml.rels`}}),FooterRelationships:e.Footers.map((n,r)=>{let i=P(this.formatter.format(n.View,{viewWrapper:n,file:e,stack:[]}),{indent:t,declaration:{encoding:`UTF-8`}}),a=this.imageReplacer.getMediaData(i,e.Media),o=W.copy(n.Relationships);return a.forEach((e,t)=>{o.addRelationship(t,`http://schemas.openxmlformats.org/officeDocument/2006/relationships/image`,`media/${e.fileName}`)}),{data:P(this.formatter.format(o,{viewWrapper:n,file:e,stack:[]}),{indent:t,declaration:{encoding:`UTF-8`}}),path:`word/_rels/footer${r+1}.xml.rels`}}),Headers:e.Headers.map((n,r)=>{let i=P(this.formatter.format(n.View,{viewWrapper:n,file:e,stack:[]}),{indent:t,declaration:{encoding:`UTF-8`}}),a=this.imageReplacer.getMediaData(i,e.Media),o=this.imageReplacer.replace(i,a,0);return{data:this.numberingReplacer.replace(o,e.Numbering.ConcreteNumbering),path:`word/header${r+1}.xml`}}),Footers:e.Footers.map((n,r)=>{let i=P(this.formatter.format(n.View,{viewWrapper:n,file:e,stack:[]}),{indent:t,declaration:{encoding:`UTF-8`}}),a=this.imageReplacer.getMediaData(i,e.Media),o=this.imageReplacer.replace(i,a,0);return{data:this.numberingReplacer.replace(o,e.Numbering.ConcreteNumbering),path:`word/footer${r+1}.xml`}}),CustomProperties:{data:P(this.formatter.format(e.CustomProperties,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:`yes`,encoding:`UTF-8`}}),path:`docProps/custom.xml`},AppProperties:{data:P(this.formatter.format(e.AppProperties,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:`yes`,encoding:`UTF-8`}}),path:`docProps/app.xml`},FootNotes:{data:(()=>{let t=this.imageReplacer.replace(i,f,c);return this.numberingReplacer.replace(t,e.Numbering.ConcreteNumbering)})(),path:`word/footnotes.xml`},FootNotesRelationships:{data:(()=>{let n=W.copy(e.FootNotes.Relationships);return f.forEach((e,t)=>{n.addRelationship(c+t,`http://schemas.openxmlformats.org/officeDocument/2006/relationships/image`,`media/${e.fileName}`)}),P(this.formatter.format(n,{viewWrapper:e.FootNotes,file:e,stack:[]}),{indent:t,declaration:{encoding:`UTF-8`}})})(),path:`word/_rels/footnotes.xml.rels`},Endnotes:{data:(()=>{let t=this.imageReplacer.replace(a,p,l);return this.numberingReplacer.replace(t,e.Numbering.ConcreteNumbering)})(),path:`word/endnotes.xml`},EndnotesRelationships:{data:(()=>{let n=W.copy(e.Endnotes.Relationships);return p.forEach((e,t)=>{n.addRelationship(l+t,`http://schemas.openxmlformats.org/officeDocument/2006/relationships/image`,`media/${e.fileName}`)}),P(this.formatter.format(n,{viewWrapper:e.Endnotes,file:e,stack:[]}),{indent:t,declaration:{encoding:`UTF-8`}})})(),path:`word/_rels/endnotes.xml.rels`},Settings:{data:P(this.formatter.format(e.Settings,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:`yes`,encoding:`UTF-8`}}),path:`word/settings.xml`}},e.Comments.IsEmpty?{}:{Comments:{data:(()=>{let t=this.imageReplacer.replace(r,d,s);return this.numberingReplacer.replace(t,e.Numbering.ConcreteNumbering)})(),path:`word/comments.xml`},CommentsRelationships:{data:(()=>{let n=W.copy(e.Comments.Relationships);return d.forEach((e,t)=>{n.addRelationship(s+t,`http://schemas.openxmlformats.org/officeDocument/2006/relationships/image`,`media/${e.fileName}`)}),P(this.formatter.format(n,{viewWrapper:{View:e.Comments,Relationships:e.Comments.Relationships},file:e,stack:[]}),{indent:t,declaration:{encoding:`UTF-8`}})})(),path:`word/_rels/comments.xml.rels`}}),e.CommentsExtended?{CommentsExtended:{data:P(this.formatter.format(e.CommentsExtended,{viewWrapper:{View:e.CommentsExtended,Relationships:e.Comments.Relationships},file:e,stack:[]}),{indent:t,declaration:{standalone:`yes`,encoding:`UTF-8`}}),path:`word/commentsExtended.xml`}}:{}),e.CommentsIds?{CommentsIds:{data:P(this.formatter.format(e.CommentsIds,{viewWrapper:{View:e.CommentsIds,Relationships:e.Comments.Relationships},file:e,stack:[]}),{indent:t,declaration:{standalone:`yes`,encoding:`UTF-8`}}),path:`word/commentsIds.xml`}}:{}),{},{FontTable:{data:P(this.formatter.format(e.FontTable.View,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:`yes`,encoding:`UTF-8`}}),path:`word/fontTable.xml`},FontTableRelationships:{data:P(this.formatter.format(e.FontTable.Relationships,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{encoding:`UTF-8`}}),path:`word/_rels/fontTable.xml.rels`},Theme:{data:P(this.formatter.format(e.Theme,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:`yes`,encoding:`UTF-8`}}),path:`word/theme/theme1.xml`}},e.Macros?.events?{MacroEvents:{data:P(this.formatter.format(e.Macros.events,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:`yes`,encoding:`UTF-8`}}),path:`word/vbaData.xml`},MacroRelationships:{data:P(this.formatter.format(e.Macros.relationships,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{encoding:`UTF-8`}}),path:`word/_rels/vbaProject.bin.rels`}}:{}),e.Bibliography?{BibliographySources:{data:P(this.formatter.format(e.Bibliography.sources,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:`yes`,encoding:`UTF-8`}}),path:`customXml/item1.xml`},BibliographySourcesProperties:{data:P(this.formatter.format(e.Bibliography.properties,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:`no`,encoding:`UTF-8`}}),path:`customXml/itemProps1.xml`},BibliographySourcesRelationships:{data:P(this.formatter.format(e.Bibliography.relationships,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:`yes`,encoding:`UTF-8`}}),path:`customXml/_rels/item1.xml.rels`}}:{}),{},{PackageParts:Hu(e,t),Numbering:{data:P(this.formatter.format(e.Numbering,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:`yes`,encoding:`UTF-8`}}),path:`word/numbering.xml`},ContentTypes:{data:P(this.formatter.format(e.ContentTypes,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{encoding:`UTF-8`}}),path:`[Content_Types].xml`}})}},Gu=n(((e,t)=>{var n=typeof Reflect==`object`?Reflect:null,r=n&&typeof n.apply==`function`?n.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)},i=n&&typeof n.ownKeys==`function`?n.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};function a(e){console&&console.warn&&console.warn(e)}var o=Number.isNaN||function(e){return e!==e};function s(){s.init.call(this)}t.exports=s,t.exports.once=y,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var c=10;function l(e){if(typeof e!=`function`)throw TypeError(`The "listener" argument must be of type Function. Received type `+typeof e)}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return c},set:function(e){if(typeof e!=`number`||e<0||o(e))throw RangeError(`The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received `+e+`.`);c=e}}),s.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(e){if(typeof e!=`number`||e<0||o(e))throw RangeError(`The value of "n" is out of range. It must be a non-negative number. Received `+e+`.`);return this._maxListeners=e,this};function u(e){return e._maxListeners===void 0?s.defaultMaxListeners:e._maxListeners}s.prototype.getMaxListeners=function(){return u(this)},s.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var i=e===`error`,a=this._events;if(a!==void 0)i&&=a.error===void 0;else if(!i)return!1;if(i){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var s=Error(`Unhandled error.`+(o?` (`+o.message+`)`:``));throw s.context=o,s}var c=a[e];if(c===void 0)return!1;if(typeof c==`function`)r(c,this,t);else for(var l=c.length,u=g(c,l),n=0;n<l;++n)r(u[n],this,t);return!0};function d(e,t,n,r){var i,o,s;if(l(n),o=e._events,o===void 0?(o=e._events=Object.create(null),e._eventsCount=0):(o.newListener!==void 0&&(e.emit(`newListener`,t,n.listener?n.listener:n),o=e._events),s=o[t]),s===void 0)s=o[t]=n,++e._eventsCount;else if(typeof s==`function`?s=o[t]=r?[n,s]:[s,n]:r?s.unshift(n):s.push(n),i=u(e),i>0&&s.length>i&&!s.warned){s.warned=!0;var c=Error(`Possible EventEmitter memory leak detected. `+s.length+` `+String(t)+` listeners added. Use emitter.setMaxListeners() to increase limit`);c.name=`MaxListenersExceededWarning`,c.emitter=e,c.type=t,c.count=s.length,a(c)}return e}s.prototype.addListener=function(e,t){return d(this,e,t,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(e,t){return d(this,e,t,!0)};function f(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=f.bind(r);return i.listener=n,r.wrapFn=i,i}s.prototype.once=function(e,t){return l(t),this.on(e,p(this,e,t)),this},s.prototype.prependOnceListener=function(e,t){return l(t),this.prependListener(e,p(this,e,t)),this},s.prototype.removeListener=function(e,t){var n,r,i,a,o;if(l(t),r=this._events,r===void 0||(n=r[e],n===void 0))return this;if(n===t||n.listener===t)--this._eventsCount===0?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit(`removeListener`,e,n.listener||t));else if(typeof n!=`function`){for(i=-1,a=n.length-1;a>=0;a--)if(n[a]===t||n[a].listener===t){o=n[a].listener,i=a;break}if(i<0)return this;i===0?n.shift():_(n,i),n.length===1&&(r[e]=n[0]),r.removeListener!==void 0&&this.emit(`removeListener`,e,o||t)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(e){var t,n=this._events,r;if(n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments.length===0){var i=Object.keys(n),a;for(r=0;r<i.length;++r)a=i[r],a!==`removeListener`&&this.removeAllListeners(a);return this.removeAllListeners(`removeListener`),this._events=Object.create(null),this._eventsCount=0,this}if(t=n[e],typeof t==`function`)this.removeListener(e,t);else if(t!==void 0)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this};function m(e,t,n){var r=e._events;if(r===void 0)return[];var i=r[t];return i===void 0?[]:typeof i==`function`?n?[i.listener||i]:[i]:n?v(i):g(i,i.length)}s.prototype.listeners=function(e){return m(this,e,!0)},s.prototype.rawListeners=function(e){return m(this,e,!1)},s.listenerCount=function(e,t){return typeof e.listenerCount==`function`?e.listenerCount(t):h.call(e,t)},s.prototype.listenerCount=h;function h(e){var t=this._events;if(t!==void 0){var n=t[e];if(typeof n==`function`)return 1;if(n!==void 0)return n.length}return 0}s.prototype.eventNames=function(){return this._eventsCount>0?i(this._events):[]};function g(e,t){for(var n=Array(t),r=0;r<t;++r)n[r]=e[r];return n}function _(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}function v(e){for(var t=Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}function y(e,t){return new Promise(function(n,r){function i(n){e.removeListener(t,a),r(n)}function a(){typeof e.removeListener==`function`&&e.removeListener(`error`,i),n([].slice.call(arguments))}x(e,t,a,{once:!0}),t!==`error`&&b(e,i,{once:!0})})}function b(e,t,n){typeof e.on==`function`&&x(e,`error`,t,n)}function x(e,t,n,r){if(typeof e.on==`function`)r.once?e.once(t,n):e.on(t,n);else if(typeof e.addEventListener==`function`)e.addEventListener(t,function i(a){r.once&&e.removeEventListener(t,i),n(a)});else throw TypeError(`The "emitter" argument must be of type EventEmitter. Received type `+typeof e)}}))(),Ku=class extends Gu.EventEmitter{pipe(e,t){let n=this,r=e,i=e=>{r.writable&&!1===r.write(e)&&n.pause&&n.pause()};n.on(`data`,i);let a=()=>{n.readable&&n.resume&&n.resume()};r.on(`drain`,a),r._isStdio||t&&t.end===!1||(n.on(`end`,s),n.on(`close`,c));let o=!1;function s(){o||(o=!0,r.end())}function c(){o||(o=!0,typeof r.destroy==`function`&&r.destroy())}function l(e){if(u(),Gu.EventEmitter.listenerCount(this,`error`)===0)throw e}n.on(`error`,l),r.on(`error`,l);function u(){n.removeListener(`data`,i),r.removeListener(`drain`,a),n.removeListener(`end`,s),n.removeListener(`close`,c),n.removeListener(`error`,l),r.removeListener(`error`,l),n.removeListener(`end`,u),n.removeListener(`close`,u),r.removeListener(`close`,u)}return n.on(`end`,u),n.on(`close`,u),r.on(`close`,u),r.emit(`pipe`,n),r}};function qu(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,i)}function Ju(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var a=e.apply(t,n);function o(e){qu(a,r,i,o,s,`next`,e)}function s(e){qu(a,r,i,o,s,`throw`,e)}o(void 0)})}}var Yu={NONE:``,WITH_2_BLANKS:` `,WITH_4_BLANKS:` `,WITH_TAB:` `},Xu=e=>e===!0?Yu.WITH_2_BLANKS:e===!1?void 0:e,Zu=e=>e.Macros===void 0?`application/vnd.openxmlformats-officedocument.wordprocessingml.document`:`application/vnd.ms-word.document.macroEnabled.12`,Qu=class e{static pack(e,t,n){var r=this;return Ju(function*(e,t,n,i=[]){return pu(ou(r.compiler.compile(e,Xu(n),i)),t,Zu(e))}).apply(this,arguments)}static toString(t,n,r=[]){return e.pack(t,`string`,n,r)}static toBuffer(t,n,r=[]){return e.pack(t,`nodebuffer`,n,r)}static toBase64String(t,n,r=[]){return e.pack(t,`base64`,n,r)}static toBlob(t,n,r=[]){return e.pack(t,`blob`,n,r)}static toArrayBuffer(t,n,r=[]){return e.pack(t,`arraybuffer`,n,r)}static toStream(e,t,n=[]){let r=new Ku,i=this.compiler.compile(e,Xu(t),n);return new Promise(e=>setTimeout(e)).then(()=>pu(ou(i),`nodebuffer`,Zu(e))).then(e=>{r.emit(`data`,e),r.emit(`end`)},e=>r.emit(`error`,e)),r}};o(Qu,`compiler`,new Wu);var $u=e=>{if(e.name!==`w:bookmarkStart`&&e.name!==`w:bookmarkEnd`)return;let t=Number(e.attributes?.[`w:id`]);return Number.isInteger(t)?t:void 0},ed=e=>{let t=$u(e);return[...t===void 0?[]:[t],...(e.elements??[]).flatMap(ed)]},td=e=>{let t=new Set(e),n=new Map,r=e.reduce((e,t)=>Math.max(e,t),0),i=e=>{let i=n.get(e);if(i!==void 0)return i;let a=t.has(e)?r+1:e;return r=Math.max(r,a),t.add(a),n.set(e,a),a},a=e=>{let t=$u(e);return m(m(m({},e),t===void 0?{}:{attributes:m(m({},e.attributes),{},{"w:id":String(i(t))})}),e.elements===void 0?{}:{elements:e.elements.map(a)})};return e=>e.map(a)},nd=new Nu,rd=e=>new TextDecoder(`utf-8`,{ignoreBOM:!0}).decode(e),id=e=>D(e,{keepWhitespaceText:!0}),ad=e=>id(P(nd.format(new cn({text:e})))).elements[0].elements??[],od=e=>m(m({},e),{},{attributes:{"xml:space":`preserve`}}),Q=(e,t)=>{let n=e.elements?.find(e=>e.name===t);return n===void 0?[]:(n.elements??=[],n.elements)},sd=(e,t,n)=>{let r=Q(e,`Types`);r.some(e=>{var r,i;return e.type===`element`&&e.name===`Default`&&(e==null||(r=e.attributes)==null?void 0:r.ContentType)===t&&(e==null||(i=e.attributes)==null?void 0:i.Extension)===n})||r.push({attributes:{ContentType:t,Extension:n},name:`Default`,type:`element`})},cd=(e,t,n)=>{let r=Q(e,`Types`);r.some(e=>e.type===`element`&&e.name===`Override`&&e.attributes?.PartName===n)||r.push({attributes:{ContentType:t,PartName:n},name:`Override`,type:`element`})},ld=(e,t)=>{let n=e.elements?.find(e=>e.name===`Types`);n?.elements!==void 0&&(n.elements=n.elements.filter(e=>e.name!==`Override`||String(e.attributes?.PartName??``).toLowerCase()!==t.toLowerCase()))},ud=e=>{let t=parseInt(e.substring(3),10);return isNaN(t)?0:t},dd=e=>Q(e,`Relationships`).map(e=>{var t;return ud(((t=e.attributes)==null||(t=t.Id)==null?void 0:t.toString())??``)}).reduce((e,t)=>Math.max(e,t),0)+1,fd=(e,t,n,r,i)=>{let a=Q(e,`Relationships`);return a.push({attributes:{Id:`rId${t}`,Type:n,Target:r,TargetMode:i},name:`Relationship`,type:`element`}),a},pd=()=>({declaration:{attributes:{version:`1.0`,encoding:`UTF-8`,standalone:`yes`}},elements:[{type:`element`,name:`Relationships`,attributes:{xmlns:`http://schemas.openxmlformats.org/package/2006/relationships`},elements:[]}]}),md=`http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties`,hd=`application/vnd.openxmlformats-package.core-properties+xml`,gd=`_rels/.rels`,_d=`docProps/core.xml`,vd={cp:`http://schemas.openxmlformats.org/package/2006/metadata/core-properties`,dc:`http://purl.org/dc/elements/1.1/`},yd={title:{namespace:`dc`,name:`title`},subject:{namespace:`dc`,name:`subject`},creator:{namespace:`dc`,name:`creator`},keywords:{namespace:`cp`,name:`keywords`},description:{namespace:`dc`,name:`description`},lastModifiedBy:{namespace:`cp`,name:`lastModifiedBy`},revision:{namespace:`cp`,name:`revision`}},bd=e=>e===``?[]:[{type:`text`,text:String(e)}],xd=e=>e.name?.slice(e.name.indexOf(`:`)+1),Sd=(e,t)=>{let n=Object.entries(m({},e.attributes)).find(([e,n])=>(e===`xmlns`||e.startsWith(`xmlns:`))&&n===vd[t])?.[0];return n===void 0?(e.attributes=m(m({},e.attributes),{},{[`xmlns:${t}`]:vd[t]}),`${t}:`):n===`xmlns`?``:`${n.slice(6)}:`},Cd=e=>{let t=e[0]===255&&e[1]===254?`utf-16le`:e[0]===254&&e[1]===255?`utf-16be`:`utf-8`;return new TextDecoder(t).decode(e)},wd=(e,t,n)=>{let r=t.get(n);if(r===void 0)return e.get(n);let i=id(Cd(r));return i.declaration?.attributes&&(i.declaration.attributes.encoding=`UTF-8`),t.delete(n),e.set(n,i),i},Td=e=>{var t;let n=e.get(gd)??pd(),r=(t=Q(n,`Relationships`).find(e=>e.attributes?.Type===md))==null||(t=t.attributes)==null?void 0:t.Target;return typeof r==`string`?Yc(``,r):(fd(n,dd(n),md,_d),e.set(gd,n),_d)},Ed=(e,t,n,{addContentTypeOverride:r})=>{let i=Td(e),a=wd(e,t,i),o=a??{declaration:{attributes:{version:`1.0`,encoding:`UTF-8`,standalone:`yes`}},elements:[{type:`element`,name:`cp:coreProperties`,attributes:{"xmlns:cp":vd.cp},elements:[]}]};a===void 0&&(e.set(i,o),r(hd,`/${i}`));let s=o.elements?.find(e=>xd(e)===`coreProperties`);if(s===void 0)throw Error(`Could not find the core properties in ${i}`);s.elements??=[];for(let[e,{namespace:t,name:r}]of Object.entries(yd)){let i=n[e];if(i===void 0)continue;let a=s.elements.find(e=>xd(e)===r);a?a.elements=bd(i):s.elements.push({type:`element`,name:`${Sd(s,t)}${r}`,elements:bd(i)})}},Dd=new Set([`wp:inline`,`wp:anchor`]),Od=new Set([`wp:docPr`,`wps:cNvPr`,`wpg:cNvPr`]),kd=new Set([`a:stCxn`,`a:endCxn`]),Ad=(e,t)=>{if(!t.has(e.name??``))return;let n=Number(e.attributes?.id);return Number.isInteger(n)?n:void 0},jd=e=>{let t=Ad(e,Od);return[...t===void 0?[]:[t],...(e.elements??[]).flatMap(jd)]},Md=e=>{let t=e=>{let n=Ad(e,Od);return[...n===void 0?[]:[n],...(e.elements??[]).flatMap(e=>Dd.has(e.name??``)?[]:t(e))]};return t(e)},Nd=e=>{let t=new Set(e),n=e.reduce((e,t)=>Math.max(e,t),0),r=e=>{let r=t.has(e)?n+1:e;return n=Math.max(n,r),t.add(r),r},i=e=>{let t=new Map([...new Set(Md(e))].map(e=>[e,r(e)])),n=r=>{if(r!==e&&Dd.has(r.name??``))return i(r);let a=Ad(r,Od)??Ad(r,kd),o=a===void 0?void 0:t.get(a);return m(m(m({},r),o===void 0?{}:{attributes:m(m({},r.attributes),{},{id:String(o)})}),r.elements===void 0?{}:{elements:r.elements.map(n)})};return n(e)},a=e=>Dd.has(e.name??``)?i(e):m(m({},e),e.elements===void 0?{}:{elements:e.elements.map(a)});return e=>e.map(a)},$={DOCUMENT:`file`,PARAGRAPH:`paragraph`,TABLE_ROWS:`tableRows`,DRAWING:`drawing`},Pd=new Map([[`wp:inline`,`wp:docPr`],[`wp:anchor`,`wp:docPr`],[`wpg:graphicFrame`,`wpg:cNvPr`],[`wpc:graphicFrame`,`wpg:cNvPr`]]),Fd=e=>(e.elements??[]).flatMap(e=>{let t=e.name===void 0?void 0:Pd.get(e.name),n=t===void 0?void 0:e.elements?.find(e=>e.name===t);return[...n?[{element:e,properties:n}]:[],...Fd(e)]}),Id=e=>[e.attributes?.descr,e.attributes?.title].flatMap(e=>e===void 0?[]:[String(e)]),Ld=`[Content_Types].xml`,Rd=e=>(e.elements?.some(e=>e.name===`Relationships`)||(e.elements=[...e.elements??[],...pd().elements]),Q(e,`Relationships`)),zd=`http://schemas.openxmlformats.org/officeDocument/2006/relationships`,Bd=e=>new Set([`r`,...Object.entries(e.attributes??{}).flatMap(([e,t])=>e.startsWith(`xmlns:`)&&t===zd?[e.slice(6)]:[]),...(e.elements??[]).flatMap(e=>[...Bd(e)])]),Vd=(e,t)=>new Set([...Object.entries(e.attributes??{}).flatMap(([e,n])=>e.includes(`:`)&&t.has(e.slice(0,e.indexOf(`:`)))?[String(n)]:[]),...(e.elements??[]).flatMap(e=>[...Vd(e,t)])]),Hd=(e,t)=>{let n=n=>e.has(n)||t.has(n),r=r=>{if(n(r))return r;let i=(()=>{try{return decodeURI(r)}catch{return}})();if(i!==void 0&&n(i))return i;let a=r.toLowerCase();return[...e.keys(),...t.keys()].find(e=>e.toLowerCase()===a)},i=(t,n)=>{let r=e.get(Kc(t));return r===void 0?void 0:Q(r,`Relationships`).find(e=>e.name===`Relationship`&&e.attributes?.Id===n)},a=(e,t)=>{let n=t.attributes?.Target;return t.attributes?.TargetMode===`External`||n===void 0?void 0:r(Yc(e,String(n)))},o=t=>[...e].some(([e,n])=>e.endsWith(`.rels`)&&Q(n,`Relationships`).some(n=>a(qc(e),n)===t)),s=(n,r)=>{if(r===void 0||r===n||r===Ld||r.endsWith(`.rels`)||o(r))return;let i=e.get(Kc(r));e.delete(r),t.delete(r),e.delete(Kc(r));let c=e.get(Ld);c!==void 0&&ld(c,`/${r}`);for(let e of i===void 0?[]:Q(i,`Relationships`))s(r,a(r,e))};return{findRelationship:i,pathOf:a,removeIfUnreferenced:s,removeRelationships:(t,n)=>{var r;let i=(r=e.get(Kc(t)))==null||(r=r.elements)==null?void 0:r.find(e=>e.name===`Relationships`),o=(i?.elements??[]).filter(e=>e.name===`Relationship`&&n.has(String(e.attributes?.Id)));if(i!==void 0&&o.length!==0){i.elements=i.elements.filter(e=>!o.includes(e));for(let e of o)s(t,a(t,e))}}}},Ud=(e,{findRelationship:t,pathOf:n,removeIfUnreferenced:r},i,a)=>{let o=new Nu;return{getRelatedPart:(r,i)=>{let a=t(r.path,i),o=a===void 0?void 0:n(r.path,a);return o===void 0?void 0:{path:o,xml:e.get(o)}},replaceRelatedPart:(a,o,s)=>{let c=`word/${i.PackageParts.add(s)}`,{relationshipType:l}=s.options,u=Xc(a.path,c),d=o===void 0?void 0:t(a.path,o);if(d===void 0){let t=Kc(a.path),n=e.get(t)??pd();e.set(t,n);let r=o??`rId${dd(n)}`;return Rd(n).push({type:`element`,name:`Relationship`,attributes:{Id:r,Type:l,Target:u}}),r}let f=n(a.path,d);return d.attributes=m(m({},Object.fromEntries(Object.entries(d.attributes).filter(([e])=>e!==`TargetMode`))),{},{Type:l,Target:u}),r(a.path,f),String(d.attributes.Id)},format:e=>id(P(o.format(e,a))).elements[0]}},Wd=({parts:e,binaryParts:t,file:n,patches:r,delimiters:i},a)=>{let o=r.map(([e,t])=>({placeholder:`${i.start}${e}${i.end}`,patch:t})),s=[...e].filter(([e])=>e.startsWith(`word/`)&&!e.endsWith(`.rels`)).flatMap(([e,t])=>Fd(t).flatMap(n=>{let r=Id(n.properties),i=o.filter(({placeholder:e})=>r.some(t=>t.includes(e)));if(i.length>1)throw Error(`The drawing "${n.properties.attributes?.name??``}" in ${e} has the placeholders ${i.map(({placeholder:e})=>e).join(` and `)} in its alt text. A drawing can only be patched once`);return i.map(({placeholder:r,patch:i})=>({drawing:m(m({placeholder:r},n),{},{part:{path:e,xml:t}}),patch:i}))})),c=Hd(e,t);for(let{drawing:t,patch:r}of s){let i=Vd(t.element,Bd(t.part.xml));r.patch(t,Ud(e,c,n,a(t.part.path)));let o=Vd(t.part.xml,Bd(t.part.xml));c.removeRelationships(t.part.path,new Set([...i].filter(e=>!o.has(e))))}},Gd=e=>typeof e==`object`&&!!e&&`on`in e&&typeof e.on==`function`,Kd=e=>typeof e==`object`&&!!e&&`generateAsync`in e&&typeof e.generateAsync==`function`,qd=e=>[`[object Blob]`,`[object File]`].includes(Object.prototype.toString.call(e)),Jd=e=>new Promise((t,n)=>{let r=[];e.on(`data`,e=>{ArrayBuffer.isView(e)?r.push(new Uint8Array(e.buffer,e.byteOffset,e.byteLength)):typeof e==`number`?r.push(e):n(TypeError(`A template stream must give bytes, but it gave a ${typeof e}. A stream with an encoding set gives text, so do not set one.`))}),e.on(`error`,n),e.on(`end`,()=>{let e=new Uint8Array(r.reduce((e,t)=>e+(typeof t==`number`?1:t.length),0));r.reduce((t,n)=>typeof n==`number`?(e[t]=n,t+1):(e.set(n,t),t+n.length),0),t(e)})}),Yd=function(){var e=Ju(function*(e){return Kd(e)?e.generateAsync({type:`uint8array`}):Gd(e)?Jd(e):qd(e)?new Uint8Array(yield e.arrayBuffer()):typeof e==`string`?Uint8Array.from({length:e.length},(t,n)=>e.charCodeAt(n)):Array.isArray(e)?Uint8Array.from(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(e)});return function(t){return e.apply(this,arguments)}}(),Xd=function(){var e=Ju(function*(e,t){return lu(yield Yd(e),t)});return function(t,n){return e.apply(this,arguments)}}(),Zd=new Nu,Qd=`word/document.xml`,$d={path:`word/footnotes.xml`,rootName:`w:footnotes`,noteName:`w:footnote`,referenceName:`w:footnoteReference`,contentType:`application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml`,relationshipType:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/footnotes`,create:{part:()=>new Yo,mark:()=>new Go,styles:()=>[new oc({}),new cc({}),new sc({})]}},ef={path:`word/endnotes.xml`,rootName:`w:endnotes`,noteName:`w:endnote`,referenceName:`w:endnoteReference`,contentType:`application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml`,relationshipType:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/endnotes`,create:{part:()=>new Ro,mark:()=>new jo,styles:()=>[new lc({}),new dc({}),new uc({})]}},tf=(e,t)=>id(P(Zd.format(e,t))).elements[0],nf=(e,t)=>{let n=t.includes(e.name??``)?Number(e.attributes?.[`w:id`]):NaN;return[...Number.isInteger(n)?[n]:[],...(e.elements??[]).flatMap(e=>nf(e,t))]},rf=(e,t)=>{let n=e.elements??[],r=+(n[0]?.name===`w:pPr`);return m(m({},e),{},{elements:[...n.slice(0,r),t,...n.slice(r)]})},af=(e,t,n,{createContext:r,addContentTypeOverride:i,renumberBookmarks:a,renumberDrawings:o,renumberLists:s,useStyles:c})=>{let l=new Map(Object.entries(t).map(([e,t])=>[Number(e),t])),u=new Map,d=[...l.keys()].filter(Number.isFinite).reduce((e,t)=>Math.max(e,Math.floor(t)),0),f=new Map,p,h=t=>{let r=t.name===e.referenceName?l.get(Number(t.attributes?.[`w:id`])):void 0;return r===void 0?t.elements===void 0?t:m(m({},t),{},{elements:t.elements.map(h)}):(p=(p??[...n.values()].flatMap(t=>nf(t,[e.noteName,e.referenceName])).reduce((e,t)=>Math.max(e,t),0))+1,f.set(p,r),m(m({},t),{},{attributes:m(m({},t.attributes),{},{"w:id":String(p)})}))},g=()=>{let t=Q(n.get(Kc(Qd))??{},`Relationships`).find(t=>t.attributes?.Type===e.relationshipType),a=t?Yc(Qd,String(t.attributes.Target)):e.path;return n.has(a)||(n.set(a,{declaration:{attributes:{version:`1.0`,encoding:`UTF-8`,standalone:`yes`}},elements:[tf(e.create.part(),r(a))]}),i(e.contentType,`/${a}`)),t||r(Qd).viewWrapper.Relationships.addRelationship(Ut(),e.relationshipType,Xc(Qd,a)),a};return{renumber:e=>e.map(h),write:()=>{if(f.size===0)return;let t=g(),i=r(t),l=new Map([...new Set(f.values())].map(t=>{let n=tf(e.create.mark(),i);return[t,c(s(a(t.children.map(e=>tf(e,i)).map((e,t)=>t===0?rf(e,n):e))))]}));Q(n.get(t),e.rootName).push(...[...f].map(([t,n])=>({type:`element`,name:e.noteName,attributes:{"w:id":String(t)},elements:[...o(l.get(n))]})));let u=n.get(`word/styles.xml`);if(u){let t=Q(u,`w:styles`),n=new Set(t.map(e=>e.attributes?.[`w:styleId`]));t.push(...e.create.styles().map(e=>tf(e,i)).filter(e=>!n.has(e.attributes?.[`w:styleId`])))}},carry:(e,t)=>{let n=u.get(e);return n===void 0?(d++,l.set(d,t),u.set(e,d),d):n}}},of=({footnotes:e={},endnotes:t={}},n,r)=>{let i={footnotes:af($d,e,n,r),endnotes:af(ef,t,n,r)};return{carry:(e,t,n)=>i[e].carry(t,n),renumber:e=>Object.values(i).reduce((e,t)=>t.renumber(e),e),write:()=>{for(let e of Object.values(i))e.write()}}},sf=new Nu,cf=`word/document.xml`,lf=`word/numbering.xml`,uf=`application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml`,df=`http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering`,ff=`default-bullet-numbering`,pf=`1`,mf=(e,t)=>id(P(sf.format(e,t))).elements[0],hf=e=>e.reduce((e,t)=>Math.max(e,t),0),gf=(e,t,{createContext:n,addContentTypeOverride:r})=>{let i=new Map,a,o=()=>Q(t.get(Kc(cf))??{},`Relationships`).find(e=>e.attributes?.Type===df),s=(e=o())=>e?Yc(cf,String(e.attributes.Target)):lf,c=(e,n)=>Q(t.get(s())??{},`w:numbering`).filter(t=>t.name===e).map(e=>Number(e.attributes[n])),l=t=>{if(t===pf)return e.ConcreteNumbering.find(({reference:e})=>e===ff);if(!t.startsWith(`{`))return;let n=e.ConcreteNumbering.find(({reference:e,instance:n})=>t===`{${e}-${n}}`);if(!n){let e=t.slice(1,-1).replace(/-\d+$/,``);throw Error(`A paragraph in a patch uses the numbering "${e}", which isn't in the numbering option of patchDocument. Add it there with its levels, as in a Document`)}return n},u=e=>{let t=i.get(e.numId);return t===void 0?(a=(a??hf(c(`w:num`,`w:numId`)))+1,i.set(e.numId,a),a):t},d=e=>{let t=e.name===`w:numId`?l(String(e.attributes[`w:val`])):void 0;return t===void 0?e.elements===void 0?e:m(m({},e),{},{elements:e.elements.map(d)}):m(m({},e),{},{attributes:m(m({},e.attributes),{},{"w:val":String(u(t))})})},f=e=>{let i=o(),a=s(i);return t.has(a)||(t.set(a,{declaration:{attributes:{version:`1.0`,encoding:`UTF-8`,standalone:`yes`}},elements:[m(m({},e),{},{elements:[]})]}),r(uf,`/${a}`)),i||n(cf).viewWrapper.Relationships.addRelationship(Ut(),df,Xc(cf,a)),a};return{renumber:e=>e.map(d),write:()=>{if(i.size===0)return;let r=mf(e,n(s())),a=e=>Number(e.elements.find(e=>e.name===`w:abstractNumId`).attributes[`w:val`]),o=r.elements.filter(e=>e.name===`w:num`&&i.has(Number(e.attributes[`w:numId`]))),l=hf(c(`w:abstractNum`,`w:abstractNumId`)),u=new Map([...new Set(o.map(a))].map((e,t)=>[e,l+t+1])),d=r.elements.flatMap(e=>{let t=e.name===`w:abstractNum`?u.get(Number(e.attributes[`w:abstractNumId`])):void 0;return t===void 0?[]:[m(m({},e),{},{attributes:m(m({},e.attributes),{},{"w:abstractNumId":String(t)})})]}),p=f(r),h=t.get(p).elements.find(e=>e.name===`w:numbering`);h.attributes=m(m(m({},Object.fromEntries(Object.entries(r.attributes).filter(([e])=>e.startsWith(`xmlns:`)))),h.attributes),{},{"mc:Ignorable":[...new Set([...String(h.attributes?.[`mc:Ignorable`]??``).split(` `),...String(r.attributes[`mc:Ignorable`]).split(` `)])].filter(e=>e!==``).join(` `)});let g=Q(t.get(p),`w:numbering`),_=e=>{let t=g.findIndex(t=>e.includes(t.name));return t===-1?g.length:t};g.splice(_([`w:num`,`w:numIdMacAtCleanup`]),0,...d),g.splice(_([`w:numIdMacAtCleanup`]),0,...o.map(e=>m(m({},e),{},{attributes:m(m({},e.attributes),{},{"w:numId":String(i.get(Number(e.attributes[`w:numId`])))}),elements:e.elements.map(t=>t.name===`w:abstractNumId`?m(m({},t),{},{attributes:{"w:val":String(u.get(a(e)))}}):t)})))}}},_f={nameOf:e=>e.type===`element`?e.name:void 0,contentOf:e=>e.elements,attributeOf:(e,t)=>e.attributes?.[t],textOf:e=>(e.elements??[]).filter(({type:e})=>e===`text`).map(({text:e})=>String(e)).join(``),textElement:e=>({type:`element`,name:`w:t`,attributes:{"xml:space":`preserve`},elements:[{type:`text`,text:e}]}),writeClean:(e,t)=>{/^\s*(PAGEREF|TOC)\b/i.test(t)&&e.attributes?.[`w:dirty`]!==void 0&&(e.attributes=Object.fromEntries(Object.entries(e.attributes).filter(([e])=>e!==`w:dirty`)))},setSimpleFieldResult:(e,t)=>{e.elements=[{type:`element`,name:`w:r`,elements:[_f.textElement(t)]}]}},vf=`word/document.xml`,yf=`http://schemas.openxmlformats.org/officeDocument/2006/relationships/aFChunk`,bf=[80,75,3,4],xf=function(){var e=Ju(function*(e){if(bf.every((t,n)=>e[n]===t))try{let t=new Map,n=new Map;for(let[r,i]of lu(e))/\.(xml|rels)$/.test(r)?t.set(r,id(rd(i))):n.set(r,i);let r=yield Sf(t,n);return m({parts:t,binaryParts:n},r.size>0?{importedDocuments:r}:{})}catch{return}});return function(t){return e.apply(this,arguments)}}(),Sf=function(){var e=Ju(function*(e,t){let n=new Map;for(let[r,i]of e)if(r.endsWith(`.rels`))for(let{attributes:e={}}of Cf(i)?.elements??[]){let i=Yc(qc(r),String(e.Target)),a=t.get(i),o=e.Type===yf&&e.TargetMode!==`External`&&a?yield xf(a):void 0;o&&n.set(i,o)}return n});return function(t,n){return e.apply(this,arguments)}}(),Cf=e=>{var t;return e==null||(t=e.elements)==null?void 0:t.find(({type:e})=>e===`element`)},wf=function(){var e=Ju(function*(e,t,n=new Map){let r=Cf(e.get(vf));if(!r)return;let i=yield Sf(e,n),a=t(m({parts:e,binaryParts:n},i.size>0?{importedDocuments:i}:{})),o=In(_f,r,a,{blank:!0}),s=Cf(e.get(Kc(vf)))?.elements??[];for(let{attributes:t={}}of s){let n=/\/(header|footer)$/.test(String(t.Type))?Cf(e.get(Yc(vf,String(t.Target)))):void 0;n&&Ln(_f,n,a,{blank:!0,sectionPageCount:o.get(String(t.Id))})}});return function(t,n){return e.apply(this,arguments)}}(),Tf=class extends Error{constructor(e){super(`Token ${e} not found`),this.name=`TokenNotFoundError`}},Ef=(e,t)=>{for(let n=0;n<(e.elements??[]).length;n++){let r=e.elements[n];if(r.type===`element`&&r.name===`w:r`){let e=(r.elements??[]).filter(e=>e.type===`element`&&e.name===`w:t`);for(let r of e)if(r.elements?.[0]&&r.elements[0].text?.includes(t))return n}}throw new Tf(t)},Df=(e,t)=>{let n=-1,r=e.elements?.map((e,r)=>{if(n!==-1)return e;if(e.type===`element`&&e.name===`w:t`){var i;let a=(((i=e.elements)==null||(i=i[0])==null?void 0:i.text)??``).split(t),o=a.map(t=>m(m(m({},e),od(e)),{},{elements:ad(t)}));return a.length>1&&(n=r),o}return e}).flat()??[];return{left:m(m({},JSON.parse(JSON.stringify(e))),{},{elements:r.slice(0,n+1)}),right:m(m({},JSON.parse(JSON.stringify(e))),{},{elements:r.slice(n+1)})}},Of={START:0,MIDDLE:1,END:2},kf=({paragraphElement:e,renderedParagraph:t,originalText:n,replacementText:r,fromIndex:i=0})=>{let a=t.text.indexOf(n,i),o=a+n.length-1,s=Of.START;for(let n of t.runs)for(let{text:t,index:i,start:c,end:l}of n.parts)switch(s){case Of.START:if(a>=c&&a<=l){let u=a-c,d=Math.min(o,l)-c;if(t.substring(u,d+1)===``)continue;let f=t.substring(0,u)+r+t.substring(d+1);Af(e.elements[n.index].elements[i],f),s=Of.MIDDLE;continue}break;case Of.MIDDLE:if(o<=l){let r=t.substring(o-c+1);Af(e.elements[n.index].elements[i],r);let a=e.elements[n.index].elements[i];e.elements[n.index].elements[i]=od(a),s=Of.END}else Af(e.elements[n.index].elements[i],``)}return e},Af=(e,t)=>(e.elements=ad(t),e),jf=e=>{if(e.element.name!==`w:p`)throw Error(`Invalid node type: ${e.element.name}`);if(!e.element.elements)return{text:``,runs:[],index:-1,pathToParagraph:[]};let t=0,n=e.element.elements.map((e,t)=>({element:e,i:t})).filter(({element:e})=>e.name===`w:r`).map(({element:e,i:n})=>{let r=Mf(e,n,t);return t+=r.text.length,r}).filter(e=>!!e);return{text:n.reduce((e,t)=>e+t.text,``),runs:n,index:e.index,pathToParagraph:Nf(e)}},Mf=(e,t,n)=>{if(!e.elements)return{text:``,parts:[],index:-1,start:n,end:n};let r=n,i=e.elements.map((e,t)=>{if(e.name!==`w:t`||!e.elements||e.elements.length===0)return;let n=e.elements[0].text?.toString()??``,i=r;return r+=n.length,{text:n,index:t,start:i,end:i+n.length-1}}).filter(e=>!!e).map(e=>e);return{text:i.reduce((e,t)=>e+t.text,``),parts:i,index:t,start:n,end:i.length>0?i[i.length-1].end:n}},Nf=e=>e.parent?[...Nf(e.parent),e.index]:[e.index],Pf=e=>e.element.elements?.map((t,n)=>({element:t,index:n,parent:e}))??[],Ff=e=>{let t=[],n=[...Pf({element:e,index:0,parent:void 0})],r;for(;n.length>0;)r=n.shift(),r.element.name===`w:p`&&(t=[...t,jf(r)]),n.push(...Pf(r));return t},If=(e,t)=>Ff(e).filter(e=>e.text.includes(t)),Lf=``,Rf=({json:e,patch:t,patchText:n,context:r,keepOriginalStyles:i=!0,recursive:a=!0,renumberIds:o=e=>e})=>{let s=If(e,n);if(s.length===0)return{element:e,didFindOccurrence:!1};let c=[...s].reverse(),l=t.type===$.DOCUMENT?qf(c):c;for(let s of l)switch(t.type){case $.DOCUMENT:{let n=Yf(e,s.pathToParagraph),i=Xf(s.pathToParagraph),a=zf(t,r,o),c=n.name===`w:tc`&&i===n.elements.length-1&&a[a.length-1]?.name!==`w:p`?[{type:`element`,name:`w:p`}]:[];n.elements.splice(i,1,...a,...c);break}case $.PARAGRAPH:default:{let c=Jf(e,s.pathToParagraph),l=s,u=0;do{let e=Bf({paragraphElement:c,renderedParagraph:l,patchText:n,fromIndex:u,children:zf(t,r,o),keepOriginalStyles:i});l=jf({element:c,index:s.index,parent:void 0}),u=l.runs.filter(t=>t.index<e).reduce((e,t)=>e+t.text.length,0)}while(a&&l.text.includes(n,u));break}}return{element:e,didFindOccurrence:!0}},zf=(e,t,n)=>n(e.children.flatMap(e=>e.writtenAs??e).flatMap(e=>{let n=e.prepForXml(t);return n?[id(P(n)).elements[0]]:[]})),Bf=({paragraphElement:e,renderedParagraph:t,patchText:n,fromIndex:r,children:i,keepOriginalStyles:a})=>{kf({paragraphElement:e,renderedParagraph:t,originalText:n,replacementText:Lf,fromIndex:r});let o=Ef(e,Lf),s=e.elements[o],{left:c,right:l}=Df(s,Lf),u=s.elements.find(e=>e.type===`element`&&e.name===`w:rPr`),d=a&&u?i.map(e=>Vf(e,u)):i,f=u?m(m({},l),{},{elements:[u,...l.elements]}):l;return e.elements.splice(o,1,c,...d,f),o+1+d.length},Vf=(e,t)=>e.name===`w:r`?Hf(e,t):e.elements?m(m({},e),{},{elements:e.elements.map(e=>Vf(e,t))}):e,Hf=(e,t)=>{let n=Gf(e).find(e=>e.type===`element`&&e.name===`w:rPr`);if(!n)return m(m({},e),{},{elements:[t,...Gf(e)]});let r=new Set(Gf(n).map(e=>e.name)),i=[...Gf(t).filter(e=>!r.has(e.name)),...Gf(n)],a=m(m({},n),{},{elements:[...i].sort((e,t)=>Wf(e)-Wf(t))});return m(m({},e),{},{elements:Gf(e).map(e=>e===n?a:e)})},Uf=`w:rStyle.w:rFonts.w:b.w:bCs.w:i.w:iCs.w:caps.w:smallCaps.w:strike.w:dstrike.w:outline.w:shadow.w:emboss.w:imprint.w:noProof.w:snapToGrid.w:vanish.w:webHidden.w:color.w:spacing.w:w.w:kern.w:position.w:sz.w:szCs.w:highlight.w:u.w:effect.w:bdr.w:shd.w:fitText.w:vertAlign.w:rtl.w:cs.w:em.w:lang.w:eastAsianLayout.w:specVanish.w:oMath.w14:glow.w14:shadow.w14:reflection.w14:textOutline.w14:textFill.w14:scene3d.w14:props3d.w14:ligatures.w14:numForm.w14:numSpacing.w14:stylisticSets.w14:cntxtAlts`.split(`.`),Wf=e=>{if(e.name===`w:rPrChange`)return Uf.length+1;let t=Uf.indexOf(e.name??``);return t===-1?Uf.length:t},Gf=e=>e.elements??[],Kf=(e,t)=>e.length>t.length&&t.every((t,n)=>e[n]===t),qf=e=>e.filter(t=>!e.some(e=>Kf(t.pathToParagraph,e.pathToParagraph))),Jf=(e,t)=>{let n=e;for(let e=1;e<t.length;e++){let r=t[e];n=n.elements[r]}return n},Yf=(e,t)=>Jf(e,t.slice(0,t.length-1)),Xf=e=>e[e.length-1],Zf=new Nu,Qf=`word/styles.xml`,$f=new Set([`w:pStyle`,`w:rStyle`,`w:tblStyle`,`w:basedOn`,`w:next`,`w:link`]),ep=e=>String(e.attributes?.[`w:styleId`]),tp=e=>{var t;let n=(t=e.elements)==null||(t=t.find(e=>e.name===`w:name`))==null||(t=t.attributes)==null?void 0:t[`w:val`];return n===void 0?void 0:String(n).toLowerCase()},np=(e,t)=>{var n;return e==null||(n=e.elements)==null?void 0:n.find(e=>e.name===t)},rp=e=>{var t;let n=Number((t=np(e,`w:sz`))==null||(t=t.attributes)==null?void 0:t[`w:val`]);return Number.isNaN(n)?void 0:n},ip=e=>{let t=e.filter(e=>e.name===`w:style`),n=t.find(e=>ep(e)===`Normal`)??t.find(e=>e.attributes?.[`w:type`]===`paragraph`&&tp(e)===`normal`),r=e.find(e=>e.name===`w:docDefaults`);return rp(np(n,`w:rPr`))??rp(np(np(r,`w:rPrDefault`),`w:rPr`))},ap=(e,t)=>new Map(Object.values(kc({document:{run:{size:t}}})).map(t=>id(P(Zf.format(t,e))).elements[0]).filter(e=>e.name===`w:style`).map(e=>[ep(e),e])),op=(e,t)=>{let n=Q(e.get(Qf)??{},`w:styles`),r=n.filter(e=>e.name===`w:style`),i=new Set(r.map(ep)),a,o=e=>(a??=ap(t(Qf),ip(n)),a.get(e)),s=new Set,c=new Map,l=e=>{let t=i.has(e)?void 0:o(e);if(t===void 0)return e;let n=r.find(e=>e.attributes?.[`w:type`]===t.attributes?.[`w:type`]&&tp(e)===tp(t));return n===void 0?(s.add(e),e):ep(n)},u=e=>(c.has(e)||c.set(e,l(e)),c.get(e)),d=e=>$f.has(e.name??``)?m(m({},e),{},{attributes:m(m({},e.attributes),{},{"w:val":u(String(e.attributes[`w:val`]))})}):e.elements===void 0?e:m(m({},e),{},{elements:e.elements.map(d)});return{use:e=>e.map(d),write:()=>{let t=e.get(Qf);if(!t)return;let n=Q(t,`w:styles`),r=new Set(n.map(ep));for(let e of s)r.has(e)||(r.add(e),n.push(d(o(e))))}}},sp={type:$.PARAGRAPH,children:[]},cp=({json:e,key:t,patch:n,delimiters:{start:r,end:i},patchPlaceholder:a,renumberDrawings:o})=>{let s=`${r}${t}.`;for(let r of lp(e,s)){let e=pp(r.elements,s,i),c=n.rows.flatMap((n,i)=>{let s={type:`element`,name:`w:tbl`,elements:[...i===0?r.elements.map(mp):o(_p(r.elements))]},c=new Map(Object.entries(n).flatMap(([e,t])=>t===void 0?[]:[[e,t]]));for(let[e,n]of c)a(s,`${t}.${e}`,n);for(let n of e.filter(e=>!c.has(e)))a(s,`${t}.${n}`,sp);return s.elements});r.parent.elements.splice(r.parent.elements.indexOf(r.elements[0]),r.elements.length,...c),r.table&&!fp(r.table.element)&&r.table.parent.elements.splice(r.table.parent.elements.indexOf(r.table.element),1)}},lp=(e,t)=>{let n=If(e,t).flatMap(t=>{let n=up(e,t.pathToParagraph);return n?[n]:[]}),r=n.filter(e=>!n.some(t=>dp(e.path,t.path))).filter((e,t,n)=>n.findIndex(t=>t.row===e.row)===t);return[...new Set(r.map(e=>e.parent))].flatMap(e=>{let t=e.elements.filter(e=>e.name===`w:tr`),n=r.filter(t=>t.parent===e).map(e=>t.indexOf(e.row)).sort((e,t)=>e-t),{table:i}=r.find(t=>t.parent===e);return n.reduce((e,t)=>{let n=e[e.length-1];return n?.[n.length-1]===t-1?[...e.slice(0,-1),[...n,t]]:[...e,[t]]},[]).map(n=>{let r=e.elements.indexOf(t[n[0]]),a=e.elements.indexOf(t[n[n.length-1]]);return{parent:e,table:i,elements:e.elements.slice(r,a+1)}})})},up=(e,t)=>{let n=e,r,i;for(let e=1;e<t.length;e++){let a=n.elements[t[e]];a.name===`w:tbl`&&(i={element:a,parent:n}),a.name===`w:tr`&&(r={parent:n,table:i,row:a,path:t.slice(0,e+1)}),n=a}return r},dp=(e,t)=>e.length>t.length&&t.every((t,n)=>e[n]===t),fp=e=>(e.elements??[]).some(e=>e.name===`w:tr`||e.name!==`w:tblPr`&&e.name!==`w:tblGrid`&&fp(e)),pp=(e,t,n)=>{let r=If({elements:[...e]},t).flatMap(({text:e})=>e.split(t).slice(1).flatMap(e=>{let t=e.indexOf(n);return t>0?[e.slice(0,t)]:[]}));return[...new Set(r)]},mp=e=>JSON.parse(JSON.stringify(e)),hp=[`w14:paraId`,`w14:textId`],gp=[`w:bookmarkStart`,`w:bookmarkEnd`],_p=(e,t)=>e.filter(e=>!gp.includes(e.name??``)&&(t?.name!==`w:sdtPr`||e.name!==`w:id`)).map(e=>m(m(m({},e),e.attributes===void 0?{}:{attributes:Object.fromEntries(Object.entries(e.attributes).filter(([e])=>!hp.includes(e)))}),e.elements===void 0?{}:{elements:[..._p(e.elements,e)]})),vp=e=>e[0]===255&&e[1]===254||e[0]===254&&e[1]===255,yp=e=>{let t=Cu(e,`word/document.xml`),n=t===void 0?void 0:[...e].find(([e])=>Zc(e,t))?.[1];return n===void 0||vp(n)?void 0:Ne(Eu(rd(n)))},bp=(e,t,{start:n,end:r},i)=>{for(let a=e.indexOf(n,t);a!==-1;a=e.indexOf(n,a+1)){let t=e.indexOf(r,a+n.length);if(t===-1)return;let o=e.slice(a+n.length,t),s=o.trim();if(s!==o&&i(s))return{index:a,placeholder:e.slice(a,t+r.length),trimmed:`${n}${s}${r}`}}},xp=(e,t,n)=>{let r=e;for(let e=bp(r,0,t,n);e!==void 0;e=bp(r,e.index+e.trimmed.length,t,n))r=`${r.slice(0,e.index)}${e.trimmed}${r.slice(e.index+e.placeholder.length)}`;return r},Sp=e=>(e.elements??[]).flatMap(e=>[...e.name===`w:p`?[e]:[],...Sp(e)]),Cp=(e,t,n)=>{let r=()=>jf({element:e,index:0,parent:void 0});for(let i=r(),a=bp(i.text,0,t,n);a!==void 0;i=r(),a=bp(i.text,a.index+a.trimmed.length,t,n))kf({paragraphElement:e,renderedParagraph:i,originalText:a.placeholder,replacementText:a.trimmed,fromIndex:a.index})},wp=(e,{delimiters:t,textKeys:n,tableRowsKeys:r,drawingKeys:i})=>{let a=e=>n.has(e)||r.some(t=>e.startsWith(`${t}.`));for(let n of Sp(e))Cp(n,t,a);let o=e=>i.has(e);for(let{properties:n}of Fd(e))for(let e of[`descr`,`title`]){let r=n.attributes?.[e];r!==void 0&&(n.attributes[e]=xp(String(r),t,o))}},Tp=e=>e.name===`v:shapetype`&&e.attributes?.id!==void 0?String(e.attributes.id):void 0,Ep=e=>{let t=Tp(e);return[...t===void 0?[]:[t],...(e.elements??[]).flatMap(Ep)]},Dp=e=>{let t=new Set(Ep(e)),n=e=>{let r=Tp(e);return r===void 0?[e.elements===void 0?e:m(m({},e),{},{elements:e.elements.flatMap(n)})]:t.has(r)?[]:(t.add(r),[e])};return e=>e.flatMap(n)},Op=(e,t,{inTableRow:n})=>{if(t?.type===$.TABLE_ROWS&&Array.isArray(t.rows))for(let n of t.rows){if(typeof n!=`object`||!n)throw Error(`Invalid patch "${e}". Expected each of its rows to be an object of patches, by the name of their field`);for(let[t,r]of Object.entries(n))r!==void 0&&Op(`${e}.${t}`,r,{inTableRow:!0})}else if(!(t?.type===$.DRAWING?!n&&typeof t.patch==`function`:t?.type!==$.TABLE_ROWS&&Array.isArray(t?.children)))throw Error(`Invalid patch "${e}". Expected { type: PatchType.PARAGRAPH or PatchType.DOCUMENT, children: [...] }, ${n?`or { type: PatchType.TABLE_ROWS, rows: [...] }`:`{ type: PatchType.TABLE_ROWS, rows: [...] }, or a drawing patch such as ImagePatch, or ChartDataPatch from docx/charts`}`)},kp=new Lu,Ap=new Uint8Array([255,254]),jp=new Uint8Array([254,255]),Mp=new Set([`w:document`,`w:hdr`,`w:ftr`,`w:footnotes`,`w:endnotes`,`w:comments`]),Np=(e,t)=>{if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0};(function(){var e=Ju(function*({outputType:e,data:t,patches:n,keepOriginalStyles:r,placeholderDelimiters:i={start:`{{`,end:`}}`},recursive:a=!0,trimPlaceholders:o=!1,footnotes:s,endnotes:c,numbering:l={config:[]},pageNumbers:u,properties:d}){let f=yield Xd(t),p=new Map,h=yp(f),g=[],_={Media:new es,Numbering:new xs(l),Theme:h&&{Colors:h},FootNotes:{View:{idOf:(e,t,n)=>N(`footnotes`,e,t,n)}},Endnotes:{View:{idOf:(e,t,n)=>N(`endnotes`,e,t,n)}},PackageParts:new Ss({addOverride:(e,t)=>g.push({contentType:e,partName:t})},new Set([...f.keys()].filter(e=>e.startsWith(`word/`)).map(e=>e.slice(5))))},v=new Map,y=[],b=[],x=!1,S=new Map;if(!i?.start.trim()||!i?.end.trim())throw Error(`Both start and end delimiters must be non-empty strings.`);let{start:C,end:w}=i;for(let[e,t]of Object.entries(n))Op(e,t,{inTableRow:!1});for(let[e,t]of f){let n=t.slice(0,2);if(Np(n,Ap)||Np(n,jp)||!e.endsWith(`.xml`)&&!e.endsWith(`.rels`)){S.set(e,t);continue}let r=id(rd(t)),i=r.elements?.find(e=>Mp.has(e.name??``));if(i&&i.attributes){for(let e of[`mc`,`wp`,`r`,`w15`,`m`,`v`,`o`])i.attributes[`xmlns:${e}`]=fo[e];i.attributes[`mc:Ignorable`]=`${i.attributes[`mc:Ignorable`]||``} w15`.trim()}v.set(e,r)}let T=td([...v.values()].flatMap(ed)),E=Nd([...v.values()].flatMap(jd)),D=new Map,O=e=>{let t=D.get(e);if(t)return t;let n={Relationships:{addRelationship:(t,n,r,i)=>{b.push({key:e,id:t,type:n,target:r,targetMode:i})}}};return D.set(e,n),n},ee=e=>({file:_,viewWrapper:O(e),stack:[]}),k=(e,t)=>{g.push({contentType:e,partName:t})},A=op(v,ee),j=gf(_.Numbering,v,{createContext:ee,addContentTypeOverride:k}),M=of({footnotes:s,endnotes:c},v,{createContext:ee,addContentTypeOverride:k,renumberBookmarks:T,renumberDrawings:E,renumberLists:j.renumber,useStyles:A.use}),N=(e,t,n,r)=>r.viewWrapper===O(`word/document.xml`)?M.carry(e,t,n):void 0;if(o){let e=e=>Object.entries(n).flatMap(([t,n])=>e(n.type)?[t]:[]),t={delimiters:{start:C,end:w},textKeys:new Set(e(e=>e!==$.TABLE_ROWS&&e!==$.DRAWING)),tableRowsKeys:e(e=>e===$.TABLE_ROWS),drawingKeys:new Set(e(e=>e===$.DRAWING))};for(let[e,n]of v)e.startsWith(`word/`)&&!e.endsWith(`.rels`)&&wp(n,t)}Wd({parts:v,binaryParts:S,file:_,patches:Object.entries(n).flatMap(([e,t])=>t.type===$.DRAWING?[[e,t]]:[]),delimiters:{start:C,end:w}},ee);let P=Object.entries(n).flatMap(([e,t])=>t.type===$.DRAWING?[]:[[e,t]]),te=[...P.filter(([,e])=>e.type===$.TABLE_ROWS),...P.filter(([,e])=>e.type!==$.TABLE_ROWS)];for(let[e,t]of[...v]){if(!e.startsWith(`word/`)||e.endsWith(`.xml.rels`))continue;let n=ee(e);p.set(e,n);let i=Dp(t),o=(t,s,c)=>{if(c.type===$.TABLE_ROWS){cp({json:t,key:s,patch:c,delimiters:{start:C,end:w},patchPlaceholder:o,renumberDrawings:E});return}let l=[],{didFindOccurrence:u}=Rf({json:t,patch:m(m({},c),{},{children:c.children.flatMap(e=>e instanceof fi?e.writtenAs:[e]).map(t=>{if(t instanceof li){let{target:n,anchor:r}=yi(t.options.link),i=new si(t.options.children,Ut(),r,t.options.link);return l.push({key:e,id:i.linkId,type:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink`,target:n,targetMode:fn.EXTERNAL}),i}return t})}),patchText:`${C}${s}${w}`,context:n,keepOriginalStyles:r,recursive:a,renumberIds:e=>A.use(j.renumber(M.renumber(T(E(i(e))))))});u&&b.push(...l)};for(let[e,n]of te)o(t,e,n)}M.write(),j.write(),A.write();for(let[e,t]of v){if(!e.startsWith(`word/`)||e.endsWith(`.xml.rels`))continue;let n=kp.getMediaData(JSON.stringify(t),_.Media);n.length>0&&(x=!0,y.push({key:e,mediaDatas:n}))}for(let{key:e,mediaDatas:t}of y){let n=Kc(e),r=v.get(n)??pd();v.set(n,r);let i=dd(r),a=kp.replace(JSON.stringify(v.get(e)),t,i);v.set(e,JSON.parse(a));for(let e=0;e<t.length;e++){let{fileName:n}=t[e];fd(r,i+e,`http://schemas.openxmlformats.org/officeDocument/2006/relationships/image`,`media/${n}`)}}for(let{key:e,id:t,type:n,target:r,targetMode:i}of b){let a=Kc(e),o=v.get(a)??pd();v.set(a,o),fd(o,t,n,r,i)}u&&(yield wf(v,u,S)),d&&Ed(v,S,d,{addContentTypeOverride:k});let ne=Hu(_,void 0);if(x||g.length>0){let e=v.get(`[Content_Types].xml`);if(!e)throw Error(`Could not find content types file`);x&&(sd(e,`image/png`,`png`),sd(e,`image/jpeg`,`jpeg`),sd(e,`image/jpeg`,`jpg`),sd(e,`image/bmp`,`bmp`),sd(e,`image/gif`,`gif`),sd(e,`image/svg+xml`,`svg`));for(let{contentType:t,partName:n}of g)cd(e,t,n)}return pu(ou([...[...v].map(([e,t])=>[e,re(t)]),...S,..._.Media.Array.map(({data:e,fileName:t})=>[`word/media/${t}`,e]),...ne.map(({path:e,data:t})=>[e,t])]),e,`application/vnd.openxmlformats-officedocument.wordprocessingml.document`)});return function(t){return e.apply(this,arguments)}})();var Pp=e=>e.startsWith(`word/`)&&/\.(xml|rels)$/.test(e)&&!e.endsWith(`.xml.rels`);(function(){var e=Ju(function*({data:e,trimPlaceholders:t=!1}){let n=yield Xd(e,Pp),r=new Set;for(let[,e]of n){let n=id(rd(e));[...Ff(n).map(e=>e.text),...Fd(n).flatMap(({properties:e})=>Id(e))].flatMap(e=>Fp(e)).map(e=>t?e.trim():e).filter(e=>e!==``).forEach(e=>r.add(e))}return Array.from(r)});return function(t){return e.apply(this,arguments)}})();var Fp=e=>{let t=RegExp(`(?<=\\{\\{).+?(?=\\}\\})`,`gs`);return e.match(t)??[]},Ip=`Courier New`,Lp=`F2F2F2`,Rp=`cfx-ordered`,zp=[Zr.HEADING_1,Zr.HEADING_2,Zr.HEADING_3,Zr.HEADING_4,Zr.HEADING_5,Zr.HEADING_6],Bp=class{next=1;take(){return this.next++}};function Vp(t,n={}){let r=[];for(let i of t)switch(i.type){case`text`:r.push(new U({text:i.value.replace(/\n/g,` `),...n}));break;case`strong`:r.push(...Vp(i.children,{...n,bold:!0}));break;case`emphasis`:r.push(...Vp(i.children,{...n,italics:!0}));break;case`delete`:r.push(...Vp(i.children,{...n,strike:!0}));break;case`inlineCode`:r.push(new U({text:i.value,...n,font:Ip,shading:{type:yt.CLEAR,fill:Lp,color:`auto`}}));break;case`break`:r.push(new U({break:1}));break;case`link`:{let t=e(i.url);if(t){let e=Vp(i.children,{...n,style:`Hyperlink`});r.push(new li({link:t,children:e.length?e:[new U({text:t,...n,style:`Hyperlink`})]}))}else r.push(...Vp(i.children,n));break}case`image`:r.push(new U({text:`[image${i.alt?`: ${i.alt}`:``}]`,...n,italics:!0}));break;case`html`:r.push(new U({text:i.value,...n}));break;case`footnoteReference`:r.push(new U({text:`[^${i.identifier}]`,...n,superScript:!0}));break;default:`children`in i?r.push(...Vp(i.children,n)):`value`in i&&r.push(new U({text:String(i.value),...n}))}return r}function Hp(e){return e.quote?{indent:{left:360+e.listLevel*720},border:{left:{style:Qe.SINGLE,size:12,color:`BBBBBB`,space:8}}}:e.listLevel>0?{indent:{left:e.listLevel*720}}:{}}function Up(e,t,n){let r=[];for(let i of e)switch(i.type){case`heading`:r.push(new G({heading:zp[i.depth-1],children:Vp(i.children)}));break;case`paragraph`:r.push(new G({children:Vp(i.children),...Hp(t)}));break;case`blockquote`:r.push(...Up(i.children,{...t,quote:!0},n));break;case`code`:{let e=i.value.split(`
|
|
10
|
+
`);r.push(new G({shading:{type:yt.CLEAR,fill:Lp,color:`auto`},spacing:{before:60,after:120},children:e.map((e,t)=>new U({text:e,font:Ip,size:19,break:t>0?1:void 0}))}));break}case`list`:r.push(...Wp(i,t,n));break;case`table`:r.push(Gp(i));break;case`thematicBreak`:r.push(new G({children:[],border:{bottom:{style:Qe.SINGLE,size:6,color:`BBBBBB`,space:1}}}));break;case`html`:r.push(new G({children:[new U({text:i.value,font:Ip})]}));break;case`footnoteDefinition`:{let e=new U({text:`[^${i.identifier}] `,superScript:!0}),[a,...o]=i.children;a&&a.type===`paragraph`?r.push(new G({children:[e,...Vp(a.children)]}),...Up(o,t,n)):r.push(new G({children:[e]}),...Up(i.children,t,n));break}}return r}function Wp(e,t,n){let r=[],i=Math.min(t.listLevel,8),a=e.ordered&&(e.start??1)===1?n.take():null;return e.children.forEach((o,s)=>{let[c,...l]=o.children,u=o.checked===!0?`☒ `:o.checked===!1?`☐ `:``,d=e.ordered&&a===null?`${(e.start??1)+s}. `:``,f=d||u?[new U({text:d+u})]:[],p=e.ordered?a===null?{indent:{left:360*(i+1)}}:{numbering:{reference:Rp,level:i,instance:a}}:{bullet:{level:i}};c&&c.type===`paragraph`?r.push(new G({...p,children:[...f,...Vp(c.children)]})):(r.push(new G({...p,children:f})),c&&r.push(...Up([c],{...t,listLevel:t.listLevel+1},n))),r.push(...Up(l,{...t,listLevel:t.listLevel+1},n))}),r}function Gp(e){let t=e.align??[],n=e=>t[e]===`center`?V.CENTER:t[e]===`right`?V.RIGHT:V.LEFT;return new ao({width:{size:100,type:aa.PERCENTAGE},rows:e.children.map((e,t)=>new io({tableHeader:t===0,children:e.children.map((e,r)=>new Ia({shading:t===0?{type:yt.CLEAR,fill:`EDEDED`,color:`auto`}:void 0,children:[new G({alignment:n(r),children:Vp(e.children,t===0?{bold:!0}:{})})]}))}))})}function Kp(e,n){let r=new Bp,i=Up(t(e).children,{listLevel:0,quote:!1},r);return new Ou({title:n,creator:`Cerefox`,styles:{default:{document:{run:{font:`Calibri`,size:22},paragraph:{spacing:{after:120,line:276}}}}},numbering:{config:[{reference:Rp,levels:Array.from({length:9},(e,t)=>({level:t,format:ts.DECIMAL,text:`%${t+1}.`,alignment:V.START,style:{paragraph:{indent:{left:720*(t+1),hanging:360}}}}))}]},sections:[{children:i.length?i:[new G({children:[]})]}]})}function qp(e,t){return Qu.toBlob(Kp(e,t))}export{qp as markdownToDocx};
|
|
11
|
+
//# sourceMappingURL=docx-CjhuGfqI.js.map
|