import{a as Z,b as Be,c as Fn,h as ki,k as Si,l as Ci}from"./chunk-LZCJIPJP.js";import{a as bi}from"./chunk-X3O2N2TI.js";import{a as En,b as xi,c as vi}from"./chunk-KQWNFM2A.js";import{D as yi,U as _,g as Vt,h as fi,i as Pn,j as ci,l as hi,m as le}from"./chunk-GHRDEUEY.js";import{a as ct,b as qt,c as kt,d as ht,e as S,f as J,g as X,h as V,i as b,j as St,k as L,l as D,m as si,n as Ut,o as oe,p as Ae,q as ae,s as mi,t as gi,v as Tt,y as wi}from"./chunk-LBSJ4B7H.js";import{b as nt,d as Rn}from"./chunk-CP4NUKLT.js";import{b as pi,d as q,e as Ct,f as Le,g as ui,h as di}from"./chunk-FWGMRJIF.js";import{a as tt}from"./chunk-7NZQ2JH6.js";import{d as ai}from"./chunk-FSRPMVAS.js";var Ti=class{constructor(t,e=1){tt(this,"pagesContainer"),tt(this,"zoom"),this.pagesContainer=t,this.zoom=e}getCoordinatesForPosition(t){let e=this.pagesContainer.getBoundingClientRect(),n=this.pagesContainer.querySelectorAll("span[data-pm-start][data-pm-end]");for(let i of Array.from(n)){let o=i,l=Number(o.dataset.pmStart),a=Number(o.dataset.pmEnd);if(o.classList.contains("layout-run-tab")){if(t>=l&&t<a){let s=o.getBoundingClientRect(),u=o.closest(".layout-line"),p=u?u.offsetHeight:16;return{x:(s.left-e.left)/this.zoom,y:(s.top-e.top)/this.zoom,height:p/this.zoom}}continue}if(t>=l&&t<=a&&i.firstChild?.nodeType===Node.TEXT_NODE){let s=i.firstChild,u=Math.min(t-l,s.length),p=o.ownerDocument;if(!p)continue;let d=p.createRange();d.setStart(s,u),d.setEnd(s,u);let f=d.getBoundingClientRect(),h=o.closest(".layout-line"),c=h?h.offsetHeight:16;return{x:(f.left-e.left)/this.zoom,y:(f.top-e.top)/this.zoom,height:c/this.zoom}}}let r=this.pagesContainer.querySelectorAll(".layout-empty-run");for(let i of Array.from(r)){let o=i.closest(".layout-paragraph");if(!o)continue;let l=Number(o.dataset.pmStart),a=Number(o.dataset.pmEnd);if(t>=l&&t<=a){let s=i.getBoundingClientRect(),u=i.closest(".layout-line"),p=u?u.offsetHeight:16;return{x:(s.left-e.left)/this.zoom,y:(s.top-e.top)/this.zoom,height:p/this.zoom}}}return null}findElementsForRange(t,e){let n=[],r=this.pagesContainer.querySelectorAll("span[data-pm-start][data-pm-end]");for(let i of Array.from(r)){let o=i,l=Number(o.dataset.pmStart);Number(o.dataset.pmEnd)>t&&l<e&&n.push(o)}return n}getRectsForRange(t,e){let n=this.pagesContainer.getBoundingClientRect(),r=[],i=this.pagesContainer.querySelectorAll("span[data-pm-start][data-pm-end]");for(let o of Array.from(i)){let l=o,a=Number(l.dataset.pmStart);if(Number(l.dataset.pmEnd)>t&&a<e){if(l.classList.contains("layout-run-tab")){let f=l.getBoundingClientRect();r.push({x:(f.left-n.left)/this.zoom,y:(f.top-n.top)/this.zoom,width:f.width/this.zoom,height:f.height/this.zoom});continue}if(o.firstChild?.nodeType!==Node.TEXT_NODE)continue;let s=o.firstChild,u=l.ownerDocument;if(!u)continue;let p=Math.max(0,t-a),d=Math.min(s.length,e-a);if(p<d){let f=u.createRange();f.setStart(s,p),f.setEnd(s,d);let h=f.getClientRects();for(let c of Array.from(h))r.push({x:(c.left-n.left)/this.zoom,y:(c.top-n.top)/this.zoom,width:c.width/this.zoom,height:c.height/this.zoom})}}}return r}getContainerOffset(){let t=this.pagesContainer.parentElement;if(!t)return{x:0,y:0};let e=this.pagesContainer.getBoundingClientRect(),n=t.getBoundingClientRect();return{x:(e.left-n.left)/this.zoom,y:(e.top-n.top)/this.zoom}}};function Cs(t,e=1){return new Ti(t,e)}var zt={top:4,bottom:4,left:7,right:7},$i=200;function ze(t,e){let n=t.kind??"<unknown>";throw new Error(`${e}: unhandled FlowBlock kind "${n}". Add the case alongside the other FlowBlock switches (see types.ts).`)}function G(t){return t/1440*96}function Mn(t,e,n){if(!n||e<=n)return{width:t,height:e};let r=n/e;return{width:Math.round(t*r),height:n}}var Ts=0;function wt(){return`block-${++Ts}`}var Bn=720,$s=31680;function Ii(t){let e=t?kt(t):null,n=e?S(e,"w","defaultTabStop"):null,r=n?parseInt(b(n,"w","val")??"",10):NaN,i=Number.isFinite(r)&&r>0&&r<=$s,o=e?S(e,"w","defaultTableStyle"):null,l=o&&(b(o,"w","val")??void 0)||void 0,a=e?S(e,"w","themeFontLang"):null,s=a&&b(a,"w","eastAsia")||void 0,u=a&&b(a,"w","bidi")||void 0,p=s||u?{...s?{eastAsia:s}:{},...u?{bidi:u}:{}}:void 0;return{defaultTabStop:i?r:Bn,...l?{defaultTableStyle:l}:{},...p?{themeFontLang:p}:{}}}var Fi=["square","tight","through"],Is=["behind","inFront"],Fs=[...Fi,...Is];function Yt(t){return!!t&&Fs.includes(t)}function $t(t){return t==="behind"||t==="inFront"}function Ne(t){return!!t&&Fi.includes(t)}function Oe(t,e,n,r){let i=t-e-n,o=(r.count-1)*r.gap;return(i-o)/r.count}function Ps(t){let e={...t.pageSize},n={...t.margins},r=t.columns??{count:1,gap:0},i=!1,o,l,a=[],s=[];function u(){return e.h-n.bottom}function p(){return u()-n.top}function d(){return e.w-n.left-n.right}if(p()<=0)throw new Error(`Paginator: page size and margins yield no content area (pageSize=${Math.round(e.w)}x${Math.round(e.h)} margins top=${Math.round(n.top)} bottom=${Math.round(n.bottom)} left=${Math.round(n.left)} right=${Math.round(n.right)})`);let f=Oe(e.w,n.left,n.right,r),h=n.top;function c(E){return n.left+E*(f+r.gap)}function m(){(o||l)&&(o&&(e=o),l&&(n=l),o=void 0,l=void 0,f=Oe(e.w,n.left,n.right,r));let E=a.length+1,P=n.top,R=u(),T=t.footnoteReservedHeights?.get(E)??0,M=R-T,B={number:E,fragments:[],margins:{...n},size:{...e},footnoteReservedHeight:T>0?T:void 0,columns:r.count>1?{...r}:void 0},N={page:B,cursorY:P,columnIndex:0,topMargin:P,contentBottom:M,trailingSpacing:0};return a.push(B),s.push(N),h=P,t.onNewPage&&t.onNewPage(N),N}function g(){return s.length===0?m():s[s.length-1]}function v(E){return E.contentBottom-E.cursorY}function C(E,P){let R=P||g();return v(R)>=E}function y(E){return E.columnIndex<r.count-1?(E.columnIndex+=1,E.cursorY=h,E.trailingSpacing=0,E):m()}function k(E){let P=g(),R=Number.isFinite(E)&&E>0?E:0;for(;!C(R,P);){let T=P.contentBottom-P.topMargin;if(R>T)return i||(i=!0,console.warn(`Paginator: fragment height ${R.toFixed(0)}px exceeds page content height ${T.toFixed(0)}px; placing with overflow.`)),P.cursorY!==P.topMargin&&(P=y(P)),P;P=y(P)}return P}function x(E,P,R=0,T=0){let M=Math.max(R,g().trailingSpacing),B=M+P,N=k(B),z=M,A=c(N.columnIndex),j=N.cursorY+z;return E.x=A,E.y=j,N.page.fragments.push(E),N.cursorY=j+P,N.trailingSpacing=T,{state:N,x:A,y:j}}function w(){if(s.length>0){let E=s[s.length-1];if(E.page.fragments.length===0&&E.cursorY===E.topMargin)return E}return m()}function I(){let E=g();return y(E)}function F(E){r=E,f=Oe(e.w,n.left,n.right,r);let P=g();P.page.columns=r.count>1?{...r}:void 0,h=P.cursorY,P.columnIndex=0}function $(E,P,R=!0){if(!R){o=E?{...E}:o,l=P?{...P}:l;return}if(E&&(e={...E}),P&&(n={...P}),p()<=0)throw new Error("Paginator: section page size and margins yield no content area");f=Oe(e.w,n.left,n.right,r),o=void 0,l=void 0}return{pages:a,states:s,get columnWidth(){return f},get columns(){return{...r}},getCurrentState:g,getAvailableHeight:()=>v(g()),getContentWidth:d,fits:E=>C(E),ensureFits:k,addFragment:x,forcePageBreak:w,forceColumnBreak:I,getColumnX:c,updateColumns:F,updatePageLayout:$}}function Rs(t){let e=new Map,n=new Set;for(let r=0;r<t.length;r++){if(n.has(r))continue;let i=t[r];if(i.kind!=="paragraph"||!i.attrs?.keepNext)continue;let o=[r],l=r;for(let u=r+1;u<t.length;u++){let p=t[u];if(p.kind==="sectionBreak"||p.kind==="pageBreak"||p.kind==="columnBreak"||p.kind!=="paragraph")break;if(p.attrs?.keepNext)o.push(u),l=u,n.add(u);else break}let a=l+1,s=-1;if(a<t.length){let u=t[a];u.kind!=="sectionBreak"&&u.kind!=="pageBreak"&&u.kind!=="columnBreak"&&(s=a)}e.set(r,{startIndex:r,endIndex:l,memberIndices:o,anchorIndex:s})}return e}function Es(t,e,n){let r=0;for(let i of t.memberIndices){let o=e[i],l=n[i];if(o.kind!=="paragraph"||l.kind!=="paragraph")continue;let a=o,s=l,u=a.attrs?.spacing?.before??0;r+=u,r+=s.totalHeight;let p=a.attrs?.spacing?.after??0;r+=p}if(t.anchorIndex!==-1){let i=n[t.anchorIndex];if(i?.kind==="paragraph"){let o=i;o.lines.length>0&&(r+=o.lines[0].lineHeight)}}return r}function Ms(t){let e=new Set;for(let n of t.values())for(let r=1;r<n.memberIndices.length;r++)e.add(n.memberIndices[r]);return e}function Bs(t){return t.kind!=="paragraph"?!1:t.attrs?.pageBreakBefore===!0}function Ot(t){return t.displayMode==="float"||Yt(t.wrapType)||t.wrapType==="topAndBottom"}function Mi(t){return Ot(t)&&t.wrapType==="topAndBottom"}function Bi(t){return Ot(t)&&!$t(t.wrapType)&&t.wrapType!=="topAndBottom"}function pe(t,e,n){if(!(!t||t<=0)){if(e==="pct")return n*t/5e3;if(!e||e==="dxa"||e==="auto")return pi(t)}}function ue(t){let e=new Map,n=[];for(let r=0;r<t.rows.length;r++){let i=t.rows[r]?.cells??[],o=e.get(r)??new Set,l=0;for(;o.has(l);)l++;for(let a=0;a<i.length;a++){let s=i[a];if(!s)continue;let u=s.colSpan??1,p=s.rowSpan??1;if(n.push({rowIndex:r,cellIndex:a,columnIndex:l,colSpan:u,rowSpan:p}),p>1)for(let d=r+1;d<r+p;d++){e.has(d)||e.set(d,new Set);let f=e.get(d);for(let h=0;h<u;h++)f.add(l+h)}for(l+=u;o.has(l);)l++}}return n}function Ls(t){return Math.max(1,...t.rows.map(e=>e.cells.reduce((n,r)=>n+Math.max(1,r.colSpan??1),0)))}function As(t,e,n){if(e<=0)return[];let r=n>0?n/e:0;if(t.length===0)return Array(e).fill(r);let i=t.slice(0,e),o=e-i.length;if(o>0){let p=i.filter(f=>f>0),d=p.length>0?p.reduce((f,h)=>f+h,0)/p.length:r;i=i.concat(Array(o).fill(d))}let l=i.reduce((p,d)=>p+(d>0?d:0),0),a=i.filter(p=>p<=0).length;if(l<=0)return Array(e).fill(r);if(a===0)return i;let s=Math.max(0,n-l),u=s>0?s/a:l/Math.max(1,e-a);return i.map(p=>p>0?p:u)}function Wn(t,e){let n=t.columnWidths??[],r=pe(t.width,t.widthType,e),i=Ls(t),o=r??e;if(t.rows.length>0&&(n=As(n,i,o)),n.length>0&&r){let l=n.reduce((a,s)=>a+s,0);if(l>0&&Math.abs(l-r)>1){let a=r/l;n=n.map(s=>s*a)}}return n}function Li(t,e){let n=Wn(t,e),r=pe(t.width,t.widthType,e);return n.reduce((i,o)=>i+o,0)||r||e}function jn(t,e,n){let r=[],i=[],o=n,l=0,a=e?.length??0;for(let s=0;s<a;s++){let u=e[s],p=t?.[s];if(p?.kind==="paragraph"&&u?.kind==="paragraph"){let d=p.attrs?.spacing;o+=Math.max(l,d?.before??0);let f=[];for(let h of u.lines)o+=h.floatSkipBefore??0,f.push(o),o+=h.lineHeight,i.push(o);r.push(f),l=d?.after??0}else u&&"totalHeight"in u&&typeof u.totalHeight=="number"?(o+=l+u.totalHeight,r.push([]),i.push(o),l=0):r.push([])}return{lineTops:r,flatBottoms:i,contentHeight:o-n+l}}function zs(t,e){let n=e.rows.length,r=[],i=0;for(let a=0;a<n;a++)r.push(i),i+=e.rows[a]?.height??0;r.push(i);let o=ue(t),l=[];for(let a=0;a<n;a++){let s=e.rows[a]?.height??0,u=new Set;u.add(s);for(let p of o){if(p.rowIndex>a||p.rowIndex+p.rowSpan-1<a)continue;let d=t.rows[p.rowIndex]?.cells?.[p.cellIndex],f=e.rows[p.rowIndex]?.cells?.[p.cellIndex];if(!d||!f)continue;let h=d.padding?.top??0,{flatBottoms:c}=jn(d.blocks,f.blocks,h),m=r[a]-r[p.rowIndex];for(let g of c){let v=g-m;v>0&&v<s&&u.add(v)}}l.push([...u].sort((p,d)=>p-d))}return{rowTops:r,breakOffsets:l}}function Ns(t,e,n,r){let i=t.breakOffsets[e];if(!i||i.length===0)return 0;let o=n+r,l=0;for(let a of i)if(!(a<=n))if(a<=o)l=a-n;else break;return l}var Os=1440,Ai=96,Xg=Os/Ai,zi=11,Ni="Calibri",Hs=1,Ds=.8,Ws=.2,se=null;function _n(){if(!se){let t=typeof document<"u"?document.createElement("canvas"):null;if(!t)throw new Error("Canvas not available. Ensure this runs in a DOM environment.");if(se=t.getContext("2d"),!se)throw new Error("Failed to get 2D context from canvas")}return se}function qg(){se=null}var Pi=new Map;function Oi(t){let e=Pi.get(t);if(e===void 0){let n=Tt(t);e={cssFallback:n.cssFallback,singleLineRatio:n.singleLineRatio},Pi.set(t,e)}return e}function js(t){return Oi(t).cssFallback}function Xn(t){let e=[];t.italic&&e.push("italic"),t.bold&&e.push("bold");let n=t.fontSize??zi,r=Nt(n);e.push(`${r}px`);let i=t.fontFamily??Ni;return e.push(js(i)),e.join(" ")}function qn(t){let e=t.fontSize??zi,n=t.fontFamily??Ni,r=Nt(e),i=r*Ds,o=r*Ws,l=r*Hs;try{let s=_n();s.font=Xn(t);let u=s.measureText("Hg");typeof u.actualBoundingBoxAscent=="number"&&typeof u.actualBoundingBoxDescent=="number"&&(i=u.actualBoundingBoxAscent,o=u.actualBoundingBoxDescent)}catch{}l=Math.max(l,i+o);let a=Oi(n).singleLineRatio;return{fontSize:e,ascent:i,descent:o,lineHeight:l,fontFamily:n,singleLineRatio:a}}function gt(t,e){if(!t)return 0;let n=_n();n.font=Xn(e);let r=n.measureText(t).width;return e.letterSpacing&&t.length>1&&(r+=e.letterSpacing*(t.length-1)),r}function _e(t,e){let n=qn(e);if(!t)return{width:0,charWidths:[],metrics:n};let r=_n();r.font=Xn(e);let i=e.letterSpacing??0,o=[],l=0;for(let a=0;a<t.length;a++){let s=t[a],u=r.measureText(s).width;i&&a<t.length-1&&(u+=i),o.push(u),l+=u}return{width:l,charWidths:o,metrics:n}}function Hi(t,e){if(e.length===0||t<=0)return 0;let n=0;for(let r=0;r<e.length;r++){let i=e[r],o=n+i/2;if(t<=o)return r;n+=i}return e.length}function Nt(t){return t*Ai/72}function Ln(t){return t/1440*96}function Di(t){return t/96*1440}function _s(t){let{explicitStops:e=[],defaultTabInterval:n=720,leftIndent:r=0}=t,i=e.filter(p=>p.val!=="clear").filter(p=>p.pos>=r),o=e.filter(p=>p.val==="clear").map(p=>p.pos),l=i.reduce((p,d)=>Math.max(p,d.pos),0),a=[...i];r>0&&!i.some(p=>p.pos<=r)&&(o.some(p=>Math.abs(p-r)<20)||a.push({val:"start",pos:r,leader:"none"}));let s=l>0?Math.max(l,r):r,u=r+14400;for(;s<u;){s+=n;let p=i.some(h=>Math.abs(h.pos-s)<20),d=o.some(h=>Math.abs(h-s)<20),f=r>0&&Math.abs(s-r)<20;!p&&!d&&!f&&a.push({val:"start",pos:s,leader:"none"})}return a.sort((p,d)=>p.pos-d.pos)}function Un(t,e,n={}){let{defaultTabInterval:r=720}=e,i=Di(t),o=_s(e).find(a=>a.pos>i);if(!o){let a=Ln(r),s=a-t%a;return s<=0&&(s=a),{width:s,alignment:"default"}}let l=Ln(o.pos)-t;if(o.val==="center")l-=(n.followingWidth??0)/2;else if(o.val==="end")l-=n.followingWidth??0;else if(o.val==="decimal")l-=n.decimalPrefixWidth??0;else if(o.val==="bar")return{width:0,leader:o.leader,alignment:"bar"};if(l<1){let a=Ln(r),s=a-t%a;return s<=0&&(s=a),{width:s,alignment:"default"}}return{width:l,leader:o.leader,alignment:o.val}}var Xs="Calibri",qs=11;function Vn(t){let e=t.attrs,n=t.runs?.find(o=>o.kind==="text"),r=e?.listMarkerFontFamily??n?.fontFamily??e?.defaultFontFamily??Xs,i=e?.listMarkerFontSize??n?.fontSize??e?.defaultFontSize??qs;return{fontFamily:r,fontSize:i}}function Yn(t){let e=t.attrs;if(!e?.listMarker||e.listMarkerHidden)return 0;let n=e.indent,r=n?.hanging??0;if(r>0)return r;let{fontFamily:i,fontSize:o}=Vn(t),l={fontFamily:i,fontSize:o},a=gt(e.listMarker,l),s=e.listMarkerSuffix??"tab";if(s==="nothing")return a;if(s==="space")return a+gt(" ",l);let u=n?.left??0,p=n?.firstLine??0,d=u+p,f=d+a,h=(e.tabs??[]).filter(v=>v.val!=="clear"&&v.val!=="bar").map(v=>G(v.pos)).filter(v=>v>=f).sort((v,C)=>v-C)[0],c=G(e.defaultTabStopTwips??Bn),m=c>0?(Math.floor(f/c)+1)*c:void 0,g;return h!==void 0&&m!==void 0?g=Math.min(h,m):g=h??m,g===void 0?a+Nt(o)*.5:g-d}var mt=11,Zt="Calibri",Us=1.15,je=1,It=.5;function Ri(t,e,n,r=!1){let i=1,o=t.length,l=0;for(;i<=o;){let a=i+o>>>1;gt(t.slice(0,a),e)<=n?(l=a,i=a+1):o=a-1}return r&&l===0?1:l}function De(t){return{fontFamily:t.fontFamily??Zt,fontSize:t.fontSize??mt,bold:t.bold,italic:t.italic,letterSpacing:t.letterSpacing}}function Wi(t,e,n){let r=Nt(t),i=n?.ascent??r*.8,o=n?.descent??r*.2,l=n?.singleLineRatio??1.15,a=r*l,s;if(e?.lineRule==="exact"&&e.line!==void 0)s=e.line;else if(e?.lineRule==="atLeast"&&e.line!==void 0){let u=a*je;s=Math.max(e.line,u)}else e?.line!==void 0&&e?.lineUnit==="multiplier"?s=a*e.line:e?.line!==void 0&&e?.lineUnit==="px"?s=e.line:s=a*je;return{ascent:i,descent:o,lineHeight:s}}function Ei(t,e,n){let r=qn({fontSize:t,fontFamily:n??Zt}),i=Wi(t,e,r),o=e?.lineRule??"auto";if(o==="auto"||o==="atLeast"){let l=Nt(t),a=Math.max(i.lineHeight,l*Us);if(a!==i.lineHeight)return{...i,lineHeight:a}}return i}function We(t){return t.kind==="text"}function ji(t){return t.kind==="tab"}function _i(t){return t.kind==="image"}function Xi(t){return t.kind==="lineBreak"}function qi(t){return t.kind==="field"}function Vs(t){return!t.text||t.text.replace(/\u00a0/g," ").trim().length===0}function Ys(t,e){let n=0;for(let r=e+1;r<t.length;r++){let i=t[r];if(ji(i)||Xi(i))break;if(We(i))n+=gt(i.text||"",De(i));else if(qi(i)){let o={fontFamily:i.fontFamily??Zt,fontSize:i.fontSize??mt,bold:i.bold,italic:i.italic};n+=gt(i.fallback||"1",o)}else _i(i)&&(n+=i.width||0)}return n}function Gs(t){let e=[];for(let n=0;n<t.length;n++){let r=t[n];(r===" "||r==="-"||r==="	")&&e.push(n+1)}return e}function Xe(t,e,n){let r=Math.max(1,n),i=Math.max(0,t),o=Math.max(0,e);return i>=r||o>=r||i+o>=r?{leftMargin:0,rightMargin:0}:{leftMargin:i,rightMargin:o}}function Gn(t,e,n){let r=t.runs,i=t.attrs,o=i?.spacing,l=n?.floatingZones,a=n?.paragraphYOffset??0,s=i?.indent,u=s?.left??0,p=s?.right??0,d=(s?.firstLine??0)-(s?.hanging??0),f=Math.max(1,e-u-p),h=(s?.hanging??0)===0?Yn(t):0,c=Math.max(1,f-d-h),m=0,g=0,v=Nt(mt)*je,C=(R,T)=>{if(!l||l.length===0)return;let M=a+m,B=Zs(M,R,l,T,Ft)-M;B>0&&(m+=B,g+=B)};C(v,c);let y=zn(m,v,l,a),k=Math.max(1,An(y,c)),x=[];if(r.length===0){if(i?.suppressEmptyParagraphHeight)return x.push({fromRun:0,fromChar:0,toRun:0,toChar:0,width:0,ascent:0,descent:0,lineHeight:0}),{kind:"paragraph",lines:x,totalHeight:0};let R=i?.defaultFontSize??mt,T=i?.defaultFontFamily??Zt,M=Ei(R,o,T);x.push({fromRun:0,fromChar:0,toRun:0,toChar:0,width:0,...M});let B=M.lineHeight;return o?.before&&(B+=o.before),o?.after&&(B+=o.after),{kind:"paragraph",lines:x,totalHeight:B}}if(r.length===1&&We(r[0])&&Vs(r[0])){let R=r[0],T=R.fontSize??i?.defaultFontSize??mt,M=R.fontFamily??i?.defaultFontFamily??Zt,B=Ei(T,o,M);x.push({fromRun:0,fromChar:0,toRun:0,toChar:0,width:0,...B});let N=B.lineHeight;return o?.before&&(N+=o.before),o?.after&&(N+=o.after),{kind:"paragraph",lines:x,totalHeight:N}}let w={fromRun:0,fromChar:0,toRun:0,toChar:0,width:0,maxFontSize:mt,maxFontMetrics:null,maxImageHeightPx:0,availableWidth:k,leftOffset:y.leftMargin,rightOffset:y.rightMargin,segmentZones:y.segments},I=()=>{let R=Wi(w.maxFontSize,o,w.maxFontMetrics),T={...R};if(w.maxImageHeightPx>T.lineHeight){let B=w.maxImageHeightPx,N=T.descent;w.fromRun===w.toRun?(T.lineHeight=B+N*2,T.ascent=B+N):(T.lineHeight=B+N,T.ascent=B)}let M={fromRun:w.fromRun,fromChar:w.fromChar,toRun:w.toRun,toChar:w.toChar,width:w.width,...T};w.leftOffset>0&&(M.leftOffset=w.leftOffset),w.rightOffset>0&&(M.rightOffset=w.rightOffset),w.segmentZones?.length&&(M.segments=F(M,w.segmentZones)),g>0&&(M.floatSkipBefore=g,g=0),x.push(M),m+=R.lineHeight},F=(R,T)=>{let M=T[0],B=T[1];if(!M)return;if(!B||R.width<=M.availableWidth+It)return[{fromRun:R.fromRun,fromChar:R.fromChar,toRun:R.toRun,toChar:R.toChar,width:R.width,leftOffset:M.leftOffset,availableWidth:M.availableWidth}];if(R.fromRun!==R.toRun)return;let N=r[R.fromRun];if(!N||!We(N))return;let z=N,A=z.text.slice(R.fromChar,R.toChar),j=De(z),H=Ri(A,j,M.availableWidth);if(H<=0||H>=A.length)return;let Y=R.fromChar+H,U=A.slice(0,H),ut=A.slice(H);return[{fromRun:R.fromRun,fromChar:R.fromChar,toRun:R.toRun,toChar:Y,width:gt(U,j),leftOffset:M.leftOffset,availableWidth:M.availableWidth},{fromRun:R.fromRun,fromChar:Y,toRun:R.toRun,toChar:R.toChar,width:gt(ut,j),leftOffset:B.leftOffset,availableWidth:B.availableWidth}]},$=(R,T)=>{I();let M=Nt(mt)*je;C(M,f);let B=zn(m,M,l,a),N=Math.max(1,An(B,f));w={fromRun:R,fromChar:T,toRun:R,toChar:T,width:0,maxFontSize:mt,maxFontMetrics:null,maxImageHeightPx:0,availableWidth:N,leftOffset:B.leftMargin,rightOffset:B.rightMargin,segmentZones:B.segments}},E=R=>{let T=R.fontSize??mt;(!w.maxFontMetrics||T>w.maxFontSize)&&(w.maxFontSize=T,w.maxFontMetrics=qn(R))};for(let R=0;R<r.length;R++){let T=r[R];if(Xi(T)){w.toRun=R,w.toChar=0,$(R+1,0);continue}if(ji(T)){let M=De(T);E(M);let B=Ys(r,R),N=w.width+(w.leftOffset??0),z=x.length===0,A=u+(z?d:0)+N,j={explicitStops:i?.tabs,leftIndent:Di(u)},H=Un(A,j,{followingWidth:B}).width;if(N+H>w.availableWidth+It){let Y=w.availableWidth-N-B;Y>1&&(H=Y)}w.width+H>w.availableWidth+It&&($(R,0),E(M)),w.width+=H,w.toRun=R,w.toChar=1;continue}if(_i(T)){let M=T.wrapType,B=T.displayMode==="float"||Ne(M);if(T.position&&B){w.toRun=R,w.toChar=1;continue}if(M==="topAndBottom"||T.displayMode==="block"){w.width>0&&$(R,0);let H=T.height,Y=T.distTop??6,U=T.distBottom??6;w.toRun=R,w.toChar=1,w.maxImageHeightPx=H+Y+U,$(R+1,0);continue}let N=T.width,z=T.height;w.width+N>w.availableWidth+It&&$(R,0);let A=N>0&&N>w.availableWidth?w.availableWidth/N:1,j=z*A+(T.distTop??0)+(T.distBottom??0);j>w.maxImageHeightPx&&(w.maxImageHeightPx=j),w.width+=N,w.toRun=R,w.toChar=1;continue}if(qi(T)){let M=T.fallback||"1",B={fontFamily:T.fontFamily??Zt,fontSize:T.fontSize??mt,bold:T.bold,italic:T.italic};E(B);let N=gt(M,B);w.width>0&&w.width+N>w.availableWidth+It&&($(R,0),E(B)),w.width+=N,w.toRun=R,w.toChar=1;continue}if(We(T)){let M=T,B=M.text,N=De(M);if(E(N),!B||B.length===0){w.toRun=R,w.toChar=0;continue}let z=Gs(B),A=0;for(;A<B.length;){let j=B.length;for(let U of z)if(U>A){j=U;break}let H=B.slice(A,j),Y=gt(H,N);if(Y>w.availableWidth+It){let U=0;for(;U<H.length;){let ut=w.availableWidth-w.width+It,vt=H.slice(U),dt=Ri(vt,N,ut);if(dt===0){if(w.width>0){$(R,A+U),E(N);continue}dt=1}let et=U+dt,K=H.slice(U,et),lt=gt(K,N);w.width+=lt,w.toRun=R,w.toChar=A+et,U=et,U<H.length&&($(R,A+U),E(N))}A=j;continue}w.width>0&&w.width+Y>w.availableWidth+It&&($(R,A),E(N)),w.width+=Y,w.toRun=R,w.toChar=j,A=j}}}I();let P=x.reduce((R,T)=>R+T.lineHeight+(T.floatSkipBefore??0),0);return o?.before&&(P+=o.before),o?.after&&(P+=o.after),{kind:"paragraph",lines:x,totalHeight:P}}function Ui(t,e){return t.map(n=>{let r=n.x-n.distLeft,i=n.x+n.width+n.distRight,o=n.y-n.distTop,l=n.y+n.height+n.distBottom;if(n.wrapType==="topAndBottom")return{leftMargin:0,rightMargin:0,topY:o,bottomY:l,fullWidthBlock:!0};let a=0,s=0,u,p=n.wrapText??"bothSides";p==="right"?a=Nn(i):p==="left"?s=On(r,e):p==="largest"?{leftMargin:a,rightMargin:s}=tp(r,i,e):Js(r,i,e)?u=Qs(r,i,e):n.side==="left"?a=Nn(i):s=On(r,e);let d=Xe(a,s,e);return{leftMargin:d.leftMargin,rightMargin:d.rightMargin,topY:o,bottomY:l,segments:u}})}function An(t,e){return t.segments?.reduce((n,r)=>n+r.availableWidth,0)??e-t.leftMargin-t.rightMargin}function zn(t,e,n,r){if(!n||n.length===0)return{leftMargin:0,rightMargin:0};let i=0,o=0,l,a=r+t,s=a+e;for(let u of n)if(!(s<=u.topY||a>=u.bottomY)){if(u.fullWidthBlock)return{leftMargin:0,rightMargin:0,segments:[{leftOffset:0,availableWidth:0}]};if(u.segments?.length){l=l?Ks(l,u.segments):u.segments;continue}i=Math.max(i,u.leftMargin),o=Math.max(o,u.rightMargin)}return{leftMargin:i,rightMargin:o,segments:l}}function Zs(t,e,n,r,i){if(!n||n.length===0)return t;let o=t;for(let l=0;l<n.length+2;l++){let a=zn(o,e,n,0);if(An(a,r)>=i)return o;let s=o+e,u=1/0;for(let p of n)s<=p.topY||o>=p.bottomY||p.bottomY>o&&p.bottomY<u&&(u=p.bottomY);if(!Number.isFinite(u)||u<=o)return o;o=u}return o}function Ks(t,e){let n=[];for(let r of t)for(let i of e){let o=Math.max(r.leftOffset,i.leftOffset),l=Math.min(r.leftOffset+r.availableWidth,i.leftOffset+i.availableWidth);l>o&&n.push({leftOffset:o,availableWidth:l-o})}return n}var Ft=24;function Js(t,e,n){return t>Ft&&e+Ft<n}function Qs(t,e,n){return[{leftOffset:0,availableWidth:Math.max(0,t)},{leftOffset:Math.max(0,e),availableWidth:Math.max(0,n-e)}].filter(r=>r.availableWidth>1)}function tp(t,e,n){let r=Math.max(0,t);return Math.max(0,n-e)>=r?{leftMargin:Nn(e),rightMargin:0}:{leftMargin:0,rightMargin:On(t,n)}}function Nn(t){return Math.max(0,t)}function On(t,e){return Math.max(0,e-t)}function ep(t,e){return t==null||!Number.isFinite(t)?0:Math.max(0,Math.min(e,t))}function He(t,e,n){if(t)return t.kind==="text"?typeof t.pmStart=="number"?t.pmStart+ep(e,t.text.length):n==="end"?t.pmEnd:void 0:n==="end"?typeof t.pmEnd=="number"?t.pmEnd:typeof t.pmStart=="number"?t.pmStart+1:void 0:t.pmStart}function np(t,e,n,r){if(e.lines.length===0||n>=r)return{pmStart:t.pmStart,pmEnd:t.pmEnd};let i=e.lines[n],o=e.lines[r-1],l=i?t.runs[i.fromRun]:void 0,a=o?t.runs[o.toRun]:void 0,s=n===0?t.pmStart??He(l,i?.fromChar??0,"start"):He(l,i?.fromChar??0,"start"),u=r>=e.lines.length?t.pmEnd??He(a,o?.toChar??0,"end"):He(a,o?.toChar??0,"end");return s==null&&(s=t.pmStart),u==null&&(u=t.pmEnd),s!=null&&u!=null&&u<=s&&(u=s+1),{pmStart:s,pmEnd:u}}function Vi(t){if(t.runs.length===0)return!0;if(t.runs.length!==1)return!1;let e=t.runs[0];return e.kind==="text"&&(e.text??"")===""}function Hn(t){let e=t.attrs?.spacing?.before??0;return Vi(t)&&!t.attrs?.spacingExplicit?.before?0:e}function Dn(t){let e=t.attrs?.spacing?.after??0;return Vi(t)&&!t.attrs?.spacingExplicit?.after?0:e}function rp(t,e,n,r){let i=0,o=!1;for(let l=n;l<r;l++){let a=t[l],s=e[l];if(a.kind==="paragraph"&&s.kind==="paragraph"){i+=Hn(a)+s.totalHeight+Dn(a),o=o||s.lines.length>0;continue}if(a.kind!=="sectionBreak")return null}return o?i:null}function ip(t,e){let n=t.columns;if(n.count<=1||!Number.isFinite(e)||e<=0)return;let r=t.getCurrentState(),i=r.cursorY,o=r.contentBottom-i;if(o<=0||e>o*n.count)return;let l=Math.ceil(e/n.count);l<=0||l>=o||(r.contentBottom=i+l)}function op({blocks:t,measures:e,paginator:n,start:r,end:i}){let o=rp(t,e,r,i);o!==null&&ip(n,o)}function Ug(t,e){for(let n=0;n<t.pages.length;n++)for(let r of t.pages[n].fragments){if(r.pmStart==null)continue;let i=r.pmStart,o=r.pmEnd??i+1;if(e>=i&&e<o)return n}return null}var lp={w:816,h:1056},Gt={top:96,right:96,bottom:96,left:96},Yi={count:1,gap:0};function Zn(t,e,n){let r=[],i=[],o=e;for(let l=0;l<t.length;l++){if(t[l].kind!=="sectionBreak")continue;let a=t[l],s={pageSize:a.pageSize??o.pageSize,margins:a.margins??o.margins,columns:a.columns};r.push(s),i.push(l),o=s}return r.push(n),{configs:r,breakIndices:i}}function Gi(t){for(let e=0;e<t.length-1;e++){let n=t[e],r=t[e+1];if(n.kind!=="paragraph"||r.kind!=="paragraph")continue;let i=n.attrs,o=r.attrs;i?.contextualSpacing&&o?.contextualSpacing&&i.styleId&&i.styleId===o.styleId&&(i.spacing&&(i.spacing={...i.spacing,after:0}),o.spacing&&(o.spacing={...o.spacing,before:0}))}for(let e of t)if(e.kind==="table")for(let n of e.rows)for(let r of n.cells)Gi(r.blocks)}function qe(t,e,n={}){if(t.length!==e.length)throw new Error(`layoutDocument: expected one measure per block (blocks=${t.length}, measures=${e.length})`);let r=n.pageSize??lp,i={top:n.margins?.top??Gt.top,right:n.margins?.right??Gt.right,bottom:n.margins?.bottom??Gt.bottom,left:n.margins?.left??Gt.left,header:n.margins?.header??n.margins?.top??Gt.top,footer:n.margins?.footer??n.margins?.bottom??Gt.bottom};n.headerContentHeights,n.footerContentHeights,n.titlePage,n.evenAndOddHeaders;let o={...i},l=n.finalPageSize??r,a=n.finalMargins??o;if(r.w-o.left-o.right<=0)throw new Error("layoutDocument: page size and margins yield no content area");let s={pageSize:r,margins:o,columns:n.columns},u={pageSize:l,margins:a,columns:n.columns},{configs:p,breakIndices:d}=Zn(t,s,u),f=[...d.map(C=>t[C].type),n.bodyBreakType],h=p[0]??s,c=Ps({pageSize:h.pageSize,margins:h.margins,columns:h.columns??Yi,footnoteReservedHeights:n.footnoteReservedHeights});Gi(t);let m=Rs(t),g=Ms(m),v=0;for(let C=0;C<t.length;C++){let y=t[C],k=e[C];Bs(y)&&c.forcePageBreak();let x=m.get(C);if(x&&!g.has(C)){let w=Es(x,t,e),I=c.getCurrentState(),F=c.getAvailableHeight(),$=I.contentBottom-I.topMargin;w<=$&&w>F&&I.page.fragments.length>0&&c.forcePageBreak()}switch(y.kind){case"paragraph":ap(y,k,c,c.getContentWidth());break;case"table":y.floating?up(y,k,c,c.getContentWidth()):pp(y,k,c);break;case"image":dp(y,k,c);break;case"textBox":cp(y,k,c);break;case"pageBreak":c.forcePageBreak();break;case"columnBreak":c.forceColumnBreak();break;case"sectionBreak":{let w=f[v+1]??f[v],I=p[v+1]??h;hp(y,c,I,w),d[v+1]===void 0&&(w??"nextPage")==="continuous"&&(I.columns?.count??1)>1&&op({blocks:t,measures:e,paginator:c,start:C+1,end:t.length}),v++;break}default:ze(y,"runLayoutPipeline")}}return c.pages.length===0&&c.getCurrentState(),{pageSize:r,pages:c.pages,columns:n.columns,pageGap:n.pageGap}}function ap(t,e,n,r){if(e.kind!=="paragraph")throw new Error("layoutParagraph: expected paragraph measure");let i=e.lines;if(i.length===0){let s=Hn(t),u=Dn(t),p=n.getCurrentState(),d={kind:"paragraph",blockId:t.id,x:n.getColumnX(p.columnIndex),y:p.cursorY+s,width:r,height:0,fromLine:0,toLine:0,pmStart:t.pmStart,pmEnd:t.pmEnd};n.addFragment(d,0,s,u);return}let o=Hn(t),l=Dn(t),a=0;for(;a<i.length;){let s=n.getCurrentState(),u=a===0?Math.max(o,s.trailingSpacing):0,p=n.getAvailableHeight()-u,d=0,f=0;for(let k=a;k<i.length;k++){let x=i[k].lineHeight+(i[k].floatSkipBefore??0),w=d+x;if(w<=p||f===0)d=w,f++;else break}let h=a===0,c=a+f>=i.length,m=h?o:0,g=c?l:0,v=np(t,e,a,a+f),C={kind:"paragraph",blockId:t.id,x:n.getColumnX(s.columnIndex),y:0,width:r,height:d,fromLine:a,toLine:a+f,pmStart:v.pmStart,pmEnd:v.pmEnd,continuesFromPrev:!h,continuesOnNext:!c},y=n.addFragment(C,d,m,g);C.y=y.y,a+=f,a<i.length&&n.ensureFits(i[a].lineHeight)}}function sp(t){let e=0;for(let n of t.rows)if(n.isHeader)e++;else break;return e}function Ue(t,e){let n=0;for(let r=0;r<e&&r<t.rows.length;r++)n+=t.rows[r].height;return n}function pp(t,e,n){if(e.kind!=="table")throw new Error("layoutTable: expected table measure");let r=e.rows;if(r.length===0)return;let i=sp(t),o=Ue(e,i),l=zs(t,e),a=0,s=0;for(;a<r.length;){let u=n.getCurrentState(),p=a===0&&s===0,d=p?u.trailingSpacing:0,f=!p&&i>0?o:0,h=n.getAvailableHeight()-d-f,c=a,m=s,g=0,v=a,C=s,y=a,k,x=!1;for(;v<r.length;){let P=r[v].height,R=v===c?C:0,T=P-R;if(g+T<=h){g+=T,v+=1,y=v;continue}let M=h-g,B=t.rows[v]?.cantSplit?0:Ns(l,v,R,M);B>0?(g+=B,y=v+1,k=R+B,x=!0):y>c||(g+=T,y=v+1);break}let w=f+g,I=y===r.length&&!x,F=n.getColumnX(u.columnIndex);t.justification==="center"?F=F+(n.columnWidth-e.totalWidth)/2:t.justification==="right"?F=F+n.columnWidth-e.totalWidth:t.indent&&(F+=t.indent);let $={kind:"table",blockId:t.id,x:F,y:0,width:e.totalWidth,height:w,fromRow:c,toRow:y,pmStart:t.pmStart,pmEnd:t.pmEnd,continuesFromPrev:!p,continuesOnNext:!I,headerRowCount:!p&&i>0?i:void 0,topClip:m>0?m:void 0,bottomClip:k},E=n.addFragment($,w,0,0);if($.y=E.y,$.x=F,x?(a=y-1,s=k??0):(a=y,s=0),a<r.length){let P=(i>0?o:0)+(r[a].height-s);n.ensureFits(P)}}}function up(t,e,n,r){if(e.kind!=="table")throw new Error("layoutFloatingTable: expected table measure");let i=n.getCurrentState(),o=t.floating,l=i.page,a=l.margins,s=e.totalWidth,u=e.totalHeight,p=l.size.h-a.top-a.bottom,d=a.left,f=a.top;o?.horzAnchor==="page"&&(d=0),o?.vertAnchor==="page"&&(f=0),o?.vertAnchor==="text"&&(f=i.cursorY);let h=n.getColumnX(i.columnIndex);if(o?.tblpX!==void 0)h=d+o.tblpX;else if(o?.tblpXSpec){let I=o.tblpXSpec;I==="left"||I==="inside"?h=d:I==="right"||I==="outside"?h=d+r-s:I==="center"&&(h=d+(r-s)/2)}else t.justification==="center"?h=d+(r-s)/2:t.justification==="right"&&(h=d+r-s);let c=i.cursorY,m=!1;if(o?.tblpY!==void 0)c=f+o.tblpY,m=!0;else if(o?.tblpYSpec){m=!0;let I=o.tblpYSpec;I==="top"?c=f:I==="bottom"?c=f+p-u:I==="center"&&(c=f+(p-u)/2)}m||(c=n.ensureFits(u).cursorY);let g=a.left,v=a.left+r-s;Number.isFinite(v)&&(h=Math.max(g,Math.min(h,v)));let C={kind:"table",blockId:t.id,x:h,y:c,width:s,height:u,fromRow:0,toRow:t.rows.length,pmStart:t.pmStart,pmEnd:t.pmEnd,isFloating:!0};i.page.fragments.push(C);let y=o?.leftFromText??0,k=o?.rightFromText??0,x=h-a.left-y,w=a.left+r-(h+s)-k;if(x<Ft&&w<Ft){let I=c+u+(o?.bottomFromText??0);I>i.cursorY&&(i.cursorY=I)}}function dp(t,e,n){if(e.kind!=="image")throw new Error("layoutImage: expected image measure");if(t.anchor?.isAnchored){fp(t,e,n);return}let r=n.ensureFits(e.height),i={kind:"image",blockId:t.id,x:n.getColumnX(r.columnIndex),y:0,width:e.width,height:e.height,pmStart:t.pmStart,pmEnd:t.pmEnd},o=n.addFragment(i,e.height,0,0);i.y=o.y}function fp(t,e,n){let r=n.getCurrentState(),i=t.anchor,o=i.offsetH??n.getColumnX(r.columnIndex),l=i.offsetV??r.cursorY,a={kind:"image",blockId:t.id,x:o,y:l,width:e.width,height:e.height,pmStart:t.pmStart,pmEnd:t.pmEnd,isAnchored:!0,zIndex:i.behindDoc?-1:1};r.page.fragments.push(a)}function cp(t,e,n){if(e.kind!=="textBox")throw new Error("layoutTextBox: expected textBox measure");if(Ot(t)){let l=n.getCurrentState(),a={kind:"textBox",blockId:t.id,x:n.getColumnX(l.columnIndex),y:l.cursorY,width:e.width,height:e.height,pmStart:t.pmStart,pmEnd:t.pmEnd,isFloating:!0,zIndex:t.wrapType==="behind"?-1:1};l.page.fragments.push(a);return}let r=n.ensureFits(e.height),i={kind:"textBox",blockId:t.id,x:n.getColumnX(r.columnIndex),y:0,width:e.width,height:e.height,pmStart:t.pmStart,pmEnd:t.pmEnd},o=n.addFragment(i,e.height,0,0);i.y=o.y}function hp(t,e,n,r){switch(r??"nextPage"){case"nextPage":e.updatePageLayout(n.pageSize,n.margins),e.forcePageBreak();break;case"evenPage":{e.updatePageLayout(n.pageSize,n.margins),e.forcePageBreak().page.number%2!==0&&e.forcePageBreak();break}case"oddPage":{e.updatePageLayout(n.pageSize,n.margins),e.forcePageBreak().page.number%2===0&&e.forcePageBreak();break}case"continuous":{let i=e.getCurrentState().page.size,o=n.pageSize;o!=null&&(Math.round(o.w)!==Math.round(i.w)||Math.round(o.h)!==Math.round(i.h))?(e.updatePageLayout(n.pageSize,n.margins),e.forcePageBreak()):e.updatePageLayout(n.pageSize,n.margins,!1);break}}e.updateColumns(n.columns??Yi)}function Kn(t){return{sdtType:t.sdtType,id:t.id??null,alias:t.alias??null,tag:t.tag??null,lock:t.lock??null,placeholder:t.placeholder??null,showingPlaceholder:t.showingPlaceholder??!1,dateFormat:t.dateFormat??null,listItems:t.listItems?JSON.stringify(t.listItems):null,checked:t.checked??null,dataBinding:t.dataBinding?JSON.stringify(t.dataBinding):null,rawPropertiesXml:t.rawPropertiesXml??null,rawEndPropertiesXml:t.rawEndPropertiesXml??null}}function Zg(t){let e={sdtType:t.sdtType??"richText"};if(typeof t.id=="number"&&(e.id=t.id),t.alias!=null&&(e.alias=String(t.alias)),t.tag!=null&&(e.tag=String(t.tag)),t.lock!=null&&(e.lock=t.lock),t.placeholder!=null&&(e.placeholder=String(t.placeholder)),t.showingPlaceholder&&(e.showingPlaceholder=!0),t.dateFormat!=null&&(e.dateFormat=String(t.dateFormat)),typeof t.listItems=="string"&&t.listItems)try{e.listItems=JSON.parse(t.listItems)}catch{}if(t.checked!=null&&(e.checked=t.checked),typeof t.dataBinding=="string"&&t.dataBinding)try{e.dataBinding=JSON.parse(t.dataBinding)}catch{}return t.rawPropertiesXml!=null&&(e.rawPropertiesXml=String(t.rawPropertiesXml)),t.rawEndPropertiesXml!=null&&(e.rawEndPropertiesXml=String(t.rawEndPropertiesXml)),e}function Jn(t){return!!t.wrap&&t.wrap.type!=="inline"}function Zi(t){let e=t.wrap?.type??"inline",n=t.wrap?.wrapText,r=t.position?.horizontal?.alignment;return{displayMode:mp(e),cssFloat:wp(e,n,r),wrapType:e,wrapText:n,anchorTarget:Jn(t)?"followingBlock":void 0,position:t.position?yp(t.position):void 0,distTop:t.wrap?.distT!=null?q(t.wrap.distT):void 0,distBottom:t.wrap?.distB!=null?q(t.wrap.distB):void 0,distLeft:t.wrap?.distL!=null?q(t.wrap.distL):void 0,distRight:t.wrap?.distR!=null?q(t.wrap.distR):void 0}}function Kg(t){return t.anchorTarget==="followingBlock"||gp(t)}function Jg(t){let e=t.position;if(!(!e?.horizontal&&!e?.vertical))return{horizontal:{relativeTo:e.horizontal?.relativeTo??"margin",alignment:e.horizontal?.align,posOffset:e.horizontal?.posOffset},vertical:{relativeTo:e.vertical?.relativeTo??"paragraph",alignment:e.vertical?.align,posOffset:e.vertical?.posOffset}}}function Qg(t){let e=t.wrapType??(t.displayMode==="float"?"square":"inline");if(!e||e==="inline")return;let n={type:e};return t.wrapText&&(n.wrapText=t.wrapText),t.distTop!=null&&(n.distT=Ct(t.distTop)),t.distBottom!=null&&(n.distB=Ct(t.distBottom)),t.distLeft!=null&&(n.distL=Ct(t.distLeft)),t.distRight!=null&&(n.distR=Ct(t.distRight)),n}function mp(t){return t==="inline"?"inline":t==="topAndBottom"?"block":"float"}function gp(t){return t.displayMode==="float"||Yt(t.wrapType)}function wp(t,e,n){return t==="inline"||t==="topAndBottom"?"none":e==="left"?"right":e==="right"||n==="left"?"left":n==="right"?"right":"none"}function yp(t){return{horizontal:t.horizontal?{relativeTo:t.horizontal.relativeTo,posOffset:t.horizontal.posOffset,align:t.horizontal.alignment}:void 0,vertical:t.vertical?{relativeTo:t.vertical.relativeTo,posOffset:t.vertical.posOffset,align:t.vertical.alignment}:void 0}}var bp=new Set(["hyperlink"]),Ki=new Set(["hyperlink","comment"]);function Ji(t,e=bp){let n=t.filter(r=>!e.has(r.type.name));return n.length===0?"":n.map(r=>`${r.type.name}:${JSON.stringify(r.attrs)}`).sort().join("|")}function Qi(t){let e=t?.package.headers;if(e){for(let n of e.values())if(n.watermark)return n.watermark}}function xp(t){let e=t.package.headers;if(!e||e.size===0)return t;let n=!1,r=new Map;for(let[i,o]of e)if(o.watermark){let{watermark:l,...a}=o;r.set(i,a),n=!0}else r.set(i,o);return n?{...t,package:{...t.package,headers:r}}:t}function vp(t,e){let n=t.package.headers;if(!n||n.size===0)return t;let r=new Map;for(let[i,o]of n)r.set(i,{...o,watermark:{...e}});return{...t,package:{...t.package,headers:r}}}function kp(t){let e=t.package.document,n=[];if(e.sections)for(let r of e.sections)r.properties&&n.push(r.properties);return e.finalSectionProperties&&n.push(e.finalSectionProperties),n}function Sp(t,e){let n=t.package,r=n.document,i=n.headers,o=kp(t),l=new Set;if(i)for(let F of i.values())l.add(F.hdrFtrType);let a=!i||i.size===0,s=o.some(F=>F.titlePg),u=o.some(F=>F.evenAndOddHeaders),p=a,d=s&&!l.has("first"),f=u&&!l.has("even");if(!p&&!d&&!f)return t;let h=n.relationships?new Map(n.relationships):new Map,c=new Map(i??[]),m=new Set;for(let F of h.values())F.target&&m.add(F.target.replace(/^\/?word\//,"").toLowerCase());function g(){let F=1;for(;m.has(`header${F}.xml`);)F++;let $=`header${F}.xml`;return m.add($.toLowerCase()),$}function v(F){let $=`rIdWmHdr${F[0].toUpperCase()}${F.slice(1)}`,E=1;for(;h.has($);)$=`rIdWmHdr${F[0].toUpperCase()}${F.slice(1)}${E++}`;return h.set($,{id:$,type:Z.header,target:g()}),c.set($,{type:"header",hdrFtrType:F,content:[],watermark:{...e}}),$}let C={};function y(F){return C[F]??(C[F]=v(F))}function k(F,$){let E=F?.headerReferences?[...F.headerReferences]:[];return E.some(P=>P.type===$)?F??{}:(E.push({type:$,rId:y($)}),{...F??{},headerReferences:E})}function x(F){let $=F;return p&&($=k($,"default")),d&&$?.titlePg&&($=k($,"first")),f&&$?.evenAndOddHeaders&&($=k($,"even")),$}let w=x(r.finalSectionProperties),I=r.sections?.map(F=>({...F,properties:x(F.properties)??F.properties}));return{...t,package:{...n,relationships:h,headers:c,document:{...r,finalSectionProperties:w,...I?{sections:I}:{}}}}}function nw(t,e){if(!e)return xp(t);let n=vp(t,e);return Sp(n,e)}function Cp(t){if(!t||t.pattern&&t.pattern!=="clear")return;let e=t.fill?.rgb;if(!(!e||t.fill?.auto))return mi(e)}function Qn(t){if(!t)return[];let e=[];t.bold&&e.push(_.mark("bold")),t.italic&&e.push(_.mark("italic")),t.underline&&t.underline.style!=="none"&&e.push(_.mark("underline",{style:t.underline.style,color:t.underline.color})),(t.strike||t.doubleStrike)&&e.push(_.mark("strike",{double:t.doubleStrike||!1})),t.color&&!t.color.auto&&e.push(_.mark("textColor",{rgb:t.color.rgb,themeColor:t.color.themeColor,themeTint:t.color.themeTint,themeShade:t.color.themeShade}));let n=t.highlight&&t.highlight!=="none"?t.highlight:Cp(t.shading);return n&&e.push(_.mark("highlight",{color:n})),(t.fontSize!=null||t.fontSizeCs!=null)&&e.push(_.mark("fontSize",{size:t.fontSize??null,sizeCs:t.fontSizeCs??null})),t.fontFamily&&e.push(_.mark("fontFamily",{ascii:t.fontFamily.ascii,hAnsi:t.fontFamily.hAnsi,eastAsia:t.fontFamily.eastAsia,cs:t.fontFamily.cs,asciiTheme:t.fontFamily.asciiTheme,hAnsiTheme:t.fontFamily.hAnsiTheme,eastAsiaTheme:t.fontFamily.eastAsiaTheme,csTheme:t.fontFamily.csTheme})),t.vertAlign==="superscript"?e.push(_.mark("superscript")):t.vertAlign==="subscript"&&e.push(_.mark("subscript")),t.allCaps&&e.push(_.mark("allCaps")),t.smallCaps&&e.push(_.mark("smallCaps")),(t.spacing!=null||t.position!=null||t.scale!=null||t.kerning!=null)&&e.push(_.mark("characterSpacing",{spacing:t.spacing??null,position:t.position??null,scale:t.scale??null,kerning:t.kerning??null})),t.emboss&&e.push(_.mark("emboss")),t.imprint&&e.push(_.mark("imprint")),t.shadow&&e.push(_.mark("textShadow")),t.emphasisMark&&t.emphasisMark!=="none"&&e.push(_.mark("emphasisMark",{type:t.emphasisMark})),t.outline&&e.push(_.mark("textOutline")),t.hidden&&e.push(_.mark("hidden")),t.rtl&&e.push(_.mark("rtl")),t.effect&&t.effect!=="none"&&e.push(_.mark("textEffect",{effect:t.effect})),t.styleId&&e.push(_.mark("runStyle",{styleId:t.styleId})),e}function Ye(t,e){if(!t)return;if(!e)return t;let n=e.resolveRunStyle(t.styleId);return n?nt(n,t):t}function no(t,e){let n="",r,i=t.type==="simpleField"?t.content:t.fieldResult;if(i){for(let s of i)if(s.type==="run"){for(let u of s.content)u.type==="text"&&(n+=u.text);!r&&s.formatting&&(r=s.formatting)}}let o=r??(t.type==="complexField"?t.formatting:void 0),l=nt(e,o),a=Qn(l);return _.node("field",{fieldType:t.fieldType,instruction:t.instruction,displayText:n,fieldKind:t.type==="simpleField"?"simple":"complex",fldLock:t.fldLock??!1,dirty:t.dirty??!1},void 0,a)}function ro(t){return _.node("math",{display:t.display,ommlXml:t.ommlXml,plainText:t.plainText||""})}function tr(t,e,n){let r=[],i=t.formatting?.styleId?n?.getRunStyleOwnProperties(t.formatting.styleId):void 0,o=nt(nt(e,i),t.formatting),l=Qn(o);for(let a of t.content){let s=io(a,l);r.push(...s)}return r}function io(t,e){switch(t.type){case"text":return t.text?[_.text(t.text,e)]:[];case"break":return t.breakType==="textWrapping"||!t.breakType?[_.node("hardBreak",null,void 0,e)]:[];case"tab":return[_.node("tab",null,void 0,e)];case"drawing":return t.image?[Tp(t.image)]:[];case"shape":{let i=t.shape;return i.textBody&&i.textBody.content.length>0?[]:[$p(i)]}case"footnoteRef":let n=_.mark("footnoteRef",{id:t.id.toString(),noteType:"footnote"});return[_.text(t.id.toString(),[...e,n])];case"endnoteRef":let r=_.mark("footnoteRef",{id:t.id.toString(),noteType:"endnote"});return[_.text(t.id.toString(),[...e,r])];default:return[]}}function Tp(t){let e=t.size?.width?q(t.size.width):void 0,n=t.size?.height?q(t.size.height):void 0,r=t.wrap.type,i=t.wrap.wrapText,o=t.position?.horizontal?.alignment,l;r==="inline"||r==="topAndBottom"?l="none":r==="square"||r==="tight"||r==="through"?i==="left"?l="right":i==="right"||o==="left"?l="left":o==="right"?l="right":l="none":l="none";let a="inline";r==="inline"?a="inline":r==="topAndBottom"?a="block":$t(r)||l&&l!=="none"?a="float":a="block";let s;if(t.transform){let x=[];t.transform.rotation&&x.push(`rotate(${t.transform.rotation}deg)`),t.transform.flipH&&x.push("scaleX(-1)"),t.transform.flipV&&x.push("scaleY(-1)"),x.length>0&&(s=x.join(" "))}let u=t.wrap.distT!=null?q(t.wrap.distT):void 0,p=t.wrap.distB!=null?q(t.wrap.distB):void 0,d=t.wrap.distL!=null?q(t.wrap.distL):void 0,f=t.wrap.distR!=null?q(t.wrap.distR):void 0,h;t.position&&(h={horizontal:t.position.horizontal?{relativeTo:t.position.horizontal.relativeTo,posOffset:t.position.horizontal.posOffset,align:t.position.horizontal.alignment}:void 0,vertical:t.position.vertical?{relativeTo:t.position.vertical.relativeTo,posOffset:t.position.vertical.posOffset,align:t.position.vertical.alignment}:void 0});let c,m,g;if(t.outline&&t.outline.width){c=Math.round(t.outline.width/914400*96*100)/100,t.outline.color?.rgb&&(m=`#${t.outline.color.rgb}`);let x={solid:"solid",dot:"dotted",dash:"dashed",lgDash:"dashed",dashDot:"dashed",lgDashDot:"dashed",lgDashDotDot:"dashed",sysDot:"dotted",sysDash:"dashed",sysDashDot:"dashed",sysDashDotDot:"dashed"};g=t.outline.style&&x[t.outline.style]||"solid"}let v=t.padding?.top?q(t.padding.top):void 0,C=t.padding?.bottom?q(t.padding.bottom):void 0,y=t.padding?.left?q(t.padding.left):void 0,k=t.padding?.right?q(t.padding.right):void 0;return _.node("image",{src:t.src||"",alt:t.alt,title:t.title,width:e,height:n,rId:t.rId,wrapType:r,displayMode:a,cssFloat:l,transform:s,distTop:u,distBottom:p,distLeft:d,distRight:f,position:h,borderWidth:c,borderColor:m,borderStyle:g,wrapText:i,hlinkHref:t.hlinkHref,cropTop:t.crop?.top,cropRight:t.crop?.right,cropBottom:t.crop?.bottom,cropLeft:t.crop?.left,opacity:t.opacity,effectExtentTop:v,effectExtentBottom:C,effectExtentLeft:y,effectExtentRight:k,layoutInCell:t.layoutInCell,allowOverlap:t.allowOverlap})}function er(t,e,n){let r=[],i=t.href||(t.anchor?`#${t.anchor}`:""),o=_.mark("hyperlink",{href:i,tooltip:t.tooltip,rId:t.rId});for(let l of t.children)if(l.type==="run"){let a=l.formatting?.styleId?n?.getRunStyleOwnProperties(l.formatting.styleId):void 0,s=nt(nt(e,a),l.formatting),u=[...Qn(s),o];for(let p of l.content)r.push(...io(p,u))}return r}function $p(t){let e=t.size?.width?q(t.size.width):100,n=t.size?.height?q(t.size.height):80,r,i="solid",o,l,a;if(t.fill&&(i=t.fill.type,t.fill.color?.rgb&&(r=`#${t.fill.color.rgb}`),t.fill.type==="gradient"&&t.fill.gradient)){let f=t.fill.gradient;o=f.type,l=f.angle,a=JSON.stringify(f.stops.map(h=>({position:h.position,color:h.color.rgb?`#${h.color.rgb}`:"#000000"})))}let s,u,p;t.outline&&(t.outline.width&&(s=Math.round(t.outline.width/914400*96*100)/100),t.outline.color?.rgb&&(u=`#${t.outline.color.rgb}`),p=t.outline.style||"solid");let d;if(t.transform){let f=[];t.transform.rotation&&f.push(`rotate(${t.transform.rotation}deg)`),t.transform.flipH&&f.push("scaleX(-1)"),t.transform.flipV&&f.push("scaleY(-1)"),f.length>0&&(d=f.join(" "))}return _.node("shape",{shapeType:t.shapeType||"rect",shapeId:t.id,width:e,height:n,fillColor:r,fillType:i,gradientType:o,gradientAngle:l,gradientStops:a,outlineWidth:s,outlineColor:u,outlineStyle:p,transform:d})}function nr(t,e,n,r){let i=Fp(t,e),o=[],l,a=[],s=new Set,u;e&&(u=e.resolveParagraphStyle(t.formatting?.styleId).runFormatting);let p=nt(u,r);for(let d of t.content){if(d.type==="commentRangeStart")s.add(d.id);else if(d.type==="commentRangeEnd")s.delete(d.id);else if(d.type==="run"){let f=tr(d,p,e),h=Ip(d,f);h&&a?a.push(h):a=void 0,s.size>0&&(f=de(f,s)),o.push(...f)}else if(d.type==="hyperlink"){let f=er(d,p,e);o.push(...f),a=void 0}else if(d.type==="simpleField"||d.type==="complexField"){let f=no(d,p);f&&o.push(f),a=void 0}else if(d.type==="inlineSdt"){let f=oo(d,p,e);f&&o.push(f),a=void 0}else if(d.type==="insertion"){let f=Ve(d,"insertion",p,e);s.size>0&&(f=de(f,s)),o.push(...f),a=void 0}else if(d.type==="deletion"){let f=Ve(d,"deletion",p,e);s.size>0&&(f=de(f,s)),o.push(...f),a=void 0}else if(d.type==="moveFrom"){let f=Ve(d,"deletion",p,e,!0);s.size>0&&(f=de(f,s)),o.push(...f),a=void 0}else if(d.type==="moveTo"){let f=Ve(d,"insertion",p,e,!0);s.size>0&&(f=de(f,s)),o.push(...f),a=void 0}else if(d.type==="mathEquation"){let f=ro(d);f&&o.push(f),a=void 0}else d.type!=="bookmarkStart"&&d.type!=="bookmarkEnd"&&(a=void 0);d.type==="bookmarkStart"&&(l||(l=[]),l.push({id:d.id,name:d.name}))}return l&&(i.bookmarks=l),a&&a.length>0&&(i._originalRunBoundaries=a),_.node("paragraph",i,o)}function Ip(t,e){let n="",r;for(let i of e){if(!i.isText)return null;n+=i.text??"";let o=Ji(i.marks,Ki);if(r!=null&&r!==o)return null;r=o}return{text:n,...r!=null?{marksKey:r}:{},...t.formatting?{formatting:t.formatting}:{},...t.propertyChanges?{propertyChanges:t.propertyChanges}:{}}}function de(t,e){if(e.size===0)return t;let n=[...e][0],r=_.marks.comment.create({commentId:n});return t.map(i=>i.isText?i.mark(r.addToSet(i.marks)):i)}function Ve(t,e,n,r,i=!1){let o=[];for(let a of t.content)a.type==="run"?o.push(...tr(a,n,r)):a.type==="hyperlink"&&o.push(...er(a,n,r));let l=_.marks[e].create({revisionId:t.info.id,author:t.info.author,date:t.info.date??null,isMovePair:i});return o.map(a=>a.isText||a.type.allowsMarkType(l.type)?a.mark(l.addToSet(a.marks)):a)}function Fp(t,e){let n=t.formatting,r=n?.styleId,i={paraId:t.paraId??void 0,textId:t.textId??void 0,styleId:r,numPr:n?.numPr,numPrFromStyle:n?.numPrFromStyle,listNumFmt:t.listRendering?.numFmt,listIsBullet:t.listRendering?.isBullet,listMarker:t.listRendering?.marker,listMarkerHidden:t.listRendering?.markerHidden||void 0,listMarkerFontFamily:t.listRendering?.markerFontFamily||void 0,listMarkerFontSize:t.listRendering?.markerFontSize||void 0,listMarkerSuffix:t.listRendering?.markerSuffix||void 0,listLevelNumFmts:t.listRendering?.levelNumFmts||void 0,listAbstractNumId:t.listRendering?.abstractNumId,listStartOverride:t.listRendering?.startOverride,_originalFormatting:n||void 0};if(e){let o=e.resolveParagraphStyle(r),l=o.paragraphFormatting,a=o.runFormatting;i.alignment=n?.alignment??l?.alignment,i.spaceBefore=n?.spaceBefore??l?.spaceBefore,i.spaceAfter=n?.spaceAfter??l?.spaceAfter,i.lineSpacing=n?.lineSpacing??l?.lineSpacing,i.lineSpacingRule=n?.lineSpacingRule??l?.lineSpacingRule,n?.spacingExplicit&&(i.spacingExplicit=n.spacingExplicit),i.indentLeft=n?.indentLeft??l?.indentLeft,i.indentRight=n?.indentRight??l?.indentRight;let s=n?.numPr?.numId===0&&l?.numPr&&l.numPr.numId!==0?void 0:l;i.indentFirstLine=n?.indentFirstLine??s?.indentFirstLine,i.hangingIndent=n?.hangingIndent??s?.hangingIndent,i.borders=n?.borders??l?.borders,i.shading=n?.shading??l?.shading,i.tabs=n?.tabs??l?.tabs,i.pageBreakBefore=n?.pageBreakBefore??l?.pageBreakBefore,i.keepNext=n?.keepNext??l?.keepNext,i.keepLines=n?.keepLines??l?.keepLines,i.contextualSpacing=n?.contextualSpacing??l?.contextualSpacing,i.outlineLevel=n?.outlineLevel??l?.outlineLevel,i.bidi=n?.bidi??l?.bidi;let u=e.getDefaultCharacterStyle()?.rPr,p=u?nt(a,u):a,d=Ye(n?.runProperties,e);i.defaultTextFormatting=nt(p,d),!n?.numPr&&l?.numPr&&l.numPr.numId!==0&&(i.numPr=l.numPr,i.numPrFromStyle=l.numPr)}else i.alignment=n?.alignment,i.spaceBefore=n?.spaceBefore,i.spaceAfter=n?.spaceAfter,i.lineSpacing=n?.lineSpacing,i.lineSpacingRule=n?.lineSpacingRule,n?.spacingExplicit&&(i.spacingExplicit=n.spacingExplicit),i.indentLeft=n?.indentLeft,i.indentRight=n?.indentRight,i.indentFirstLine=n?.indentFirstLine,i.hangingIndent=n?.hangingIndent,i.borders=n?.borders,i.shading=n?.shading,i.tabs=n?.tabs,i.pageBreakBefore=n?.pageBreakBefore,i.keepNext=n?.keepNext,i.keepLines=n?.keepLines,i.outlineLevel=n?.outlineLevel,i.bidi=n?.bidi,i.defaultTextFormatting=Ye(n?.runProperties,e);if(t.sectionProperties){i._sectionProperties=t.sectionProperties;let o=t.sectionProperties.sectionStart;(o==="nextPage"||o==="continuous"||o==="oddPage"||o==="evenPage")&&(i.sectionBreakType=o)}return t.renderedPageBreakBefore&&(i.renderedPageBreakBefore=!0),Rp(t)&&(i.pageBreakBefore=!0),t.pPrIns&&(i.pPrIns={revisionId:t.pPrIns.id,author:t.pPrIns.author,date:t.pPrIns.date??null}),t.pPrDel&&(i.pPrDel={revisionId:t.pPrDel.id,author:t.pPrDel.author,date:t.pPrDel.date??null}),t.propertyChanges&&t.propertyChanges.length>0&&(i.pPrChange=t.propertyChanges),i}function oo(t,e,n){let r=t.properties,i=[];for(let o of t.content)if(o.type==="run"){let l=tr(o,e,n);i.push(...l)}else if(o.type==="hyperlink"){let l=er(o,e,n);i.push(...l)}else if(o.type==="simpleField"||o.type==="complexField"){let l=no(o,e);l&&i.push(l)}else if(o.type==="inlineSdt"){let l=oo(o,e,n);l&&i.push(l)}else if(o.type==="mathEquation"){let l=ro(o);l&&i.push(l)}return _.node("sdt",Kn(r),i.length>0?i:void 0)}function Pp(t){return t.type==="text"?t.text.length>0:!0}function lo(t,e){for(let n of t)n.type==="break"&&n.breakType==="page"?e.push("pageBreak"):Pp(n)&&e.push("visible")}function fe(t,e){for(let n of t)n.type==="run"?lo(n.content,e):fe(n.children.filter(r=>r.type==="run"),e)}function ao(t,e){for(let n of t)switch(n.type){case"run":lo(n.content,e);break;case"hyperlink":fe(n.children.filter(r=>r.type==="run"),e);break;case"simpleField":fe(n.content,e);break;case"complexField":fe([...n.fieldCode,...n.fieldResult],e);break;case"inlineSdt":ao(n.content,e);break;case"insertion":case"deletion":case"moveFrom":case"moveTo":fe(n.content,e);break;case"mathEquation":e.push("visible");break}}function so(t){let e=[];return ao(t.content,e),e}function Rp(t){return so(t)[0]==="pageBreak"}function Ep(t){let e=!1,n=!1;for(let r of so(t))if(r==="pageBreak"){if(n||e)return!0;e=!0}else n=!0;return!1}function it(t,e,n){if(!t||!e)return;let r=t.getStyle(e);if(!r?.tblStylePr)return;let i=r.tblStylePr.find(s=>s.type===n);if(!i)return;let o=Ye(i.pPr?.runProperties,t),l=Ye(i.rPr,t),a=nt(o,l);return{tcPr:i.tcPr,rPr:a}}function at(t,e){if(!t&&!e)return;if(!t)return e;if(!e)return t;let n={},r=t.tcPr,i=e.tcPr;if(r||i){let o={...r??{},...i??{}};(r?.borders||i?.borders)&&(o.borders={...r?.borders??{},...i?.borders??{}}),(r?.shading||i?.shading)&&(o.shading={...r?.shading??{},...i?.shading??{}}),(r?.margins||i?.margins)&&(o.margins={...r?.margins??{},...i?.margins??{}}),n.tcPr=o}return n.rPr=nt(t.rPr,e.rPr),n}function Mp(t){let e=new Map,n=t.rows.length,r=new Map;for(let i=0;i<n;i++){let o=t.rows[i],l=0,a=o.cells.map(s=>{let u=s.formatting?.gridSpan??1,p=l;return l+=u,{colIndex:p,vMerge:s.formatting?.vMerge,key:`${i}-${p}`}});if(a.length>0&&a.every(({colIndex:s,vMerge:u})=>u==="continue"&&r.has(s))){for(let{colIndex:s,key:u}of a)r.delete(s),e.set(u,{rowSpan:1,skip:!1});continue}for(let{colIndex:s,vMerge:u,key:p}of a){let d=s;if(u==="restart")r.set(d,i),e.set(p,{rowSpan:1,skip:!1});else if(u==="continue"){let f=r.get(d);if(f!==void 0){let h=`${f}-${d}`,c=e.get(h);c&&c.rowSpan++,e.set(p,{rowSpan:1,skip:!0})}else e.set(p,{rowSpan:1,skip:!1})}else r.delete(d),e.set(p,{rowSpan:1,skip:!1})}}return e}function rr(t,e,n){let r=Mp(t),i=t.columnWidths,o=i?.reduce((x,w)=>x+w,0)??0,l=t.formatting?.styleId,a=t.formatting?.look,s=l?e?.getStyle(l):void 0,u=e?.getDefaultTableStyle(),p=t.formatting?.borders??s?.tblPr?.borders??u?.tblPr?.borders,d=t.formatting?.cellMargins??s?.tblPr?.cellMargins??u?.tblPr?.cellMargins??void 0,f=d?{top:d.top?.value,bottom:d.bottom?.value,left:d.left?.value,right:d.right?.value}:void 0,h={styleId:t.formatting?.styleId,width:t.formatting?.width?.value,widthType:t.formatting?.width?.type,justification:t.formatting?.justification,columnWidths:i,tableLayout:t.formatting?.layout??null,floating:t.formatting?.floating,cellMargins:f,look:t.formatting?.look,bidi:t.formatting?.bidi||void 0,_originalFormatting:t.formatting||void 0};t.propertyChanges&&t.propertyChanges.length>0&&(h.tblPrChange=t.propertyChanges);let c={wholeTable:it(e,l,"wholeTable"),firstRow:it(e,l,"firstRow"),lastRow:it(e,l,"lastRow"),firstCol:it(e,l,"firstCol"),lastCol:it(e,l,"lastCol"),band1Horz:it(e,l,"band1Horz"),band2Horz:it(e,l,"band2Horz"),band1Vert:it(e,l,"band1Vert"),band2Vert:it(e,l,"band2Vert"),nwCell:it(e,l,"nwCell"),neCell:it(e,l,"neCell"),swCell:it(e,l,"swCell"),seCell:it(e,l,"seCell")},m=a?.noHBand!==!0,g=a?.noVBand!==!0,v=0,C=t.rows.length,y=i?.length??Math.max(0,...t.rows.map(x=>x.cells.reduce((w,I)=>w+(I.formatting?.gridSpan??1),0))),k=t.rows.map((x,w)=>{let I=w===0&&!!a?.firstRow,F=w===C-1&&!!a?.lastRow,$=m&&!I&&!F?v%2===0?c.band1Horz:c.band2Horz:void 0;return m&&!I&&!F&&v++,Bp(x,e,I,i,o,c,$,g,a,p,w,C,y,r,f,n)});return _.node("table",h,k)}function Bp(t,e,n,r,i,o,l,a,s,u,p,d,f,h,c,m){let g={height:t.formatting?.height?.value,heightRule:t.formatting?.heightRule,isHeader:!!t.formatting?.header,_originalFormatting:t.formatting||void 0};if(t.structuralChange){let E=t.structuralChange,P={revisionId:E.info.id,author:E.info.author,date:E.info.date??null};E.type==="tableRowInsertion"?g.trIns=P:E.type==="tableRowDeletion"&&(g.trDel=P)}t.propertyChanges&&t.propertyChanges.length>0&&(g.trPrChange=t.propertyChanges);let v=t.cells.length,C=p===0,y=p===(d??1)-1,k=t.formatting?.conditionalFormat,x=k?.firstRow??C,w=k?.lastRow??y,I=f??v,F=0,$=[];for(let E=0;E<t.cells.length;E++){let P=t.cells[E],R=P.formatting?.gridSpan??1,T=`${p??0}-${F}`,M=h?.get(T),B=M?.skip??!1,N=M?.rowSpan??1,z;if(r&&i&&i>0){let lt=0;for(let ft=0;ft<R&&F+ft<r.length;ft++)lt+=r[F+ft];z=Math.round(lt/i*100)}if(F+=R,B)continue;let A=F-R===0,j=F===I,H=P.formatting?.conditionalFormat,Y=H?.firstRow??x,U=H?.lastRow??w,ut=H?.firstColumn??A,vt=H?.lastColumn??j,dt;if(a){let lt=s?.firstColumn?1:0,ft=F-R-lt;ft>=0&&!(s?.lastColumn&&vt)&&!(s?.firstColumn&&ut)&&(dt=ft%2===0?o?.band1Vert:o?.band2Vert)}H?.oddVBand?dt=o?.band1Vert:H?.evenVBand&&(dt=o?.band2Vert);let et=l;k?.oddHBand?et=o?.band1Horz:k?.evenHBand&&(et=o?.band2Horz),H?.oddHBand?et=o?.band1Horz:H?.evenHBand&&(et=o?.band2Horz);let K=o?.wholeTable;K=at(K,et),K=at(K,dt),Y&&(s?.firstRow||k?.firstRow||H?.firstRow)&&(K=at(K,o?.firstRow)),U&&(s?.lastRow||k?.lastRow||H?.lastRow)&&(K=at(K,o?.lastRow)),ut&&(s?.firstColumn||k?.firstColumn||H?.firstColumn)&&(K=at(K,o?.firstCol)),vt&&(s?.lastColumn||k?.lastColumn||H?.lastColumn)&&(K=at(K,o?.lastCol)),Y&&ut&&(s?.firstRow||k?.firstRow||H?.firstRow)&&(s?.firstColumn||k?.firstColumn||H?.firstColumn)&&(K=at(K,o?.nwCell)),Y&&vt&&(s?.firstRow||k?.firstRow||H?.firstRow)&&(s?.lastColumn||k?.lastColumn||H?.lastColumn)&&(K=at(K,o?.neCell)),U&&ut&&(s?.lastRow||k?.lastRow||H?.lastRow)&&(s?.firstColumn||k?.firstColumn||H?.firstColumn)&&(K=at(K,o?.swCell)),U&&vt&&(s?.lastRow||k?.lastRow||H?.lastRow)&&(s?.lastColumn||k?.lastColumn||H?.lastColumn)&&(K=at(K,o?.seCell)),$.push(to(P,e,n,z,K,u,C,y,A,j,N,c,m))}if($.length===0){let E=Math.max(I,1),P={formatting:E>1?{gridSpan:E}:void 0,content:[{type:"paragraph",content:[]}]},R=at(o?.wholeTable,l);$.push(to(P,e,n,i&&i>0?100:void 0,R,u,C,y,!0,!0,1,c,m))}return _.node("tableRow",g,$)}var Lp=["top","bottom","left","right","insideH","insideV"];function Ap(t,e){if(!t)return t;let n;for(let r of Lp){let i=t[r];if(!i?.color?.themeColor||i.color.auto)continue;let o=ae(i.color,e);o&&(n??(n={...t}),n[r]={...i,color:{rgb:o}})}return n??t}function to(t,e,n,r,i,o,l,a,s,u,p,d,f){let h=t.formatting,c=p??1,m=h?.width?.value,g=h?.width?.type;m===void 0&&r!==void 0&&(m=r,g="pct");let v=ae(h?.shading?.fill??i?.tcPr?.shading?.fill,f),C=o?{top:l?o.top:o.insideH,bottom:a?o.bottom:o.insideH,left:s?o.left:o.insideV,right:u?o.right:o.insideV}:void 0,y=i?.tcPr?.borders,k=h?.borders,x=Ap(C||y||k?{...C??{},...y??{},...k??{}}:void 0,f),w={colspan:h?.gridSpan??1,rowspan:c,width:m,widthType:g,verticalAlign:h?.verticalAlign,backgroundColor:v,textDirection:h?.textDirection,noWrap:h?.noWrap,borders:x,margins:h?.margins?{top:h.margins.top?.value,bottom:h.margins.bottom?.value,left:h.margins.left?.value,right:h.margins.right?.value}:i?.tcPr?.margins?{top:i.tcPr.margins.top?.value,bottom:i.tcPr.margins.bottom?.value,left:i.tcPr.margins.left?.value,right:i.tcPr.margins.right?.value}:d,_originalFormatting:h||void 0,_originalResolvedFill:v};if(t.structuralChange){let $=t.structuralChange,E={revisionId:$.info.id,author:$.info.author,date:$.info.date??null};$.type==="tableCellInsertion"?w.cellMarker={kind:"ins",info:E}:$.type==="tableCellDeletion"?w.cellMarker={kind:"del",info:E}:$.type==="tableCellMerge"&&(w.cellMarker={kind:"merge",info:E,vMerge:$.vMerge??"cont",...$.vMergeOrig?{vMergeOrig:$.vMergeOrig}:{}})}t.propertyChanges&&t.propertyChanges.length>0&&(w.tcPrChange=t.propertyChanges);let I=[];for(let $ of t.content)$.type==="paragraph"?I.push(nr($,e,void 0,i?.rPr)):$.type==="table"&&I.push(rr($,e));I.length===0&&I.push(_.node("paragraph",{},[]));let F=n?"tableHeader":"tableCell";return _.node(F,w,I)}yi(rr);function zp(t,e){let n=Op(t),r=nr(t,e),i=[],o=n.length>0&&r.content.size===0,{anchored:l,inFlow:a}=Np(n);for(let s of l)i.push(eo(s,e));o||i.push(r);for(let s of a)i.push(eo(s,e));return i}function Np(t){let e=[],n=[];for(let r of t)Jn(r)?e.push(r):n.push(r);return{anchored:e,inFlow:n}}function Op(t){let e=[];for(let n of t.content)if(n.type==="run"){for(let r of n.content)if(r.type==="shape"&&"shape"in r){let i=r.shape;i.textBody&&i.textBody.content.length>0&&e.push({type:"textBox",id:i.id,size:i.size,position:i.position,wrap:i.wrap,fill:i.fill,outline:i.outline,content:i.textBody.content,margins:i.textBody.margins})}}return e}function eo(t,e){let n=t.size?.width?q(t.size.width):200,r=t.size?.height?q(t.size.height):void 0,i;t.fill?.color?.rgb&&(i=`#${t.fill.color.rgb}`);let o,l,a;t.outline&&t.outline.width&&(o=Math.round(t.outline.width/914400*96*100)/100,t.outline.color?.rgb&&(l=`#${t.outline.color.rgb}`),a=t.outline.style||"solid");let s=t.margins?.top!=null?q(t.margins.top):4,u=t.margins?.bottom!=null?q(t.margins.bottom):4,p=t.margins?.left!=null?q(t.margins.left):7,d=t.margins?.right!=null?q(t.margins.right):7,f=[];for(let h of t.content)f.push(nr(h,e));return f.length===0&&f.push(_.node("paragraph",{},[])),_.node("textBox",{width:n,height:r,textBoxId:t.id,fillColor:i,outlineWidth:o,outlineColor:l,outlineStyle:a,marginTop:s,marginBottom:u,marginLeft:p,marginRight:d,...Zi(t)},f)}function ir(t,e,n,r){let i=[];for(let o of t)if(o.type==="paragraph")i.push(...zp(o,e)),r&&Ep(o)&&i.push(_.node("pageBreak"));else if(o.type==="table")i.push(rr(o,e,n));else if(o.type==="blockSdt"){let l=ir(o.content,e,n,r),a=l.length>0?l:[_.node("paragraph",{},[])];i.push(_.node("blockSdt",Kn(o.properties),a))}return i}function cw(t,e){let n=t.package.theme??null,r=e?.styles?Rn(e.styles):null,i=ir(t.package.document.content,r,n,!0);return i.length===0&&i.push(_.node("paragraph",{},[])),i[i.length-1]?.type.spec.isolating&&i.push(_.node("paragraph",{},[])),_.node("doc",{defaultTabStopTwips:t.package.settings?.defaultTabStop??null,watermark:Qi(t)??null},i)}function or(t,e){let n=e?.styles?Rn(e.styles):null,r=e?.theme??null,i=ir(t,n,r,!1);return i.length===0&&i.push(_.node("paragraph",{},[])),_.node("doc",{defaultTabStopTwips:e?.defaultTabStopTwips??null},i)}function po(t,e){return or(t,e)}function hw(){return _.node("doc",null,[_.node("paragraph",{},[])])}var Hp={accent1:"accent1",accent2:"accent2",accent3:"accent3",accent4:"accent4",accent5:"accent5",accent6:"accent6",dk1:"dk1",lt1:"lt1",dk2:"dk2",lt2:"lt2",tx1:"text1",tx2:"text2",bg1:"background1",bg2:"background2",hlink:"hlink",folHlink:"folHlink"},uo={black:"000000",white:"FFFFFF",red:"FF0000",green:"00FF00",blue:"0000FF",yellow:"FFFF00",cyan:"00FFFF",magenta:"FF00FF"};function fo(t,e){let n=V(e),r=n.find(o=>o.name==="a:shade");if(r){let o=b(r,null,"val");o&&(t.themeShade=Math.round(parseInt(o,10)/1e5*255).toString(16).padStart(2,"0").toUpperCase())}let i=n.find(o=>o.name==="a:tint");if(i){let o=b(i,null,"val");o&&(t.themeTint=Math.round(parseInt(o,10)/1e5*255).toString(16).padStart(2,"0").toUpperCase())}return t}function co(t){if(!t)return;let e=V(t),n=e.find(l=>l.name==="a:srgbClr");if(n){let l=b(n,null,"val");if(l)return fo({rgb:l},n)}let r=e.find(l=>l.name==="a:schemeClr");if(r){let l=b(r,null,"val");if(l){let a={themeColor:Hp[l]??"dk1"};return fo(a,r)}}let i=e.find(l=>l.name==="a:sysClr");if(i)return{rgb:b(i,null,"lastClr")??"000000"};let o=e.find(l=>l.name==="a:prstClr");if(o){let l=b(o,null,"val");if(l&&uo[l])return{rgb:uo[l]}}}function Dp(t){if(!t)return;let e=V(t);if(e.find(r=>r.name==="a:noFill"))return{type:"none"};let n=e.find(r=>r.name==="a:solidFill");if(n)return{type:"solid",color:co(n)};if(e.find(r=>r.name==="a:gradFill"))return{type:"gradient"}}function Wp(t){let e=t?X(t,"a:ln"):null;if(!e)return;let n=V(e);if(n.find(a=>a.name==="a:noFill"))return;let r={},i=b(e,null,"w");i&&(r.width=parseInt(i,10));let o=n.find(a=>a.name==="a:solidFill");o&&(r.color=co(o));let l=n.find(a=>a.name==="a:prstDash");if(l){let a=b(l,null,"val");a&&(r.style=a)}return r}function ho(t){if(!t)return;let e=b(t,null,"relativeFrom")??"column",n=X(t,"wp:align");if(n){let i=St(n);return{relativeTo:e,alignment:i}}let r=X(t,"wp:posOffset");if(r){let i=St(r),o=parseInt(i,10);return{relativeTo:e,posOffset:isNaN(o)?0:o}}return{relativeTo:e}}function mo(t){if(!t)return;let e=b(t,null,"relativeFrom")??"paragraph",n=X(t,"wp:align");if(n){let i=St(n);return{relativeTo:e,alignment:i}}let r=X(t,"wp:posOffset");if(r){let i=St(r),o=parseInt(i,10);return{relativeTo:e,posOffset:isNaN(o)?0:o}}return{relativeTo:e}}function jp(t){let e=X(t,"wp:positionH"),n=X(t,"wp:positionV");if(!(!e&&!n))return{horizontal:ho(e)??{relativeTo:"column"},vertical:mo(n)??{relativeTo:"paragraph"}}}var go=["wp:wrapNone","wp:wrapSquare","wp:wrapTight","wp:wrapThrough","wp:wrapTopAndBottom"];function wo(t,e,n){if(!t){let d={type:e?"behind":"inFront"};return n?.distT!==void 0&&(d.distT=n.distT),n?.distB!==void 0&&(d.distB=n.distB),n?.distL!==void 0&&(d.distL=n.distL),n?.distR!==void 0&&(d.distR=n.distR),d}let r=(t.name||"").replace("wp:",""),i;switch(r){case"wrapNone":i=e?"behind":"inFront";break;case"wrapSquare":i="square";break;case"wrapTight":i="tight";break;case"wrapThrough":i="through";break;case"wrapTopAndBottom":i="topAndBottom";break;default:i="square"}let o={type:i},l=b(t,null,"wrapText");l&&(o.wrapText=l);let a=L(t,null,"distT")??n?.distT,s=L(t,null,"distB")??n?.distB,u=L(t,null,"distL")??n?.distL,p=L(t,null,"distR")??n?.distR;return a!==void 0&&(o.distT=a),s!==void 0&&(o.distB=s),u!==void 0&&(o.distL=u),p!==void 0&&(o.distR=p),o}function _p(t){let e=V(t),n=b(t,null,"behindDoc")==="1",r=e.find(o=>go.includes(o.name??"")),i={distT:L(t,null,"distT")??void 0,distB:L(t,null,"distB")??void 0,distL:L(t,null,"distL")??void 0,distR:L(t,null,"distR")??void 0};return wo(r??null,n,i)}function Xp(t){if(!t)return{};let e={},n=L(t,null,"lIns"),r=L(t,null,"rIns"),i=L(t,null,"tIns"),o=L(t,null,"bIns");return(n!==void 0||r!==void 0||i!==void 0||o!==void 0)&&(e.margins={left:n,right:r,top:i,bottom:o}),e}function yo(t,e,n,r,i,o,l,a){if(!t)return[];let s=[],u=V(t);for(let p of u){let d=p.name||"",f=d.indexOf(":");if((f>=0?d.substring(f+1):d)==="p"){let c=e(p,r,i,o,l);s.push(c)}}return s}function lr(t){let e=V(t).find(o=>o.name==="wp:inline"||o.name==="wp:anchor");if(!e)return!1;let n=X(e,"a:graphic");if(!n)return!1;let r=X(n,"a:graphicData");if(!r)return!1;let i=X(r,"wps:wsp");return i?X(i,"wps:txbx")!==null:!1}function bo(t){let e=V(t).find(y=>y.name==="wp:inline"||y.name==="wp:anchor");if(!e)return null;let n=e.name==="wp:anchor",r=X(e,"a:graphic");if(!r)return null;let i=X(r,"a:graphicData");if(!i)return null;let o=X(i,"wps:wsp");if(!o||!X(o,"wps:txbx"))return null;let l=V(o),a=l.find(y=>y.name==="wps:spPr"),s=l.find(y=>y.name==="wps:bodyPr"),u=X(e,"wp:extent"),p=L(u,null,"cx")??0,d=L(u,null,"cy")??0,f={width:p,height:d},h=X(e,"wp:docPr"),c=h?b(h,null,"id")??void 0:void 0,m=Dp(a??null),g=Wp(a??null),v=Xp(s??null),C={type:"textBox",size:f,content:[]};if(c&&(C.id=c),m&&(C.fill=m),g&&(C.outline=g),v.margins&&(C.margins=v.margins),n){let y=jp(e);y&&(C.position=y);let k=_p(e);k&&(C.wrap=k)}return C}function xo(t){let e=X(t,"wps:txbx");return e?X(e,"w:txbxContent"):null}function qp(t){if(!t)return;let e=parseInt(t,10);if(!isNaN(e))return e/6e4}function Up(t,e){let n=V(t);for(let r of n)if(e.includes(r.name||""))return r;return null}function vo(t){if(!t)return{width:0,height:0};let e=L(t,null,"cx")??0,n=L(t,null,"cy")??0;return{width:e,height:n}}function ko(t){if(!t)return;let e=L(t,null,"l")??0,n=L(t,null,"t")??0,r=L(t,null,"r")??0,i=L(t,null,"b")??0;if(!(e===0&&n===0&&r===0&&i===0))return{left:e,top:n,right:r,bottom:i}}function So(t){if(!t)return{};let e=b(t,null,"id")??void 0,n=b(t,null,"name")??void 0,r=b(t,null,"descr")??void 0,i=b(t,null,"title")??void 0,o=b(t,null,"decorative")==="1",l=S(t,"a","hlinkClick"),a=l?b(l,"r","id")??void 0:void 0;return{id:e,name:n,alt:r,title:i,decorative:o||void 0,hlinkRId:a}}function Co(t){if(!t)return;let e=b(t,null,"rot"),n=b(t,null,"flipH")==="1",r=b(t,null,"flipV")==="1",i=qp(e);if(i===void 0&&!n&&!r)return;let o={};return i!==void 0&&(o.rotation=i),n&&(o.flipH=!0),r&&(o.flipV=!0),o}function To(t){let e=X(t,"a:graphic");if(!e)return{blipFill:null,blip:null};let n=X(e,"a:graphicData");if(!n)return{blipFill:null,blip:null};let r=X(n,"pic:pic");if(!r)return{blipFill:null,blip:null};let i=X(r,"pic:blipFill");return i?{blipFill:i,blip:X(i,"a:blip")}:{blipFill:null,blip:null}}function $o(t){if(!t)return;let e=X(t,"a:srcRect");if(!e)return;let n=s=>{let u=L(e,null,s);if(!(u===void 0||u===0))return u/1e5},r=n("l"),i=n("t"),o=n("r"),l=n("b");if(r===void 0&&i===void 0&&o===void 0&&l===void 0)return;let a={};return r!==void 0&&(a.left=r),i!==void 0&&(a.top=i),o!==void 0&&(a.right=o),l!==void 0&&(a.bottom=l),a}function Io(t){if(!t)return;let e=X(t,"a:alphaModFix");if(!e)return;let n=L(e,null,"amt");if(!(n===void 0||n>=1e5))return Math.max(0,Math.min(1,n/1e5))}function Fo(t){if(!t)return"";let e=b(t,"r","embed");if(e)return e;let n=b(t,null,"embed");return n||b(t,"r","link")||""}function Po(t){let e=X(t,"a:graphic");if(!e)return null;let n=X(e,"a:graphicData");if(!n)return null;let r=X(n,"pic:pic");if(!r)return null;let i=X(r,"pic:spPr");return i?X(i,"a:xfrm"):null}function Vp(t){if(!t)return t;let e=t.replace(/^\/+/,"");return e.startsWith("media/")?e=`word/${e}`:e.startsWith("word/")||(e=`word/${e}`),e}function Yp(t){let e=t.split(".").pop()?.toLowerCase()??"";return{png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",bmp:"image/bmp",tiff:"image/tiff",tif:"image/tiff",webp:"image/webp",svg:"image/svg+xml",emf:"image/x-emf",wmf:"image/x-wmf"}[e]??"application/octet-stream"}function Ge(t,e,n){if(!t||!e)return{};let r=e.get(t);if(!r)return{};let i=r.target;if(!i)return{};let o=Vp(i),l=i.split("/").pop(),a=(s,u)=>{let p=u.toLowerCase();for(let[d,f]of s.entries())if(d.toLowerCase()===p)return f};if(n){let s=a(n,o);if(s)return{src:s.dataUrl||s.base64,mimeType:s.mimeType,filename:l};let u=i.replace(/^\/+/,""),p=a(n,u);if(p)return{src:p.dataUrl||p.base64,mimeType:p.mimeType,filename:l};let d=`word/${u}`,f=a(n,d);if(f)return{src:f.dataUrl||f.base64,mimeType:f.mimeType,filename:l}}return{mimeType:Yp(i),filename:l}}function Gp(t,e,n){let r=X(t,"wp:extent"),i=vo(r),o=X(t,"wp:effectExtent"),l=ko(o),a=X(t,"wp:docPr"),s=So(a),{blip:u,blipFill:p}=To(t),d=Fo(u),f=$o(p),h=Io(u),c=Ge(d,e,n),m=Po(t),g=Co(m),v=L(t,null,"distT")??void 0,C=L(t,null,"distB")??void 0,y=L(t,null,"distL")??void 0,k=L(t,null,"distR")??void 0,x={type:"inline"};v!==void 0&&(x.distT=v),C!==void 0&&(x.distB=C),y!==void 0&&(x.distL=y),k!==void 0&&(x.distR=k);let w={type:"image",rId:d,size:i,wrap:x};if(s.id&&(w.id=s.id),s.alt&&(w.alt=s.alt),s.title&&(w.title=s.title),s.decorative&&(w.decorative=!0),c.src&&(w.src=c.src),c.mimeType&&(w.mimeType=c.mimeType),c.filename&&(w.filename=c.filename),l&&(w.padding=l),g&&(w.transform=g),f&&(w.crop=f),h!==void 0&&(w.opacity=h),s.hlinkRId&&e){let I=oe(Fn(e,s.hlinkRId));I&&(w.hlinkHref=I)}return w}function Zp(t,e,n){let r=X(t,"wp:extent"),i=vo(r),o=X(t,"wp:effectExtent"),l=ko(o),a=X(t,"wp:docPr"),s=So(a),u=b(t,null,"behindDoc")==="1",p=b(t,null,"layoutInCell"),d=p===null?void 0:p==="1",f=b(t,null,"allowOverlap"),h=f===null?void 0:f==="1",c={distT:L(t,null,"distT")??void 0,distB:L(t,null,"distB")??void 0,distL:L(t,null,"distL")??void 0,distR:L(t,null,"distR")??void 0},m=Up(t,go),g=wo(m,u,c),v=X(t,"wp:positionH"),C=X(t,"wp:positionV"),y=ho(v),k=mo(C),x;(y||k)&&(x={horizontal:y??{relativeTo:"column"},vertical:k??{relativeTo:"paragraph"}});let{blip:w,blipFill:I}=To(t),F=Fo(w),$=$o(I),E=Io(w),P=Ge(F,e,n),R=Po(t),T=Co(R),M={type:"image",rId:F,size:i,wrap:g};if(s.id&&(M.id=s.id),s.alt&&(M.alt=s.alt),s.title&&(M.title=s.title),s.decorative&&(M.decorative=!0),P.src&&(M.src=P.src),P.mimeType&&(M.mimeType=P.mimeType),P.filename&&(M.filename=P.filename),x&&(M.position=x),l&&(M.padding=l),T&&(M.transform=T),$&&(M.crop=$),E!==void 0&&(M.opacity=E),d!==void 0&&(M.layoutInCell=d),h!==void 0&&(M.allowOverlap=h),s.hlinkRId&&e){let B=oe(Fn(e,s.hlinkRId));B&&(M.hlinkHref=B)}return M}function Kp(t,e,n){if(lr(t))return null;let r=V(t);for(let i of r){let o=i.name||"";if(o==="wp:inline"||o==="wp:anchor")return o==="wp:inline"?Gp(i,e,n):Zp(i,e,n)}return null}function Ro(t,e,n){return Kp(t,e,n)}var jo={dk1:"000000",lt1:"FFFFFF",dk2:"44546A",lt2:"E7E6E6",accent1:"4472C4",accent2:"ED7D31",accent3:"A5A5A5",accent4:"FFC000",accent5:"5B9BD5",accent6:"70AD47",hlink:"0563C1",folHlink:"954F72"},Qe={majorFont:{latin:"Calibri Light",ea:"",cs:"",fonts:{}},minorFont:{latin:"Calibri",ea:"",cs:"",fonts:{}}},ar={name:"Office Theme",colorScheme:jo,fontScheme:Qe},Jp=["dk1","lt1","dk2","lt2","accent1","accent2","accent3","accent4","accent5","accent6","hlink","folHlink"];function Qp(t){if(!t)return null;switch(ht(t.name||"")){case"srgbClr":return b(t,"a","val")??b(t,null,"val")??null;case"sysClr":{let e=b(t,"a","lastClr")??b(t,null,"lastClr");if(e)return e;switch(b(t,"a","val")??b(t,null,"val")){case"windowText":case"menuText":case"captionText":case"btnText":return"000000";case"window":case"menu":case"btnFace":case"btnHighlight":return"FFFFFF";case"highlight":return"0078D7";case"highlightText":return"FFFFFF";case"grayText":return"808080";default:return null}}case"schemeClr":return b(t,"a","val")??b(t,null,"val"),null;default:return null}}function tu(t){let e={...jo};if(!t)return e;for(let n of Jp){let r=S(t,"a",n);if(r){let i=V(r);if(i.length>0){let o=Qp(i[0]);o&&(e[n]=o)}}}return e}function Eo(t){let e={latin:"",ea:"",cs:"",fonts:{}};if(!t)return e;let n=S(t,"a","latin");n&&(e.latin=b(n,"a","typeface")??b(n,null,"typeface")??"");let r=S(t,"a","ea");r&&(e.ea=b(r,"a","typeface")??b(r,null,"typeface")??"");let i=S(t,"a","cs");i&&(e.cs=b(i,"a","typeface")??b(i,null,"typeface")??"");let o=J(t,"a","font");for(let l of o){let a=b(l,"a","script")??b(l,null,"script"),s=b(l,"a","typeface")??b(l,null,"typeface");a&&s&&(e.fonts=e.fonts||{},e.fonts[a]=s)}return e}function eu(t){let e={...Qe};if(!t)return e;let n=S(t,"a","majorFont");n&&(e.majorFont=Eo(n));let r=S(t,"a","minorFont");return r&&(e.minorFont=Eo(r)),e}function _o(t){if(!t)return{...ar};try{let e=kt(t);if(!e)return{...ar};let n=b(e,"a","name")??b(e,null,"name")??"Office Theme",r=S(e,"a","themeElements"),i=S(r,"a","clrScheme"),o=tu(i),l=S(r,"a","fontScheme"),a=eu(l);return{name:n,colorScheme:o,fontScheme:a}}catch(e){return console.warn("Failed to parse theme:",e),{...ar}}}function nu(t){let e=t.toLowerCase();return e.startsWith("ja")?"Jpan":e.startsWith("ko")?"Hang":e.startsWith("zh")?e.includes("hant")||/-(tw|hk|mo)\b/.test(e)?"Hant":"Hans":null}function ru(t){let e=t.toLowerCase();return e.startsWith("ar")?"Arab":e.startsWith("he")||e.startsWith("iw")?"Hebr":e.startsWith("th")?"Thai":e.startsWith("hi")||e.startsWith("mr")||e.startsWith("ne")?"Deva":null}function Xo(t,e){if(!t?.fontScheme||!e)return;let n=e.eastAsia?nu(e.eastAsia):null,r=e.bidi?ru(e.bidi):null;for(let i of[t.fontScheme.majorFont,t.fontScheme.minorFont])i&&(!i.ea&&n&&i.fonts?.[n]&&(i.ea=i.fonts[n]),!i.cs&&r&&i.fonts?.[r]&&(i.cs=i.fonts[r]))}function iu(t,e="latin"){if(!t?.fontScheme?.majorFont)return Qe.majorFont?.latin??"Calibri Light";let n=t.fontScheme.majorFont;return e==="latin"?n.latin||"Calibri Light":e==="ea"?n.ea||"":e==="cs"?n.cs||"":n.fonts?.[e]?n.fonts[e]:n.latin||"Calibri Light"}function Mo(t,e="latin"){if(!t?.fontScheme?.minorFont)return Qe.minorFont?.latin??"Calibri";let n=t.fontScheme.minorFont;return e==="latin"?n.latin||"Calibri":e==="ea"?n.ea||"":e==="cs"?n.cs||"":n.fonts?.[e]?n.fonts[e]:n.latin||"Calibri"}function Pt(t,e){if(!e)return"Calibri";let n=e.toLowerCase().includes("major"),r=e.toLowerCase().includes("minor"),i="latin",o=e.toLowerCase();return o.includes("eastasia")?i="ea":(o.includes("bidi")||o.includes("cs"))&&(i="cs"),n?iu(t,i):r?Mo(t,i):Mo(t,"latin")}function sr(t,e,n,r){let i={};return t&&t!=="auto"?i.rgb=t:t==="auto"&&(i.auto=!0),e&&(i.themeColor=e),n&&(i.themeTint=n),r&&(i.themeShade=r),i}function me(t){if(!t)return;let e={},n=b(t,"w","color");n&&n!=="auto"&&(e.color={rgb:n});let r=b(t,"w","fill");r&&r!=="auto"&&(e.fill={rgb:r});let i=b(t,"w","themeFill");i&&(e.fill=e.fill||{},e.fill.themeColor=i);let o=b(t,"w","themeFillTint");o&&e.fill&&(e.fill.themeTint=o);let l=b(t,"w","themeFillShade");l&&e.fill&&(e.fill.themeShade=l);let a=b(t,"w","val");return a&&(e.pattern=a),Object.keys(e).length>0?e:void 0}function ge(t,e){if(!t)return;let n={},r=S(t,"w","b");r&&(n.bold=D(r));let i=S(t,"w","bCs");i&&(n.boldCs=D(i));let o=S(t,"w","i");o&&(n.italic=D(o));let l=S(t,"w","iCs");l&&(n.italicCs=D(l));let a=S(t,"w","u");if(a){let z=b(a,"w","val");if(z){n.underline={style:z};let A=b(a,"w","color"),j=b(a,"w","themeColor");(A||j)&&(n.underline.color=sr(A,j,b(a,"w","themeTint"),b(a,"w","themeShade")))}}let s=S(t,"w","strike");s&&(n.strike=D(s));let u=S(t,"w","dstrike");u&&(n.doubleStrike=D(u));let p=S(t,"w","vertAlign");if(p){let z=b(p,"w","val");(z==="superscript"||z==="subscript"||z==="baseline")&&(n.vertAlign=z)}let d=S(t,"w","smallCaps");d&&(n.smallCaps=D(d));let f=S(t,"w","caps");f&&(n.allCaps=D(f));let h=S(t,"w","vanish");h&&(n.hidden=D(h));let c=S(t,"w","color");c&&(n.color=sr(b(c,"w","val"),b(c,"w","themeColor"),b(c,"w","themeTint"),b(c,"w","themeShade")));let m=S(t,"w","highlight");if(m){let z=b(m,"w","val");z&&(n.highlight=z)}let g=S(t,"w","shd");g&&(n.shading=me(g));let v=S(t,"w","sz");if(v){let z=L(v,"w","val");z!==void 0&&(n.fontSize=z)}let C=S(t,"w","szCs");if(C){let z=L(C,"w","val");z!==void 0&&(n.fontSizeCs=z)}let y=S(t,"w","rFonts");if(y){n.fontFamily={ascii:b(y,"w","ascii")??void 0,hAnsi:b(y,"w","hAnsi")??void 0,eastAsia:b(y,"w","eastAsia")??void 0,cs:b(y,"w","cs")??void 0};let z=b(y,"w","asciiTheme");z&&(n.fontFamily.asciiTheme=z,e&&!n.fontFamily.ascii&&(n.fontFamily.ascii=Pt(e,z)));let A=b(y,"w","hAnsiTheme");A&&(n.fontFamily.hAnsiTheme=A,e&&!n.fontFamily.hAnsi&&(n.fontFamily.hAnsi=Pt(e,A)));let j=b(y,"w","eastAsiaTheme");j&&(n.fontFamily.eastAsiaTheme=j,e&&!n.fontFamily.eastAsia&&(n.fontFamily.eastAsia=Pt(e,j)));let H=b(y,"w","cstheme");H&&(n.fontFamily.csTheme=H,e&&!n.fontFamily.cs&&(n.fontFamily.cs=Pt(e,H)))}let k=S(t,"w","spacing");if(k){let z=L(k,"w","val");z!==void 0&&(n.spacing=z)}let x=S(t,"w","position");if(x){let z=L(x,"w","val");z!==void 0&&(n.position=z)}let w=S(t,"w","w");if(w){let z=L(w,"w","val");z!==void 0&&(n.scale=z)}let I=S(t,"w","kern");if(I){let z=L(I,"w","val");z!==void 0&&(n.kerning=z)}let F=S(t,"w","effect");if(F){let z=b(F,"w","val");z&&(n.effect=z)}let $=S(t,"w","em");if($){let z=b($,"w","val");z&&(n.emphasisMark=z)}let E=S(t,"w","emboss");E&&(n.emboss=D(E));let P=S(t,"w","imprint");P&&(n.imprint=D(P));let R=S(t,"w","outline");R&&(n.outline=D(R));let T=S(t,"w","shadow");T&&(n.shadow=D(T));let M=S(t,"w","rtl");M&&(n.rtl=D(M));let B=S(t,"w","cs");B&&(n.cs=D(B));let N=S(t,"w","rStyle");if(N){let z=b(N,"w","val");z&&(n.styleId=z)}return Object.keys(n).length>0?n:void 0}function st(t){if(!t)return;let e={style:b(t,"w","val")??"none"},n=L(t,"w","sz");n!==void 0&&(e.size=n);let r=L(t,"w","space");r!==void 0&&(e.space=r);let i=b(t,"w","color"),o=b(t,"w","themeColor"),l=b(t,"w","themeTint"),a=b(t,"w","themeShade");(i||o||l||a)&&(e.color=sr(i,o,l,a));let s=b(t,"w","shadow");(s==="1"||s==="true")&&(e.shadow=!0);let u=b(t,"w","frame");return(u==="1"||u==="true")&&(e.frame=!0),e}function we(t){if(!t)return;let e={},n=st(S(t,"w","top"));n&&(e.top=n);let r=st(S(t,"w","bottom"));r&&(e.bottom=r);let i=st(S(t,"w","left")??S(t,"w","start"));i&&(e.left=i);let o=st(S(t,"w","right")??S(t,"w","end"));o&&(e.right=o);let l=st(S(t,"w","insideH"));l&&(e.insideH=l);let a=st(S(t,"w","insideV"));if(a&&(e.insideV=a),Object.keys(e).length!==0)return e}function ur(t){if(!t)return;let e={};for(let n of["top","bottom","left","right","between","bar"]){let r=st(S(t,"w",n));r&&(e[n]=r)}return Object.keys(e).length>0?e:void 0}function ou(t){if(!t)return;let e=L(t,"w","w")??0,n=b(t,"w","type")??"dxa",r="dxa";return(n==="auto"||n==="dxa"||n==="nil"||n==="pct")&&(r=n),{value:e,type:r}}function Rt(t){return ou(t)}function Jt(t){let e=b(t,"w","id"),n=e?parseInt(e,10):0,r=(b(t,"w","author")??"").trim(),i=(b(t,"w","date")??"").trim();return{id:Number.isInteger(n)&&n>=0?n:0,author:r.length>0?r:"Unknown",date:i.length>0?i:void 0}}function dr(t){return Jt(t)}function qo(t){if(!t)return;let e={},n=Rt(S(t,"w","top"));n&&(e.top=n);let r=Rt(S(t,"w","bottom"));r&&(e.bottom=r);let i=Rt(S(t,"w","left")??S(t,"w","start"));i&&(e.left=i);let o=Rt(S(t,"w","right")??S(t,"w","end"));if(o&&(e.right=o),Object.keys(e).length!==0)return e}function Uo(t){if(!t)return;let e={},n=b(t,"w","fill");n&&n!=="auto"&&(e.fill={rgb:n});let r=b(t,"w","themeFill");if(r){e.fill={themeColor:r};let l=b(t,"w","themeFillTint");l&&e.fill&&(e.fill.themeTint=l);let a=b(t,"w","themeFillShade");a&&e.fill&&(e.fill.themeShade=a)}let i=b(t,"w","color");i&&i!=="auto"&&(e.color={rgb:i});let o=b(t,"w","val");if(o&&(e.pattern=o),Object.keys(e).length!==0)return e}function lu(t){if(!t)return;let e={},n=b(t,"w","firstRow");(n==="1"||n==="true")&&(e.firstRow=!0);let r=b(t,"w","lastRow");(r==="1"||r==="true")&&(e.lastRow=!0);let i=b(t,"w","firstColumn");(i==="1"||i==="true")&&(e.firstColumn=!0);let o=b(t,"w","lastColumn");(o==="1"||o==="true")&&(e.lastColumn=!0);let l=b(t,"w","noHBand");(l==="1"||l==="true")&&(e.noHBand=!0);let a=b(t,"w","noVBand");(a==="1"||a==="true")&&(e.noVBand=!0);let s=b(t,"w","val");if(s){let u=parseInt(s,16);isNaN(u)||(u&32&&(e.firstRow=!0),u&64&&(e.lastRow=!0),u&128&&(e.firstColumn=!0),u&256&&(e.lastColumn=!0),u&512&&(e.noHBand=!0),u&1024&&(e.noVBand=!0))}if(Object.keys(e).length!==0)return e}function au(t){if(!t)return;let e={},n=b(t,"w","horzAnchor");(n==="margin"||n==="page"||n==="text")&&(e.horzAnchor=n);let r=b(t,"w","vertAnchor");(r==="margin"||r==="page"||r==="text")&&(e.vertAnchor=r);let i=L(t,"w","tblpX");i!==void 0&&(e.tblpX=i);let o=b(t,"w","tblpXSpec");o&&(e.tblpXSpec=o);let l=L(t,"w","tblpY");l!==void 0&&(e.tblpY=l);let a=b(t,"w","tblpYSpec");a&&(e.tblpYSpec=a);let s=L(t,"w","topFromText");s!==void 0&&(e.topFromText=s);let u=L(t,"w","bottomFromText");u!==void 0&&(e.bottomFromText=u);let p=L(t,"w","leftFromText");p!==void 0&&(e.leftFromText=p);let d=L(t,"w","rightFromText");if(d!==void 0&&(e.rightFromText=d),Object.keys(e).length!==0)return e}var su={richText:"richText",text:"plainText",date:"date",dropDownList:"dropDownList",comboBox:"comboBox",picture:"picture",docPartObj:"buildingBlockGallery",docPartList:"buildingBlockGallery",group:"group",equation:"equation",citation:"citation",bibliography:"bibliography",checkbox:"checkbox"};function pu(t){if(!t||!t.elements)return"richText";for(let e of t.elements){if(e.type!=="element"||!e.name)continue;let n=ht(e.name),r=su[n];if(r)return r}return"richText"}function uu(t){let e=[];for(let n of t.elements??[])n.type==="element"&&ht(n.name||"")==="listItem"&&e.push({displayText:b(n,"w","displayText")||"",value:b(n,"w","value")||""});return e}function Vo(t,e){let n={sdtType:pu(t)};if(t){n.rawPropertiesXml=qt(t);for(let r of t.elements??[])if(!(r.type!=="element"||!r.name))switch(ht(r.name)){case"id":{let i=b(r,"w","val");if(i!=null){let o=parseInt(i,10);Number.isNaN(o)||(n.id=o)}break}case"alias":n.alias=b(r,"w","val")??void 0;break;case"tag":n.tag=b(r,"w","val")??void 0;break;case"lock":n.lock=b(r,"w","val")??"unlocked";break;case"placeholder":{let i=S(r,"w","docPart");i&&(n.placeholder=b(i,"w","val")??void 0);break}case"showingPlcHdr":{let i=b(r,"w","val");n.showingPlaceholder=i==null||!/^(0|false|off)$/i.test(i);break}case"date":{let i=S(r,"w","dateFormat");i&&(n.dateFormat=b(i,"w","val")??void 0);break}case"dropDownList":case"comboBox":n.listItems=uu(r);break;case"checkbox":{let i=S(r,"w14","checked")??S(r,"w","checked");n.checked=i?b(i,"w14","val")==="1"||b(i,"w","val")==="1":!1;break}case"dataBinding":{let i={},o=b(r,"w","xpath"),l=b(r,"w","storeItemID"),a=b(r,"w","prefixMappings");o!=null&&(i.xpath=o),l!=null&&(i.storeItemID=l),a!=null&&(i.prefixMappings=a),n.dataBinding=i;break}}}return e&&(n.rawEndPropertiesXml=qt(e)),n}var Bo={183:"\u2022",111:"\u25CB",167:"\u25A0",252:"\u2713",110:"\u25A0",113:"\u25CB",117:"\u25C6",118:"\u2756",168:"\u2713",251:"\u2713",254:"\u2713",61623:"\u2022",61550:"\u25A0",61551:"\u25CB",61607:"\u25A0",61692:"\u2713",8226:"\u2022",9679:"\u25CF",9675:"\u25CB",9632:"\u25A0",9633:"\u25A1",9670:"\u25C6",9671:"\u25C7",8211:"\u2013",8212:"\u2014",62:">",45:"-"};function fr(t){if(!t||t.trim()==="")return"\u2022";let e=t.charCodeAt(0);return Bo[e]?Bo[e]:e>=57344&&e<=63743||e<32||e>=127&&e<160?"\u2022":t}function du(t){let e=t.listRendering;e&&e.isBullet&&(e.marker=fr(e.marker||""))}function fu(t,e,n,r,i,o,l){if(t.content.length===0)return;let a=V(e),s=0;function u(p){if(!lr(p))return;let d=bo(p);if(!d)return;let f=si(p,"wps","wsp");if(f){let g=xo(f);g&&(d.content=yo(g,ye,null,n,r,i,o??void 0,l??void 0))}let h={type:"shape",shapeType:"rect",size:d.size,position:d.position,wrap:d.wrap,fill:d.fill,outline:d.outline,textBody:{content:d.content,margins:d.margins}};d.id&&(h.id=d.id);let c={type:"shape",shape:h},m=s;if(m>=t.content.length){m=-1;for(let g=t.content.length-1;g>=0;g--)if(t.content[g].type==="run"){m=g;break}}if(m>=0){let g=t.content[m];g.type==="run"&&g.content.push(c)}}for(let p of a){if(ht(p.name??"")!=="r")continue;let d=V(p);for(let f of d){let h=ht(f.name??"");if(h==="drawing")u(f);else if(h==="AlternateContent"){let c=V(f),m=c.find(g=>ht(g.name??"")==="Choice")??c.find(g=>ht(g.name??"")==="Fallback");if(m)for(let g of V(m))ht(g.name??"")==="drawing"&&u(g)}}s++}}function Qt(t,e,n,r,i,o,l){let a=[],s=V(t);for(let u of s){let p=u.name??"";if(p==="w:p"||p.endsWith(":p")){let d=ye(u,e,n,r,i,o,l);fu(d,u,e,n,r,i,o),du(d),a.push(d)}else if(p==="w:tbl"||p.endsWith(":tbl")){let d=wl(u,e,n,r,i,o,l);a.push(d)}else(p==="w:sdt"||p.endsWith(":sdt"))&&a.push(cu(u,e,n,r,i,o,l))}return a}function cu(t,e,n,r,i,o,l){let a=S(t,"w","sdtPr"),s=S(t,"w","sdtEndPr"),u=S(t,"w","sdtContent"),p=Vo(a,s),d=u?Qt(u,e,n,r,i,o,l):[];return{type:"blockSdt",properties:p,content:d}}function pr(t){let e={};if(!t)return e;for(let n of t.split(";")){let r=n.indexOf(":");if(r<0)continue;let i=n.slice(0,r).trim().toLowerCase(),o=n.slice(r+1).trim();i&&(e[i]=o)}return e}function hu(t){if(!t)return"#C0C0C0";let e=t.trim();return e.startsWith("#")?e:/^[0-9a-fA-F]{6}$/.test(e)?`#${e}`:e}function Lo(t){if(!t)return;let e=t.match(/^(-?[0-9.]+)(pt|px|in|cm|mm)?$/);if(!e)return;let n=parseFloat(e[1]);if(!isNaN(n))switch(e[2]){case"in":return n*96;case"cm":return n/2.54*96;case"mm":return n/25.4*96;case"px":return n;default:return n*96/72}}var Ao=914400/96;function mu(t,e,n){if(!t||!e)return{};let r=e.get(t);if(!r?.target)return{};let i=r.target,o=i.split("/").pop()??i,l=[i,i.replace(/^\/+/,""),`word/${i.replace(/^\/+/,"")}`,`word/media/${o}`,`media/${o}`];if(n)for(let a of l){let s=a.toLowerCase();for(let[u,p]of n.entries())if(u.toLowerCase()===s)return{dataUrl:p.dataUrl??p.base64,mediaPath:p.path,contentType:p.mimeType}}return{}}function Yo(t,e){if(e.includes("watermark")||(b(t,null,"type")??"").includes("_t136"))return!0;let n=V(t).find(r=>r.name==="v:imagedata"||r.name?.endsWith(":imagedata"));return!!(n&&(b(n,null,"gain")||b(n,"o","gain")||b(n,null,"blacklevel")))}function gu(t,e=null,n=null){if(!t)return;let r=Ut(t,"v","shape");for(let i of r){let o=(b(i,null,"id")??"").toLowerCase(),l=V(i),a=l.find(f=>f.name==="v:textpath"||f.name?.endsWith(":textpath")),s=l.find(f=>f.name==="v:imagedata"||f.name?.endsWith(":imagedata"));if(!Yo(i,o)&&!a)continue;let u=pr(b(i,null,"style")),p=parseFloat(u.rotation??"0")||0,d=Math.abs(p)>5;if(a){let f=b(a,null,"string")??"",h=(pr(b(a,null,"style"))["font-family"]??"Calibri").replace(/["']/g,"").replace(/^&quot;|&quot;$/g,"").trim()||"Calibri",c=l.find(v=>v.name==="v:fill"||v.name?.endsWith(":fill")),m=c?b(c,null,"opacity"):null,g=m!=null&&parseFloat(m)<1;return{kind:"text",text:f,font:h,color:hu(b(i,null,"fillcolor")),semitransparent:g,layout:d?"diagonal":"horizontal",fontSize:void 0}}if(s){let f=b(s,"r","id")??b(s,"r","embed")??b(s,null,"id")??"",{dataUrl:h,mediaPath:c,contentType:m}=mu(f,e,n),g=b(s,null,"gain"),v=b(s,null,"blacklevel"),C=g!=null||v!=null,y=Lo(u.width),k=Lo(u.height);return{kind:"picture",relId:f||void 0,mediaPath:c,contentType:m,dataUrl:h,scale:1,washout:C,widthEmu:y!=null?Math.round(y*Ao):void 0,heightEmu:k!=null?Math.round(k*Ao):void 0}}}}function Go(t){switch(t){case"first":return"first";case"even":return"even";default:return"default"}}function wu(t){let e=b(t,"w","type"),n=b(t,"r","id")??"";return{type:Go(e),rId:n}}function yu(t){let e=b(t,"w","type"),n=b(t,"r","id")??"";return{type:Go(e),rId:n}}function Zo(t,e="default",n=null,r=null,i=null,o=null,l=null){let a={type:"header",hdrFtrType:e,content:[]};if(!t)return a;let s=ct(t);if(!s)return a;let u=s.elements?.find(d=>d.type==="element"&&(d.name==="w:hdr"||d.name?.endsWith(":hdr")));if(!u)return a;a.content=Qt(u,n,r,i,o,l,{inHeaderFooter:!0});let p=gu(u,o,l);return p&&(a.watermark=p),a}function Ko(t,e="default",n=null,r=null,i=null,o=null,l=null){let a={type:"footer",hdrFtrType:e,content:[]};if(!t)return a;let s=ct(t);if(!s)return a;let u=s.elements?.find(p=>p.type==="element"&&(p.name==="w:ftr"||p.name?.endsWith(":ftr")));return u&&(a.content=Qt(u,n,r,i,o,l,{inHeaderFooter:!0})),a}function Jo(t){switch(t){case"separator":return"separator";case"continuationSeparator":return"continuationSeparator";case"continuationNotice":return"continuationNotice";default:return"normal"}}function Qo(t,e,n,r,i,o){let l=Qt(t,e,n,r,i,o),a=!1;for(let s of V(t)){let u=s.name??"";if(u==="w:bookmarkStart"||u.endsWith(":bookmarkStart")||u==="w:bookmarkEnd"||u.endsWith(":bookmarkEnd")||u==="w:customXml"||u.endsWith(":customXml")){a=!0;break}}return{blocks:l,hasUnmodeled:a}}function bu(t,e,n,r,i,o){let l=L(t,"w","id")??0,a=b(t,"w","type"),s=Jo(a),{blocks:u,hasUnmodeled:p}=Qo(t,e,n,r,i,o);return{type:"footnote",id:l,noteType:s,content:u,...p?{verbatimXml:qt(t)}:{}}}function tl(t,e=null,n=null,r=null,i=null,o=null){let l=new Map,a=[];if(!t)return Ze(l,a);let s=ct(t);if(!s)return Ze(l,a);let u=s.elements?.find(d=>d.type==="element"&&(d.name==="w:footnotes"||d.name?.endsWith(":footnotes")));if(!u)return Ze(l,a);let p=J(u,"w","footnote");for(let d of p){let f=bu(d,e,n,r,i,o);l.set(f.id,f),a.push(f)}return Ze(l,a)}function Ze(t,e){return{byId:t,footnotes:e,getFootnote(n){return t.get(n)},hasFootnote(n){return t.has(n)},getNormalFootnotes(){return e.filter(n=>n.noteType==="normal")},getSeparator(){return e.find(n=>n.noteType==="separator")},getContinuationSeparator(){return e.find(n=>n.noteType==="continuationSeparator")}}}function xu(t,e,n,r,i,o){let l=L(t,"w","id")??0,a=b(t,"w","type"),s=Jo(a),{blocks:u,hasUnmodeled:p}=Qo(t,e,n,r,i,o);return{type:"endnote",id:l,noteType:s,content:u,...p?{verbatimXml:qt(t)}:{}}}function el(t,e=null,n=null,r=null,i=null,o=null){let l=new Map,a=[];if(!t)return Ke(l,a);let s=ct(t);if(!s)return Ke(l,a);let u=s.elements?.find(d=>d.type==="element"&&(d.name==="w:endnotes"||d.name?.endsWith(":endnotes")));if(!u)return Ke(l,a);let p=J(u,"w","endnote");for(let d of p){let f=xu(d,e,n,r,i,o);l.set(f.id,f),a.push(f)}return Ke(l,a)}function Ke(t,e){return{byId:t,endnotes:e,getEndnote(n){return t.get(n)},hasEndnote(n){return t.has(n)},getNormalEndnotes(){return e.filter(n=>n.noteType==="normal")},getSeparator(){return e.find(n=>n.noteType==="separator")},getContinuationSeparator(){return e.find(n=>n.noteType==="continuationSeparator")}}}function nl(t){return t?{decimal:"decimal",upperRoman:"upperRoman",lowerRoman:"lowerRoman",upperLetter:"upperLetter",lowerLetter:"lowerLetter",ordinal:"ordinal",cardinalText:"cardinalText",ordinalText:"ordinalText",bullet:"bullet",chicago:"chicago",none:"none"}[t]:void 0}function vu(t){switch(t){case"pageBottom":return"pageBottom";case"beneathText":return"beneathText";case"sectEnd":return"sectEnd";case"docEnd":return"docEnd";default:return}}function ku(t){switch(t){case"sectEnd":return"sectEnd";case"docEnd":return"docEnd";default:return}}function rl(t){switch(t){case"continuous":return"continuous";case"eachSect":return"eachSect";case"eachPage":return"eachPage";default:return}}function Su(t){let e={};if(!t)return e;let n=S(t,"w","pos");if(n){let l=b(n,"w","val");e.position=vu(l)}let r=S(t,"w","numFmt");if(r){let l=b(r,"w","val");e.numFmt=nl(l)}let i=S(t,"w","numStart");i&&(e.numStart=L(i,"w","val")??void 0);let o=S(t,"w","numRestart");if(o){let l=b(o,"w","val");e.numRestart=rl(l)}return e}function Cu(t){let e={};if(!t)return e;let n=S(t,"w","pos");if(n){let l=b(n,"w","val");e.position=ku(l)}let r=S(t,"w","numFmt");if(r){let l=b(r,"w","val");e.numFmt=nl(l)}let i=S(t,"w","numStart");i&&(e.numStart=L(i,"w","val")??void 0);let o=S(t,"w","numRestart");if(o){let l=b(o,"w","val");e.numRestart=rl(l)}return e}function il(t){let e=[];for(let n of t.content){if(n.type!=="paragraph")continue;let r=[];for(let i of n.content)if(i.type==="run")for(let o of i.content)o.type==="text"&&r.push(o.text);e.push(r.join(""))}return e.join(`
`)}function ol(t){return t.noteType==="separator"||t.noteType==="continuationSeparator"||t.noteType==="continuationNotice"}function ll(t){return t.noteType==="separator"||t.noteType==="continuationSeparator"||t.noteType==="continuationNotice"}function Tu(t){switch(t){case"landscape":return"landscape";case"portrait":return"portrait";default:return}}function $u(t){switch(t){case"continuous":return"continuous";case"nextPage":return"nextPage";case"oddPage":return"oddPage";case"evenPage":return"evenPage";case"nextColumn":return"nextColumn";default:return}}function Iu(t){switch(t){case"top":return"top";case"center":return"center";case"both":return"both";case"bottom":return"bottom";default:return}}function Fu(t){switch(t){case"continuous":return"continuous";case"newPage":return"newPage";case"newSection":return"newSection";default:return}}function cr(t,e){let n={};if(!t)return n;let r=S(t,"w","pgSz");if(r){let x=L(r,"w","w");x!==void 0&&(n.pageWidth=x);let w=L(r,"w","h");w!==void 0&&(n.pageHeight=w);let I=b(r,"w","orient"),F=Tu(I);F&&(n.orientation=F)}let i=S(t,"w","pgMar");if(i){let x=L(i,"w","top");x!==void 0&&(n.marginTop=x);let w=L(i,"w","bottom");w!==void 0&&(n.marginBottom=w);let I=L(i,"w","left");I!==void 0&&(n.marginLeft=I);let F=L(i,"w","right");F!==void 0&&(n.marginRight=F);let $=L(i,"w","header");$!==void 0&&(n.headerDistance=$);let E=L(i,"w","footer");E!==void 0&&(n.footerDistance=E);let P=L(i,"w","gutter");P!==void 0&&(n.gutter=P)}let o=S(t,"w","cols");if(o){let x=L(o,"w","num");x!==void 0&&(n.columnCount=x);let w=L(o,"w","space");w!==void 0&&(n.columnSpace=w);let I=b(o,"w","equalWidth");I==="1"||I==="true"?n.equalWidth=!0:(I==="0"||I==="false")&&(n.equalWidth=!1);let F=b(o,"w","sep");(F==="1"||F==="true")&&(n.separator=!0);let $=J(o,"w","col");if($.length>0){n.columns=[];for(let E of $){let P={},R=L(E,"w","w");R!==void 0&&(P.width=R);let T=L(E,"w","space");T!==void 0&&(P.space=T),n.columns.push(P)}n.columnCount===void 0&&(n.columnCount=$.length)}}let l=S(t,"w15","footnoteColumns");if(l){let x=L(l,"w","val");x!==void 0&&x>0&&(n.footnoteColumns=x)}let a=S(t,"w","type");if(a){let x=b(a,"w","val"),w=$u(x);w&&(n.sectionStart=w)}let s=S(t,"w","vAlign");if(s){let x=b(s,"w","val"),w=Iu(x);w&&(n.verticalAlign=w)}let u=S(t,"w","bidi");u&&(n.bidi=D(u));let p=J(t,"w","headerReference");p.length>0&&(n.headerReferences=p.map(x=>wu(x)));let d=J(t,"w","footerReference");d.length>0&&(n.footerReferences=d.map(x=>yu(x)));let f=S(t,"w","titlePg");f&&(n.titlePg=D(f));let h=S(t,"w","evenAndOddHeaders");h&&(n.evenAndOddHeaders=D(h));let c=S(t,"w","lnNumType");if(c){n.lineNumbers={};let x=L(c,"w","start");x!==void 0&&(n.lineNumbers.start=x);let w=L(c,"w","countBy");w!==void 0&&(n.lineNumbers.countBy=w);let I=L(c,"w","distance");I!==void 0&&(n.lineNumbers.distance=I);let F=b(c,"w","restart"),$=Fu(F);$&&(n.lineNumbers.restart=$)}let m=S(t,"w","pgBorders");if(m){n.pageBorders={};let x=st(S(m,"w","top"));x&&(n.pageBorders.top=x);let w=st(S(m,"w","bottom"));w&&(n.pageBorders.bottom=w);let I=st(S(m,"w","left"));I&&(n.pageBorders.left=I);let F=st(S(m,"w","right"));F&&(n.pageBorders.right=F);let $=b(m,"w","display");($==="allPages"||$==="firstPage"||$==="notFirstPage")&&(n.pageBorders.display=$);let E=b(m,"w","offsetFrom");(E==="page"||E==="text")&&(n.pageBorders.offsetFrom=E);let P=b(m,"w","zOrder");(P==="front"||P==="back")&&(n.pageBorders.zOrder=P)}let g=S(t,"w","background");if(g){n.background={};let x=b(g,"w","color");x&&x!=="auto"&&(n.background.color={rgb:x});let w=b(g,"w","themeColor");w&&(n.background.themeColor=w);let I=b(g,"w","themeTint");I&&(n.background.themeTint=I);let F=b(g,"w","themeShade");F&&(n.background.themeShade=F)}let v=S(t,"w","footnotePr");if(v){let x=Su(v);Object.keys(x).length>0&&(n.footnotePr=x)}let C=S(t,"w","endnotePr");if(C){let x=Cu(C);Object.keys(x).length>0&&(n.endnotePr=x)}let y=S(t,"w","docGrid");if(y){n.docGrid={};let x=b(y,"w","type");(x==="default"||x==="lines"||x==="linesAndChars"||x==="snapToChars")&&(n.docGrid.type=x);let w=L(y,"w","linePitch");w!==void 0&&(n.docGrid.linePitch=w);let I=L(y,"w","charSpace");I!==void 0&&(n.docGrid.charSpace=I)}let k=S(t,"w","paperSrc");if(k){let x=L(k,"w","first");x!==void 0&&(n.paperSrcFirst=x);let w=L(k,"w","other");w!==void 0&&(n.paperSrcOther=w)}return n}function al(){return{pageWidth:12240,pageHeight:15840,orientation:"portrait",marginTop:1440,marginBottom:1440,marginLeft:1440,marginRight:1440,headerDistance:720,footerDistance:720,gutter:0,columnCount:1,columnSpace:720,equalWidth:!0,sectionStart:"nextPage",verticalAlign:"top"}}function zo(t,e){if(!e||e.length===0)return t;let n=new Set((t??[]).map(i=>i.type)),r=e.filter(i=>!n.has(i.type));return r.length===0?t:[...t??[],...r]}function sl(t){if(t.length<2)return t;let e=[t[0]];for(let n=1;n<t.length;n++){let r=e[n-1].properties,i=t[n].properties,o=zo(i.headerReferences,r.headerReferences),l=zo(i.footerReferences,r.footerReferences),a=i.titlePg!==void 0?i.titlePg:r.titlePg;if(o===i.headerReferences&&l===i.footerReferences&&a===i.titlePg){e.push(t[n]);continue}e.push({...t[n],properties:{...i,headerReferences:o,footerReferences:l,titlePg:a}})}return e}function No(t){if(!t)return;let e=/^(-?[\d.]+)\s*(pt|in|px|cm|mm|pc)?$/.exec(t.trim());if(!e)return;let n=parseFloat(e[1]);if(!isNaN(n))switch(e[2]){case"pt":return n/72*96;case"in":return n*96;case"cm":return n/2.54*96;case"mm":return n/25.4*96;case"pc":return n/6*96;case"px":case void 0:return n;default:return}}function Pu(t){return b(t,"r","id")??b(t,"r","embed")??b(t,null,"id")??""}function Ru(t){if(!t)return null;let e;if(t.startsWith("data:")){let n=t.indexOf(",");if(n<0)return null;e=t.slice(n+1)}else if(/^[A-Za-z0-9+/]/.test(t)&&!t.includes(":"))e=t;else return null;try{let n=typeof atob=="function"?atob(e):globalThis.Buffer?.from(e,"base64").toString("binary");if(typeof n!="string")return null;let r=new Uint8Array(n.length);for(let i=0;i<n.length;i++)r[i]=n.charCodeAt(i);return r}catch{return null}}function Eu(t){if(!t||t.length<24)return null;let e=new DataView(t.buffer,t.byteOffset,t.byteLength);if(t[0]===137&&t[1]===80&&t[2]===78&&t[3]===71)return{width:e.getUint32(16),height:e.getUint32(20)};if(t[0]===71&&t[1]===73&&t[2]===70)return{width:t[6]|t[7]<<8,height:t[8]|t[9]<<8};if(t[0]===66&&t[1]===77&&t.length>=26)return{width:e.getInt32(18,!0),height:Math.abs(e.getInt32(22,!0))};if(t[0]===255&&t[1]===216){let n=2;for(;n+9<t.length;){if(t[n]!==255){n++;continue}let r=t[n+1];if(r>=192&&r<=207&&r!==196&&r!==200&&r!==204)return{height:t[n+5]<<8|t[n+6],width:t[n+7]<<8|t[n+8]};let i=t[n+2]<<8|t[n+3];if(i<2)break;n+=2+i}}return null}function Mu(t,e,n){let r=[...Ut(t,"v","shape"),...Ut(t,"v","rect"),...Ut(t,"v","roundrect"),...Ut(t,"v","oval")];for(let i of r){let o=V(i).find(g=>g.name==="v:imagedata"||g.name?.endsWith(":imagedata"));if(!o)continue;let l=Pu(o);if(!l)continue;let a=(b(i,null,"id")??"").toLowerCase();if(Yo(i,a))continue;let{src:s,mimeType:u,filename:p}=Ge(l,e??void 0,n??void 0),d=pr(b(i,null,"style")),f=No(d.width),h=No(d.height);if(f==null||h==null){let g=Eu(Ru(s));g&&g.width>0&&g.height>0&&(f==null&&h==null?(f=g.width,h=g.height):f==null?f=h*(g.width/g.height):h=f*(g.height/g.width))}let c={type:"image",rId:l,size:{width:f!=null?Ct(f):0,height:h!=null?Ct(h):0},wrap:{type:"inline"}};s&&(c.src=s),u&&(c.mimeType=u),p&&(c.filename=p);let m=b(o,"o","title")??void 0;return m&&(c.title=m),{type:"drawing",image:c}}return null}function Oo(t,e,n,r){let i={};return t&&t!=="auto"?i.rgb=t:t==="auto"&&(i.auto=!0),e&&(i.themeColor=e),n&&(i.themeTint=n),r&&(i.themeShade=r),i}function Bu(t){if(!t)return;let e={},n=b(t,"w","color");n&&n!=="auto"&&(e.color={rgb:n});let r=b(t,"w","fill");r&&r!=="auto"&&(e.fill={rgb:r});let i=b(t,"w","themeFill");i&&(e.fill=e.fill||{},e.fill.themeColor=i);let o=b(t,"w","themeFillTint");o&&e.fill&&(e.fill.themeTint=o);let l=b(t,"w","themeFillShade");l&&e.fill&&(e.fill.themeShade=l);let a=b(t,"w","val");return a&&(e.pattern=a),Object.keys(e).length>0?e:void 0}function hr(t,e,n){if(!t)return;let r={},i=S(t,"w","b");i&&(r.bold=D(i));let o=S(t,"w","bCs");o&&(r.boldCs=D(o));let l=S(t,"w","i");l&&(r.italic=D(l));let a=S(t,"w","iCs");a&&(r.italicCs=D(a));let s=S(t,"w","u");if(s){let A=b(s,"w","val");if(A){r.underline={style:A};let j=b(s,"w","color"),H=b(s,"w","themeColor");(j||H)&&(r.underline.color=Oo(j,H,b(s,"w","themeTint"),b(s,"w","themeShade")))}}let u=S(t,"w","strike");u&&(r.strike=D(u));let p=S(t,"w","dstrike");p&&(r.doubleStrike=D(p));let d=S(t,"w","vertAlign");if(d){let A=b(d,"w","val");(A==="superscript"||A==="subscript"||A==="baseline")&&(r.vertAlign=A)}let f=S(t,"w","smallCaps");f&&(r.smallCaps=D(f));let h=S(t,"w","caps");h&&(r.allCaps=D(h));let c=S(t,"w","vanish");c&&(r.hidden=D(c));let m=S(t,"w","color");m&&(r.color=Oo(b(m,"w","val"),b(m,"w","themeColor"),b(m,"w","themeTint"),b(m,"w","themeShade")));let g=S(t,"w","highlight");if(g){let A=b(g,"w","val");A&&(r.highlight=A)}let v=S(t,"w","shd");v&&(r.shading=Bu(v));let C=S(t,"w","sz");if(C){let A=L(C,"w","val");A!==void 0&&(r.fontSize=A)}let y=S(t,"w","szCs");if(y){let A=L(y,"w","val");A!==void 0&&(r.fontSizeCs=A)}let k=S(t,"w","rFonts");if(k){r.fontFamily={ascii:b(k,"w","ascii")??void 0,hAnsi:b(k,"w","hAnsi")??void 0,eastAsia:b(k,"w","eastAsia")??void 0,cs:b(k,"w","cs")??void 0};let A=b(k,"w","asciiTheme");A&&(r.fontFamily.asciiTheme=A,e&&!r.fontFamily.ascii&&(r.fontFamily.ascii=Pt(e,A)));let j=b(k,"w","hAnsiTheme");j&&(r.fontFamily.hAnsiTheme=j,e&&!r.fontFamily.hAnsi&&(r.fontFamily.hAnsi=Pt(e,j)));let H=b(k,"w","eastAsiaTheme");H&&(r.fontFamily.eastAsiaTheme=H,e&&!r.fontFamily.eastAsia&&(r.fontFamily.eastAsia=Pt(e,H)));let Y=b(k,"w","cstheme");Y&&(r.fontFamily.csTheme=Y,e&&!r.fontFamily.cs&&(r.fontFamily.cs=Pt(e,Y)))}let x=S(t,"w","spacing");if(x){let A=L(x,"w","val");A!==void 0&&(r.spacing=A)}let w=S(t,"w","position");if(w){let A=L(w,"w","val");A!==void 0&&(r.position=A)}let I=S(t,"w","w");if(I){let A=L(I,"w","val");A!==void 0&&(r.scale=A)}let F=S(t,"w","kern");if(F){let A=L(F,"w","val");A!==void 0&&(r.kerning=A)}let $=S(t,"w","effect");if($){let A=b($,"w","val");A&&(r.effect=A)}let E=S(t,"w","em");if(E){let A=b(E,"w","val");A&&(r.emphasisMark=A)}let P=S(t,"w","emboss");P&&(r.emboss=D(P));let R=S(t,"w","imprint");R&&(r.imprint=D(R));let T=S(t,"w","outline");T&&(r.outline=D(T));let M=S(t,"w","shadow");M&&(r.shadow=D(M));let B=S(t,"w","rtl");B&&(r.rtl=D(B));let N=S(t,"w","cs");N&&(r.cs=D(N));let z=S(t,"w","rStyle");if(z){let A=b(z,"w","val");A&&(r.styleId=A)}return Object.keys(r).length>0?r:void 0}function Lu(t){let e=b(t,"w","id"),n=e?parseInt(e,10):0,r=(b(t,"w","author")??"").trim(),i=(b(t,"w","date")??"").trim(),o=(b(t,"w","rsid")??"").trim();return{id:Number.isInteger(n)&&n>=0?n:0,author:r.length>0?r:"Unknown",date:i.length>0?i:void 0,rsid:o.length>0?o:void 0}}function Au(t,e,n,r){if(!t)return;let i=J(t,"w","rPrChange").map(o=>{let l=S(o,"w","rPr");return{type:"runPropertyChange",info:Lu(o),previousFormatting:hr(l,e),currentFormatting:r}}).filter(o=>o.previousFormatting||o.currentFormatting);return i.length>0?i:void 0}function zu(t){let e=St(t),n=b(t,"xml","space")==="preserve";return{type:"text",text:e,preserveSpace:n||void 0}}function Nu(){return{type:"tab"}}function Ou(t){let e=b(t,"w","type"),n=b(t,"w","clear"),r={type:"break"};return(e==="page"||e==="column"||e==="textWrapping")&&(r.breakType=e),(n==="none"||n==="left"||n==="right"||n==="all")&&(r.clear=n),r}function Hu(t){let e=b(t,"w","font")??"",n=b(t,"w","char")??"";return{type:"symbol",font:e,char:n}}function Du(t){return{type:"footnoteRef",id:L(t,"w","id")??0}}function Wu(t){return{type:"endnoteRef",id:L(t,"w","id")??0}}function ju(t){let e=b(t,"w","fldCharType"),n=b(t,"w","fldLock")==="true"||b(t,"w","fldLock")==="1",r=b(t,"w","dirty")==="true"||b(t,"w","dirty")==="1",i="begin";return e==="separate"?i="separate":e==="end"&&(i="end"),{type:"fieldChar",charType:i,fldLock:n||void 0,dirty:r||void 0}}function _u(t){return{type:"instrText",text:St(t)}}function Ho(t,e,n){let r=Ro(t,e??void 0,n??void 0);return r?{type:"drawing",image:r}:null}function Je(t){if(!t)return"";let e=t.indexOf(":");return e>=0?t.substring(e+1):t}function Xu(t,e,n){let r=[],i=V(t);for(let o of i)switch(Je(o.name)){case"t":r.push(zu(o));break;case"tab":r.push(Nu());break;case"br":r.push(Ou(o));break;case"sym":r.push(Hu(o));break;case"footnoteReference":r.push(Du(o));break;case"endnoteReference":r.push(Wu(o));break;case"fldChar":r.push(ju(o));break;case"instrText":r.push(_u(o));break;case"softHyphen":r.push({type:"softHyphen"});break;case"noBreakHyphen":r.push({type:"noBreakHyphen"});break;case"drawing":let l=Ho(o,e,n);l&&r.push(l);break;case"pict":case"object":{let a=Mu(o,e,n);a&&r.push(a);break}case"rPr":break;case"lastRenderedPageBreak":break;case"cr":r.push({type:"break",breakType:"textWrapping"});break;case"AlternateContent":{let a=V(o).find(s=>Je(s.name)==="Choice")??V(o).find(s=>Je(s.name)==="Fallback");if(a){for(let s of V(a))if(Je(s.name)==="drawing"){let u=Ho(s,e,n);u?.image?.src&&r.push(u)}}break}case"footnoteRef":r.push({type:"footnoteRefMark"});break;case"endnoteRef":r.push({type:"endnoteRefMark"});break;case"separator":r.push({type:"separator"});break;case"continuationSeparator":r.push({type:"continuationSeparator"});break}return r}function mr(t,e,n,r=null,i=null){let o={type:"run",content:[]},l=S(t,"w","rPr");return l&&(o.formatting=hr(l,n),o.propertyChanges=Au(l,n,e,o.formatting)),o.content=Xu(t,r,i),o}function qu(t){if(!t)return;let e={},n=b(t,"w","color");n&&n!=="auto"&&(e.color={rgb:n});let r=b(t,"w","fill");r&&r!=="auto"&&(e.fill={rgb:r});let i=b(t,"w","themeFill");i&&(e.fill=e.fill||{},e.fill.themeColor=i);let o=b(t,"w","themeFillTint");o&&e.fill&&(e.fill.themeTint=o);let l=b(t,"w","themeFillShade");l&&e.fill&&(e.fill.themeShade=l);let a=b(t,"w","val");return a&&(e.pattern=a),Object.keys(e).length>0?e:void 0}function Uu(t){if(!t)return;let e=J(t,"w","tab");if(e.length===0)return;let n=[];for(let r of e){let i=L(r,"w","pos"),o=b(r,"w","val");if(i!==void 0&&o){let l={position:i,alignment:o},a=b(r,"w","leader");a&&(l.leader=a),n.push(l)}}return n.length>0?n:void 0}function Vu(t){if(!t)return;let e={},n=L(t,"w","w");n!==void 0&&(e.width=n);let r=L(t,"w","h");r!==void 0&&(e.height=r);let i=b(t,"w","hAnchor");(i==="text"||i==="margin"||i==="page")&&(e.hAnchor=i);let o=b(t,"w","vAnchor");(o==="text"||o==="margin"||o==="page")&&(e.vAnchor=o);let l=L(t,"w","x");l!==void 0&&(e.x=l);let a=L(t,"w","y");a!==void 0&&(e.y=a);let s=b(t,"w","xAlign");s&&(e.xAlign=s);let u=b(t,"w","yAlign");u&&(e.yAlign=u);let p=b(t,"w","wrap");return p&&(e.wrap=p),Object.keys(e).length>0?e:void 0}function pl(t,e,n){if(!t)return;let r={},i=S(t,"w","jc");if(i){let I=b(i,"w","val");I&&(r.alignment=I)}let o=S(t,"w","bidi");o&&(r.bidi=D(o));let l=S(t,"w","spacing");if(l){let I=L(l,"w","before");I!==void 0&&(r.spaceBefore=I);let F=L(l,"w","after");F!==void 0&&(r.spaceAfter=F);let $=L(l,"w","line");$!==void 0&&(r.lineSpacing=$);let E={};I!==void 0&&(E.before=!0),F!==void 0&&(E.after=!0),(E.before||E.after)&&(r.spacingExplicit=E);let P=b(l,"w","lineRule");P&&(r.lineSpacingRule=P);let R=b(l,"w","beforeAutospacing");R&&(r.beforeAutospacing=R==="1"||R==="true");let T=b(l,"w","afterAutospacing");T&&(r.afterAutospacing=T==="1"||T==="true")}let a=S(t,"w","ind");if(a){let I=L(a,"w","left");I!==void 0&&(r.indentLeft=I);let F=L(a,"w","right");F!==void 0&&(r.indentRight=F);let $=L(a,"w","firstLine");$!==void 0&&(r.indentFirstLine=$);let E=L(a,"w","hanging");E!==void 0&&(r.indentFirstLine=-E,r.hangingIndent=!0);let P=L(a,"w","start");P!==void 0&&r.indentLeft===void 0&&(r.indentLeft=P);let R=L(a,"w","end");R!==void 0&&r.indentRight===void 0&&(r.indentRight=R)}let s=ur(S(t,"w","pBdr"));s&&(r.borders=s);let u=S(t,"w","shd");u&&(r.shading=qu(u));let p=S(t,"w","tabs");p&&(r.tabs=Uu(p));let d=S(t,"w","keepNext");d&&(r.keepNext=D(d));let f=S(t,"w","keepLines");f&&(r.keepLines=D(f));let h=S(t,"w","widowControl");h&&(r.widowControl=D(h));let c=S(t,"w","pageBreakBefore");c&&(r.pageBreakBefore=D(c));let m=S(t,"w","contextualSpacing");m&&(r.contextualSpacing=D(m));let g=S(t,"w","numPr");if(g){let I=S(g,"w","numId"),F=S(g,"w","ilvl");if(I||F){if(r.numPr={},I){let $=L(I,"w","val");$!==void 0&&(r.numPr.numId=$)}if(F){let $=L(F,"w","val");$!==void 0&&(r.numPr.ilvl=$)}}}let v=S(t,"w","outlineLvl");if(v){let I=L(v,"w","val");I!==void 0&&(r.outlineLevel=I)}let C=S(t,"w","pStyle");if(C){let I=b(C,"w","val");I&&(r.styleId=I)}let y=S(t,"w","framePr");y&&(r.frame=Vu(y));let k=S(t,"w","suppressLineNumbers");k&&(r.suppressLineNumbers=D(k));let x=S(t,"w","suppressAutoHyphens");x&&(r.suppressAutoHyphens=D(x));let w=S(t,"w","rPr");return w&&(r.runProperties=hr(w,e)),Object.keys(r).length>0?r:void 0}function Yu(t){if(!t)return"";let e=t.indexOf(":");return e>=0?t.substring(e+1):t}function Gu(t){let e=L(t,"w","id")??0,n=b(t,"w","name")??"",r={type:"bookmarkStart",id:e,name:n},i=L(t,"w","colFirst");i!==void 0&&(r.colFirst=i);let o=L(t,"w","colLast");return o!==void 0&&(r.colLast=o),r}function Zu(t){return{type:"bookmarkEnd",id:L(t,"w","id")??0}}function Ku(t,e,n=null,r=null,i=null){let o={type:"hyperlink",children:[]},l=b(t,"r","id");if(l&&(o.rId=l,e)){let h=e.get(l);h&&(o.href=oe(h.target))}let a=b(t,"w","anchor");a&&(o.anchor=a,o.href||(o.href=`#${a}`));let s=b(t,"w","tooltip");s&&(o.tooltip=s);let u=b(t,"w","tgtFrame");u&&(o.target=u);let p=b(t,"w","history");(p==="1"||p==="true")&&(o.history=!0);let d=b(t,"w","docLocation");d&&(o.docLocation=d);let f=V(t);for(let h of f)switch(Yu(h.name)){case"r":o.children.push(mr(h,n,r,e,i));break;case"bookmarkStart":o.children.push(Gu(h));break;case"bookmarkEnd":o.children.push(Zu(h));break}return o}function Ju(t){let e=L(t,"w","id")??0,n=b(t,"w","name")??"",r={type:"bookmarkStart",id:e,name:n},i=L(t,"w","colFirst");i!==void 0&&(r.colFirst=i);let o=L(t,"w","colLast");return o!==void 0&&(r.colLast=o),r}function Qu(t){return{type:"bookmarkEnd",id:L(t,"w","id")??0}}function ul(t){let e="";if(t.type==="text"&&typeof t.text=="string")return t.text;if(t.elements)for(let n of t.elements)if((n.name?.replace(/^.*:/,"")??"")==="t"&&n.elements)for(let r of n.elements)r.type==="text"&&typeof r.text=="string"&&(e+=r.text);else e+=ul(n);return e}function he(t){if(!t)return"";let e=t.indexOf(":");return e>=0?t.substring(e+1):t}function td(t){let e=new Set(["hyperlink","smartTag","sdt","sdtContent","fldSimple","customXml","ins","del","moveFrom","moveTo"]),n=new Set(["pPr","proofErr","bookmarkStart","bookmarkEnd","commentRangeStart","commentRangeEnd","commentReference","permStart","permEnd","rsidR"]),r=new Set(["t","tab","br","cr","sym","drawing","pict","object","softHyphen","noBreakHyphen","fldChar","instrText","pgNum","separator","continuationSeparator","footnoteRef","endnoteRef","footnoteReference","endnoteReference","ptab","monthShort","monthLong","yearShort","yearLong","dayShort","dayLong"]),i=!1;function o(a){for(let s of V(a)){let u=he(s.name);if(!n.has(u)){if(u==="lastRenderedPageBreak"){i=!0;continue}if(u==="r"){for(let p of V(s)){let d=he(p.name);if(d!=="rPr"){if(d==="lastRenderedPageBreak"){i=!0;continue}if(d==="br"&&b(p,"w","type")==="page")return"forced";if(r.has(d))return"visible"}}continue}if(e.has(u)){let p=o(s);if(p!=="continue")return p;continue}return"continue"}}return"continue"}let l=o(t);return l==="forced"?!0:l==="visible"?i:!1}function Do(t,e){if(!t)return`w:${e}`;let n=t.indexOf(":");return n<0?e:`${t.substring(0,n+1)}${e}`}function dl(t){if(t.type!=="element")return t;let e=he(t.name),n=t.name;return e==="delText"?n=Do(t.name,"t"):e==="delInstrText"&&(n=Do(t.name,"instrText")),{...t,name:n,elements:t.elements?.map(dl)}}function ce(t){let e=b(t,"w","id"),n=e?parseInt(e,10):0,r=b(t,"w","author"),i=b(t,"w","date"),o=r?.trim()??"",l=i?.trim()??"";return{id:Number.isInteger(n)&&n>=0?n:0,author:o.length>0?o:"Unknown",date:l.length>0?l:void 0}}function ed(t){return ce(t)}function nd(t,e,n,r){if(!t)return;let i=J(t,"w","pPrChange").map(o=>{let l=S(o,"w","pPr");return{type:"paragraphPropertyChange",info:ed(o),previousFormatting:pl(l,e),currentFormatting:r}}).filter(o=>o.previousFormatting||o.currentFormatting);return i.length>0?i:void 0}function rd(t,e,n,r,i){return Ku(t,e,n,r,i)}function id(t){return Ju(t)}function od(t){return Qu(t)}function fl(t){let e=t.trim().match(/^\\?([A-Z]+)/i);if(!e)return"UNKNOWN";let n=e[1].toUpperCase();return["PAGE","NUMPAGES","NUMWORDS","NUMCHARS","DATE","TIME","CREATEDATE","SAVEDATE","PRINTDATE","AUTHOR","TITLE","SUBJECT","KEYWORDS","COMMENTS","FILENAME","FILESIZE","TEMPLATE","DOCPROPERTY","DOCVARIABLE","REF","PAGEREF","NOTEREF","HYPERLINK","TOC","TOA","INDEX","SEQ","STYLEREF","AUTONUM","AUTONUMLGL","AUTONUMOUT","IF","MERGEFIELD","NEXT","NEXTIF","ASK","SET","QUOTE","INCLUDETEXT","INCLUDEPICTURE","SYMBOL","ADVANCE","EDITTIME","REVNUM","SECTION","SECTIONPAGES","USERADDRESS","USERNAME","USERINITIALS"].includes(n)?n:"UNKNOWN"}function ld(t,e,n,r,i){let o=b(t,"w","instr")??"",l=fl(o),a={type:"simpleField",instruction:o,fieldType:l,content:[]},s=b(t,"w","fldLock");(s==="1"||s==="true")&&(a.fldLock=!0);let u=b(t,"w","dirty");(u==="1"||u==="true")&&(a.dirty=!0);let p=V(t);for(let d of p)he(d.name)==="r"&&a.content.push(mr(d,e,n,r,i));return a}function Kt(t,e,n,r,i,o,l="default"){let a=[],s=V(t),u=!1,p="",d=[],f=[],h=!1,c=!1,m=!1,g;for(let v of s){let C=he(v.name);switch(C){case"r":{let y=l==="deletion"?dl(v):v,k=mr(y,e,n,i,o),x=!1,w=!1,I=!1,F="";for(let $ of k.content)$.type==="fieldChar"?$.charType==="begin"?(x=!0,$.fldLock&&(c=!0),$.dirty&&(m=!0)):$.charType==="separate"?w=!0:$.charType==="end"&&(I=!0):$.type==="instrText"&&(F+=$.text);if(x&&(u=!0,h=!1,p="",d=[],f=[],c=!1,m=!1,g=k.formatting),u){if(F&&(p+=F),!g&&k.formatting&&(g=k.formatting),w&&(h=!0),h&&!I?w||f.push(k):!h&&!x&&d.push(k),I){let $={type:"complexField",instruction:p.trim(),fieldType:fl(p),fieldCode:d,fieldResult:f};g&&($.formatting=g),c&&($.fldLock=!0),m&&($.dirty=!0),a.push($),u=!1}}else a.push(k);break}case"hyperlink":a.push(rd(v,i,e,n,o));break;case"bookmarkStart":a.push(id(v));break;case"bookmarkEnd":a.push(od(v));break;case"fldSimple":a.push(ld(v,e,n,i,o));break;case"pPr":break;case"proofErr":case"permStart":case"permEnd":case"customXml":break;case"sdt":{let y=(v.elements??[]).find(x=>x.type==="element"&&(x.name==="w:sdtPr"||x.name?.endsWith(":sdtPr"))),k=(v.elements??[]).find(x=>x.type==="element"&&(x.name==="w:sdtContent"||x.name?.endsWith(":sdtContent")));if(k){let x=Kt(k,e,n,null,i,o,l),w={type:"inlineSdt",properties:Vo(y??null),content:x.filter(I=>I.type==="run"||I.type==="hyperlink"||I.type==="simpleField"||I.type==="complexField"||I.type==="inlineSdt"||I.type==="mathEquation")};a.push(w)}break}case"ins":{let y=ce(v),k=Kt(v,e,n,null,i,o),x={type:"insertion",info:y,content:k.filter(w=>w.type==="run"||w.type==="hyperlink")};a.push(x);break}case"del":{let y=ce(v),k=Kt(v,e,n,null,i,o,"deletion"),x={type:"deletion",info:y,content:k.filter(w=>w.type==="run"||w.type==="hyperlink")};a.push(x);break}case"moveFrom":{let y=ce(v),k=Kt(v,e,n,null,i,o,"deletion"),x={type:"moveFrom",info:y,content:k.filter(w=>w.type==="run"||w.type==="hyperlink")};a.push(x);break}case"moveTo":{let y=ce(v),k=Kt(v,e,n,null,i,o),x={type:"moveTo",info:y,content:k.filter(w=>w.type==="run"||w.type==="hyperlink")};a.push(x);break}case"smartTag":break;case"moveFromRangeStart":{let y=parseInt(b(v,"w","id")??"0",10),k=b(v,"w","name")??"";a.push({type:"moveFromRangeStart",id:y,name:k});break}case"moveFromRangeEnd":{let y=parseInt(b(v,"w","id")??"0",10);a.push({type:"moveFromRangeEnd",id:y});break}case"moveToRangeStart":{let y=parseInt(b(v,"w","id")??"0",10),k=b(v,"w","name")??"";a.push({type:"moveToRangeStart",id:y,name:k});break}case"moveToRangeEnd":{let y=parseInt(b(v,"w","id")??"0",10);a.push({type:"moveToRangeEnd",id:y});break}case"commentRangeStart":{let y=parseInt(b(v,"w","id")??"0",10);a.push({type:"commentRangeStart",id:y});break}case"commentRangeEnd":{let y=parseInt(b(v,"w","id")??"0",10);a.push({type:"commentRangeEnd",id:y});break}case"oMath":case"oMathPara":{let y=C==="oMathPara",k=qt(v),x=ul(v),w={type:"mathEquation",display:y?"block":"inline",ommlXml:k,plainText:x||void 0};a.push(w);break}}}return a}function gr(t){let e="";for(let n of t.content)if(n.type==="run")for(let r of n.content)r.type==="text"?e+=r.text:r.type==="tab"?e+="	":r.type==="break"&&(r.breakType==="page"?e+="\f":e+=`
`);else if(n.type==="hyperlink"){for(let r of n.children)if(r.type==="run")for(let i of r.content)i.type==="text"&&(e+=i.text)}else if(n.type==="simpleField"){for(let r of n.content)if(r.type==="run")for(let i of r.content)i.type==="text"&&(e+=i.text)}else if(n.type==="complexField")for(let r of n.fieldResult)for(let i of r.content)i.type==="text"&&(e+=i.text);return e}function Wo(t){let e=b(t,"w","id");if(e==null)return null;let n=parseInt(e,10);if(Number.isNaN(n))return null;let r=b(t,"w","author")??"",i=b(t,"w","date")??void 0,o={id:n,author:r};return i&&(o.date=i),o}function ye(t,e,n,r,i=null,o=null,l){let a={type:"paragraph",content:[]},s=b(t,"w14","paraId")??b(t,"w","paraId");s&&(a.paraId=Pn(s));let u=b(t,"w14","textId")??b(t,"w","textId");u&&(a.textId=Pn(u)),!l?.inHeaderFooter&&td(t)&&(a.renderedPageBreakBefore=!0);let p=S(t,"w","pPr");if(p){a.formatting=pl(p,n),a.propertyChanges=nd(p,n,e,a.formatting);let c=S(p,"w","rPr");if(c){let g=S(c,"w","ins");if(g){let C=Wo(g);C&&(a.pPrIns=C)}let v=S(c,"w","del");if(v){let C=Wo(v);C&&(a.pPrDel=C)}}let m=S(p,"w","sectPr");m&&(a.sectionProperties=cr(m))}let d=Kt(t,e,n,r,i,o);a.content=d;let f=a.formatting?.numPr,h=!1;if(!f&&a.formatting?.styleId&&e){let c=e.get(a.formatting.styleId);c?.pPr?.numPr&&(f=c.pPr.numPr,h=!0,a.formatting||(a.formatting={}),a.formatting.numPr=f,a.formatting.numPrFromStyle=f)}if(f&&r){let c=hi(f,r);if(c){a.listRendering=c;let m=h?ad(a.formatting?.styleId,e):{left:!1,firstLine:!1},g=r.getLevel(c.numId,c.level);if(g?.pPr){a.formatting||(a.formatting={});let v=p?S(p,"w","ind"):null,C=v!=null&&(b(v,"w","left")!==null||b(v,"w","start")!==null),y=x=>{let w=v?b(v,"w",x):null;if(w===null)return!1;let I=parseInt(w,10);return Number.isNaN(I)||I!==0},k=v!=null&&(y("firstLine")||y("hanging"));!C&&!m.left&&g.pPr.indentLeft!==void 0&&(a.formatting.indentLeft=g.pPr.indentLeft),!k&&!m.firstLine&&(g.pPr.indentFirstLine!==void 0&&(a.formatting.indentFirstLine=g.pPr.indentFirstLine),g.pPr.hangingIndent!==void 0&&(a.formatting.hangingIndent=g.pPr.hangingIndent))}}}return a}function ad(t,e){let n={left:!1,firstLine:!1};if(!t||!e)return n;let r=new Set,i=t;for(;i&&!r.has(i);){r.add(i);let o=e.get(i);if(!o)break;let l=o.pPr;if(l&&(n.left||(n.left=l.indentLeft!==void 0),n.firstLine||(n.firstLine=l.indentFirstLine!==void 0||l.hangingIndent!==void 0)),n.left&&n.firstLine)break;i=o.basedOn}return n}function cl(t){if(!t)return;let e={},n=Rt(S(t,"w","tblW"));n&&(e.width=n);let r=S(t,"w","jc");if(r){let c=b(r,"w","val");(c==="left"||c==="center"||c==="right"||c==="start")&&(e.justification=c==="start"?"left":c)}let i=Rt(S(t,"w","tblCellSpacing"));i&&(e.cellSpacing=i);let o=Rt(S(t,"w","tblInd"));o&&(e.indent=o);let l=we(S(t,"w","tblBorders"));l&&(e.borders=l);let a=qo(S(t,"w","tblCellMar"));a&&(e.cellMargins=a);let s=S(t,"w","tblLayout");if(s){let c=b(s,"w","type");(c==="fixed"||c==="autofit")&&(e.layout=c)}let u=S(t,"w","tblStyle");if(u){let c=b(u,"w","val");c&&(e.styleId=c)}let p=lu(S(t,"w","tblLook"));p&&(e.look=p);let d=Uo(S(t,"w","shd"));d&&(e.shading=d);let f=S(t,"w","tblOverlap");if(f){let c=b(f,"w","val");(c==="never"||c==="overlap")&&(e.overlap=c)}let h=au(S(t,"w","tblpPr"));if(h&&(e.floating=h),D(S(t,"w","bidiVisual"))&&(e.bidi=!0),Object.keys(e).length!==0)return e}function sd(t,e){if(!t)return;let n=J(t,"w","tblPrChange").map(r=>{let i=S(r,"w","tblPr");return{type:"tablePropertyChange",info:dr(r),previousFormatting:cl(i),currentFormatting:e}}).filter(r=>r.previousFormatting||r.currentFormatting);return n.length>0?n:void 0}function pd(t,e){if(!t)return;let n=J(t,"w","trPrChange").map(r=>{let i=S(r,"w","trPr");return{type:"tableRowPropertyChange",info:dr(r),previousFormatting:hl(i),currentFormatting:e}}).filter(r=>r.previousFormatting||r.currentFormatting);return n.length>0?n:void 0}function ud(t,e){if(!t)return;let n=J(t,"w","tcPrChange").map(r=>{let i=S(r,"w","tcPr");return{type:"tableCellPropertyChange",info:dr(r),previousFormatting:gl(i),currentFormatting:e}}).filter(r=>r.previousFormatting||r.currentFormatting);return n.length>0?n:void 0}function dd(t){if(!t)return;let e=S(t,"w","ins");if(e)return{type:"tableRowInsertion",info:Jt(e)};let n=S(t,"w","del");if(n)return{type:"tableRowDeletion",info:Jt(n)}}function fd(t){if(!t)return;let e=S(t,"w","cellIns");if(e)return{type:"tableCellInsertion",info:Jt(e)};let n=S(t,"w","cellDel");if(n)return{type:"tableCellDeletion",info:Jt(n)};let r=S(t,"w","cellMerge");if(r){let i=b(r,"w","vMerge"),o=b(r,"w","vMergeOrig"),l=a=>a==="rest"||a==="cont";return{type:"tableCellMerge",info:Jt(r),...l(i)?{vMerge:i}:{},...l(o)?{vMergeOrig:o}:{}}}}function hl(t){if(!t)return;let e={},n=S(t,"w","trHeight");if(n){let o=L(n,"w","val");o!==void 0&&o>0&&(e.height={value:o,type:"dxa"});let l=b(n,"w","hRule");(l==="auto"||l==="atLeast"||l==="exact")&&(e.heightRule=l)}D(S(t,"w","tblHeader"))&&(e.header=!0),D(S(t,"w","cantSplit"))&&(e.cantSplit=!0);let r=S(t,"w","jc");if(r){let o=b(r,"w","val");(o==="left"||o==="center"||o==="right")&&(e.justification=o)}D(S(t,"w","hidden"))&&(e.hidden=!0);let i=ml(S(t,"w","cnfStyle"));if(i&&(e.conditionalFormat=i),Object.keys(e).length!==0)return e}function ml(t){if(!t)return;let e={},n=b(t,"w","firstRow");(n==="1"||n==="true")&&(e.firstRow=!0);let r=b(t,"w","lastRow");(r==="1"||r==="true")&&(e.lastRow=!0);let i=b(t,"w","firstColumn");(i==="1"||i==="true")&&(e.firstColumn=!0);let o=b(t,"w","lastColumn");(o==="1"||o==="true")&&(e.lastColumn=!0);let l=b(t,"w","oddHBand");(l==="1"||l==="true")&&(e.oddHBand=!0);let a=b(t,"w","evenHBand");(a==="1"||a==="true")&&(e.evenHBand=!0);let s=b(t,"w","oddVBand");(s==="1"||s==="true")&&(e.oddVBand=!0);let u=b(t,"w","evenVBand");(u==="1"||u==="true")&&(e.evenVBand=!0);let p=b(t,"w","firstRowFirstColumn");(p==="1"||p==="true")&&(e.nwCell=!0);let d=b(t,"w","firstRowLastColumn");(d==="1"||d==="true")&&(e.neCell=!0);let f=b(t,"w","lastRowFirstColumn");(f==="1"||f==="true")&&(e.swCell=!0);let h=b(t,"w","lastRowLastColumn");(h==="1"||h==="true")&&(e.seCell=!0);let c=b(t,"w","val");if(c&&c.length===12&&(c[0]==="1"&&(e.firstRow=!0),c[1]==="1"&&(e.lastRow=!0),c[2]==="1"&&(e.firstColumn=!0),c[3]==="1"&&(e.lastColumn=!0),c[4]==="1"&&(e.oddVBand=!0),c[5]==="1"&&(e.evenVBand=!0),c[6]==="1"&&(e.oddHBand=!0),c[7]==="1"&&(e.evenHBand=!0),c[8]==="1"&&(e.nwCell=!0),c[9]==="1"&&(e.neCell=!0),c[10]==="1"&&(e.swCell=!0),c[11]==="1"&&(e.seCell=!0)),Object.keys(e).length!==0)return e}function gl(t){if(!t)return;let e={},n=Rt(S(t,"w","tcW"));n&&(e.width=n);let r=we(S(t,"w","tcBorders"));r&&(e.borders=r);let i=qo(S(t,"w","tcMar"));i&&(e.margins=i);let o=Uo(S(t,"w","shd"));o&&(e.shading=o);let l=S(t,"w","vAlign");if(l){let d=b(l,"w","val");(d==="top"||d==="center"||d==="bottom")&&(e.verticalAlign=d)}let a=S(t,"w","textDirection");if(a){let d=b(a,"w","val");d&&(e.textDirection=d)}let s=S(t,"w","gridSpan");if(s){let d=L(s,"w","val");d!==void 0&&d>1&&(e.gridSpan=d)}let u=S(t,"w","vMerge");u&&(b(u,"w","val")==="restart"?e.vMerge="restart":e.vMerge="continue"),D(S(t,"w","tcFitText"))&&(e.fitText=!0),D(S(t,"w","noWrap"))&&(e.noWrap=!0),D(S(t,"w","hideMark"))&&(e.hideMark=!0);let p=ml(S(t,"w","cnfStyle"));if(p&&(e.conditionalFormat=p),Object.keys(e).length!==0)return e}function cd(t,e,n,r,i,o,l){let a=[],s=t.elements||[];for(let u of s){if(!u.name)continue;let p=u.name.split(":").pop();if(p==="p"){let d=ye(u,e,n,r,i,o,l);a.push(d)}else if(p==="tbl"){let d=wl(u,e,n,r,i,o,l);a.push(d)}}return a.length===0&&a.push({type:"paragraph",content:[]}),a}function hd(t,e,n,r,i,o,l){let a={type:"tableCell",content:[]},s=S(t,"w","tcPr"),u=gl(s);return u&&(a.formatting=u),a.propertyChanges=ud(s,u),a.structuralChange=fd(s),a.content=cd(t,e,n,r,i,o,l),a}function md(t,e,n,r,i,o,l){let a={type:"tableRow",cells:[]},s=S(t,"w","trPr"),u=hl(s);u&&(a.formatting=u),a.propertyChanges=pd(s,u),a.structuralChange=dd(s);let p=J(t,"w","tc");for(let d of p){let f=hd(d,e,n,r,i,o,l);a.cells.push(f)}return a}function gd(t){if(!t)return;let e=[],n=J(t,"w","gridCol");for(let r of n){let i=L(r,"w","w")??0;e.push(i)}if(!(e.length>0&&e.every(r=>r<=0)))return e.length>0?e:void 0}function wd(t){return t.cells.reduce((e,n)=>e+(n.formatting?.gridSpan??1),0)}function yd(t){let e=Math.max(t.columnWidths?.length??0,...t.rows.map(n=>wd(n)));if(!(e<=1))for(let n of t.rows){if(n.cells.length!==1)continue;let r=n.cells[0];(r.formatting?.gridSpan??1)>=e||r.formatting?.vMerge||r.formatting?.gridSpan==null&&(r.formatting={...r.formatting??{},gridSpan:e})}}function wl(t,e,n,r,i,o,l){let a={type:"table",rows:[]},s=S(t,"w","tblPr"),u=cl(s);u&&(a.formatting=u),a.propertyChanges=sd(s,u);let p=gd(S(t,"w","tblGrid"));p&&(a.columnWidths=p);let d=J(t,"w","tr");for(let f of d){let h=md(f,e,n,r,i,o,l);a.rows.push(h)}return yd(a),a}function tn(t,e){let n={};for(let r of t)switch(r.type.name){case"bold":n.bold=!0;break;case"italic":n.italic=!0;break;case"underline":{let i=r.attrs;if(i.style||i.color){let o=i.color?Ae(i.color,e):void 0;n.underline={style:i.style,color:o}}else n.underline=!0;break}case"strike":n.strike=!0;break;case"textColor":{let i=r.attrs;(i.themeColor||i.rgb)&&(n.color=Ae({rgb:i.rgb,themeColor:i.themeColor,themeTint:i.themeTint,themeShade:i.themeShade},e));break}case"highlight":n.highlight=gi(r.attrs.color);break;case"fontSize":{let i=r.attrs,o=t.some(l=>l.type.name==="rtl")&&i.sizeCs!=null?i.sizeCs:i.size;o!=null&&(n.fontSize=o/2);break}case"fontFamily":{let i=r.attrs,o=t.some(l=>l.type.name==="rtl");n.fontFamily=o&&i.cs?i.cs:i.ascii||i.hAnsi;break}case"characterSpacing":{let i=r.attrs;i.spacing!=null&&i.spacing!==0&&(n.letterSpacing=G(i.spacing)),i.position!=null&&i.position!==0&&(n.positionPx=ui(i.position)),i.scale!=null&&i.scale!==100&&(n.horizontalScale=i.scale),i.kerning!=null&&i.kerning>0&&(n.kerningMinPt=di(i.kerning));break}case"allCaps":n.allCaps=!0;break;case"smallCaps":n.smallCaps=!0;break;case"emboss":n.emboss=!0;break;case"imprint":n.imprint=!0;break;case"textShadow":n.textShadow=!0;break;case"textOutline":n.textOutline=!0;break;case"hidden":n.hidden=!0;break;case"rtl":n.rtl=!0;break;case"textEffect":{let i=r.attrs.effect;(i==="blinkBackground"||i==="lights"||i==="antsBlack"||i==="antsRed"||i==="shimmer"||i==="sparkle")&&(n.textEffect=i);break}case"emphasisMark":{let i=r.attrs.type;i==="dot"||i==="comma"||i==="circle"||i==="underDot"?n.emphasisMark=i:n.emphasisMark="dot";break}case"superscript":n.superscript=!0;break;case"subscript":n.subscript=!0;break;case"hyperlink":{let i=r.attrs;n.hyperlink={href:i.href,tooltip:i.tooltip};break}case"footnoteRef":{let i=r.attrs,o=typeof i.id=="string"?parseInt(i.id,10):i.id;i.noteType==="endnote"?n.endnoteRefId=o:n.footnoteRefId=o,n.superscript=!0;break}case"comment":{let i=r.attrs.commentId;i&&(n.commentIds||(n.commentIds=[]),n.commentIds.push(i));break}case"insertion":n.isInsertion=!0,n.changeAuthor=r.attrs.author,n.changeDate=r.attrs.date,n.changeRevisionId=r.attrs.revisionId;break;case"deletion":n.isDeletion=!0,n.changeAuthor=r.attrs.author,n.changeDate=r.attrs.date,n.changeRevisionId=r.attrs.revisionId;break}return n}function bd(t){let e=t.defaultTextFormatting;if(!e)return{};let n={};if(e.fontFamily){let r=e.fontFamily.ascii||e.fontFamily.hAnsi;r&&(n.fontFamily=r)}return e.fontSize!=null&&(n.fontSize=e.fontSize/2),n}function yl(t){t.hyperlink&&(t.hyperlink={...t.hyperlink,noDefaultStyle:!0},delete t.color,delete t.underline)}function xd(t){return t==="contentLocked"||t==="sdtContentLocked"}function vd(t,e){let n=t.attrs;if(n.sdtType==="checkbox"&&!(xd(n.lock)||n.dataBinding!=null))return{kind:"checkbox",groupId:`sdt@${e}`,pos:e,tag:n.tag!=null?String(n.tag):void 0,alias:n.alias!=null?String(n.alias):void 0,checked:typeof n.checked=="boolean"?n.checked:void 0}}function kd(t,e,n){let r=[],i=e+1,o=n.theme,l=bd(t.attrs),a=t.attrs.styleId,s=typeof a=="string"&&/^TOC\d*$/i.test(a);function u(p,d,f){if(p.isText&&p.text){let h=tn(p.marks,o);s&&yl(h);let c={kind:"text",text:p.text,...l,...h,pmStart:d,pmEnd:d+p.nodeSize,inlineSdtWidget:f};r.push(c)}else if(p.type.name==="hardBreak")r.push({kind:"lineBreak",pmStart:d,pmEnd:d+p.nodeSize});else if(p.type.name==="tab"){let h=tn(p.marks,o),c={kind:"tab",...l,...h,pmStart:d,pmEnd:d+p.nodeSize};r.push(c)}else if(p.type.name==="image"){let h=p.attrs,c=Mn(h.width||100,h.height||100,n.pageContentHeight),m=tn(p.marks,o),g={kind:"image",src:h.src,width:c.width,height:c.height,alt:h.alt,transform:h.transform,wrapType:h.wrapType,displayMode:h.displayMode,cssFloat:h.cssFloat,distTop:h.distTop,distBottom:h.distBottom,distLeft:h.distLeft,distRight:h.distRight,position:h.position,cropTop:h.cropTop,cropRight:h.cropRight,cropBottom:h.cropBottom,cropLeft:h.cropLeft,opacity:h.opacity,isInsertion:m.isInsertion,isDeletion:m.isDeletion,changeAuthor:m.changeAuthor,changeDate:m.changeDate,changeRevisionId:m.changeRevisionId,pmStart:d,pmEnd:d+p.nodeSize};r.push(g)}else if(p.type.name==="field"){let h=p.attrs.fieldType,c=h==="PAGE"?"PAGE":h==="NUMPAGES"?"NUMPAGES":h==="DATE"?"DATE":h==="TIME"?"TIME":"OTHER",m=tn(p.marks,o);s&&yl(m),r.push({kind:"field",fieldType:c,fallback:p.attrs.displayText||"",...l,...m,pmStart:d,pmEnd:d+p.nodeSize})}else if(p.type.name==="math"){let h=p.attrs.plainText||"[equation]";r.push({kind:"text",text:h,italic:!0,fontFamily:"Cambria Math",pmStart:d,pmEnd:d+p.nodeSize})}else if(p.type.name==="sdt"){let h=vd(p,d)??f,c=d+1;p.forEach((m,g)=>{u(m,c+g,h)})}}return t.forEach((p,d)=>{u(p,i+d)}),r}function Sd(t){return Math.max(1,Math.round(t/8*1.333))}var Cd={single:"solid",double:"double",dotted:"dotted",dashed:"dashed",thick:"solid",dashSmallGap:"dashed",dotDash:"dashed",dotDotDash:"dotted",triple:"double",wave:"solid",doubleWave:"double",threeDEmboss:"ridge",threeDEngrave:"groove",outset:"outset",inset:"inset"};function vl(t,e){if(!t||!t.style||t.style==="none"||t.style==="nil")return;let n={style:Cd[t.style]||"solid",width:Sd(t.size??0),color:t.color?Ae(t.color,e):"#000000"};return t.space!==void 0&&(n.space=Le(t.space)),n}function Td(t,e){let n=t.borders;if(!n)return;let r={},i=["top","bottom","left","right"];for(let o of i){let l=n[o],a=l?vl(l,e):void 0;r[o]=a??{width:0,style:"none"}}return Object.keys(r).length>0?r:void 0}function $d(t,e){let n=[];for(let r=0;r<=e;r+=1){let i=t[r]??0;if(i<=0)break;n.push(i)}return n.length===0?"1.":`${n.join(".")}.`}var Id=[[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"]];function bl(t,e){if(t<=0)return"";let n=t,r="";for(let[i,o]of Id)for(;n>=i;)r+=o,n-=i;return e?r:r.toLowerCase()}function xl(t,e){if(t<=0)return"";let n=t,r="";for(;n>0;){let i=(n-1)%26;r=String.fromCharCode(65+i)+r,n=Math.floor((n-1)/26)}return e?r:r.toLowerCase()}function Fd(t,e){if(t<=0)return"";switch(e){case"upperRoman":return bl(t,!0);case"lowerRoman":return bl(t,!1);case"upperLetter":return xl(t,!0);case"lowerLetter":return xl(t,!1);case"decimalZero":return le(t,2);case"decimalZero3":return le(t,3);case"decimalZero4":return le(t,4);case"decimalZero5":return le(t,5);case"none":return"";default:return String(t)}}function Pd(t,e,n){return t.replace(/%(\d)([.):\]])?/g,(r,i,o="")=>{let l=parseInt(i,10)-1;if(l<0)return"";let a=e[l]??0,s=n?.[l]??"decimal",u=Fd(a,s);return u?u+o:""})}function Rd(t,e,n){let r=t.numPr;if(!r)return null;let i=r.numId;if(i==null||i===0)return null;if(t.listIsBullet)return fr(t.listMarker||"");let o=r.ilvl??0;if((t.listLevelNumFmts?.[o]??t.listNumFmt)==="none")return t.listMarker?t.listMarker:null;let l=t.listAbstractNumId??i,a=e.get(l)??new Array(9).fill(0),s=`${i}:${o}`;n.has(s)||(n.add(s),t.listStartOverride!=null&&(a[o]=t.listStartOverride-1)),a[o]=(a[o]??0)+1;for(let u=o+1;u<a.length;u+=1)a[u]=0;return e.set(l,a),t.listMarker&&t.listMarker.includes("%")?Pd(t.listMarker,a,t.listLevelNumFmts??void 0):t.listMarker?t.listMarker:$d(a,o)}var Ed="Calibri",Md=11;function Bd(t,e,n,r,i){let o={};if(t.alignment){let c=t.alignment;c==="both"||c==="distribute"?o.alignment="justify":c==="left"?o.alignment="left":c==="center"?o.alignment="center":c==="right"&&(o.alignment="right")}let l=t._originalFormatting?.beforeAutospacing,a=t._originalFormatting?.afterAutospacing;(l||a||t.spaceBefore!=null||t.spaceAfter!=null||t.lineSpacing!=null)&&(o.spacing={},l?o.spacing.before=14:t.spaceBefore!=null&&(o.spacing.before=G(t.spaceBefore)),a?o.spacing.after=14:t.spaceAfter!=null&&(o.spacing.after=G(t.spaceAfter)),t.lineSpacing!=null&&(t.lineSpacingRule==="exact"||t.lineSpacingRule==="atLeast"?(o.spacing.line=G(t.lineSpacing),o.spacing.lineUnit="px",o.spacing.lineRule=t.lineSpacingRule):(o.spacing.line=t.lineSpacing/240,o.spacing.lineUnit="multiplier",o.spacing.lineRule="auto"))),t.spacingExplicit&&(o.spacingExplicit=t.spacingExplicit);let s=t.indentLeft,u=t.indentFirstLine,p=t.hangingIndent;if(t.numPr?.numId&&s==null&&(s=((t.numPr.ilvl??0)+1)*720,u==null&&(u=-360,p=!0)),(s!=null||t.indentRight!=null||u!=null)&&(o.indent={},s!=null&&(o.indent.left=G(s)),t.indentRight!=null&&(o.indent.right=G(t.indentRight)),u!=null&&(p?o.indent.hanging=Math.abs(G(u)):o.indent.firstLine=G(u))),t.styleId&&(o.styleId=t.styleId),t.borders){let c=t.borders;o.borders={};let m=g=>g?vl(g,e):void 0;c.top&&(o.borders.top=m(c.top)),c.bottom&&(o.borders.bottom=m(c.bottom)),c.left&&(o.borders.left=m(c.left)),c.right&&(o.borders.right=m(c.right)),c.between&&(o.borders.between=m(c.between)),c.bar&&(o.borders.bar=m(c.bar)),!o.borders.top&&!o.borders.bottom&&!o.borders.left&&!o.borders.right&&!o.borders.between&&!o.borders.bar&&delete o.borders}let d=ae(t.shading?.fill,e);d&&(o.shading=`#${d}`),t.tabs&&t.tabs.length>0&&(o.tabs=t.tabs.map(c=>({val:Ld(c.alignment),pos:c.position,leader:c.leader}))),t.pageBreakBefore&&(o.pageBreakBefore=!0),t.keepNext&&(o.keepNext=!0),t.keepLines&&(o.keepLines=!0),t.contextualSpacing&&(o.contextualSpacing=!0),t.bidi&&(o.bidi=!0),t.styleId&&(o.styleId=t.styleId),t.numPr&&(o.numPr={numId:t.numPr.numId,ilvl:t.numPr.ilvl});let f=n&&r?Rd(t,n,r):null;f!=null?o.listMarker=f:t.listMarker&&(o.listMarker=t.listMarker),t.listIsBullet!=null&&(o.listIsBullet=t.listIsBullet),t.listMarkerHidden&&(o.listMarkerHidden=!0),t.listMarkerFontFamily&&(o.listMarkerFontFamily=t.listMarkerFontFamily),t.listMarkerFontSize&&(o.listMarkerFontSize=t.listMarkerFontSize),t.listMarkerSuffix&&(o.listMarkerSuffix=t.listMarkerSuffix),i!==void 0&&(o.defaultTabStopTwips=i);let h=t.defaultTextFormatting;if(h&&(h.fontSize!=null&&(o.defaultFontSize=h.fontSize/2),h.fontFamily&&(o.defaultFontFamily=h.fontFamily.ascii||h.fontFamily.hAnsi)),t.pPrIns&&(o.pPrIns=t.pPrIns),t.pPrDel&&(o.pPrDel=t.pPrDel),t.numPr){let c=t.pPrChange,m=Array.isArray(c)&&c.some(g=>!g?.previousFormatting?.numPr);t.pPrDel?o.listMarkerRevision="del":(t.pPrIns||m)&&(o.listMarkerRevision="ins")}return o}function Ld(t){switch(t){case"left":return"start";case"right":return"end";case"center":return"center";case"decimal":return"decimal";case"bar":return"bar";case"clear":return"clear";case"num":return"start";default:return"start"}}function wr(t,e,n){let r=t.attrs,i=kd(t,e,n),o=Bd(r,n.theme,n.listCounters,n.listSeenNumIds,n.defaultTabStopTwips);return{kind:"paragraph",id:wt(),paraId:r.paraId||void 0,runs:i,attrs:o,pmStart:e,pmEnd:e+t.nodeSize}}function Ad(t,e,n,r){let i=[],o=e+1;t.forEach(c=>{c.type.name==="paragraph"?i.push(wr(c,o,n)):c.type.name==="table"&&i.push(kl(c,o,n)),o+=c.nodeSize});let l=t.attrs,a=l.width,s=l.widthType,u=a&&(!s||s==="dxa"||s==="auto")?G(a):void 0,p=l.margins,d=(c,m)=>{if(c!=null){let g=G(c);if(g>0)return g}if(m!=null){let g=G(m);if(g>=0)return g}return 0},f={top:d(p?.top,r?.top),right:d(p?.right,r?.right),bottom:d(p?.bottom,r?.bottom),left:d(p?.left,r?.left)},h=l.cellMarker;return{id:wt(),blocks:i,colSpan:l.colspan,rowSpan:l.rowspan,width:u,widthValue:a,widthType:s,verticalAlign:l.verticalAlign,background:l.backgroundColor?`#${l.backgroundColor}`:void 0,borders:Td(l,n.theme),padding:f,noWrap:l.noWrap||void 0,trackedMarker:h??void 0}}function zd(t,e,n,r){let i=[],o=e+1;t.forEach(s=>{(s.type.name==="tableCell"||s.type.name==="tableHeader")&&i.push(Ad(s,o,n,r)),o+=s.nodeSize});let l=t.attrs,a=l._originalFormatting;return{id:wt(),cells:i,height:l.height?G(l.height):void 0,heightRule:l.heightRule??void 0,isHeader:l.isHeader,cantSplit:a?.cantSplit||void 0,trackedIns:l.trIns??void 0,trackedDel:l.trDel??void 0}}function kl(t,e,n){let r=[],i=e+1,o=t.attrs.cellMargins;t.forEach(c=>{c.type.name==="tableRow"&&r.push(zd(c,i,n,o)),i+=c.nodeSize});let l=t.attrs.columnWidths?.map(G),a=t.attrs.width,s=t.attrs.widthType;if(!l&&r.length>0){let c=r[0].cells.map(m=>m.width);c.every(m=>m!==void 0&&m>0)&&(l=c)}let u=t.attrs.justification,p=t.attrs._originalFormatting,d=p?.indent?.value&&p.indent.type==="dxa"?G(p.indent.value):void 0,f=t.attrs.floating,h=f?{horzAnchor:f.horzAnchor,vertAnchor:f.vertAnchor,tblpX:f.tblpX!==void 0?G(f.tblpX):void 0,tblpXSpec:f.tblpXSpec,tblpY:f.tblpY!==void 0?G(f.tblpY):void 0,tblpYSpec:f.tblpYSpec,topFromText:f.topFromText!==void 0?G(f.topFromText):void 0,bottomFromText:f.bottomFromText!==void 0?G(f.bottomFromText):void 0,leftFromText:f.leftFromText!==void 0?G(f.leftFromText):void 0,rightFromText:f.rightFromText!==void 0?G(f.rightFromText):void 0}:void 0;return{kind:"table",id:wt(),rows:r,columnWidths:l,width:a,widthType:s,justification:u,bidi:t.attrs.bidi||void 0,indent:d,floating:h,pmStart:e,pmEnd:e+t.nodeSize}}function Nd(t,e,n){let r=t.attrs,i=r.wrapType,o=i==="behind"||i==="inFront",l=Mn(r.width||100,r.height||100,n);return{kind:"image",id:wt(),src:r.src,width:l.width,height:l.height,alt:r.alt,transform:r.transform,anchor:o?{isAnchored:!0,offsetH:r.distLeft,offsetV:r.distTop,behindDoc:i==="behind"}:void 0,hlinkHref:r.hlinkHref,pmStart:e,pmEnd:e+t.nodeSize}}function Od(t,e,n){let r=t.attrs,i=[];return t.forEach((o,l)=>{if(o.type.name==="paragraph"){let a=wr(o,e+1+l,n);i.push(a)}}),{kind:"textBox",id:wt(),width:r.width??$i,height:r.height??void 0,fillColor:r.fillColor,outlineWidth:r.outlineWidth,outlineColor:r.outlineColor,outlineStyle:r.outlineStyle,margins:{top:r.marginTop??zt.top,bottom:r.marginBottom??zt.bottom,left:r.marginLeft??zt.left,right:r.marginRight??zt.right},content:i,displayMode:r.displayMode,cssFloat:r.cssFloat,wrapType:r.wrapType,wrapText:r.wrapText,anchorTarget:r.anchorTarget,position:r.position,distTop:r.distTop,distBottom:r.distBottom,distLeft:r.distLeft,distRight:r.distRight,pmStart:e,pmEnd:e+t.nodeSize}}function en(t,e={}){let n=t.attrs?.defaultTabStopTwips,r={...e,defaultFont:e.defaultFont??Ed,defaultSize:e.defaultSize??Md,defaultTabStopTwips:e.defaultTabStopTwips??n},i=[],o=0,l={top:1440,bottom:1440,left:1440,right:1440};r.listCounters||(r.listCounters=new Map),r.listSeenNumIds||(r.listSeenNumIds=new Set);let a=(s,u,p)=>{if(s.type.name==="blockSdt"){let f=s.attrs,h={id:`sdt@${u}`,sdtType:typeof f.sdtType=="string"?f.sdtType:"richText",tag:f.tag!=null?String(f.tag):void 0,alias:f.alias!=null?String(f.alias):void 0,lock:f.lock!=null?String(f.lock):void 0,checked:typeof f.checked=="boolean"?f.checked:void 0,bound:f.dataBinding!=null?!0:void 0,repeatingItem:/<w15:repeatingSectionItem[\s/>]/.test(String(f.rawPropertiesXml??""))?!0:void 0},c=[...p,h];s.forEach((m,g)=>{a(m,u+1+g,c)});return}let d=i.length;switch(s.type.name){case"paragraph":{let f=wr(s,u,r),h=s.attrs;i.push(f);let c=h._sectionProperties;if(c||h.sectionBreakType){let m={kind:"sectionBreak",id:wt(),type:c?.sectionStart??h.sectionBreakType};if(c){if((c.pageWidth!==void 0||c.pageHeight!==void 0)&&(m.pageSize={w:G(c.pageWidth??12240),h:G(c.pageHeight??15840)}),c.marginTop!==void 0||c.marginBottom!==void 0||c.marginLeft!==void 0||c.marginRight!==void 0){let v={top:c.marginTop??l.top,bottom:c.marginBottom??l.bottom,left:c.marginLeft??l.left,right:c.marginRight??l.right};m.margins={top:G(v.top),bottom:G(v.bottom),left:G(v.left),right:G(v.right)},l=v}let g=c.columnCount??1;if(g>1){let v={count:g,gap:G(c.columnSpace??720),equalWidth:c.equalWidth??!0,separator:c.separator};m.columns=v}}i.push(m)}}break;case"table":i.push(kl(s,u,r));break;case"image":i.push(Nd(s,u,r.pageContentHeight));break;case"textBox":i.push(Od(s,u,r));break;case"horizontalRule":case"pageBreak":{let f={kind:"pageBreak",id:wt(),pmStart:u,pmEnd:u+s.nodeSize};i.push(f);break}}if(p.length>0)for(let f=d;f<i.length;f++)i[f].sdtGroups=p};return t.forEach((s,u)=>{a(s,o+u,[])}),i}function Hd(t,e){let n=t.floating;if(!n)return!1;let r=Li(t,e),i=0;n.tblpX!==void 0?i=n.tblpX:n.tblpXSpec?n.tblpXSpec==="left"||n.tblpXSpec==="inside"?i=0:n.tblpXSpec==="right"||n.tblpXSpec==="outside"?i=e-r:n.tblpXSpec==="center"&&(i=(e-r)/2):t.justification==="center"?i=(e-r)/2:t.justification==="right"&&(i=e-r);let o=n.leftFromText??0,l=n.rightFromText??0,a=i-o,s=e-(i+r)-l;return a<Ft&&s<Ft}function Hw(t,e,n){for(let r=0;r<t.length;r++){let i=t[r];i.kind==="table"&&i.floating&&Hd(i,e[r]??n)&&(t[r]={...i,floating:void 0})}}function Il(t,e){let n=t.pageGap??0,r=0;for(let i=0;i<e&&i<t.pages.length;i++){let o=t.pages[i].size?.h??t.pageSize.h;r+=o+n}return r}function Fl(t,e){return t.findIndex(n=>n.id===e)}function Dd(t,e){let n=0;for(let r=t.fromLine;r<t.toLine&&r<e.lines.length;r++)n+=e.lines[r].lineHeight;return n}function Dw(t,e,n,r){let i=[...t.page.fragments].sort((o,l)=>{let a=o.y-l.y;return Math.abs(a)>.5?a:o.x-l.x});for(let o of i){let l=Fl(e,o.blockId);if(l===-1)continue;let a=e[l],s=n[l];if(!a||!s)continue;let u;if(o.kind==="paragraph"){if(a.kind!=="paragraph"||s.kind!=="paragraph")continue;u=Dd(o,s)}else if(o.kind==="table")u=o.height;else if(o.kind==="image")u=o.height;else continue;let p=r.x>=o.x&&r.x<=o.x+o.width,d=r.y>=o.y&&r.y<=o.y+u;if(p&&d)return{fragment:o,block:a,measure:s,pageIndex:t.pageIndex,localX:r.x-o.x,localY:r.y-o.y}}return null}function Ww(t,e,n,r){for(let i of t.page.fragments){if(i.kind!=="table")continue;let o=i,l=r.x>=o.x&&r.x<=o.x+o.width,a=r.y>=o.y&&r.y<=o.y+o.height;if(!l||!a)continue;let s=Fl(e,o.blockId);if(s===-1)continue;let u=e[s],p=n[s];if(!u||u.kind!=="table"||!p||p.kind!=="table")continue;let d=u,f=p,h=r.x-o.x,c=r.y-o.y,m=o.headerRowCount??0,g=m>0&&o.continuesFromPrev?Ue(f,m):0,v=0,C=-1;if(f.rows.length===0||d.rows.length===0)continue;if(g>0&&c<g){let B=0;for(let N=0;N<m&&N<f.rows.length;N++){let z=f.rows[N];if(c>=B&&c<B+z.height){C=N;break}B+=z.height}C===-1&&(C=0)}else{let B=c-g;for(let N=o.fromRow;N<o.toRow&&N<f.rows.length;N++){let z=f.rows[N];if(B>=v&&B<v+z.height){C=N;break}v+=z.height}}if(C===-1&&(C=Math.min(o.toRow-1,f.rows.length-1),C<o.fromRow))continue;let y=f.rows[C],k=d.rows[C];if(!y||!k)continue;let x=0,w=-1;if(y.cells.length===0||k.cells.length===0)continue;for(let B=0;B<y.cells.length;B++){let N=y.cells[B];if(h>=x&&h<x+N.width){w=B;break}x+=N.width}if(w===-1&&(w=y.cells.length-1,w<0))continue;let I=y.cells[w],F=k.cells[w];if(!I||!F)continue;let $=0;if(g>0&&C<m)for(let B=0;B<C;B++)$+=f.rows[B]?.height??0;else{$=g;for(let B=o.fromRow;B<C;B++)$+=f.rows[B]?.height??0}let E=0;for(let B=0;B<w;B++)E+=y.cells[B]?.width??0;let P,R;if(F.blocks&&F.blocks.length>0){let B=F.blocks[0],N=I.blocks[0];B.kind==="paragraph"&&N?.kind==="paragraph"&&(P=B,R=N)}let T=h-E,M=c-$;return{fragment:o,block:d,measure:f,pageIndex:t.pageIndex,rowIndex:C,colIndex:w,cellBlock:P,cellMeasure:R,cellLocalX:Math.max(0,T),cellLocalY:Math.max(0,M)}}return null}function Wd(t){return{fontFamily:t.fontFamily??"Arial",fontSize:t.fontSize??12,bold:t.bold,italic:t.italic,letterSpacing:t.letterSpacing}}function jd(t,e){let n=[];for(let r=e.fromRun;r<=e.toRun&&r<t.runs.length;r++){let i=t.runs[r];if(i){if(i.kind==="tab"||i.kind==="image"||i.kind==="lineBreak"){n.push(i);continue}if(i.kind==="text"){let o=i.text??"",l=r===e.fromRun,a=r===e.toRun;if(l||a){let s=l?e.fromChar:0,u=a?e.toChar:o.length,p=o.slice(s,u);p.length>0&&n.push({...i,text:p})}else n.push(i)}}}return n}function _d(t,e){let n,r,i=t.pmStart??0,o=0;for(let l=0;l<t.runs.length&&l<=e.toRun;l++){let a=t.runs[l];a&&(l<e.fromRun?a.kind==="text"?o+=(a.text??"").length:(a.kind==="tab"||a.kind==="lineBreak"||a.kind==="image")&&(o+=1):l===e.fromRun&&(o+=e.fromChar,n=i+o,a.kind==="text"&&(o=e.fromChar)))}if(n!==void 0){let l=0;for(let a=e.fromRun;a<=e.toRun&&a<t.runs.length;a++){let s=t.runs[a];if(s)if(s.kind==="text"){let u=s.text??"",p=a===e.fromRun?e.fromChar:0,d=a===e.toRun?e.toChar:u.length;l+=d-p}else(s.kind==="tab"||s.kind==="lineBreak"||s.kind==="image")&&(l+=1)}r=n+l}return{pmStart:n,pmEnd:r}}function Xd(t,e,n,r){let i=0;for(let o=n;o<r&&o<t.lines.length;o++){let l=t.lines[o].lineHeight;if(e>=i&&e<i+l)return o;i+=l}return r>n?Math.min(r-1,t.lines.length-1):null}function qd(t,e,n,r){let{pmStart:i,pmEnd:o}=_d(t,e);if(i===void 0||o===void 0)return{charOffset:0,pmPosition:t.pmStart??0};let l=t.attrs?.alignment??"left",a=0;l==="center"?a=Math.max(0,(r-e.width)/2):l==="right"&&(a=Math.max(0,r-e.width));let s=Math.max(0,n-a);if(s<=0)return{charOffset:0,pmPosition:i};let u=jd(t,e);if(u.length===0)return{charOffset:0,pmPosition:i};let p=0,d=0;for(let f of u){if(f.kind==="tab"){let h=f.width??48,c=p+h;if(s<=c){let m=p+h/2;return s<m?{charOffset:d,pmPosition:i+d}:{charOffset:d+1,pmPosition:i+d+1}}p=c,d+=1;continue}if(f.kind==="image"){let h=f.width,c=p+h;if(s<=c){let m=p+h/2;return s<m?{charOffset:d,pmPosition:i+d}:{charOffset:d+1,pmPosition:i+d+1}}p=c,d+=1;continue}if(f.kind==="lineBreak"){if(s>=p)return{charOffset:d,pmPosition:i+d};d+=1;continue}if(f.kind==="text"){let h=f.text??"";if(h.length===0)continue;let c=Wd(f),m=_e(h,c),g=p+m.width;if(s<=g){let v=s-p,C=Hi(v,m.charWidths),y=d+C;return{charOffset:y,pmPosition:i+y}}p=g,d+=h.length}}return{charOffset:o-i,pmPosition:o}}function Pl(t){let{fragment:e,block:n,measure:r,localX:i,localY:o}=t;if(e.kind!=="paragraph"||n.kind!=="paragraph"||r.kind!=="paragraph")return null;let l=e,a=n,s=r,u=Xd(s,o,l.fromLine,l.toLine);if(u===null)return null;let p=s.lines[u];if(!p)return null;let d=0;for(let y=l.fromLine;y<u;y++)d+=s.lines[y]?.lineHeight??0;let f=a.attrs?.indent,h=f?.left??0,c=f?.right??0,m=Math.max(0,e.width-h-c),g=i-h,{charOffset:v,pmPosition:C}=qd(a,p,g,m);return{pmPosition:C,charOffset:v,lineIndex:u}}function Ud(t){let{cellBlock:e,cellMeasure:n,cellLocalX:r,cellLocalY:i}=t;if(!e||!n)return null;let o={fragment:{kind:"paragraph",blockId:e.id,x:0,y:0,width:n.lines.reduce((l,a)=>Math.max(l,a.width),100),fromLine:0,toLine:n.lines.length,height:n.totalHeight},block:e,measure:n,pageIndex:t.pageIndex,localX:r,localY:i};return Pl(o)?.pmPosition??null}function jw(t,e){if(e)return Ud(e);if(!t)return null;let{fragment:n}=t;return n.kind==="paragraph"?Pl(t)?.pmPosition??null:n.kind==="image"?n.pmStart??null:null}function _w(t,e,n={}){let r=n.scope??"body",i=r==="body"?"layout-page-content":`layout-page-${r}`,o=`.${i} .layout-table-cell`,l=t.querySelectorAll(`.${i} .layout-table-cell-selected`);for(let p of Array.from(l))p.classList.remove("layout-table-cell-selected");let a=e.selection;if(!("$anchorCell"in a&&typeof a.forEachCell=="function")||!a.forEachCell)return;let s=[];a.forEachCell((p,d)=>{s.push([d,d+p.nodeSize])});let u=t.querySelectorAll(o);for(let p of Array.from(u)){let d=p,f=d.dataset.pmStart;if(f===void 0)continue;let h=Number(f);for(let[c,m]of s)if(h>=c&&h<m){d.classList.add("layout-table-cell-selected");break}}}function Sl(t){return{fontFamily:t.fontFamily??"Arial",fontSize:t.fontSize??12,bold:t.bold,italic:t.italic,letterSpacing:t.letterSpacing}}function yr(t,e){return t.findIndex(n=>n.id===e)}function ve(t,e){let n=(t.pmStart??0)+1,r=0,i;for(let a=0;a<t.runs.length&&a<=e.toRun;a++){let s=t.runs[a];if(s){if(a<e.fromRun)s.kind==="text"?r+=(s.text??"").length:r+=1;else if(a===e.fromRun){r+=e.fromChar,i=n+r;break}}}i===void 0&&(i=n);let o=0;for(let a=e.fromRun;a<=e.toRun&&a<t.runs.length;a++){let s=t.runs[a];if(s)if(s.kind==="text"){let u=s.text??"",p=a===e.fromRun?e.fromChar:0,d=a===e.toRun?e.toChar:u.length;o+=d-p}else o+=1}let l=i+o;return{pmStart:i,pmEnd:l}}function Cl(t,e,n,r){let i=[];for(let o=0;o<e.lines.length;o++){let l=e.lines[o],a=ve(t,l);a.pmStart===void 0||a.pmEnd===void 0||a.pmEnd>n&&a.pmStart<r&&i.push({line:l,index:o})}return i}function be(t,e,n){let r=ve(t,e);return r.pmStart===void 0?0:Math.max(0,n-r.pmStart)}function xe(t,e,n,r){let i=0,o=0;for(let l=e.fromRun;l<=e.toRun&&l<t.runs.length;l++){let a=t.runs[l];if(a){if(a.kind==="tab"){let s=a.width??48;if(o+1>=n)return n<=o?i:i+s;i+=s,o+=1;continue}if(a.kind==="image"){let s=a.width;if(o+1>=n)return n<=o?i:i+s;i+=s,o+=1;continue}if(a.kind==="lineBreak"){if(n<=o)return i;o+=1;continue}if(a.kind==="text"){let s=a.text??"",u=l===e.fromRun,p=l===e.toRun,d=u?e.fromChar:0,f=p?e.toChar:s.length,h=s.slice(d,f);if(o+h.length>=n){let g=n-o,v=Sl(a),C=_e(h.slice(0,g),v);return i+C.width}let c=Sl(a),m=_e(h,c);i+=m.width,o+=h.length}}}return i}function rn(t,e){let n=0;for(let r=0;r<e&&r<t.lines.length;r++)n+=t.lines[r].lineHeight;return n}function Xw(t,e,n,r,i){if(r===i)return[];let o=Math.min(r,i),l=Math.max(r,i),a=[];for(let s=0;s<t.pages.length;s++){let u=t.pages[s],p=Il(t,s);for(let d of u.fragments){if(d.kind==="paragraph"){let f=yr(e,d.blockId);if(f===-1)continue;let h=e[f],c=n[f];if(!h||h.kind!=="paragraph"||!c||c.kind!=="paragraph")continue;let m=h,g=c,v=d,C=Cl(m,g,o,l);for(let{line:y,index:k}of C){if(k<v.fromLine||k>=v.toLine)continue;let x=ve(m,y);if(x.pmStart===void 0||x.pmEnd===void 0)continue;let w=Math.max(x.pmStart,o),I=Math.min(x.pmEnd,l);if(w>=I)continue;let F=be(m,y,w),$=be(m,y,I),E=m.attrs?.indent,P=E?.left??0,R=E?.right??0,T=Math.max(0,d.width-P-R),M=xe(m,y,F),B=xe(m,y,$),N=m.attrs?.alignment??"left",z=0;N==="center"?z=Math.max(0,(T-y.width)/2):N==="right"&&(z=Math.max(0,T-y.width));let A=rn(g,k)-rn(g,v.fromLine),j=d.x+P+z+Math.min(M,B),H=Math.max(1,Math.abs(B-M)),Y=d.y+A;a.push({x:j,y:Y+p,width:H,height:y.lineHeight,pageIndex:s})}}if(d.kind==="table"){let f=yr(e,d.blockId);if(f===-1)continue;let h=e[f],c=n[f];if(!h||h.kind!=="table"||!c||c.kind!=="table")continue;let m=h,g=c,v=d,C=[],y=0;for(let $=0;$<g.rows.length;$++)C.push(Math.round(y)),y+=g.rows[$]?.height??0;C.push(Math.round(y));let k=v.headerRowCount??0,x=k>0&&v.continuesFromPrev?Ue(g,k):0,w=(C[v.fromRow]??0)+(v.topClip??0),I=v.bottomClip!==void 0?Math.round(v.height):x+((C[v.toRow]??0)-w),F=$=>x+($-w);for(let $=v.fromRow;$<v.toRow&&$<m.rows.length;$++){let E=m.rows[$],P=g.rows[$];if(!E||!P)continue;let R=C[$]??0,T=0;for(let M=0;M<E.cells.length;M++){let B=E.cells[M],N=P.cells[M];if(!B||!N)continue;let z=B.padding?.top??0,A=jn(B.blocks,N.blocks,z);for(let j=0;j<B.blocks.length;j++){let H=B.blocks[j],Y=N.blocks[j];if(!H||H.kind!=="paragraph"||!Y||Y.kind!=="paragraph")continue;let U=H,ut=Y,vt=A.lineTops[j]??[],dt=Cl(U,ut,o,l);for(let{line:et,index:K}of dt){let lt=ve(U,et);if(lt.pmStart===void 0||lt.pmEnd===void 0)continue;let ft=Math.max(lt.pmStart,o),ii=Math.min(lt.pmEnd,l);if(ft>=ii)continue;let In=F(R+(vt[K]??0));if(In+et.lineHeight<=x||In>=I)continue;let ks=be(U,et,ft),Ss=be(U,et,ii),oi=xe(U,et,ks,N.width),li=xe(U,et,Ss,N.width);a.push({x:v.x+T+Math.min(oi,li),y:v.y+In+p,width:Math.max(1,Math.abs(li-oi)),height:et.lineHeight,pageIndex:s})}}T+=N.width}}}if(d.kind==="image"){let f=d.pmStart??0;(d.pmEnd??f+1)>o&&f<l&&a.push({x:d.x,y:d.y+p,width:d.width,height:d.height,pageIndex:s})}}}return a}function qw(t,e,n,r,i=0){for(let o=Math.max(0,i);o<t.pages.length;o++){let l=t.pages[o],a=Il(t,o);for(let s of l.fragments){if(s.kind==="paragraph"){let u=yr(e,s.blockId);if(u===-1)continue;let p=e[u],d=n[u];if(!p||p.kind!=="paragraph"||!d||d.kind!=="paragraph")continue;let f=p,h=d,c=s,m=f.pmStart??0,g=f.pmEnd??m;if(r<m||r>g)continue;for(let v=c.fromLine;v<c.toLine;v++){let C=h.lines[v];if(!C)continue;let y=ve(f,C);if(!(y.pmStart===void 0||y.pmEnd===void 0)&&r>=y.pmStart&&r<=y.pmEnd){let k=be(f,C,r),x=f.attrs?.indent,w=x?.left??0,I=x?.right??0,F=Math.max(0,s.width-w-I),$=xe(f,C,k),E=f.attrs?.alignment??"left",P=0;E==="center"?P=Math.max(0,(F-C.width)/2):E==="right"&&(P=Math.max(0,F-C.width));let R=rn(h,v)-rn(h,c.fromLine);return{x:s.x+w+P+$,y:s.y+R+a,height:C.lineHeight,pageIndex:o}}}}if(s.kind==="image"){let u=s.pmStart??0,p=s.pmEnd??u+1;if(r>=u&&r<=p){let d=r===u?0:s.width;return{x:s.x+d,y:s.y+a,height:s.height,pageIndex:o}}}}}return null}function Vd(t){if(t.kind!=="paragraph")return!1;let e=t.attrs;return e?!!(e.borders?.top||e.borders?.bottom||e.spacingExplicit?.before||e.spacingExplicit?.after):!1}function Yd(t){return Rl(t)}function Rl(t){let e=new Set;for(let n=1;n<t.length;n++){let r=t[n-1],i=t[n];r.kind==="table"&&i.kind==="paragraph"&&(i.runs.length>0||Vd(i)||e.add(n))}return t.map((n,r)=>{if(n.kind==="table")return Gd(n);if(n.kind!=="paragraph")return n;let i=e.has(r),o=n.attrs?.spacingExplicit,l=n.attrs?.spacing?.before!=null,a=n.attrs?.spacing?.after!=null,s=l&&!o?.before,u=a&&!o?.after,p=s||u;if(!p&&!i)return n;let d=n.attrs;return p&&d?.spacing&&(d={...d,spacing:{...d.spacing,before:o?.before?d.spacing.before:void 0,after:o?.after?d.spacing.after:void 0}}),i&&(d={...d??{},suppressEmptyParagraphHeight:!0}),{...n,attrs:d}})}function Gd(t){let e=!1,n=t.rows.map(r=>{let i=!1,o=r.cells.map(l=>{let a=Rl(l.blocks);return a.some((s,u)=>s!==l.blocks[u])?(i=!0,{...l,blocks:a}):l});return i?(e=!0,{...r,cells:o}):r});return e?{...t,rows:n}:t}function Zd(t){return t?.align??t?.alignment}function Kd(t,e,n,r){let i=r.section==="header"?r.margins.header??48:r.pageSize.h-(r.margins.footer??48)-n,o=t.position?.vertical;if(!o)return e;let l=Zd(o),a=o.posOffset!==void 0?q(o.posOffset):void 0;if(o.relativeTo==="page"){if(a!==void 0)return a-i;if(l==="top")return-i;if(l==="bottom")return r.pageSize.h-t.height-i;if(l==="center")return(r.pageSize.h-t.height)/2-i}if(o.relativeTo==="margin"){let s=r.margins.top,u=r.pageSize.h-r.margins.top-r.margins.bottom;if(a!==void 0)return s+a-i;if(l==="top")return s-i;if(l==="bottom")return s+u-t.height-i;if(l==="center")return s+(u-t.height)/2-i}return a!==void 0?e+a:e}function Jd(t){switch(t.kind){case"paragraph":case"table":return!0;case"image":return!t.anchor?.isAnchored;case"textBox":return t.displayMode===void 0||t.displayMode==="inline";default:return!1}}function Qd(t){return t?t.kind==="paragraph"||t.kind==="table"?t.totalHeight:t.kind==="image"||t.kind==="textBox"?t.height:0:0}function tf(t,e,n,r){let i=0,o=0,l=0;for(let a=0;a<t.length;a++){let s=t[a],u=e[a];if(!(!s||!u)){if(s.kind==="paragraph"&&u.kind==="paragraph"){let p=l,d=p+u.totalHeight;i=Math.min(i,p),o=Math.max(o,d);for(let f of s.runs){if(f.kind!=="image"||!f.position)continue;let h=Kd(f,p,n,r);i=Math.min(i,h),o=Math.max(o,h+f.height)}l=d}else if(s.kind==="table"&&u.kind==="table"){let p=l+u.totalHeight;i=Math.min(i,l),o=Math.max(o,p),l=p}else if(s.kind==="image"&&u.kind==="image"){let p=l+u.height;i=Math.min(i,l),o=Math.max(o,p),l=p}else if(s.kind==="textBox"&&u.kind==="textBox"){let p=l+u.height;i=Math.min(i,l),o=Math.max(o,p),s.displayMode!=="float"&&(l=p)}}}return{visualTop:i,visualBottom:o}}function Uw(t,e,n,r){if(!t||!t.content||t.content.length===0)return;let i=or(t.content,{styles:r.styles??void 0,theme:r.theme??null,defaultTabStopTwips:r.defaultTabStopTwips??null});return ef(i,e,n,r)}function ef(t,e,n,r){let i=en(t,{theme:r.theme??void 0});if(i.length===0)return;let o=Yd(i),l=r.measureBlocks(o,e),a=0,s=0;for(let d=0;d<o.length;d++){let f=Qd(l[d]);a+=f,Jd(o[d])&&(s+=f)}let{visualTop:u,visualBottom:p}=tf(o,l,a,n);return{blocks:o,measures:l,height:a,flowHeight:s,visualTop:u,visualBottom:p}}var on={header:null,footer:null};function Vw(){on.header=null,on.footer=null}function El(t,e){let n=e.querySelectorAll(`.layout-page-${t}`);if(n.length===0)return null;let r=e.defaultView,i=r?r.innerHeight/2:0,o=n[0],l=1/0;for(let d of Array.from(n)){let f=d.getBoundingClientRect(),h=Math.abs((f.top+f.bottom)/2-i);h<l&&(l=h,o=d)}let a=on[t];if(a&&a.host===o&&a.host.isConnected)return a;let s=Array.from(o.querySelectorAll("span[data-pm-start][data-pm-end]")),u=Array.from(o.querySelectorAll("[data-pm-start][data-pm-end]")),p={host:o,spans:s,ranged:u};return on[t]=p,p}function Yw(t,e,n=globalThis.document){let r=t.state.selection;if(!r.empty)return null;let i=r.head,o=El(e,n);if(!o)return null;let{host:l,spans:a}=o;for(let m of a){let g=Number(m.dataset.pmStart),v=Number(m.dataset.pmEnd);if(!(!Number.isFinite(g)||!Number.isFinite(v))&&i>=g&&i<=v){let C=l.ownerDocument.createRange(),y=l.ownerDocument.createTreeWalker(m,NodeFilter.SHOW_TEXT),k=i-g,x=y.nextNode();for(;x;){let F=x.data.length;if(k<=F){try{C.setStart(x,k),C.setEnd(x,k);let $=C.getClientRects()[0]??C.getBoundingClientRect();if($&&$.height>0)return{top:$.top,left:$.left,height:$.height}}catch{}break}k-=F,x=y.nextNode()}let w=m.getBoundingClientRect(),I=(i-g)/Math.max(1,v-g);return{top:w.top,left:w.left+w.width*I,height:w.height}}}let s=l.querySelector(`[data-pm-start="${i}"]`);if(s){let m=s.getBoundingClientRect();return{top:m.top,left:m.left+1,height:m.height||16}}let u=o.ranged,p=null,d=1/0;for(let m of u){let g=Number(m.dataset.pmStart),v=Number(m.dataset.pmEnd);if(!Number.isFinite(g)||!Number.isFinite(v)||i<g||i>v)continue;let C=v-g;C<d&&(d=C,p=m)}if(p){let m=p.getBoundingClientRect(),g=Number(p.dataset.pmEnd),v=i>=g;return{top:m.top,left:v?m.right:m.left+1,height:m.height||16}}let f=null,h=-1/0;for(let m of u){let g=Number(m.dataset.pmStart);Number.isFinite(g)&&(g>i||g>h&&(h=g,f=m))}if(f){let m=f.getBoundingClientRect();return{top:m.top,left:m.right,height:m.height||16}}let c=l.getBoundingClientRect();return{top:c.top+2,left:c.left+2,height:16}}function Gw(t,e,n=globalThis.document){let r=t.state.selection;if(r.empty)return[];let i=r.from,o=r.to,l=[],a=El(e,n);if(!a)return l;let{host:s,spans:u}=a;for(let p of u){let d=Number(p.dataset.pmStart),f=Number(p.dataset.pmEnd);if(!Number.isFinite(d)||!Number.isFinite(f)||f<=i||d>=o)continue;if(p.classList.contains("layout-run-tab")){let v=p.getBoundingClientRect();l.push({top:v.top,left:v.left,width:v.width,height:v.height});continue}let h=null;if(p.firstChild?.nodeType===Node.TEXT_NODE?h=p.firstChild:p.firstChild?.nodeType===Node.ELEMENT_NODE&&p.firstChild.tagName==="A"&&p.firstChild.firstChild?.nodeType===Node.TEXT_NODE&&(h=p.firstChild.firstChild),!h)continue;let c=Math.max(0,i-d),m=Math.min(h.length,o-d);if(c>=m)continue;let g=s.ownerDocument.createRange();g.setStart(h,c),g.setEnd(h,m);for(let v of Array.from(g.getClientRects()))l.push({top:v.top,left:v.left,width:v.width,height:v.height})}return l}function Tl(t){return t?t.flowHeight??t.height:0}function Zw(t){let{pageSize:e,margins:n,finalMargins:r,bodyBlocks:i,headers:o,footers:l,warn:a}=t,s=n.header??48,u=n.footer??48,p=n.top-s,d=n.bottom-u,f=Math.max(0,...(o??[]).map(Tl)),h=Math.max(0,...(l??[]).map(Tl)),c=f>p,m=h>d;if(!c&&!m)return{margins:n,finalMargins:r};let g=Math.max(0,e.h-24),v=!1,C=x=>{let w={...x};return c&&(w.top=Math.max(x.top,s+f)),m&&(w.bottom=Math.max(x.bottom,u+h)),w.top+w.bottom>g&&(v=!0,w.bottom=Math.max(0,Math.min(w.bottom,g-w.top)),w.top+w.bottom>g&&(w.top=Math.max(0,g-w.bottom))),w},y=C(n),k=C(r);if(i)for(let x of i){if(x.kind!=="sectionBreak")continue;let w=x;w.margins&&(w.margins=C(w.margins))}return v&&a&&a(`[layout] header/footer content exceeds page height; clamping margins to preserve a content area. pageHeight=${Math.round(e.h)} headerBand=${Math.round(f)} footerBand=${Math.round(h)} top=${Math.round(y.top)} bottom=${Math.round(y.bottom)}`),{margins:y,finalMargins:k}}var nf=816,rf=1056,nn=96,$l=48;function ln(t){return Math.round(t/1440*96)}function te(t,e){return t!=null?ln(t):e}function Kw(t){return{w:t?.pageWidth?ln(t.pageWidth):nf,h:t?.pageHeight?ln(t.pageHeight):rf}}function Jw(t){return{top:te(t?.marginTop,nn),right:te(t?.marginRight,nn),bottom:te(t?.marginBottom,nn),left:te(t?.marginLeft,nn),header:te(t?.headerDistance,$l),footer:te(t?.footerDistance,$l)}}function Qw(t,e){let n={header:null,footer:null,firstHeader:null,firstFooter:null};if(!t?.package)return n;let r=t.package.headers,i=t.package.footers,o=null,l=null,a=null,s=null;if(r&&e?.headerReferences){let u=e.headerReferences.find(d=>d.type==="default");u?.rId&&(o=r.get(u.rId)??null);let p=e.headerReferences.find(d=>d.type==="first");p?.rId&&(a=r.get(p.rId)??null)}if(i&&e?.footerReferences){let u=e.footerReferences.find(d=>d.type==="default");u?.rId&&(l=i.get(u.rId)??null);let p=e.footerReferences.find(d=>d.type==="first");p?.rId&&(s=i.get(p.rId)??null)}return e?.titlePg||(!o&&a&&(o=a),!l&&s&&(l=s)),{header:o,footer:l,firstHeader:a,firstFooter:s}}function t0(t){let e=t?.columnCount??1;if(e<=1)return;let n=ln(t?.columnSpace??720);return{count:e,gap:n,equalWidth:t?.equalWidth??!0,separator:t?.separator}}function of(t){let e=t.pageSize.w-t.margins.left-t.margins.right,n=t.columns;return!n||n.count<=1?e:Math.floor((e-(n.count-1)*n.gap)/n.count)}function e0(t,e,n){let{configs:r,breakIndices:i}=Zn(t,e,n),o=0,l=[];for(let a=0;a<t.length;a++)l.push(of(r[o]??e)),o<i.length&&a===i[o]&&o++;return l}function xr(t){return!$t(t.wrapType)&&t.wrapType!=="topAndBottom"}function ke(t){return t.wrapType==="behind"}function Ht(t){return Yt(t.wrapType)?!0:t.displayMode==="float"}function lf(t){return $t(t.wrapType)||t.wrapType==="topAndBottom"?!1:Ne(t.wrapType)?!0:t.displayMode==="float"&&t.cssFloat!=="none"}function vr(t){return t==="left"?"right":t==="right"?"left":"bothSides"}function zl(t){return{pageWidth:t.size.w,pageHeight:t.size.h,marginLeft:t.margins.left,marginTop:t.margins.top,contentWidth:t.size.w-t.margins.left-t.margins.right,contentHeight:t.size.h-t.margins.top-t.margins.bottom}}function kr(t,e,n,r){let{x:i,side:o}=sf(t,n,r),l=Nl(t,e,r);return{x:i,y:l,side:o}}function af(t,e,n){return Nl(t,e,n)}function sf(t,e,n){let r=t.position?.horizontal;if(!r)return t.cssFloat==="right"?{x:e-t.width,side:"right"}:{x:0,side:"left"};let i=pf(r.relativeTo,e,n);if(r.align==="right")return{x:i.size?i.base+i.size-t.width:0,side:"right"};if(r.align==="left")return{x:i.base,side:"left"};if(r.align==="center")return{x:i.size?i.base+(i.size-t.width)/2:0,side:"left"};if(r.posOffset!==void 0){let o=i.base+q(r.posOffset);return{x:o,side:o>e/2?"right":"left"}}return{x:i.base,side:"left"}}function pf(t,e,n){let r=n?.pageWidth??0,i=n?.marginLeft??0;switch(t){case"page":return{base:-i,size:r};case"leftMargin":return{base:-i,size:i};case"rightMargin":return{base:e,size:i};case"character":return{base:0,size:0};default:return{base:0,size:e}}}function Nl(t,e,n){let r=t.position?.vertical;if(!r)return e;let i=uf(r.relativeTo,e,n);return r.align==="top"?i.base:r.align==="center"?i.size?i.base+(i.size-t.height)/2:e:r.align==="bottom"?i.size?i.base+i.size-t.height:e:r.posOffset!==void 0?i.base+q(r.posOffset):r.relativeTo==="paragraph"||r.relativeTo==="line"?e:i.base}function uf(t,e,n){let r=n?.pageHeight??0,i=n?.marginTop??0,o=n?.contentHeight??0;switch(t){case"paragraph":case"line":return{base:e,size:0};case"page":return{base:-i,size:r};case"topMargin":return{base:-i,size:i};case"bottomMargin":return{base:o,size:i};default:return{base:0,size:o}}}var Ml=7,Bl=0;function df(t,e){if(t.kind!=="paragraph"||e.kind!=="paragraph")return"totalHeight"in e?e.totalHeight:"height"in e?e.height:0;let n=t.runs.filter(l=>l.kind!=="text"||l.text.length>0);if(!(e.lines.length===1&&n.length>0&&n.every(l=>l.kind==="image")))return e.totalHeight;let r=n.reduce((l,a)=>a.kind==="image"?Math.max(l,a.height):l,0),i=t.attrs?.spacing?.before??0,o=t.attrs?.spacing?.after??0;return i+r+o}function Ll(t){let e=t?.borders?.top?.width??0,n=t?.borders?.bottom?.width??0;return e+n}function ff(t,e,n){let r=pe(t.width,t.widthType,e),i=r??e,o=Wn(t,e),l=new Map;for(let f of ue(t))l.set(`${f.rowIndex}-${f.cellIndex}`,f.columnIndex);let a=t.rows.map((f,h)=>({cells:f.cells.map((c,m)=>{let g=c.colSpan??1,v=l.get(`${h}-${m}`)??0,C=0;for(let w=0;w<g&&v+w<o.length;w++)C+=o[v+w]??0;C===0&&(C=(c.width&&c.width>0?c.width:pe(c.widthValue,c.widthType,i))??100);let y=c.padding?.left??Ml,k=c.padding?.right??Ml,x=Math.max(1,C-y-k);return{blocks:c.blocks.map(w=>n(w,x)),width:C,height:0,colSpan:c.colSpan,rowSpan:c.rowSpan}}),height:0})),s=[];for(let f=0;f<a.length;f++){let h=a[f],c=t.rows[f]?.cells,m=0,g=0;for(let k=0;k<h.cells.length;k++){let x=h.cells[k],w=c?.[k],I=0,F=0;for(let P=0;P<x.blocks.length;P++){let R=w?.blocks[P],T=x.blocks[P];if(!R||!T)continue;let M=df(R,T),B=R.kind==="paragraph"?R.attrs?.spacing:void 0,N=B?.before??0,z=B?.after??0;I+=Math.max(F,N)+(M-N-z),F=z}I+=F,x.height=I;let $=w?.padding?.top??Bl,E=w?.padding?.bottom??Bl;x.height+=$+E,(x.rowSpan??1)<=1&&(m=Math.max(m,x.height)),g=Math.max(g,Ll(w))}let v=t.rows[f],C=v?.height,y=v?.heightRule;s[f]=y==="exact"&&!!C,C&&y==="exact"?h.height=C:C?h.height=Math.max(m+g,C):h.height=m+g}let u=a.map(f=>f.height);for(let f=0;f<a.length;f++){let h=t.rows[f]?.cells,c=a[f]?.cells;if(!(!h||!c))for(let m=0;m<h.length;m++){let g=h[m]?.rowSpan??1;if(g<=1)continue;let v=Math.min(f+g-1,a.length-1),C=(c[m]?.height??0)+Ll(h[m]),y=0;for(let w=f;w<=v;w++)y+=u[w]??0;let k=C-y;if(k<=0)continue;let x=v;for(;x>f&&s[x];)x--;s[x]||(a[x].height+=k)}}let p=a.reduce((f,h)=>f+h.height,0),d=o.reduce((f,h)=>f+h,0)||r||e;return{kind:"table",rows:a,columnWidths:o,totalWidth:d,totalHeight:p}}var cf=4;function l0(t,e,n,r){let i=Array.isArray(e)?e[0]??0:e,o=hf(t,i,n,r),l=o.filter(m=>m.isMarginRelative),a=o.filter(m=>!m.isMarginRelative),s=new Map;for(let m of l){let g=s.get(m.topY)??[];g.push(m),s.set(m.topY,g)}let u=yf(a,cf),p=[];Al(u,p),Al(Array.from(s.values()),p);let d=new Map;for(let m of p){let g=m.fullWidthBlock&&m.isMarginRelative?0:m.anchorBlockIndex,v=d.get(g)??[],{anchorBlockIndex:C,isMarginRelative:y,...k}=m;v.push(k),d.set(g,v)}let f=new Set(d.keys()),h=0,c=[];return t.map((m,g)=>{f.has(g)&&(h=0,c=d.get(g)??[]);let v=c.length>0?c:void 0,C=Array.isArray(e)?e[g]??i:e,y=n(m,C,v,h);return"totalHeight"in y&&(m.kind==="table"&&m.floating||(h+=y.totalHeight)),y})}function hf(t,e,n,r){let i=[];for(let o=0;o<t.length;o++){let l=t[o];switch(l.kind){case"paragraph":mf(l,o,e,i);break;case"table":gf(l,o,e,n,i);break;case"textBox":wf(l,o,e,i,r);break}}return i}function Ol(t,e,n,r,i,o){let l=0,a=0,s=t?.horizontal;if(s?.align==="left")l=n+i;else if(s?.align==="right")a=n+r;else if(s?.posOffset!==void 0){let u=q(s.posOffset);u<o/2?l=u+n+i:a=o-u+r}else e==="left"?l=n+i:e==="right"&&(a=n+r);return Xe(l,a,o)}function br(t){let e=t?.vertical?.relativeTo;return e==="margin"||e==="page"}function mf(t,e,n,r){for(let i of t.runs){if(i.kind!=="image")continue;let o=i;if(!lf(o))continue;let l=o.distTop??0,a=o.distBottom??0,s=o.distLeft??12,u=o.distRight??12,p=0,d=o.position?.vertical;d?.align==="top"&&d.relativeTo==="margin"?p=0:d?.posOffset!==void 0&&(p=q(d.posOffset));let f=p+o.height,{leftMargin:h,rightMargin:c}=Ol(o.position,o.cssFloat,o.width,s,u,n);(h>0||c>0)&&r.push({leftMargin:h,rightMargin:c,topY:p-l,bottomY:f+a,anchorBlockIndex:e,isMarginRelative:br(o.position)})}}function gf(t,e,n,r,i){let o=t.floating;if(!o)return;let l=ff(t,n,r),a=l.totalWidth,s=l.totalHeight,u=o.leftFromText??12,p=o.rightFromText??12,d=o.topFromText??0,f=o.bottomFromText??0,h=0;o.tblpX!==void 0?h=o.tblpX:o.tblpXSpec?o.tblpXSpec==="left"||o.tblpXSpec==="inside"?h=0:o.tblpXSpec==="right"||o.tblpXSpec==="outside"?h=n-a:o.tblpXSpec==="center"&&(h=(n-a)/2):t.justification==="center"?h=(n-a)/2:t.justification==="right"&&(h=n-a);let c=0,m=0;h<n/2?c=h+a+p:m=n-h+u,{leftMargin:c,rightMargin:m}=Xe(c,m,n);let g=o.tblpY??0,v=g+s;i.push({leftMargin:c,rightMargin:m,topY:g-d,bottomY:v+f,anchorBlockIndex:e})}function wf(t,e,n,r,i){if(!Ot(t)||$t(t.wrapType))return;let o=t.width??0,l=t.height??0;if(o<=0||l<=0)return;let a=t.distTop??0,s=t.distBottom??0,u=t.distLeft??12,p=t.distRight??12;if(t.wrapType==="topAndBottom"){let m=af({height:l,position:t.position},0,i),g=m+l+s;if(g<=0)return;r.push({leftMargin:0,rightMargin:0,topY:Math.max(0,m-a),bottomY:g,anchorBlockIndex:e,isMarginRelative:br(t.position),fullWidthBlock:!0});return}let d=0;t.position?.vertical?.posOffset!==void 0&&(d=q(t.position.vertical.posOffset));let f=d+l,{leftMargin:h,rightMargin:c}=Ol(t.position,t.cssFloat,o,u,p,n);h<=0&&c<=0||r.push({leftMargin:h,rightMargin:c,topY:d-a,bottomY:f+s,anchorBlockIndex:e,isMarginRelative:br(t.position)})}function yf(t,e){let n=[];for(let r of t){let i=n.find(o=>o.some(l=>Math.abs(l.anchorBlockIndex-r.anchorBlockIndex)<=e&&r.topY<l.bottomY&&r.bottomY>l.topY));i?i.push(r):n.push([r])}return n}function Al(t,e){for(let n of t){let r=Math.min(...n.map(i=>i.anchorBlockIndex));for(let i of n)e.push({...i,anchorBlockIndex:r})}}var bf=new Map;function xf(){bf.clear()}var vf=new Map;function kf(){vf.clear()}var Sf=5e3,Cf=Sf,Et=new Map;function Hl(t){let e=[];for(let r of t.runs)r.kind==="text"?e.push(`t:${r.text}|${r.fontFamily}|${r.fontSize}|${r.bold}|${r.italic}`):r.kind==="tab"?e.push(`tab:${r.width}`):r.kind==="image"?e.push(`img:${r.width}x${r.height}`):r.kind==="lineBreak"&&e.push("br");let n=t.attrs;if(n){n.alignment&&e.push(`align:${n.alignment}`),n.indent&&e.push(`indent:${n.indent.left}|${n.indent.right}|${n.indent.firstLine}|${n.indent.hanging}`),n.spacing&&e.push(`spacing:${n.spacing.before}|${n.spacing.after}|${n.spacing.line}|${n.spacing.lineRule}`),n.defaultFontSize!=null&&e.push(`dfs:${n.defaultFontSize}`),n.defaultFontFamily!=null&&e.push(`dff:${n.defaultFontFamily}`);let r=n.borders;if(r){let i=o=>o?`${o.width??""},${o.style??""},${o.color??""}`:"";e.push(`bdr:${i(r.top)}|${i(r.bottom)}|${i(r.left)}|${i(r.right)}`)}n.suppressEmptyParagraphHeight&&e.push("sup"),n.pPrIns&&e.push(`pins:${n.pPrIns.revisionId}`),n.pPrDel&&e.push(`pdel:${n.pPrDel.revisionId}`)}return e.join("||")}function Tf(){for(;Et.size>Cf;){let t=Et.keys().next().value;if(t===void 0)break;Et.delete(t)}}function a0(t,e){let n=Hl(t),r=Et.get(n);if(r!==void 0&&r.maxWidth===e)return Et.delete(n),Et.set(n,r),r.measure}function s0(t,e,n){let r=Hl(t);Et.set(r,{measure:n,maxWidth:e}),Tf()}function $f(){Et.clear()}function p0(){xf(),kf(),$f()}function If(t,e,n,r,i){let o=new Map,l=[];for(let u of t.fragments){let p=r(u);if(p.length===0||!("height"in u))continue;let d=u.y-t.margins.top,f=d+u.height;p.forEach((h,c)=>{let m=`${c}:${h.id}`,g=o.get(m);g?(g.top=Math.min(g.top,d),g.bottom=Math.max(g.bottom,f)):(o.set(m,{group:h,depth:c,top:d,bottom:f}),l.push(m))})}let a=2,s=[];for(let u of l){let{group:p,depth:d,top:f,bottom:h}=o.get(u),c=d*(a+1),m=i.createElement("div");m.className="layout-block-sdt-box",m.dataset.sdtGroupId=p.id,m.dataset.sdtType=p.sdtType,m.dataset.sdtDepth=String(d+1),p.tag!=null&&(m.dataset.sdtTag=p.tag),p.alias!=null&&(m.dataset.sdtAlias=p.alias),p.lock!=null&&(m.dataset.sdtLock=p.lock),m.style.position="absolute",m.style.left=`${c}px`,m.style.top=`${f-a}px`,m.style.width=`${n-c*2}px`,m.style.height=`${h-f+a*2}px`;let g=p.alias||p.tag||p.sdtType;if(g){let C=i.createElement("span");C.className="layout-block-sdt-label",C.textContent=g,m.appendChild(C)}let v=Ff(p.sdtType);if(v&&p.tag!=null&&!p.bound&&p.lock!=="contentLocked"&&p.lock!=="sdtContentLocked"){let C=i.createElement("button");C.type="button",C.className="layout-sdt-widget",C.dataset.sdtWidget=v,C.dataset.sdtTag=p.tag,C.dataset.sdtGroupId=p.id,C.setAttribute("aria-label",`${v} control ${p.alias||p.tag}`),v==="dropdown"?C.setAttribute("aria-haspopup","listbox"):v==="date"&&C.setAttribute("aria-haspopup","dialog"),C.textContent=v==="dropdown"?"\u25BE":v==="date"?"\u{1F4C5}":p.checked?"\u2612":"\u2610",m.appendChild(C)}if(p.repeatingItem&&!p.bound){let C=i.createElement("div");C.className="layout-sdt-repeat-controls";for(let y of["add","remove"]){let k=i.createElement("button");k.type="button",k.className="layout-sdt-repeat-btn",k.dataset.sdtRepeat=y,k.dataset.sdtGroupId=p.id,k.setAttribute("aria-label",y==="add"?"Add item":"Remove item"),k.textContent=y==="add"?"\uFF0B":"\u2715",C.appendChild(k)}m.appendChild(C)}e.appendChild(m),s.push(m)}Pf(e,s)}function Ff(t){return t==="checkbox"?"checkbox":t==="dropDownList"||t==="comboBox"?"dropdown":t==="date"?"date":null}function Pf(t,e){if(e.length===0||typeof t.addEventListener!="function")return;let n=(a,s)=>{for(let u of e){let p=u.getBoundingClientRect(),d=a>=p.left&&a<=p.right&&s>=p.top&&s<=p.bottom;d!==u.classList.contains("is-active")&&u.classList.toggle("is-active",d)}},r=typeof requestAnimationFrame=="function"?requestAnimationFrame:a=>a(),i=!1,o=0,l=0;t.addEventListener("mousemove",a=>{o=a.clientX,l=a.clientY,!i&&(i=!0,r(()=>{i=!1,n(o,l)}))}),t.addEventListener("mouseleave",()=>{for(let a of e)a.classList.remove("is-active")})}function x0(t,e,n){let r=new Set,i=t.content.size,o=l=>{let a=t.resolve(Math.max(0,Math.min(l,i)));for(let s=1;s<=a.depth;s++)a.node(s).type.name==="blockSdt"&&r.add(`sdt@${a.before(s)}`)};return o(e),n!==e&&o(n),r}function v0(t,e){let n=t.querySelectorAll(".layout-block-sdt-box");for(let r of n){let i=r.dataset.sdtGroupId,o=i!=null&&e.has(i);o!==r.classList.contains("is-focused")&&r.classList.toggle("is-focused",o)}}var jt={fragment:"layout-fragment",paragraph:"layout-fragment-paragraph",table:"layout-fragment-table",image:"layout-fragment-image",line:"layout-line",run:"layout-run"};function Rf(t){return t.kind==="paragraph"}function Ef(t){return t.kind==="table"}function Mf(t){return t.kind==="image"}function mn(t){t.style.position="absolute",t.style.overflow="hidden"}function Bf(t,e,n){let r=n.createElement("div");return r.className=`${jt.fragment} ${jt.paragraph}`,mn(r),r.dataset.blockId=String(t.blockId),r.dataset.fromLine=String(t.fromLine),r.dataset.toLine=String(t.toLine),t.pmStart!==void 0&&(r.dataset.pmStart=String(t.pmStart)),t.pmEnd!==void 0&&(r.dataset.pmEnd=String(t.pmEnd)),t.continuesFromPrev&&(r.dataset.continuesFromPrev="true"),t.continuesOnNext&&(r.dataset.continuesOnNext="true"),r}function Lf(t,e,n){let r=n.createElement("div");return r.className=`${jt.fragment} ${jt.table}`,mn(r),r.dataset.blockId=String(t.blockId),r.dataset.fromRow=String(t.fromRow),r.dataset.toRow=String(t.toRow),t.pmStart!==void 0&&(r.dataset.pmStart=String(t.pmStart)),t.pmEnd!==void 0&&(r.dataset.pmEnd=String(t.pmEnd)),r}function Af(t,e,n){let r=n.createElement("div");return r.className=`${jt.fragment} ${jt.image}`,mn(r),r.dataset.blockId=String(t.blockId),t.pmStart!==void 0&&(r.dataset.pmStart=String(t.pmStart)),t.pmEnd!==void 0&&(r.dataset.pmEnd=String(t.pmEnd)),t.isAnchored&&(r.dataset.anchored="true"),t.zIndex!==void 0&&(r.style.zIndex=String(t.zIndex)),r}function Dl(t,e,n={}){let r=n.document??document;if(Rf(t))return Bf(t,e,r);if(Ef(t))return Lf(t,e,r);if(Mf(t))return Af(t,e,r);let i=r.createElement("div");i.className=jt.fragment,mn(i);let o=t;return o.blockId!==void 0&&(i.dataset.blockId=String(o.blockId)),o.kind&&(i.dataset.kind=o.kind),i}var rt={fragment:"layout-paragraph",line:"layout-line",run:"layout-run",text:"layout-run-text",tab:"layout-run-tab",image:"layout-run-image",lineBreak:"layout-run-linebreak"};function Mt(t){return t.kind==="text"}function Dt(t){return t.kind==="tab"}function ee(t){return t.kind==="image"}function Wt(t){return t.kind==="lineBreak"}function $e(t){return t.kind==="field"}var Wl={image:"layout-image",imageAnchored:"layout-image-anchored"};function Er(t){return!!(t.cropTop||t.cropRight||t.cropBottom||t.cropLeft||t.opacity!=null&&t.opacity<1)}function Mr(t,e){e.opacity!=null&&e.opacity<1&&(t.style.opacity=String(Math.max(0,e.opacity))),zf(t,e)}function zf(t,e){let n=e.cropTop??0,r=e.cropRight??0,i=e.cropBottom??0,o=e.cropLeft??0;if(!(n||r||i||o))return;let l=o+r>0?o/(o+r)*100:50,a=n+i>0?n/(n+i)*100:50;t.style.objectFit="cover",t.style.objectPosition=`${l}% ${a}%`}function Br(t,e,n,r,i={}){let o=i.document??document,l=o.createElement("div");l.className=Wl.image,t.isAnchored&&l.classList.add(Wl.imageAnchored),l.style.position="absolute",l.style.width=`${t.width}px`,l.style.height=`${t.height}px`,l.style.overflow="hidden",t.zIndex!==void 0&&(l.style.zIndex=String(t.zIndex)),e.anchor?.behindDoc&&(l.style.zIndex="-1"),l.dataset.blockId=String(t.blockId),t.pmStart!==void 0&&(l.dataset.pmStart=String(t.pmStart)),t.pmEnd!==void 0&&(l.dataset.pmEnd=String(t.pmEnd));let a=o.createElement("img");if(a.src=e.src,a.alt=e.alt??"",a.style.width="100%",a.style.height="100%",a.style.objectFit="contain",a.style.display="block",e.transform&&(a.style.transform=e.transform),a.draggable=!1,e.hlinkHref){let s=o.createElement("a");s.href=e.hlinkHref,s.target="_blank",s.rel="noopener noreferrer",s.style.display="block",s.style.width="100%",s.style.height="100%",s.appendChild(a),l.appendChild(s)}else l.appendChild(a);return l}function Nf(t,e,n){if(e.fontFamily&&(t.style.fontFamily=Tt(e.fontFamily).cssFallback),e.fontSize){let i=e.fontSize*96/72;t.style.fontSize=`${i}px`}if(e.bold&&(t.style.fontWeight="bold"),e.italic&&(t.style.fontStyle="italic"),e.color&&(t.style.color=e.color),e.letterSpacing&&(t.style.letterSpacing=`${e.letterSpacing}px`),e.allCaps&&(t.style.textTransform="uppercase"),e.smallCaps&&(t.style.fontVariant="small-caps"),e.positionPx&&(t.style.verticalAlign=`${e.positionPx}px`),e.horizontalScale&&e.horizontalScale!==100&&(t.style.display="inline-block",t.style.transform=`scaleX(${e.horizontalScale/100})`,t.style.transformOrigin="left center"),e.kerningMinPt&&e.kerningMinPt>0&&(e.fontSize??11)>=e.kerningMinPt&&(t.style.fontKerning="normal"),e.emboss&&(t.style.textShadow="1px 1px 1px rgba(255,255,255,0.5), -1px -1px 1px rgba(0,0,0,0.3)"),e.imprint&&(t.style.textShadow="-1px -1px 1px rgba(255,255,255,0.5), 1px 1px 1px rgba(0,0,0,0.3)"),e.textShadow&&!e.emboss&&!e.imprint&&(t.style.textShadow="1px 1px 2px rgba(0,0,0,0.3)"),e.textOutline&&(t.style.webkitTextStroke="1px currentColor",t.style.webkitTextFillColor="transparent"),e.emphasisMark){let i=e.emphasisMark==="comma"?"filled sesame":e.emphasisMark==="circle"?"filled circle":"filled dot",o=e.emphasisMark==="underDot"?"under right":"over right";t.style.textEmphasis=`${i}`,t.style.textEmphasisPosition=o,t.style.webkitTextEmphasis=i,t.style.webkitTextEmphasisPosition=o}e.highlight&&(t.style.backgroundColor=e.highlight);let r=[];if(e.underline&&(r.push("underline"),typeof e.underline=="object"&&(e.underline.style&&(t.style.textDecorationStyle=e.underline.style),e.underline.color&&(t.style.textDecorationColor=e.underline.color))),e.strike&&r.push("line-through"),e.commentIds&&e.commentIds.length>0){let i=e.commentIds.find(o=>!n||!n.has(o));i!=null&&(t.style.backgroundColor="rgba(255, 212, 0, 0.15)",t.style.borderBottom="1px solid rgba(255, 212, 0, 0.4)",t.style.cursor="pointer",t.style.transition="background-color 0.15s ease",t.dataset.commentId=String(i))}e.isInsertion&&(t.style.backgroundColor="rgba(52, 168, 83, 0.08)",t.style.borderBottom="2px dashed #2e7d32",t.style.paddingBottom="1px",t.classList.add("docx-insertion"),e.changeAuthor&&(t.dataset.changeAuthor=e.changeAuthor),e.changeDate&&(t.dataset.changeDate=e.changeDate),e.changeRevisionId!=null&&(t.dataset.revisionId=String(e.changeRevisionId))),e.isDeletion&&(t.style.backgroundColor="rgba(211, 47, 47, 0.08)",t.style.color="#c62828",r.includes("line-through")||r.push("line-through"),t.style.textDecorationColor="#c62828",t.classList.add("docx-deletion"),e.changeAuthor&&(t.dataset.changeAuthor=e.changeAuthor),e.changeDate&&(t.dataset.changeDate=e.changeDate),e.changeRevisionId!=null&&(t.dataset.revisionId=String(e.changeRevisionId))),r.length>0&&(t.style.textDecorationLine=r.join(" ")),e.superscript&&(t.style.fontSize="0.75em",t.style.position="relative",t.style.top="-0.4em"),e.subscript&&(t.style.fontSize="0.75em",t.style.position="relative",t.style.top="0.2em"),e.hidden&&(t.classList.add("docx-hidden"),t.style.opacity="0.4",t.style.textDecoration="underline dotted"),e.rtl&&t.setAttribute("dir","rtl"),e.textEffect&&(t.classList.add("docx-text-effect",`docx-text-effect-${e.textEffect}`),t.dataset.effect=e.textEffect)}function Bt(t,e,n){e!==void 0&&(t.dataset.pmStart=String(e)),n!==void 0&&(t.dataset.pmEnd=String(n))}function Of(t,e){let n=e.inlineSdtWidget;n&&(t.classList.add("layout-inline-sdt-widget"),t.dataset.sdtWidget=n.kind,t.dataset.sdtGroupId=n.groupId,t.dataset.sdtPos=String(n.pos),n.tag&&(t.dataset.sdtTag=n.tag),n.alias&&(t.dataset.sdtAlias=n.alias),typeof n.checked=="boolean"&&(t.dataset.sdtChecked=String(n.checked),t.setAttribute("aria-checked",String(n.checked))),t.setAttribute("role","checkbox"),t.setAttribute("tabindex","0"),t.setAttribute("aria-label",n.alias||n.tag||"Checkbox content control"))}function fn(t,e,n){let r=e.createElement("span");if(r.className=`${rt.run} ${rt.text}`,Nf(r,t,n),Bt(r,t.pmStart,t.pmEnd),Of(r,t),t.hyperlink){let i=e.createElement("a");i.href=t.hyperlink.href,t.hyperlink.href.startsWith("#")||(i.target="_blank",i.rel="noopener noreferrer"),t.hyperlink.tooltip&&(i.title=t.hyperlink.tooltip),i.textContent=t.text,i.style.color="inherit",i.style.textDecoration="inherit",t.hyperlink.noDefaultStyle||(t.color||(i.style.color="#0563c1",r.style.color="#0563c1"),t.underline||(i.style.textDecoration="underline")),r.appendChild(i)}else r.textContent=t.text;return r}var Hf=1e3;function $r(t,e,n,r){let i=e.createElement("span");i.className=`${rt.run} ${rt.tab}`,i.style.display="inline-block",i.style.width=`${n}px`,Bt(i,t.pmStart,t.pmEnd);let o=r&&r!=="none"?Df(r):null;if(o){i.style.position="relative",i.textContent="\u200B";let l=e.createElement("span");l.style.position="absolute",l.style.left="0",l.style.right="0",l.style.top="0",l.style.bottom="0",l.style.overflow="hidden",l.style.whiteSpace="nowrap",l.textContent=o.repeat(Hf),i.appendChild(l)}else i.textContent="\xA0";return i}function Df(t){switch(t){case"dot":return".";case"hyphen":return"-";case"underscore":return"_";case"middleDot":return"\xB7";case"heavy":return"_";default:return null}}function Kl(t){if(!t)return 0;let e=t.match(/rotate\(([-\d.]+)deg\)/);return e?(parseFloat(e[1])%360+360)%360:0}function Jl(t,e,n){if(n===0||n===180)return{w:t,h:e};if(n===90||n===270)return{w:e,h:t};let r=n*Math.PI/180,i=Math.abs(Math.sin(r)),o=Math.abs(Math.cos(r));return{w:t*o+e*i,h:t*i+e*o}}function jl(t,e){e.distTop&&(t.style.marginTop=`${e.distTop}px`),e.distBottom&&(t.style.marginBottom=`${e.distBottom}px`)}function Wf(t,e){let n=e.createElement("img");n.className=`${rt.run} ${rt.image}`,n.src=t.src,n.width=t.width,n.height=t.height,n.style.width=`${t.width}px`,n.style.height=`${t.height}px`,t.alt&&(n.alt=t.alt),t.transform&&(n.style.transform=t.transform,n.style.transformOrigin="center center"),Er(t)&&Mr(n,t);let r=Kl(t.transform);if(r!==0){let i=Jl(t.width,t.height,r),o=e.createElement("span");return o.style.display="inline-block",o.style.position="relative",o.style.width=`${i.w}px`,o.style.height=`${i.h}px`,o.style.verticalAlign="middle",n.style.position="absolute",n.style.left=`${(i.w-t.width)/2}px`,n.style.top=`${(i.h-t.height)/2}px`,jl(o,t),Bt(o,t.pmStart,t.pmEnd),o.appendChild(n),o}return n.style.display="inline-block",n.style.verticalAlign="middle",t.width>0&&t.height>0&&(n.style.height="auto",n.style.aspectRatio=`${t.width} / ${t.height}`,n.style.maxWidth="100%"),jl(n,t),Bt(n,t.pmStart,t.pmEnd),n}function jf(t,e){let n=e.createElement("div");n.className="layout-block-image",n.style.display="block",n.style.textAlign="center",n.style.marginTop=`${t.distTop??6}px`,n.style.marginBottom=`${t.distBottom??6}px`;let r=e.createElement("img");r.src=t.src,r.width=t.width,r.height=t.height,r.style.marginLeft="auto",r.style.marginRight="auto",t.alt&&(r.alt=t.alt),t.transform&&(r.style.transform=t.transform,r.style.transformOrigin="center center"),Er(t)&&Mr(r,t);let i=Kl(t.transform);if(i!==0){let o=Jl(t.width,t.height,i);n.style.height=`${o.h}px`,n.style.position="relative",r.style.position="absolute",r.style.left="50%",r.style.top="50%",r.style.marginLeft=`${-t.width/2}px`,r.style.marginRight="0",r.style.marginTop=`${-t.height/2}px`}return Bt(n,t.pmStart,t.pmEnd),n.appendChild(r),n}function Ir(t,e){let n;return Ht(t)||t.displayMode==="block"||t.wrapType==="topAndBottom"?n=jf(t,e):n=Wf(t,e),_f(n,t),n}function _f(t,e){if(e.isInsertion)t.style.outline="2px solid #2e7d32",t.style.outlineOffset="1px",t.classList.add("docx-insertion");else if(e.isDeletion)t.style.outline="2px solid #c62828",t.style.outlineOffset="1px",t.style.opacity="0.6",t.classList.add("docx-deletion");else return;e.changeAuthor&&(t.dataset.changeAuthor=e.changeAuthor),e.changeDate&&(t.dataset.changeDate=e.changeDate),e.changeRevisionId!=null&&(t.dataset.revisionId=String(e.changeRevisionId))}function Ql(t,e){let n=e.createElement("br");return n.className=`${rt.run} ${rt.lineBreak}`,Bt(n,t.pmStart,t.pmEnd),n}function Fr(t,e,n){let r=t.fallback??"";switch(t.fieldType){case"PAGE":r=String(n.pageNumber);break;case"NUMPAGES":r=String(n.totalPages);break;case"DATE":r=new Date().toLocaleDateString();break;case"TIME":r=new Date().toLocaleTimeString();break}let i={...t,text:r};return fn(i,e,n?.resolvedCommentIds)}function _l(t,e,n){if(Mt(t))return fn(t,e,n?.resolvedCommentIds);if(Dt(t))return $r(t,e,48,void 0);if(ee(t))return Ir(t,e);if(Wt(t))return Ql(t,e);if($e(t)&&n)return Fr(t,e,n);let r=e.createElement("span");return r.className=rt.run,r}function Xf(t,e){let n=[],r=t.runs;for(let i=e.fromRun;i<=e.toRun;i++){let o=r[i];if(o)if(Mt(o)){let l=i===e.fromRun?e.fromChar:0,a=i===e.toRun?e.toChar:o.text.length;if(l>0||a<o.text.length){let s=o.text.slice(l,a);n.push({...o,text:s,pmStart:o.pmStart!==void 0?o.pmStart+l:void 0,pmEnd:o.pmStart!==void 0?o.pmStart+a:void 0})}else n.push(o)}else n.push(o)}return n}function Xl(t){return t==="center"?"center":t==="right"?"flex-end":"flex-start"}function qf(t,e){let n=t.position?.horizontal;return n?n.align??"left":e}function ql(t){return[t.pmStart??"no-start",t.pmEnd??"no-end",t.src,t.width,t.height,t.displayMode??"inline",t.wrapType??"none"].join("|")}function Uf(t){return{val:t.val,pos:t.pos,leader:t.leader}}function Vf(t,e,n){let r="";for(let i=e+1;i<t.length;i++){let o=t[i];if(Mt(o))r+=o.text;else if($e(o))o.fieldType==="PAGE"&&n?r+=String(n.pageNumber):o.fieldType==="NUMPAGES"&&n?r+=String(n.totalPages):r+=o.fallback??"";else if(Dt(o)||Wt(o))break}return r}var Yf=.5;function Gf(t,e,n,r){let i=0;for(let o=e+1;o<t.length;o++){let l=t[o];if(Dt(l)||Wt(l))break;if(Mt(l))i+=n(l.text||"",l.fontSize,l.fontFamily,l.bold,l.italic);else if($e(l)){let a;l.fieldType==="PAGE"&&r?a=String(r.pageNumber):l.fieldType==="NUMPAGES"&&r?a=String(r.totalPages):a=l.fallback??"",i+=n(a,l.fontSize,l.fontFamily,l.bold,l.italic)}else ee(l)&&!Ht(l)&&(i+=l.width||0)}return i}function Zf(t){let e=t.createElement("canvas").getContext("2d");return(n,r=11,i="Calibri",o=!1,l=!1)=>{if(!e)return n.length*7;let a=Tt(i).cssFallback,s=r*96/72,u=[];return l&&u.push("italic"),o&&u.push("bold"),u.push(`${s}px`,a),e.font=u.join(" "),e.measureText(n).width}}function Ul(t,e,n,r,i){let o=r.createElement("div");o.className=rt.line,o.style.height=`${e.lineHeight}px`,o.style.lineHeight=`${e.lineHeight}px`;let l=Xf(t,e);if(l.length===1&&ee(l[0])){let m=l[0],g=qf(m,n);o.style.display="flex",o.style.alignItems="center",o.style.justifyContent=Xl(g),o.dataset.flexLine="true"}else l.some(ee)&&(o.style.display="flex",o.style.alignItems="baseline",o.style.justifyContent=Xl(n),o.style.lineHeight="normal",o.dataset.flexLine="true");if(l.length===0){let m=r.createElement("span");return m.className=`${rt.run} layout-empty-run`,m.innerHTML="&nbsp;",o.appendChild(m),o}let a=n==="justify",s=!1;a&&i&&(s=!i.isLastLine||i.paragraphEndsWithLineBreak,s&&(o.style.textAlign="justify",o.style.textAlignLast="justify",o.style.width=`${i.availableWidth}px`)),o.style.whiteSpace="pre";let u=l.some(m=>Mt(m)&&m.highlight);o.style.overflow=u?"hidden":"visible";let p=l.some(Dt),d,f=Zf(r);if(p){let m=i?.tabStops?.map(Uf),g=i?.leftIndentPx?Math.round(i.leftIndentPx*15):0;d={explicitStops:m,leftIndent:g}}let h=0,c=i?.leftIndentPx??0;if(i?.isFirstLine){let m=i?.firstLineIndentPx??0;h=c+m}else h=c;for(let m=0;m<l.length;m++){let g=l[m];if(Dt(g)&&d){let v=Gf(l,m,f,i?.context),C=Vf(l,m,i?.context),y=C.indexOf("."),k=y>=0?f(C.slice(0,y)):0,x=Un(h,d,{followingWidth:v,decimalPrefixWidth:k}),w=i?.lineRightEdgePx,I=v,F=!1;for(let P=m+1;P<l.length&&!Wt(l[P]);P++)if(Dt(l[P])){F=!0;break}if(w!==void 0&&x.alignment==="end"&&!F&&h+x.width+I>=w-Yf){o.style.display="flex",o.style.alignItems="baseline",o.style.whiteSpace="nowrap",o.style.textIndent="0",o.dataset.flexLine="true",i?.isFirstLine&&i.firstLineIndentPx&&i.firstLineIndentPx<0&&o.firstElementChild instanceof HTMLElement&&(o.firstElementChild.style.marginLeft=`${i.firstLineIndentPx}px`);let P=$r(g,r,0,x.leader);P.style.flex="1 1 0",P.style.minWidth="0",P.style.width="auto",o.appendChild(P);for(let R=m+1;R<l.length;R++){let T=l[R];if(Dt(T)||Wt(T))break;if(Mt(T))o.appendChild(fn(T,r,i?.context?.resolvedCommentIds));else if($e(T)&&i?.context)o.appendChild(Fr(T,r,i.context));else if(ee(T)){if(Ht(T))continue;let M=ql(T);i?.renderedInlineImageKeys?.has(M)||(i?.renderedInlineImageKeys?.add(M),o.appendChild(Ir(T,r)))}else o.appendChild(_l(T,r,i?.context))}break}let $=x.width;w!==void 0&&h+$+I>w&&($=Math.max(1,w-h-I));let E=$r(g,r,$,x.leader);o.appendChild(E),h+=$}else if(Mt(g)){let v=fn(g,r,i?.context?.resolvedCommentIds);if(g.highlight){let k=(g.fontSize?g.fontSize*96/72:14.67)*1.2,x=Math.max(0,e.lineHeight-k);if(x>0){let w=x/2;v.style.paddingTop=`${w}px`,v.style.paddingBottom=`${w}px`}}o.appendChild(v);let C=g.fontSize||11,y=g.fontFamily||"Calibri";h+=f(g.text,C,y,g.bold,g.italic)}else if(ee(g)){if(Ht(g))continue;let v=ql(g);if(i?.renderedInlineImageKeys?.has(v))continue;i?.renderedInlineImageKeys?.add(v);let C=Ir(g,r);o.appendChild(C),g.displayMode!=="block"&&g.wrapType!=="topAndBottom"&&(h+=g.width)}else if(Wt(g)){let v=Ql(g,r);o.appendChild(v)}else if($e(g)&&i?.context){let v=Fr(g,r,i.context);o.appendChild(v);let C=g.fallback??"";g.fieldType==="PAGE"?C=String(i.context.pageNumber):g.fieldType==="NUMPAGES"&&(C=String(i.context.totalPages));let y=g.fontSize||11,k=g.fontFamily||"Calibri";h+=f(C,y,k,g.bold,g.italic)}else{let v=_l(g,r,i?.context);o.appendChild(v)}}if(!o.querySelector("span[data-pm-start][data-pm-end]")){let m=l.find(Wt);if(m?.pmStart!==void 0){let g=r.createElement("span");g.className=rt.run,Bt(g,m.pmStart,m.pmStart),g.textContent="\u200B",o.insertBefore(g,o.firstChild)}}return o}function Se(t,e){return!t&&!e?!0:!t||!e?!1:t.style===e.style&&t.width===e.width&&t.color===e.color}function Vl(t,e){return!t&&!e||!t||!e?!1:Se(t.top,e.top)&&Se(t.bottom,e.bottom)&&Se(t.left,e.left)&&Se(t.right,e.right)&&Se(t.between,e.between)}var Kf=/[\u0590-\u085F\u08A0-\u08FF\uFB1D-\uFDFF\uFE70-\uFEFF]/,Jf=/[\u0041-\u005A\u0061-\u007A\u00C0-\u02B8\u0370-\u0589\u10A0-\u10FF\u1E00-\u1FFF]/;function Qf(t){let e=(t.runs??[]).filter(Mt);if(!e.some(n=>n.rtl))return!1;for(let n of e)for(let r of n.text){if(Kf.test(r))return!0;if(Jf.test(r))return!1}return!0}function Ie(t,e,n,r,i={}){let o=i.document??document,l=o.createElement("div");l.className=rt.fragment,l.style.position=r.positioning==="absolute"?"absolute":"relative",l.dataset.blockId=String(t.blockId),e.paraId&&(l.dataset.paraId=e.paraId),l.dataset.fromLine=String(t.fromLine),l.dataset.toLine=String(t.toLine),Bt(l,t.pmStart,t.pmEnd),t.continuesFromPrev&&(l.dataset.continuesFromPrev="true"),t.continuesOnNext&&(l.dataset.continuesOnNext="true");let a=e.attrs?.pPrIns,s=e.attrs?.pPrDel;if(a||s){let x=a??s;l.classList.add("layout-revision-pmark"),l.classList.add(a?"layout-revision-ins":"layout-revision-del"),l.dataset.revisionId=String(x.revisionId),l.dataset.revisionAuthor=x.author,x.date&&(l.dataset.revisionDate=x.date)}let u=n.lines.slice(t.fromLine,t.toLine),p=e.attrs?.alignment;e.attrs?.styleId&&(l.dataset.styleId=e.attrs.styleId);let d=!!e.attrs?.bidi||Qf(e);d&&(l.dir="rtl"),p?p==="center"?l.style.textAlign="center":p==="right"?l.style.textAlign="right":p==="left"?l.style.textAlign="left":l.style.textAlign=d?"right":"left":d&&(l.style.textAlign="right");let f=e.attrs?.indent,h=0,c=0;f&&(d?(f.left&&f.left>0&&(c=f.left),f.right&&f.right>0&&(h=f.right)):(f.left&&f.left>0&&(h=f.left),f.right&&f.right>0&&(c=f.right)));let m=e.attrs?.borders;if(m){let x=R=>{switch(R){case"single":return"solid";case"double":return"double";case"dotted":return"dotted";case"dashed":return"dashed";case"thick":return"solid";case"wave":return"wavy";case"dashSmallGap":return"dashed";case"nil":case"none":return"none";default:return"solid"}};l.style.boxSizing="border-box";let w=R=>`${R.width}px ${x(R.style)} ${R.color}`,I=Vl(i.prevBorders,m),F=Vl(m,i.nextBorders),$=I?m.between:m.top,E=F?void 0:m.bottom,P=o.createElement("div");if(P.className="layout-paragraph-border",P.style.position="absolute",P.style.pointerEvents="none",P.style.boxSizing="border-box",P.style.left=`${h-(m.left?.space??0)}px`,P.style.right=`${c-(m.right?.space??0)}px`,P.style.top=`${-($?.space??0)}px`,P.style.bottom=`${-(E?.space??0)}px`,$&&(P.style.borderTop=w($)),E&&(P.style.borderBottom=w(E)),m.left&&(P.style.borderLeft=w(m.left)),m.right&&(P.style.borderRight=w(m.right)),($||E||m.left||m.right)&&l.appendChild(P),m.bar){let R=o.createElement("div");R.style.position="absolute",R.style.left="-8px",R.style.top="0",R.style.bottom="0",R.style.borderLeft=w(m.bar),l.style.position="relative",l.appendChild(R)}}e.attrs?.shading&&(l.style.backgroundColor=e.attrs.shading);let g=t.width-h-c,v=e.runs[e.runs.length-1]?.kind==="lineBreak",C=n.lines.length,y=0;f?.hanging&&f.hanging>0?y=-f.hanging:f?.firstLine&&f.firstLine>0&&(y=f.firstLine);let k=i.renderedInlineImageKeys??new Set;for(let x=0;x<u.length;x++){let w=u[x],I=t.fromLine+x,F=I===C-1,$=I===0&&!t.continuesFromPrev,E=w.leftOffset??0,P=w.rightOffset??0,R=g;if(tc(w,e)){let z=o.createElement("div");z.className=`${rt.line} layout-line-split`,z.style.position="relative",z.style.height=`${w.lineHeight}px`,z.style.lineHeight=`${w.lineHeight}px`;for(let A of w.segments){let j={fromRun:A.fromRun,fromChar:A.fromChar,toRun:A.toRun,toChar:A.toChar,width:A.width,ascent:w.ascent,descent:w.descent,lineHeight:w.lineHeight},H=Ul(e,j,p,o,{availableWidth:A.availableWidth,isLastLine:F,isFirstLine:$,paragraphEndsWithLineBreak:v,tabStops:e.attrs?.tabs,leftIndentPx:h,firstLineIndentPx:$?y:0,context:r,renderedInlineImageKeys:k});H.className+=" layout-line-segment",H.style.position="absolute",H.style.left=`${A.leftOffset}px`,H.style.top="0",H.style.width=`${A.availableWidth}px`,z.appendChild(H)}l.appendChild(z);continue}let T=Ul(e,w,p,o,{availableWidth:R-E-P,isLastLine:F,isFirstLine:$,paragraphEndsWithLineBreak:v,tabStops:e.attrs?.tabs,leftIndentPx:h,firstLineIndentPx:$?y:0,context:r,renderedInlineImageKeys:k,lineRightEdgePx:t.width-c-P});if(E>0||P>0){E>0&&(T.style.marginLeft=`${E}px`),P>0&&(T.style.marginRight=`${P}px`);let z=R-E-P;z>0&&(T.style.width=`${z}px`)}w.floatSkipBefore&&w.floatSkipBefore>0&&(T.style.marginTop=`${w.floatSkipBefore}px`);let M=f?.hanging&&f.hanging>0,B=f?.firstLine&&f.firstLine>0,N=T.dataset.flexLine==="true";if($?h>0&&M?(T.style.paddingLeft=`${h}px`,N||(T.style.textIndent=`-${f.hanging}px`)):h>0&&B?(T.style.paddingLeft=`${h}px`,T.style.textIndent=`${f.firstLine}px`):h>0?T.style.paddingLeft=`${h}px`:B&&(T.style.textIndent=`${f.firstLine}px`):h>0?T.style.paddingLeft=`${h}px`:M&&(T.style.paddingLeft=`${f.hanging}px`),c>0&&(T.style.paddingRight=`${c}px`),$&&e.attrs?.listMarker&&!e.attrs?.listMarkerHidden){let z=f?.hanging??0,A=f?.firstLine??0,j=z>0?h-z:h+A;T.style.paddingLeft=`${Math.max(0,j)}px`,T.style.textIndent="0";let{fontFamily:H,fontSize:Y}=Vn(e),U=ec(e.attrs.listMarker,Yn(e),o,H,Y,e.attrs.listMarkerRevision);j<0&&h>0&&(U.style.marginLeft=`${j}px`),T.insertBefore(U,T.firstChild)}l.appendChild(T)}if((a||s)&&!t.continuesOnNext){let x=l.lastElementChild;if(x){let w=o.createElement("span");w.className="layout-revision-pmark-glyph",a?w.classList.add("layout-revision-ins"):w.classList.add("layout-revision-del"),w.textContent="\xB6",w.setAttribute("aria-hidden","true"),x.appendChild(w)}}return l}function tc(t,e){return(t.segments?.length??0)>1&&!e.attrs?.listMarker}function ec(t,e,n,r,i,o){let l=n.createElement("span");return l.className="layout-list-marker",l.style.fontFamily=Tt(r).cssFallback,l.style.fontSize=`${i*96/72}px`,l.style.textAlign="left",l.style.boxSizing="border-box",l.style.display="inline-block",l.style.minWidth=`${e}px`,l.textContent=t,o==="ins"?l.style.color="#2e7d32":o==="del"&&(l.style.color="#c62828",l.style.textDecoration="line-through"),l}function cn(t,e,n){let r=e.createElement("div");r.className=n.layerClass,r.style.position="absolute",r.style.top="0",r.style.left="0",n.sizing==="inset0"?(r.style.right="0",r.style.bottom="0"):(r.style.width="100%",r.style.height="100%",r.style.overflow="hidden"),r.style.pointerEvents="none",n.layerMode==="front"&&(r.style.zIndex="10");for(let i of t){let o=e.createElement("div");o.className=n.itemClass,o.style.position="absolute",o.style.pointerEvents="auto",o.style.top=`${i.y}px`,o.style.left=`${i.x}px`,i.pmStart!==void 0&&(o.dataset.pmStart=String(i.pmStart)),i.pmEnd!==void 0&&(o.dataset.pmEnd=String(i.pmEnd));let l=e.createElement("img");l.src=i.src,l.style.width=`${i.width}px`,l.style.height=`${i.height}px`,l.style.display="block",l.style.maxWidth="none",l.style.maxHeight="none",i.alt&&(l.alt=i.alt),i.transform&&(l.style.transform=i.transform,l.style.transformOrigin="center center"),Er(i)&&Mr(l,i),o.appendChild(l),r.appendChild(o)}return r}function nc(t,e,n){let r=[],i=0;for(let o=0;o<t.blocks.length;o++){let l=t.blocks[o];if(l?.kind!=="paragraph"){let u=e.blocks[o];u&&u.kind==="table"&&(i+=u.totalHeight??0);continue}let a=l;for(let u of a.runs){if(u.kind!=="image")continue;let p=u;if(!Ht(p))continue;let d=p.position,f=p.distTop??0,h=p.distBottom??0,c=p.distLeft??12,m=p.distRight??12,g="left",v=0;if(d?.horizontal){let y=d.horizontal;y.align==="right"?(g="right",v=n-p.width):y.align==="left"?v=0:y.align==="center"?v=(n-p.width)/2:y.posOffset!==void 0&&(v=q(y.posOffset),g=v>n/2?"right":"left")}else p.cssFloat==="right"&&(g="right",v=n-p.width);let C=i;if(d?.vertical){let y=d.vertical;y.posOffset!==void 0?C=i+q(y.posOffset):y.align==="top"&&(C=0)}v=Math.max(0,Math.min(v,n-p.width)),r.push({src:p.src,width:p.width,height:p.height,alt:p.alt,transform:p.transform,x:v,y:C,side:g,distTop:f,distBottom:h,distLeft:c,distRight:m,wrapText:vr(p.cssFloat),wrapType:p.wrapType,pmStart:p.pmStart,pmEnd:p.pmEnd})}let s=e.blocks[o];s&&s.kind==="paragraph"&&(i+=s.totalHeight)}return r}function ta(t){return!!t&&t.style!=="none"&&t.style!=="nil"&&t.width!==0}function Ce(t,e,n){let r=`border${e.charAt(0).toUpperCase()+e.slice(1)}`;if(!ta(n))t.style[r]="none";else{let i=n.width??1,o=n.color??"#000000",l=n.style??"solid";t.style[r]=`${i}px ${l} ${o}`}}function ea(t){let e=[],n=0;for(let r of t)e.push(Math.round(n)),n+=r?.height??0;return e.push(Math.round(n)),e}function rc(t,e,n,r,i){if(e<=0)return{bodyParent:t,bodyOriginY:0};let o=i.createElement("div");return o.style.position="absolute",o.style.left="0",o.style.top=`${e}px`,o.style.width=`${r}px`,o.style.height=`${Math.max(0,n-e)}px`,o.style.overflowX="visible",o.style.overflowY="hidden",t.appendChild(o),{bodyParent:o,bodyOriginY:e}}function ic(t,e){let n=t.createElement("div");n.className="layout-table-cut-border",n.style.position="absolute",n.style.left=`${e.x}px`,n.style.width=`${e.width}px`;let r=e.border.width??1;return n.style.top=`${e.edge==="bottom"?e.topY-r:e.topY}px`,Ce(n,"top",e.border),n}function Pr(t,e,n,r){t.classList.add(`ep-revision-${e}`,`ep-revision-${n}`),t.dataset.revisionId=String(r.revisionId),t.dataset.revisionAuthor=r.author,r.date&&(t.dataset.revisionDate=r.date)}var ot={table:"layout-table",row:"layout-table-row",cell:"layout-table-cell",cellContent:"layout-table-cell-content",resizeHandle:"layout-table-resize-handle",rowResizeHandle:"layout-table-row-resize-handle",tableEdgeHandleBottom:"layout-table-edge-handle-bottom",tableEdgeHandleRight:"layout-table-edge-handle-right"};function oc(t,e,n,r){let i=r.createElement("div");i.className=ot.cellContent,i.style.position="relative";let o=t.padding?.left??7,l=t.padding?.right??7,a=Math.max(0,e.width-o-l);i.style.width=`${a}px`;let s=nc(t,e,a),u;if(s.length>0){u=s.filter(xr).map(c=>{let m=c.x+c.width+c.distRight,g=c.y-c.distTop,v=c.y+c.height+c.distBottom,C=0,y=0,k=c.wrapText??"bothSides";return k==="right"?C=m:k==="left"?y=a-(c.x-c.distLeft):c.side==="left"?C=m:y=a-(c.x-c.distLeft),{leftMargin:C,rightMargin:y,topY:g,bottomY:v}});let h=s.filter(ke);h.length>0&&i.appendChild(cn(h,r,{layerClass:"layout-cell-floating-images-layer",itemClass:"layout-cell-floating-image",sizing:"fullSize",layerMode:"behind"}))}let p=0,d=0;for(let h=0;h<t.blocks.length;h++){let c=t.blocks[h],m=e.blocks[h];if(c?.kind==="paragraph"&&m?.kind==="paragraph"){let g=c,v=m,C=g.attrs?.spacing,y=Math.max(d,C?.before??0);p+=y,u&&u.length>0&&(v=Gn(g,a,{floatingZones:u,paragraphYOffset:p}));let k={blockId:g.id,width:a,height:v.totalHeight,fromLine:0,toLine:v.lines.length,pmStart:g.pmStart,pmEnd:g.pmEnd},x={...n,insideTableCell:!0},w=Ie(k,g,v,x,{document:r});w.style.position="relative",y>0&&(w.style.marginTop=`${y}px`),i.appendChild(w),p+=v.totalHeight,d=C?.after??0}else if(c?.kind==="table"&&m?.kind==="table"){let g=c,v=m,C=d,y=lc(g,v,n,r);y.style.position="relative",C>0&&(y.style.marginTop=`${C}px`),i.appendChild(y),p+=C+(m.totalHeight??0),d=0}}d>0&&(i.style.paddingBottom=`${d}px`);let f=s.filter(h=>!ke(h));return f.length>0&&i.appendChild(cn(f,r,{layerClass:"layout-cell-floating-images-layer",itemClass:"layout-cell-floating-image",sizing:"fullSize",layerMode:"front"})),i}function lc(t,e,n,r){let i=r.createElement("div");i.className=`${ot.table} layout-nested-table`,i.style.position="relative",i.style.width=`${e.totalWidth}px`,i.style.display="block",t.justification==="center"?(i.style.marginLeft="auto",i.style.marginRight="auto"):t.justification==="right"?i.style.marginLeft="auto":t.indent&&(i.style.marginLeft=`${t.indent}px`),i.dataset.blockId=String(t.id),t.pmStart!==void 0&&(i.dataset.pmStart=String(t.pmStart)),t.pmEnd!==void 0&&(i.dataset.pmEnd=String(t.pmEnd));let o=t.rows[0],l=o?.trackedIns,a=o?.trackedDel,s=(c,m)=>!!c&&!!m&&(c.author??"")===(m.author??"")&&(c.date??null)===(m.date??null),u=t.rows.length>0&&t.rows.every(c=>l?s(c.trackedIns,l):a?s(c.trackedDel,a):!1);if(u){let c=l??a,m=l?"ins":"del";i.classList.add("ep-revision-table",`ep-revision-${m}`),i.dataset.revisionId=String(c.revisionId),i.dataset.revisionAuthor=c.author,c.date&&(i.dataset.revisionDate=c.date)}let p=ea(e.rows),d=t.bidi===!0,f=e.columnWidths.reduce((c,m)=>c+(m??0),0),h=new Map;for(let c=0;c<t.rows.length;c++){let m=t.rows[c],g=e.rows[c];if(!m||!g)continue;let v=Rr(m,g,c,p[c]??0,e.columnWidths,t.rows.length,n,r,h,p,void 0,u,d,f);i.appendChild(v)}return i.style.height=`${p[t.rows.length]??0}px`,i}function na(t,e,n,r,i,o,l,a){let s=l.createElement("div");s.className=ot.cell,t.trackedMarker&&t.trackedMarker.info.revisionId!==a&&Pr(s,"cell",t.trackedMarker.kind,t.trackedMarker.info),s.style.position="absolute",s.style.left=`${n}px`,s.style.top="0",s.style.width=`${e.width}px`,s.style.height=`${r}px`,s.style.overflow="hidden",s.style.boxSizing="border-box";let u=t.padding?.top??1,p=t.padding?.right??7,d=t.padding?.bottom??1,f=t.padding?.left??7;s.style.padding=`${u}px ${p}px ${d}px ${f}px`,t.borders&&(i.isFirstRow&&Ce(s,"top",t.borders.top),Ce(s,"right",t.borders.right),Ce(s,"bottom",t.borders.bottom),i.isFirstCol&&Ce(s,"left",t.borders.left)),t.background&&(s.style.backgroundColor=t.background),t.noWrap&&(s.style.whiteSpace="nowrap");let h=(e.height??0)>=r-.5;if(t.verticalAlign&&!h)switch(s.style.display="flex",s.style.flexDirection="column",t.verticalAlign){case"top":s.style.justifyContent="flex-start";break;case"center":s.style.justifyContent="center";break;case"bottom":s.style.justifyContent="flex-end";break}let c=oc(t,e,o,l);if(s.appendChild(c),t.blocks.length>0){let m=t.blocks[0],g=t.blocks[t.blocks.length-1];m&&"pmStart"in m&&m.pmStart!==void 0&&(s.dataset.pmStart=String(m.pmStart)),g&&"pmEnd"in g&&g.pmEnd!==void 0&&(s.dataset.pmEnd=String(g.pmEnd))}return s}function ac(t,e){let n=t.bidi===!0,r=n?e.reduce((i,o)=>i+(o??0),0):0;return ue(t).map(i=>{let o=0;for(let l=0;l<i.columnIndex;l++)o+=e[l]??0;if(n){let l=0;for(let a=0;a<i.colSpan;a++)l+=e[i.columnIndex+a]??0;o=r-o-l}return{rowIndex:i.rowIndex,cellIndex:i.cellIndex,columnIndex:i.columnIndex,x:o,colSpan:i.colSpan,rowSpan:i.rowSpan,cell:t.rows[i.rowIndex].cells[i.cellIndex]}})}function Rr(t,e,n,r,i,o,l,a,s,u,p,d,f=!1,h=0){let c=a.createElement("div");c.className=ot.row,d||(t.trackedDel?Pr(c,"row","del",t.trackedDel):t.trackedIns&&Pr(c,"row","ins",t.trackedIns));let m=u&&u.length>n+1?(u[n+1]??0)-(u[n]??0):e.height;c.style.position="absolute",c.style.left="0",c.style.top=`${r}px`,c.style.width="100%",c.style.height=`${m}px`,c.dataset.rowIndex=String(n);let g=new Set;if(s){for(let[,y]of s)if(y.startRow<n&&y.startRow+y.rowSpan>n)for(let k=0;k<y.colSpan;k++)g.add(y.columnIndex+k)}let v=0,C=0;for(;g.has(C);)v+=i[C]??0,C++;for(let y=0;y<t.cells.length;y++){let k=t.cells[y],x=e.cells[y];if(!k||!x)continue;let w=k.colSpan??1,I=k.rowSpan??1,F=m;if(I>1&&u){F=0;for(let T=n;T<n+I&&T<u.length-1;T++)F+=(u[T+1]??0)-(u[T]??0);F===0&&(F=e.height*I)}let $=0;for(let T=0;T<w&&C+T<i.length;T++)$+=i[C+T]??0;let E=n===0||p===!0,P=f?C+w>=i.length:C===0;f||C+w>=i.length;let R=na(k,x,f?h-v-$:v,F,{isFirstRow:E,isFirstCol:P},l,a,t.trackedIns?.revisionId??t.trackedDel?.revisionId);if(R.dataset.cellIndex=String(y),R.dataset.columnIndex=String(C),I>1&&(R.dataset.rowSpan=String(I)),c.appendChild(R),I>1&&s){let T=`${n}-${C}`;s.set(T,{cell:k,cellMeasure:x,columnIndex:C,startRow:n,rowSpan:I,colSpan:w,x:v,totalHeight:F})}for(v+=$,C+=w;g.has(C);)v+=i[C]??0,C++}return c}function Lr(t,e,n,r,i={}){let o=i.document??document,l=o.createElement("div");l.className=ot.table,l.style.position=r.positioning==="flow"?"relative":"absolute",l.style.width=`${t.width}px`,l.style.overflow="hidden",l.dataset.blockId=String(t.blockId),l.dataset.fromRow=String(t.fromRow),l.dataset.toRow=String(t.toRow),t.pmStart!==void 0&&(l.dataset.pmStart=String(t.pmStart)),t.pmEnd!==void 0&&(l.dataset.pmEnd=String(t.pmEnd));let a=e.rows[0],s=a?.trackedIns,u=a?.trackedDel,p=(T,M)=>!!T&&!!M&&(T.author??"")===(M.author??"")&&(T.date??null)===(M.date??null),d=e.rows.length>0&&e.rows.every(T=>s?p(T.trackedIns,s):u?p(T.trackedDel,u):!1);if(d){let T=s??u,M=s?"ins":"del";l.classList.add("ep-revision-table",`ep-revision-${M}`),l.dataset.revisionId=String(T.revisionId),l.dataset.revisionAuthor=T.author,T.date&&(l.dataset.revisionDate=T.date),l.style.overflowX="visible",l.style.overflowY="hidden"}let f=e.bidi===!0,h=n.columnWidths.reduce((T,M)=>T+(M??0),0),c=0;for(let T=0;T<n.columnWidths.length-1;T++){c+=n.columnWidths[T]??0;let M=o.createElement("div");M.className=ot.resizeHandle,M.style.position="absolute",M.style.left=`${(f?h-c:c)-3}px`,M.style.top="0",M.style.width="6px",M.style.height="100%",M.style.cursor="col-resize",M.style.zIndex="10",M.dataset.columnIndex=String(T),M.dataset.tableBlockId=String(t.blockId),t.pmStart!==void 0&&(M.dataset.tablePmStart=String(t.pmStart)),l.appendChild(M)}let m=ea(n.rows),g=ac(e,n.columnWidths),v=t.headerRowCount??0,C=0;if(v>0&&t.continuesFromPrev){let T=new Map;for(let M=0;M<v;M++){let B=e.rows[M],N=n.rows[M];if(!B||!N)continue;let z=Rr(B,N,M,C,n.columnWidths,e.rows.length,r,o,T,m,M===0,d,f,h);z.dataset.repeatedHeader="true",l.appendChild(z),C+=N.height}}let y=(m[t.fromRow]??0)+(t.topClip??0),k=T=>C+(T-y),x=t.bottomClip!==void 0?Math.round(t.height):k(m[t.toRow]??0);l.style.height=`${x}px`;let{bodyParent:w,bodyOriginY:I}=rc(l,C,x,t.width,o),F=T=>k(T)-I,$=new Map,E=v>0&&t.continuesFromPrev;for(let T of g){if(T.rowSpan<=1||T.rowIndex>=t.fromRow||T.rowIndex+T.rowSpan<=t.fromRow||E&&T.rowIndex<v)continue;let M=n.rows[T.rowIndex]?.cells?.[T.cellIndex];if(!M)continue;let B=0;for(let A=T.rowIndex;A<T.rowIndex+T.rowSpan&&A<m.length-1;A++)B+=(m[A+1]??0)-(m[A]??0);$.set(`${T.rowIndex}-${T.columnIndex}`,{cell:T.cell,cellMeasure:M,columnIndex:T.columnIndex,startRow:T.rowIndex,rowSpan:T.rowSpan,colSpan:T.colSpan,x:T.x,totalHeight:B}),T.rowIndex+T.rowSpan>=e.rows.length;let N=f?T.columnIndex+T.colSpan>=n.columnWidths.length:T.columnIndex===0;f?T.columnIndex:T.columnIndex+T.colSpan>=n.columnWidths.length;let z=na(T.cell,M,T.x,B,{isFirstRow:!1,isFirstCol:N},r,o);z.style.top=`${F(m[T.rowIndex]??0)}px`,z.dataset.columnIndex=String(T.columnIndex),z.dataset.vmergeContinuation="true",delete z.dataset.pmStart,delete z.dataset.pmEnd,w.appendChild(z)}for(let T=t.fromRow;T<t.toRow;T++){let M=e.rows[T],B=n.rows[T];if(!M||!B)continue;let N=v>0&&t.continuesFromPrev?!1:t.continuesFromPrev&&T===t.fromRow&&!t.topClip,z=Rr(M,B,T,F(m[T]??0),n.columnWidths,e.rows.length,r,o,$,m,N,d,f,h);w.appendChild(z)}let P=(T,M,B,N)=>{for(let z of g){if(z.rowIndex>T||z.rowIndex+z.rowSpan-1<T||N&&!(M==="bottom"?z.rowIndex+z.rowSpan-1>T:z.rowIndex<T))continue;let A=z.cell.borders?.[M];if(!ta(A))continue;let j=0;for(let H=0;H<z.colSpan;H++)j+=n.columnWidths[z.columnIndex+H]??0;l.appendChild(ic(o,{x:z.x,topY:B,width:j,edge:M,border:A}))}};t.topClip?P(t.fromRow,"top",C,!1):t.continuesFromPrev&&P(t.fromRow,"top",C,!0),t.bottomClip!==void 0?P(t.toRow-1,"bottom",x,!1):t.continuesOnNext&&P(t.toRow-1,"bottom",x,!0);for(let T=t.fromRow;T<t.toRow-1;T++){let M=k(m[T+1]??0);if(M<=C||M>=t.height)continue;let B=o.createElement("div");B.className=ot.rowResizeHandle,B.style.position="absolute",B.style.left="0",B.style.top=`${M-3}px`,B.style.width="100%",B.style.height="6px",B.style.cursor="row-resize",B.style.zIndex="10",B.dataset.rowIndex=String(T),B.dataset.tableBlockId=String(t.blockId),t.pmStart!==void 0&&(B.dataset.tablePmStart=String(t.pmStart)),l.appendChild(B)}let R=t.toRow===e.rows.length&&t.bottomClip===void 0;if(R){let T=o.createElement("div");T.className=ot.tableEdgeHandleBottom,T.style.position="absolute",T.style.left="0",T.style.top=`${k(m[t.toRow]??0)-3}px`,T.style.width="100%",T.style.height="6px",T.style.cursor="row-resize",T.style.zIndex="10",T.dataset.rowIndex=String(e.rows.length-1),T.dataset.tableBlockId=String(t.blockId),T.dataset.isEdge="bottom",t.pmStart!==void 0&&(T.dataset.tablePmStart=String(t.pmStart)),l.appendChild(T)}if(R){let T=o.createElement("div");T.className=ot.tableEdgeHandleRight,T.style.position="absolute",T.style.left=`${h-3}px`,T.style.top="0",T.style.width="6px",T.style.height="100%",T.style.cursor="col-resize",T.style.zIndex="10",T.dataset.columnIndex=String(n.columnWidths.length-1),T.dataset.tableBlockId=String(t.blockId),T.dataset.isEdge="right",t.pmStart!==void 0&&(T.dataset.tablePmStart=String(t.pmStart)),l.appendChild(T)}return l}var sc={textBox:"layout-textbox"};function Ar(t,e,n,r,i={}){let o=i.document??document,l=o.createElement("div");if(l.className=sc.textBox,l.style.position="absolute",l.style.width=`${t.width}px`,l.style.height=`${t.height}px`,l.style.overflow="hidden",l.style.boxSizing="border-box",pc(l,t),e.fillColor&&(l.style.backgroundColor=e.fillColor),e.outlineWidth&&e.outlineWidth>0){let p=e.outlineStyle||"solid",d=e.outlineColor||"#000000";l.style.border=`${e.outlineWidth}px ${p} ${d}`}let a=e.margins??zt;l.style.padding=`${a.top}px ${a.right}px ${a.bottom}px ${a.left}px`,l.dataset.blockId=String(t.blockId),t.pmStart!==void 0&&(l.dataset.pmStart=String(t.pmStart)),t.pmEnd!==void 0&&(l.dataset.pmEnd=String(t.pmEnd));let s=t.width-a.left-a.right,u=0;for(let p=0;p<e.content.length;p++){let d=e.content[p],f=n.innerMeasures[p];if(!f)continue;let h={blockId:d.id,width:s,height:f.totalHeight,pmStart:d.pmStart,pmEnd:d.pmEnd,fromLine:0,toLine:f.lines.length},c=Ie(h,d,f,{...r,positioning:"flow"},{document:o});l.appendChild(c),u+=f.totalHeight}return l}function pc(t,e){!e.isFloating&&e.zIndex===void 0||(t.style.zIndex=String(e.zIndex??10))}var uc="layout-watermark-layer";function dc(t,e){let n=Math.max(t.trim().length,1),r=e/(n*.62);return Math.max(24,Math.min(r,180))}function fc(t,e,n){let r=n.createElement("div");r.style.position="absolute",r.style.top="50%",r.style.left="50%",r.style.whiteSpace="nowrap",r.style.fontWeight="bold",r.style.color=t.color,r.style.fontFamily=Tt(t.font).cssFallback,r.style.userSelect="none";let i=e.size.w-e.margins.left-e.margins.right,o=t.layout==="diagonal"?i*1.3:i,l=t.fontSize!==void 0?t.fontSize*96/72:dc(t.text,o);r.style.fontSize=`${l}px`,r.style.lineHeight="1",r.style.opacity=t.semitransparent?"0.5":"0.85";let a=t.layout==="diagonal"?-45:0;return r.style.transform=`translate(-50%, -50%) rotate(${a}deg)`,r.style.transformOrigin="center center",r.textContent=t.text,r}function cc(t,e,n){if(!t.dataUrl)return null;let r=n.createElement("img");r.src=t.dataUrl,r.alt="",r.style.position="absolute",r.style.top="50%",r.style.left="50%",r.style.transform="translate(-50%, -50%)";let i=e.size.w-e.margins.left-e.margins.right,o=t.widthEmu!==void 0?t.widthEmu/(914400/96):i*.75;return r.style.width=`${o*(t.scale||1)}px`,r.style.height="auto",t.washout&&(r.style.opacity="0.5",r.style.filter="brightness(1.4) contrast(0.4)"),r}function hc(t,e,n=document){let r=t.kind==="text"?fc(t,e,n):cc(t,e,n);if(!r)return null;let i=n.createElement("div");return i.className=uc,i.setAttribute("aria-hidden","true"),i.style.position="absolute",i.style.inset="0",i.style.overflow="hidden",i.style.pointerEvents="none",i.style.zIndex="0",i.appendChild(r),i}function ra(t){return t?.align??t?.alignment}function mc(t,e){let n=t.position.vertical;if(!n)return t.paragraphY;let r=ra(n),i=n.posOffset!==void 0?q(n.posOffset):void 0;if(n.relativeTo==="page"){if(i!==void 0)return i-e.flowTop;if(r==="top")return-e.flowTop;if(r==="bottom")return e.pageHeight-t.height-e.flowTop;if(r==="center")return(e.pageHeight-t.height)/2-e.flowTop}if(n.relativeTo==="margin"){let o=e.margins.top,l=e.pageHeight-e.margins.top-e.margins.bottom;if(i!==void 0)return o+i-e.flowTop;if(r==="top")return o-e.flowTop;if(r==="bottom")return o+l-t.height-e.flowTop;if(r==="center")return o+(l-t.height)/2-e.flowTop}return i!==void 0?t.paragraphY+i:t.paragraphY}function ia(t,e,n){if(!e)return"0";let r=ra(e);if(e.relativeTo==="page"){if(e.posOffset!==void 0)return`${q(e.posOffset)-n.flowLeft}px`;if(r==="right")return`${n.pageWidth-t-n.flowLeft}px`;if(r==="center")return`${(n.pageWidth-t)/2-n.flowLeft}px`;if(r==="left")return`${-n.flowLeft}px`}return e.posOffset!==void 0?`${q(e.posOffset)}px`:r==="right"?`${n.contentWidth-t}px`:r==="center"?`${(n.contentWidth-t)/2}px`:"0"}function gc(t,e,n){t.style.left=ia(e.width,e.position.horizontal,n)}function wc(t,e){let n=t.tblpY??0;t.vertAnchor==="page"?n-=e.flowTop:t.vertAnchor==="margin"&&(n+=e.margins.top-e.flowTop);let r=t.tblpX??0;return t.horzAnchor==="page"?r-=e.flowLeft:t.horzAnchor==="margin"&&(r+=e.margins.left-e.flowLeft),{left:r,top:n}}function Yl(t,e,n,r){let i=n.document??document,o=i.createElement("div");o.style.position="relative";let l=e.contentWidth??600,a=[],s=0;for(let u=0;u<t.blocks.length;u++){let p=t.blocks[u],d=t.measures[u];if(!(!p||!d))if(p.kind==="paragraph"){if(d.kind!=="paragraph")continue;let f=p,h=d,c=f.attrs?.spacing?.before??0,m=s,g=[];for(let k of f.runs)if(k.kind==="image"&&"position"in k&&k.position){let x=k;a.push({src:x.src,width:x.width,height:x.height,alt:x.alt,paragraphY:m,position:x.position})}else g.push(k);let v={...f,runs:g},C={blockId:f.id,width:l,height:h.totalHeight,fromLine:0,toLine:h.lines.length,pmStart:f.pmStart,pmEnd:f.pmEnd},y=Ie(C,v,h,{...e,positioning:"absolute"},{document:i});y.style.top=`${s+c}px`,y.style.left="0",y.style.width=`${l}px`,o.appendChild(y),s+=h.totalHeight}else if(p.kind==="table"){if(d.kind!=="table")continue;let f={blockId:p.id,width:d.totalWidth,height:d.totalHeight,fromRow:0,toRow:d.rows.length,pmStart:p.pmStart,pmEnd:p.pmEnd},h=Lr(f,p,d,{...e,positioning:"absolute"},{document:i});if(p.floating){let{left:c,top:m}=wc(p.floating,r);h.style.top=`${m}px`,h.style.left=`${c}px`,o.appendChild(h)}else h.style.top=`${s}px`,h.style.left="0",o.appendChild(h),s+=d.totalHeight}else if(p.kind==="image"){if(d.kind!=="image")continue;let f={blockId:p.id,width:d.width,height:d.height,pmStart:p.pmStart,pmEnd:p.pmEnd},h=Br(f,p,d,{...e},{document:i});h.style.top=`${s}px`,h.style.left="0",o.appendChild(h),s+=d.height}else if(p.kind==="textBox"){if(d.kind!=="textBox")continue;let f={blockId:p.id,width:d.width,height:d.height,pmStart:p.pmStart,pmEnd:p.pmEnd},h=Ar(f,p,d,{...e,positioning:"absolute"},{document:i});h.style.top=`${s}px`,h.style.left=ia(d.width,p.position?.horizontal,r),o.appendChild(h),p.displayMode!=="float"&&(s+=d.height)}else p.kind==="sectionBreak"||p.kind==="pageBreak"||p.kind==="columnBreak"||ze(p,"renderHeaderFooterContent")}for(let u of a){let p=i.createElement("img");p.src=u.src,p.width=u.width,p.height=u.height,u.alt&&(p.alt=u.alt),p.style.position="absolute",p.style.display="block",p.style.width=`${u.width}px`,p.style.height=`${u.height}px`,p.style.maxWidth="none",p.style.maxHeight="none",gc(p,u,r),p.style.top=`${mc(u,r)}px`,o.appendChild(p)}return o}var hn=12,Gl=24,Sr=6;function yc(t,e){if(t.size!==e.size)return!1;for(let[n,r]of t)if(e.get(n)!==r)return!1;return!0}function bc(t,e){for(let[n,r]of e)if((t.get(n)??0)<r)return!1;return!0}function xc(t,e){let n=new Map(t);for(let[r,i]of e)n.set(r,Math.max(n.get(r)??0,i));return n}var Cr=8;function k0(t){let e=[],n=(r,i)=>{for(let o of r)if(o.kind==="paragraph")for(let l of o.runs)l.kind==="text"&&l.footnoteRefId!=null&&e.push({footnoteId:l.footnoteRefId,pmPos:l.pmStart??0,...i??{}});else o.kind==="table"?o.rows.forEach((l,a)=>{for(let s of l.cells)n(s.blocks,i??{tableBlockId:o.id,rowIndex:a})}):o.kind==="textBox"&&n(o.content,i)};return n(t),e}function an(t,e){let n=new Map;if(e.length===0)return n;let r=(i,o)=>{let l=n.get(i)??[];l.includes(o)||l.push(o),n.set(i,l)};for(let i of e){let o=!1;for(let l of t){for(let a of l.fragments){let s=!1;if(i.tableBlockId!=null&&i.rowIndex!=null)s=a.kind==="table"&&a.blockId===i.tableBlockId&&i.rowIndex>=a.fromRow&&i.rowIndex<a.toRow;else{let u=a.pmStart??-1,p=a.pmEnd??-1;s=u>=0&&p>=0&&i.pmPos>=u&&i.pmPos<p}if(s){r(l.number,i.footnoteId),o=!0;break}}if(o)break}}return n}function vc(t,e){if(t.length===0)return[{kind:"paragraph",id:`fn-empty-${e}`,runs:[{kind:"text",text:`${e}  `,fontSize:Cr,superscript:!0}]}];let n=t.map(i=>{if(i.kind!=="paragraph")return i;let o=i;return{...o,runs:o.runs.map(l=>(l.kind==="text"||l.kind==="tab")&&l.fontSize==null?{...l,fontSize:Cr}:l)}}),r=n[0];if(r.kind==="paragraph"){let i=r,o=i.runs.find(a=>a.kind==="text"),l={kind:"text",text:`${e}  `,fontSize:Cr,superscript:!0,...o?.fontFamily?{fontFamily:o.fontFamily}:{}};n[0]={...i,runs:[l,...i.runs]}}return n}function kc(t,e,n,r){let i=po(t.content,{styles:r.styles??void 0,theme:r.theme??null,defaultTabStopTwips:r.defaultTabStopTwips??null}),o=en(i,{theme:r.theme??void 0}),l=vc(o,e),a=r.measureBlocks(l,n),s=a.reduce((u,p)=>p.kind==="paragraph"||p.kind==="table"?u+p.totalHeight:p.kind==="image"||p.kind==="textBox"?u+p.height:u,0);return{id:t.id,displayNumber:e,blocks:l,measures:a,height:s}}function S0(t,e,n,r){let i=new Map,o=new Map;for(let s of t)(s.noteType==="normal"||s.noteType==null)&&o.set(s.id,s);let l=1,a=new Set;for(let s of e){if(a.has(s.footnoteId))continue;a.add(s.footnoteId);let u=o.get(s.footnoteId);u&&(i.set(s.footnoteId,kc(u,l,n,r)),l++)}return i}function zr(t,e){let n=Math.max(1,Math.floor(e));if(n<=1||t.length<=1)return[t];let r=t.reduce((l,a)=>l+a.height,0)/n,i=[[]],o=0;for(let l of t)i.length<n&&o>0&&o+l.height/2>r&&(i.push([]),o=0),i[i.length-1].push(l),o+=l.height;return i}function Tr(t,e,n=1){let r=new Map;for(let[i,o]of t){let l=o.map(s=>e.get(s)?.height??0).filter(s=>s>0).map(s=>({height:s}));if(l.length===0)continue;let a=zr(l,n).reduce((s,u)=>Math.max(s,u.reduce((p,d)=>p+d.height,0)),0);a>0&&r.set(i,a+hn)}return r}function C0(t){let{blocks:e,measures:n,layoutOpts:r,footnoteRefs:i,footnoteContentMap:o,initialLayout:l}=t,a=Math.max(1,t.footnoteColumns??1),s=an(l.pages,i),u=Tr(s,o,a);if(u.size===0)return{layout:l,pageFootnoteMap:s,converged:!0};let p=l,d=!1;for(let f=0;f<Sr;f++){p=qe(e,n,{...r,footnoteReservedHeights:u});let h=an(p.pages,i),c=Tr(h,o,a);if(s=h,yc(u,c)){u=c,d=!0;break}u=c}if(!d){let f=u,h=!1;for(let c=0;c<Sr;c++){p=qe(e,n,{...r,footnoteReservedHeights:f}),s=an(p.pages,i);let m=Tr(s,o,a);if(bc(f,m)){h=!0;break}f=xc(f,m)}h||(p=qe(e,n,{...r,footnoteReservedHeights:f}),s=an(p.pages,i)),console.warn(`[docx-editor] footnote layout did not stabilize within ${Sr} passes; settling with conservative page reservations. If footnotes appear misplaced, please file a bug with the document.`)}for(let[f,h]of s){let c=p.pages.find(m=>m.number===f);c&&(c.footnoteIds=h,a>1&&(c.footnoteColumns=a))}return{layout:p,pageFootnoteMap:s,converged:d}}function T0(t,e,n){let r=new Map;if(!n?.package?.footnotes)return r;let i=new Map;for(let o of n.package.footnotes)o.noteType&&o.noteType!=="normal"||i.set(o.id,o);for(let[o,l]of t){let a=[];for(let s of l){let u=i.get(s);if(!u)continue;let p=e.get(s),d=p?.displayNumber??0;a.push({displayNumber:String(d),text:il(u),content:p})}a.length>0&&r.set(o,a)}return r}function Sc(t,e,n,r){let i=r.createElement("div");i.className="layout-footnote-content",i.style.position="relative",i.style.width=`${e}px`,i.style.height=`${t.height}px`;let o=0;for(let l=0;l<t.blocks.length;l++){let a=t.blocks[l],s=t.measures[l];if(!(!a||!s)){if(a.kind==="paragraph"&&s.kind==="paragraph"){let u=a.attrs?.spacing?.before??0,p={blockId:a.id,width:e,height:s.totalHeight,pmStart:a.pmStart,pmEnd:a.pmEnd,fromLine:0,toLine:s.lines.length},d=Ie(p,a,s,{...n,section:"body",contentWidth:e,positioning:"absolute"},{document:r});d.style.top=`${o+u}px`,d.style.left="0",d.style.width=`${e}px`,d.style.height=`${s.totalHeight}px`,i.appendChild(d),o+=s.totalHeight}else if(a.kind==="table"&&s.kind==="table"){let u={blockId:a.id,width:s.totalWidth,height:s.totalHeight,pmStart:a.pmStart,pmEnd:a.pmEnd,fromRow:0,toRow:s.rows.length},p=Lr(u,a,s,{...n,section:"body",contentWidth:e,positioning:"absolute"},{document:r});p.style.top=`${o}px`,p.style.left="0",i.appendChild(p),o+=s.totalHeight}else if(a.kind==="image"&&s.kind==="image"){let u={blockId:a.id,width:s.width,height:s.height,pmStart:a.pmStart,pmEnd:a.pmEnd},p=Br(u,a,s,{...n},{document:r});p.style.top=`${o}px`,p.style.left="0",i.appendChild(p),o+=s.height}else if(a.kind==="textBox"&&s.kind==="textBox"){let u={blockId:a.id,width:s.width,height:s.height,pmStart:a.pmStart,pmEnd:a.pmEnd},p=Ar(u,a,s,{...n,section:"body",contentWidth:e,positioning:"absolute"},{document:r});p.style.top=`${o}px`,p.style.left="0",i.appendChild(p),o+=s.height}}}return i}function Cc(t,e){let n=e.createElement("div");n.style.fontSize="10px",n.style.lineHeight="1.3",n.style.marginBottom="4px",n.style.color="#000";let r=e.createElement("sup");r.textContent=t.displayNumber,r.style.fontSize="7px",r.style.marginRight="2px",n.appendChild(r);let i=e.createTextNode(" "+t.text);return n.appendChild(i),n}function Tc(t,e=1){let n=t.filter(i=>i.content).map(i=>({height:i.content.height}));if(n.length===0)return hn;let r=zr(n,e).reduce((i,o)=>Math.max(i,o.reduce((l,a)=>l+a.height,0)),0);return hn+r}function $c(t,e,n,r,i=1){let o=r.createElement("div");o.className="layout-footnote-area",o.style.width=`${e}px`;let l=r.createElement("div"),a=.5,s=(hn-a)/2;l.style.width="33%",l.style.height=`${a}px`,l.style.backgroundColor="#000",l.style.marginBottom=`${s}px`,l.style.marginTop=`${s}px`,o.appendChild(l);let u=(c,m)=>c.content?Sc(c.content,m,n,r):Cc(c,r),p=Math.max(1,Math.floor(i));if(p<=1){for(let c of t)o.appendChild(u(c,e));return o}let d=Math.max(1,(e-(p-1)*Gl)/p),f=zr(t.map(c=>({fn:c,height:c.content?.height??0})),p),h=r.createElement("div");h.className="layout-footnote-columns",h.style.display="flex",h.style.alignItems="flex-start",h.style.gap=`${Gl}px`;for(let c of f){let m=r.createElement("div");m.className="layout-footnote-column",m.style.flex=`0 0 ${d}px`,m.style.width=`${d}px`;for(let{fn:g}of c)m.appendChild(u(g,d));h.appendChild(m)}return o.appendChild(h),o}function Nr(t,e,n){let r={pageNumber:t.number,totalPages:e,section:"body",resolvedCommentIds:n.resolvedCommentIds},i={...n};if(n.titlePg&&t.number===1&&(i.headerContent=n.firstPageHeaderContent,i.footerContent=n.firstPageFooterContent),n.footnotesByPage){let o=n.footnotesByPage.get(t.number);o&&o.length>0&&(i.footnoteArea=o)}return{context:r,pageOptions:i}}function Zl(t){let e=[];e.push(`s:${t.size.w},${t.size.h}`),e.push(`m:${t.margins.top},${t.margins.right},${t.margins.bottom},${t.margins.left}`),e.push(`n:${t.number}`),t.footnoteReservedHeight&&e.push(`fn:${t.footnoteReservedHeight}`);for(let n of t.fragments){let r=`${n.kind}:${n.blockId},${n.x},${n.y},${n.width},${n.height}`;n.pmStart!==void 0&&(r+=`,ps:${n.pmStart}`),n.pmEnd!==void 0&&(r+=`,pe:${n.pmEnd}`),n.kind==="paragraph"?r+=`,fl:${n.fromLine},tl:${n.toLine}`:n.kind==="table"&&(r+=`,fr:${n.fromRow},tr:${n.toRow}`),e.push(r)}return e.join("|")}function Ic(t){let e=[];return t.headerContent&&e.push(`hdr:${t.headerContent.blocks.length},${t.headerContent.height},${t.headerContent.visualTop??0},${t.headerContent.visualBottom??t.headerContent.height}`),t.footerContent&&e.push(`ftr:${t.footerContent.blocks.length},${t.footerContent.height},${t.footerContent.visualTop??0},${t.footerContent.visualBottom??t.footerContent.height}`),t.firstPageHeaderContent&&e.push(`fp-hdr:${t.firstPageHeaderContent.blocks.length},${t.firstPageHeaderContent.height}`),t.firstPageFooterContent&&e.push(`fp-ftr:${t.firstPageFooterContent.blocks.length},${t.firstPageFooterContent.height}`),t.titlePg&&e.push("titlePg"),t.theme&&e.push(`thm:${t.theme.name??"default"}`),t.pageBorders&&e.push(`pb:${JSON.stringify(t.pageBorders)}`),t.headerDistance!==void 0&&e.push(`hd:${t.headerDistance}`),t.footerDistance!==void 0&&e.push(`fd:${t.footerDistance}`),e.join("|")}function Fc(t,e){t.style.display="flex",t.style.flexDirection="column",t.style.alignItems="center",t.style.gap=`${e}px`,t.style.padding=`${e}px`,t.style.backgroundColor="var(--doc-bg, #f8f9fa)"}var sn=2,Pc=8;function $0(t,e,n={}){let r=t.length,i=n.pageGap??24,o=e,l=o.__pageRenderState,a=Ic(n),s=r>=Pc;if(l&&l.optionsHash===a&&s){let m=l.pageStates,g=l.pageDataMap,v=o.__pageObserver,C=[];for(let x of t)C.push(Zl(x));let y=l.totalPages!==r,k=Math.min(m.length,t.length);for(let x=0;x<k;x++){let w=m[x],I=C[x];if(w.fingerprint===I&&!y){let E=g.get(w.element);E&&(E.page=t[x]);continue}let F=w.element,$=g.get(F);$&&($.page=t[x],$.rendered&&Rc(F,g,r,n)),w.fingerprint=I,dn(F,t[x].size.w,t[x].size.h,n),F.dataset.pageNumber=String(t[x].number)}if(t.length>m.length){let x=n.document??document;for(let w=m.length;w<t.length;w++){let I=t[w],F=x.createElement("div");F.className=n.pageClassName??pt.page,F.dataset.pageNumber=String(I.number),F.dataset.pageIndex=String(w),dn(F,I.size.w,I.size.h,n),e.appendChild(F),m.push({element:F,fingerprint:C[w]}),g.set(F,{page:I,index:w,rendered:!1}),v&&v.observe(F)}}if(t.length<m.length){for(let x=m.length-1;x>=t.length;x--){let w=m[x].element;v&&v.unobserve(w),g.delete(w),e.removeChild(w)}m.length=t.length}for(let x=0;x<m.length;x++){let w=g.get(m[x].element);w&&(w.index=x)}return l.totalPages=r,l.currentOptions=n,"incremental"}let u=o.__pageObserver;u&&(u.disconnect(),o.__pageObserver=void 0),e.innerHTML="",o.__pageRenderState=void 0,Fc(e,i);let p=[],d=[];for(let m=0;m<t.length;m++){let g=t[m];if(d.push(Zl(g)),s){let v=(n.document??document).createElement("div");v.className=n.pageClassName??pt.page,v.dataset.pageNumber=String(g.number),v.dataset.pageIndex=String(m),dn(v,g.size.w,g.size.h,n),e.appendChild(v),p.push(v)}else{let{context:v,pageOptions:C}=Nr(g,r,n),y=Or(g,v,C);e.appendChild(y),p.push(y)}}if(!s)return"full";let f=new Map;for(let m=0;m<t.length;m++)f.set(p[m],{page:t[m],index:m,rendered:!1});let h=new IntersectionObserver(m=>{let g=o.__pageRenderState;if(!g)return;let{currentOptions:v,totalPages:C,pageDataMap:y}=g;for(let I of m){let F=I.target,$=y.get(F);if($&&I.isIntersecting){Te(F,y,C,v);for(let E=-sn;E<=sn;E++){let P=$.index+E;P>=0&&P<g.pageStates.length&&P!==$.index&&Te(g.pageStates[P].element,y,C,v)}}}let k=window.innerHeight,x=k*3,w=new Set;for(let[I,F]of y){if(!F.rendered)continue;let $=I.getBoundingClientRect();$.bottom>-x&&$.top<k+x&&w.add(F.index)}for(let[I,F]of y){if(!F.rendered)continue;let $=!1;for(let E of w)if(Math.abs(F.index-E)<=sn+1){$=!0;break}!$&&w.size>0&&Ec(I,y)}},{root:null,rootMargin:"1500px 0px 1500px 0px"});for(let m of p)h.observe(m);o.__pageObserver=h,o.__pageRenderState={pageStates:p.map((m,g)=>({element:m,fingerprint:d[g]})),totalPages:r,optionsHash:a,pageDataMap:f,currentOptions:n};let c=Math.min(t.length,sn+3);for(let m=0;m<c;m++)Te(p[m],f,r,n);return"full"}function Te(t,e,n,r){let i=e.get(t);if(!i||i.rendered)return;let{context:o,pageOptions:l}=Nr(i.page,n,r),a=Or(i.page,o,l);for(;a.firstChild;)t.appendChild(a.firstChild);i.rendered=!0}function Rc(t,e,n,r){let i=e.get(t);if(!i)return;let{context:o,pageOptions:l}=Nr(i.page,n,r),a=Or(i.page,o,l).querySelector(`.${pt.content}`),s=t.querySelector(`.${pt.content}`);a&&s?t.replaceChild(a,s):(t.innerHTML="",i.rendered=!1,Te(t,e,n,r))}function Ec(t,e){let n=e.get(t);!n||!n.rendered||(t.innerHTML="",n.rendered=!1)}function I0(t){let e=t.__pageRenderState;if(!e)return 0;let{pageStates:n,totalPages:r,currentOptions:i,pageDataMap:o}=e,l=0;for(let{element:a}of n){let s=o.get(a);!s||s.rendered||(Te(a,o,r,i),l++)}return l}var pt={page:"layout-page",content:"layout-page-content",header:"layout-page-header",footer:"layout-page-footer"};function dn(t,e,n,r){t.style.position="relative",t.style.width=`${e}px`,t.style.height=`${n}px`,t.style.backgroundColor=r.backgroundColor??"var(--doc-page-bg, #ffffff)",t.style.overflow="hidden",t.style.fontFamily=Tt("Calibri").cssFallback,t.style.fontSize=`${1056/72}px`,t.style.color="var(--doc-page-text, #000000)",r.showBorders&&(t.style.border="1px solid #ccc"),r.showShadow&&(t.style.boxShadow="0 2px 8px rgba(0, 0, 0, 0.15)")}function Mc(t,e){switch(e??"allPages"){case"firstPage":return t===1;case"notFirstPage":return t!==1;default:return!0}}function pn(t){return t?.space!==void 0?Le(t.space):0}function un(t,e,n,r){if(!e||e.style==="none"||e.style==="nil")return;let i=wi(e,n,r);for(let[a,s]of Object.entries(i))t.style[a]=String(s);let o=`border${n}Style`,l=`border${n}Width`;if(t.style[o]==="double"){let a=parseFloat(t.style[l]);(!Number.isFinite(a)||a<3)&&(t.style[l]="3px")}}function Bc(t,e,n){let r=e.pageBorders;if(!r||!Mc(t.number,r.display)||![r.top,r.bottom,r.left,r.right].some(p=>p&&p.style!=="none"&&p.style!=="nil"))return null;let i=r.offsetFrom??"text",o=pn(r.top),l=pn(r.right),a=pn(r.bottom),s=pn(r.left),u=n.createElement("div");return u.className="layout-page-border",u.style.position="absolute",u.style.pointerEvents="none",u.style.boxSizing="border-box",u.style.zIndex=r.zOrder==="back"?"0":"20",i==="page"?(u.style.top=`${o}px`,u.style.right=`${l}px`,u.style.bottom=`${a}px`,u.style.left=`${s}px`):(u.style.top=`${Math.max(0,t.margins.top-o)}px`,u.style.right=`${Math.max(0,t.margins.right-l)}px`,u.style.bottom=`${Math.max(0,t.margins.bottom-a)}px`,u.style.left=`${Math.max(0,t.margins.left-s)}px`),un(u,r.top,"Top",e.theme),un(u,r.bottom,"Bottom",e.theme),un(u,r.left,"Left",e.theme),un(u,r.right,"Right",e.theme),u}function Lc(t,e){let n=e.margins;t.style.position="absolute",t.style.top=`${n.top}px`,t.style.left=`${n.left}px`,t.style.right=`${n.right}px`,t.style.bottom=`${n.bottom}px`,t.style.overflow="visible"}function Ac(t,e,n){t.style.position="absolute",t.style.left=`${e.x-n.left}px`;let r=e.y-n.top;t.style.top=`${e.kind==="table"?Math.round(r):r}px`,t.style.width=`${e.width}px`,"height"in e&&e.kind!=="table"&&(t.style.height=`${e.height}px`)}function zc(t,e,n,r){let i=[];for(let o of t.runs){if(o.kind!=="image")continue;let l=o;if(!Ht(l))continue;let a=l.distTop??0,s=l.distBottom??0,u=l.distLeft??12,p=l.distRight??12,{x:d,y:f,side:h}=kr(l,e,n,r);i.push({src:l.src,width:l.width,height:l.height,alt:l.alt,transform:l.transform,side:h,x:d,y:f,distTop:a,distBottom:s,distLeft:u,distRight:p,pmStart:l.pmStart,pmEnd:l.pmEnd,wrapText:vr(l.cssFloat),wrapType:l.wrapType,cropTop:l.cropTop,cropRight:l.cropRight,cropBottom:l.cropBottom,cropLeft:l.cropLeft,opacity:l.opacity})}return i}function Or(t,e,n={}){let r=n.document??document,i=r.createElement("div");if(i.className=n.pageClassName??pt.page,i.dataset.pageNumber=String(t.number),dn(i,t.size.w,t.size.h,n),n.watermark){let y=hc(n.watermark,t,r);y&&i.appendChild(y)}let o=Bc(t,n,r);o&&n.pageBorders?.zOrder==="back"&&i.appendChild(o);let l=r.createElement("div");l.className=pt.content,Lc(l,t);let a=zl(t),s=a.contentWidth,u=[],p=[];for(let y of t.fragments)if(y.kind==="paragraph"&&n.blockLookup){let k=n.blockLookup.get(String(y.blockId));if(k?.block.kind==="paragraph"){let x=k.block,w=y.y-t.margins.top,I=zc(x,w,s,a);u.push(...I)}}for(let y of u)xr(y)&&p.push({side:y.side,x:y.x,y:y.y,width:y.width,height:y.height,distTop:y.distTop,distBottom:y.distBottom,distLeft:y.distLeft,distRight:y.distRight,wrapText:y.wrapText,wrapType:y.wrapType});if(n.blockLookup)for(let y of t.fragments){if(y.kind!=="table")continue;let k=n.blockLookup.get(String(y.blockId));if(k?.block.kind!=="table")continue;let x=k.block.floating;if(!x)continue;let w=y.x-t.margins.left,I=y.y-t.margins.top,F=x.topFromText??0,$=x.bottomFromText??0,E=x.leftFromText??12,P=x.rightFromText??12,R=w<s/2?"left":"right";p.push({side:R,x:w,y:I,width:y.width,height:y.height,distTop:F,distBottom:$,distLeft:E,distRight:P})}if(n.blockLookup)for(let y of t.fragments){if(y.kind!=="textBox")continue;let k=n.blockLookup.get(String(y.blockId));if(k?.block.kind!=="textBox")continue;let x=k.block;if(!Ot(x))continue;let w=y.y-t.margins.top,I=kr({width:y.width,height:y.height,position:x.position,cssFloat:x.cssFloat},w,s,a);y.x=t.margins.left+I.x,y.y=t.margins.top+I.y,!(!Mi(x)&&!Bi(x))&&p.push({side:I.side,x:I.x,y:I.y,width:y.width,height:y.height,distTop:x.distTop??0,distBottom:x.distBottom??0,distLeft:x.distLeft??12,distRight:x.distRight??12,wrapText:x.wrapText,wrapType:x.wrapType})}let d=p.length>0?Ui(p,s):[],f=u.filter(ke),h=u.filter(y=>!ke(y));if(f.length>0){let y=cn(f,r,{layerClass:"layout-floating-images-layer",itemClass:"layout-page-floating-image",sizing:"inset0",layerMode:"behind"});l.appendChild(y)}let c=y=>{if(y.kind!=="paragraph"||!n.blockLookup||!y.blockId)return;let k=n.blockLookup.get(String(y.blockId));if(k?.block.kind==="paragraph")return k.block.attrs?.borders},m,g=new Map,v=y=>!n.blockLookup||!y.blockId?[]:n.blockLookup.get(String(y.blockId))?.block.sdtGroups??[],C=(y,k)=>{if(k.length===0)return;let x=k[k.length-1];y.classList.add("layout-block-sdt"),y.dataset.sdtGroupId=x.id,y.dataset.sdtType=x.sdtType,y.dataset.sdtDepth=String(k.length),x.tag!=null&&(y.dataset.sdtTag=x.tag),x.alias!=null&&(y.dataset.sdtAlias=x.alias),x.lock!=null&&(y.dataset.sdtLock=x.lock)};for(let y=0;y<t.fragments.length;y++){let k=t.fragments[y],x,w={...e,section:"body",contentWidth:s},I=k.y-t.margins.top;if(n.blockLookup&&k.blockId){let F=n.blockLookup.get(String(k.blockId));if(k.kind==="paragraph"&&F?.block.kind==="paragraph"&&F?.measure.kind==="paragraph"){let $=F.block,E=y+1<t.fragments.length?c(t.fragments[y+1]):void 0,P=String(k.blockId),R=g.get(P);R||(R=new Set,g.set(P,R));let T=F.measure;d.length>0&&(T=Gn($,s,{floatingZones:d,paragraphYOffset:I})),x=Ie(k,$,T,w,{document:r,prevBorders:m,nextBorders:E,renderedInlineImageKeys:R}),m=$.attrs?.borders}else k.kind==="table"&&F?.block.kind==="table"&&F?.measure.kind==="table"?(x=Lr(k,F.block,F.measure,w,{document:r}),m=void 0):k.kind==="image"&&F?.block.kind==="image"&&F?.measure.kind==="image"?(x=Br(k,F.block,F.measure,w,{document:r}),m=void 0):k.kind==="textBox"&&F?.block.kind==="textBox"&&F?.measure.kind==="textBox"?(x=Ar(k,F.block,F.measure,w,{document:r}),m=void 0):(x=Dl(k,w,{document:r}),m=void 0)}else x=Dl(k,w,{document:r}),m=void 0;Ac(x,k,{left:t.margins.left,top:t.margins.top}),C(x,v(k)),l.appendChild(x)}if(If(t,l,s,v,r),h.length>0){let y=cn(h,r,{layerClass:"layout-floating-images-layer",itemClass:"layout-page-floating-image",sizing:"inset0",layerMode:"front"});l.appendChild(y)}if(t.columns&&t.columns.separator&&t.columns.count>1){let y=t.columns.count,k=t.columns.gap,x=(s-(y-1)*k)/y,w=t.size.h-t.margins.top-t.margins.bottom;for(let I=0;I<y-1;I++){let F=(I+1)*x+I*k+k/2,$=r.createElement("div");$.style.position="absolute",$.style.left=`${F}px`,$.style.top="0",$.style.height=`${w}px`,$.style.width="0.5px",$.style.backgroundColor="#000",$.style.pointerEvents="none",l.appendChild($)}}if(n.footnoteArea&&n.footnoteArea.length>0){let y=t.footnoteColumns??1,k=$c(n.footnoteArea,s,e,r,y);k.style.position="absolute";let x=Math.max(t.footnoteReservedHeight??0,Tc(n.footnoteArea,y)),w=t.size.h-t.margins.bottom-t.margins.top;k.style.top=`${Math.max(-t.margins.top,w-x)}px`,k.style.left="0",k.style.right="0",l.appendChild(k)}i.appendChild(l);{let y=n.headerDistance??t.margins.header??48,k=t.size.w-t.margins.left-t.margins.right,x=Math.max(t.margins.top-y,48),w=n.headerContent?.visualTop??0,I=n.headerContent?.visualBottom??n.headerContent?.height??0,F=n.headerContent?.flowHeight??n.headerContent?.height??0,$=Math.max(F-Math.min(0,w),24),E=I>x,P=r.createElement("div");P.className=pt.header,P.style.position="absolute",P.style.top=`${y+w}px`,P.style.left=`${t.margins.left}px`,P.style.right=`${t.margins.right}px`,P.style.width=`${k}px`,P.style.height=`${$}px`,P.style.minHeight=`${$}px`;let R=!E;if(n.headerContent&&n.headerContent.blocks.length>0){let T={flowTop:y,flowLeft:t.margins.left,contentWidth:k,pageWidth:t.size.w,pageHeight:t.size.h,margins:t.margins},M=Yl(n.headerContent,{...e,section:"header",contentWidth:k},n,T);M.style.top=`${-w}px`,M.querySelector("img")&&(R=!1),P.appendChild(M)}R&&(P.style.maxHeight=`${x}px`,P.style.overflow="hidden"),i.appendChild(P)}{let y=n.footerDistance??t.margins.footer??48,k=t.size.w-t.margins.left-t.margins.right,x=Math.max(t.margins.bottom-y,48),w=n.footerContent?.visualTop??0,I=n.footerContent?.visualBottom??n.footerContent?.height??0,F=Math.max(I-w,24),$=F>x,E=n.footerContent?.flowHeight??n.footerContent?.height??0,P=Math.max(E-Math.min(0,w),24),R=r.createElement("div");R.className=pt.footer,R.style.position="absolute",R.style.top=`${t.size.h-y-P}px`,R.style.left=`${t.margins.left}px`,R.style.right=`${t.margins.right}px`,R.style.width=`${k}px`,R.style.height=`${P}px`,R.style.minHeight=`${P}px`;let T=!$;if(n.footerContent&&n.footerContent.blocks.length>0){let M={flowTop:t.size.h-y-(n.footerContent?.height??0),flowLeft:t.margins.left,contentWidth:k,pageWidth:t.size.w,pageHeight:t.size.h,margins:t.margins},B=Yl(n.footerContent,{...e,section:"footer",contentWidth:k},n,M);B.style.top=`${-w-(F-P)}px`,B.querySelector("img")&&(T=!1),R.appendChild(B)}T&&(R.style.maxHeight=`${x}px`,R.style.overflow="hidden"),i.appendChild(R)}return o&&n.pageBorders?.zOrder!=="back"&&i.appendChild(o),i}var Nc=30,R0=200,Oc=24,Hc=10,Dc=10,Wc=24;function E0(t){let{mouseX:e,mouseY:n,pagesContainer:r,target:i,hfEditMode:o,edgeProximity:l=Nc}=t,a=`.${ot.table}`,s=`.${ot.row}`,u=`.${ot.cell}`,p=`.${pt.header}`,d=`.${pt.footer}`,f=y=>{let k=!!y.closest(p),x=!!y.closest(d);return!k&&!x?!o:k?o==="header":o==="footer"},h=i.closest(a);if(h&&!f(h)&&(h=null),!h){let y=r.querySelectorAll(a);for(let k of Array.from(y)){if(!f(k))continue;let x=k.getBoundingClientRect(),w=e>=x.left-l&&e<x.left,I=n>=x.top-l&&n<x.top,F=e>=x.left-l&&e<=x.right,$=n>=x.top-l&&n<=x.bottom;if(w&&$||I&&F){h=k;break}}}if(!h)return null;let c=h.getBoundingClientRect(),m=e<c.left+l&&e>=c.left-l,g=n<c.top+l&&n>=c.top-l;if(!m&&!g)return null;let v=h.querySelectorAll(`:scope > ${s}`);if(v.length===0)return null;let C=y=>y&&Number(y.dataset.pmStart)||0;if(m)for(let y=0;y<v.length;y++){let k=v[y].getBoundingClientRect();if(n>=k.top&&n<=k.bottom){let x=v[y].querySelector(u),w=C(x);if(!w)break;return{type:"row",clientX:c.left-Oc,clientY:k.top+k.height/2-Hc,cellPmPos:w}}}if(g){let y=v[0].querySelectorAll(`:scope > ${u}`);for(let k=0;k<y.length;k++){let x=y[k].getBoundingClientRect();if(e>=x.left&&e<=x.right){let w=C(y[k]);if(!w)break;return{type:"column",clientX:x.left+x.width/2-Dc,clientY:c.top-Wc,cellPmPos:w}}}}return null}var gn=".layout-page-content";function ua(t){return Array.from(t.querySelectorAll(`${gn} span[data-pm-start][data-pm-end]`))}function jc(t){return Array.from(t.querySelectorAll(`${gn} .layout-empty-run`))}function B0(t){return Array.from(t.querySelectorAll(`${gn} [data-pm-start]`))}function L0(t,e){return Number.isFinite(e)?t.querySelector(`${gn} [data-pm-start="${e}"]`):null}function A0(t,e,n,r=1){let i=document.elementsFromPoint(e,n),o=i.find(p=>p.classList.contains("layout-page"));if(!o)return null;let l=i.find(p=>p.tagName==="SPAN"&&p.dataset.pmStart!==void 0&&p.dataset.pmEnd!==void 0);if(l)return Hr(l,e);let a=i.find(p=>p.classList.contains("layout-empty-run"));if(a){let p=a.closest(".layout-paragraph");if(p&&p.dataset.pmStart)return Number(p.dataset.pmStart)}let s=i.find(p=>p.classList.contains("layout-paragraph")&&p.dataset.pmStart!==void 0);if(s&&s.dataset.pmStart){let p=oa(s,e,n);return p!==null?p:Number(s.dataset.pmStart)}let u=i.find(p=>p.classList.contains("layout-table-cell"));return u?oa(u,e,n):_c(t,o,e,n)}function Hr(t,e,n){let r=Number(t.dataset.pmStart),i=Number(t.dataset.pmEnd);if(t.classList.contains("layout-run-tab")){let d=t.getBoundingClientRect(),f=(d.left+d.right)/2;return e<f?r:i}let o=t.firstChild;if(!o||o.nodeType!==Node.TEXT_NODE)return r;let l=o,a=l.length;if(a===0)return r;let s=t.ownerDocument;if(!s)return r;let u=0,p=a;for(;u<p;){let d=Math.floor((u+p)/2),f=s.createRange();f.setStart(l,d),f.setEnd(l,d);let h=f.getBoundingClientRect().left;e<h?p=d:u=d+1}if(u>0&&u<=a){let d=s.createRange();d.setStart(l,u-1),d.setEnd(l,u-1);let f=d.getBoundingClientRect();d.setStart(l,Math.min(u,a)),d.setEnd(l,Math.min(u,a));let h=d.getBoundingClientRect(),c=Math.abs(e-f.left),m=Math.abs(e-h.left);if(c<m)return r+(u-1)}return r+Math.min(u,i-r)}function oa(t,e,n){let r=t.querySelector(".layout-empty-run");if(r){let d=r.closest(".layout-paragraph");if(d&&d.dataset.pmStart)return Number(d.dataset.pmStart)}let i=t.querySelectorAll(".layout-line"),o=null,l=1/0;for(let d of Array.from(i)){let f=d,h=f.getBoundingClientRect(),c=(h.top+h.bottom)/2,m=Math.abs(n-c);m<l&&(l=m,o=f)}if(!o){let d=t.querySelector(".layout-paragraph[data-pm-start]");return d?.dataset.pmStart?Number(d.dataset.pmStart):t.dataset.pmStart?Number(t.dataset.pmStart):null}let a=o.querySelectorAll("span[data-pm-start][data-pm-end]");if(a.length===0){let d=o.closest(".layout-paragraph");return d?.dataset.pmStart?Number(d.dataset.pmStart):null}let s=null,u=1/0;for(let d of Array.from(a)){let f=d,h=f.getBoundingClientRect();if(e>=h.left&&e<=h.right)return Hr(f,e);let c=e<h.left?h.left-e:e-h.right;c<u&&(u=c,s=f)}if(!s)return null;let p=s.getBoundingClientRect();return e<p.left?Number(s.dataset.pmStart):Number(s.dataset.pmEnd)}function _c(t,e,n,r,i){if(e.querySelectorAll("span[data-pm-start][data-pm-end]").length===0){let f=e.querySelectorAll(".layout-paragraph");if(f.length>0){let h=f[0];return Number(h.dataset.pmStart)||0}return null}let o=e.querySelectorAll(".layout-line"),l=null,a=1/0;for(let f of Array.from(o)){let h=f,c=h.getBoundingClientRect(),m=(c.top+c.bottom)/2,g=Math.abs(r-m);g<a&&(a=g,l=h)}if(!l)return null;let s=l.querySelectorAll("span[data-pm-start][data-pm-end]");if(s.length===0){let f=l.closest(".layout-paragraph");return f?.dataset.pmStart?Number(f.dataset.pmStart):null}let u=null,p=1/0;for(let f of Array.from(s)){let h=f,c=h.getBoundingClientRect();if(n>=c.left&&n<=c.right)return Hr(h,n);let m=n<c.left?c.left-n:n-c.right;m<p&&(p=m,u=h)}if(!u)return null;let d=u.getBoundingClientRect();return n<d.left?Number(u.dataset.pmStart):Number(u.dataset.pmEnd)}var Xc=.5;function da(t,e){let n=t.closest(".layout-table:not(.layout-nested-table)");if(!n)return{left:e.left,top:e.top,right:e.right,bottom:e.bottom};let r=n.getBoundingClientRect(),i=Math.max(e.top,r.top),o=Math.min(e.bottom,r.bottom);return o-i<=Xc?null:{left:e.left,top:i,right:e.right,bottom:o}}var qc=4;function la(t,e){let n=(t.closest(".layout-line")??t).getBoundingClientRect(),r=t.getBoundingClientRect().left,i=da(t,{left:r,top:n.top,right:r+qc,bottom:n.bottom});if(!i)return null;let o=t.closest(".layout-page");return{x:i.left-e.left,y:i.top-e.top,width:i.right-i.left,height:i.bottom-i.top,pageIndex:o?Number(o.dataset.pageNumber||1)-1:0}}function Uc(t){let e=t.closest(".layout-paragraph");if(!e)return null;let n=Number(e.dataset.pmStart),r=Number(e.dataset.pmEnd);return!Number.isFinite(n)||!Number.isFinite(r)?null:{pmStart:n,pmEnd:r}}function z0(t,e,n,r){let i=[],o=ua(t);for(let l of Array.from(o)){let a=l,s=Number(a.dataset.pmStart),u=Number(a.dataset.pmEnd);if(u<=e||s>=n)continue;let p=a.closest(".layout-page"),d=p?Number(p.dataset.pageNumber||1)-1:0,f=C=>{let y=da(a,C);y&&i.push({x:y.left-r.left,y:y.top-r.top,width:y.right-y.left,height:y.bottom-y.top,pageIndex:d})};if(s===u){let C=la(a,r);C&&i.push(C);continue}if(a.classList.contains("layout-run-tab")){f(a.getBoundingClientRect());continue}let h=null;if(a.firstChild?.nodeType===Node.TEXT_NODE?h=a.firstChild:a.firstChild?.nodeType===Node.ELEMENT_NODE&&a.firstChild.tagName==="A"&&a.firstChild.firstChild?.nodeType===Node.TEXT_NODE&&(h=a.firstChild.firstChild),!h)continue;let c=a.ownerDocument;if(!c)continue;let m=Math.max(0,e-s),g=Math.min(h.length,n-s);if(m>=g)continue;let v=c.createRange();v.setStart(h,m),v.setEnd(h,g);for(let C of Array.from(v.getClientRects()))f(C)}for(let l of jc(t)){let a=Uc(l);if(!a||a.pmEnd<=e||a.pmStart>=n)continue;let s=la(l,r);s&&i.push(s)}return i}function aa(t,e){let n=t.closest(".layout-table:not(.layout-nested-table)");if(!n)return!1;let r=n.getBoundingClientRect(),i=(e.top+e.bottom)/2;return i<r.top-.5||i>r.bottom+.5}function sa(t,e,n,r,i){let o=t.closest(".layout-page"),l=o?Number(o.dataset.pageNumber||1)-1:0,a=t.closest(".layout-line"),s=a?a.offsetHeight:16,u=t.firstChild;if(t.classList.contains("layout-run-tab")||!u||u.nodeType!==Node.TEXT_NODE){let c=t.getBoundingClientRect();return{x:c.left-r.left,y:c.top-r.top,height:s,pageIndex:l}}let p=u,d=Math.min(e-n,p.length),f=t.ownerDocument.createRange();f.setStart(p,d),f.setEnd(p,d);let h=f.getBoundingClientRect();return{x:h.left-r.left,y:h.top-r.top,height:h.height?h.height/i:s,pageIndex:l}}function N0(t,e,n,r=1){let i=ua(t),o=null,l=0;for(let u of Array.from(i)){let p=u,d=Number(p.dataset.pmStart),f=Number(p.dataset.pmEnd);if(!(p.classList.contains("layout-run-tab")?e>=d&&e<f:e>=d&&e<=f))continue;let h=p.getBoundingClientRect();if(aa(p,h)){o||(o=p,l=d);continue}return sa(p,e,d,n,r)}if(o)return sa(o,e,l,n,r);let a=t.querySelectorAll(".layout-paragraph"),s=null;for(let u of Array.from(a)){let p=u,d=Number(p.dataset.pmStart),f=Number(p.dataset.pmEnd);if(e>=d&&e<=f){let h=p.querySelector(".layout-empty-run")||p,c=h.getBoundingClientRect();if(aa(p,c)){s||(s={el:p,targetEl:h});continue}return pa(p,h,n)}}return s?pa(s.el,s.targetEl,n):null}function pa(t,e,n){let r=e.getBoundingClientRect(),i=t.closest(".layout-page"),o=i?Number(i.dataset.pageNumber||1)-1:0,l=(e.closest(".layout-line")||e).offsetHeight||16;return{x:r.left-n.left,y:r.top-n.top,height:l,pageIndex:o}}var ga=ai(bi(),1);async function Vc(t){let e=await ga.default.loadAsync(t),n={documentXml:null,stylesXml:null,themeXml:null,numberingXml:null,fontTableXml:null,settingsXml:null,webSettingsXml:null,headers:new Map,footers:new Map,footnotesXml:null,endnotesXml:null,commentsXml:null,commentsExtensibleXml:null,commentsExtendedXml:null,documentRels:null,packageRels:null,contentTypesXml:null,corePropsXml:null,appPropsXml:null,customPropsXml:null,media:new Map,fonts:new Map,allXml:new Map,originalZip:e,originalBuffer:t};for(let[r,i]of Object.entries(e.files)){if(i.dir)continue;let o=r.toLowerCase();if(o.endsWith(".xml")||o.endsWith(".rels")){let l=await i.async("text");if(n.allXml.set(r,l),o==="word/document.xml")n.documentXml=l;else if(o==="word/styles.xml")n.stylesXml=l;else if(o==="word/theme/theme1.xml")n.themeXml=l;else if(o==="word/numbering.xml")n.numberingXml=l;else if(o==="word/fonttable.xml")n.fontTableXml=l;else if(o==="word/settings.xml")n.settingsXml=l;else if(o==="word/websettings.xml")n.webSettingsXml=l;else if(o==="word/footnotes.xml")n.footnotesXml=l;else if(o==="word/endnotes.xml")n.endnotesXml=l;else if(o==="word/comments.xml")n.commentsXml=l;else if(o==="word/commentsextensible.xml")n.commentsExtensibleXml=l;else if(o==="word/commentsextended.xml")n.commentsExtendedXml=l;else if(o==="word/_rels/document.xml.rels")n.documentRels=l;else if(o==="_rels/.rels")n.packageRels=l;else if(o==="[content_types].xml")n.contentTypesXml=l;else if(o==="docprops/core.xml")n.corePropsXml=l;else if(o==="docprops/app.xml")n.appPropsXml=l;else if(o==="docprops/custom.xml")n.customPropsXml=l;else if(o.match(/^word\/header\d+\.xml$/)){let a=r.split("/").pop()||r;n.headers.set(a,l)}else if(o.match(/^word\/footer\d+\.xml$/)){let a=r.split("/").pop()||r;n.footers.set(a,l)}}else if(o.startsWith("word/media/")){let l=await i.async("arraybuffer");n.media.set(r,l)}else if(o.startsWith("word/fonts/")){let l=await i.async("arraybuffer");n.fonts.set(r,l)}}return n}function Yc(t){switch(t.toLowerCase().split(".").pop()){case"png":return"image/png";case"jpg":case"jpeg":return"image/jpeg";case"gif":return"image/gif";case"bmp":return"image/bmp";case"tif":case"tiff":return"image/tiff";case"wmf":return"image/x-wmf";case"emf":return"image/x-emf";case"svg":return"image/svg+xml";case"webp":return"image/webp";default:return"application/octet-stream"}}function Gc(t){if(!t)return;let e=J(t,"w","tab");if(e.length===0)return;let n=[];for(let r of e){let i=L(r,"w","pos"),o=b(r,"w","val");if(i!==void 0&&o){let l={position:i,alignment:o},a=b(r,"w","leader");a&&(l.leader=a),n.push(l)}}return n.length>0?n:void 0}function Dr(t,e){if(!t)return;let n={},r=S(t,"w","jc");if(r){let x=b(r,"w","val");x&&(n.alignment=x)}let i=S(t,"w","bidi");i&&(n.bidi=D(i));let o=S(t,"w","spacing");if(o){let x=L(o,"w","before");x!==void 0&&(n.spaceBefore=x);let w=L(o,"w","after");w!==void 0&&(n.spaceAfter=w);let I=L(o,"w","line");I!==void 0&&(n.lineSpacing=I);let F=b(o,"w","lineRule");F&&(n.lineSpacingRule=F);let $=b(o,"w","beforeAutospacing");$&&(n.beforeAutospacing=$==="1"||$==="true");let E=b(o,"w","afterAutospacing");E&&(n.afterAutospacing=E==="1"||E==="true")}let l=S(t,"w","ind");if(l){let x=L(l,"w","left");x!==void 0&&(n.indentLeft=x);let w=L(l,"w","right");w!==void 0&&(n.indentRight=w);let I=L(l,"w","firstLine");I!==void 0&&(n.indentFirstLine=I);let F=L(l,"w","hanging");F!==void 0&&(n.indentFirstLine=-F,n.hangingIndent=!0)}let a=ur(S(t,"w","pBdr"));a&&(n.borders=a);let s=S(t,"w","shd");s&&(n.shading=me(s));let u=S(t,"w","tabs");u&&(n.tabs=Gc(u));let p=S(t,"w","keepNext");p&&(n.keepNext=D(p));let d=S(t,"w","keepLines");d&&(n.keepLines=D(d));let f=S(t,"w","widowControl");f&&(n.widowControl=D(f));let h=S(t,"w","pageBreakBefore");h&&(n.pageBreakBefore=D(h));let c=S(t,"w","contextualSpacing");c&&(n.contextualSpacing=D(c));let m=S(t,"w","numPr");if(m){let x=S(m,"w","numId"),w=S(m,"w","ilvl");if(x||w){if(n.numPr={},x){let I=L(x,"w","val");I!==void 0&&(n.numPr.numId=I)}if(w){let I=L(w,"w","val");I!==void 0&&(n.numPr.ilvl=I)}}}let g=S(t,"w","outlineLvl");if(g){let x=L(g,"w","val");x!==void 0&&(n.outlineLevel=x)}let v=S(t,"w","pStyle");if(v){let x=b(v,"w","val");x&&(n.styleId=x)}let C=S(t,"w","suppressLineNumbers");C&&(n.suppressLineNumbers=D(C));let y=S(t,"w","suppressAutoHyphens");y&&(n.suppressAutoHyphens=D(y));let k=S(t,"w","rPr");return k&&(n.runProperties=ge(k,e)),Object.keys(n).length>0?n:void 0}function xt(t){if(!t)return;let e=L(t,"w","w"),n=b(t,"w","type");if(e!==void 0&&n)return{value:e,type:n}}function wa(t){if(!t)return;let e={},n=xt(S(t,"w","top"));n&&(e.top=n);let r=xt(S(t,"w","bottom"));r&&(e.bottom=r);let i=xt(S(t,"w","left"));i&&(e.left=i);let o=xt(S(t,"w","right"));return o&&(e.right=o),Object.keys(e).length>0?e:void 0}function Zc(t){if(!t)return;let e={},n=b(t,"w","val");if(n){let u=parseInt(n,16);isNaN(u)||(e.firstRow=(u&32)!==0,e.lastRow=(u&64)!==0,e.firstColumn=(u&128)!==0,e.lastColumn=(u&256)!==0,e.noHBand=(u&512)!==0,e.noVBand=(u&1024)!==0)}let r=b(t,"w","firstColumn");r&&(e.firstColumn=r==="1");let i=b(t,"w","firstRow");i&&(e.firstRow=i==="1");let o=b(t,"w","lastColumn");o&&(e.lastColumn=o==="1");let l=b(t,"w","lastRow");l&&(e.lastRow=l==="1");let a=b(t,"w","noHBand");a&&(e.noHBand=a==="1");let s=b(t,"w","noVBand");return s&&(e.noVBand=s==="1"),Object.keys(e).length>0?e:void 0}function fa(t,e){if(!t)return;let n={},r=S(t,"w","tblW");r&&(n.width=xt(r));let i=S(t,"w","jc");if(i){let c=b(i,"w","val");(c==="left"||c==="center"||c==="right")&&(n.justification=c)}let o=S(t,"w","tblCellSpacing");o&&(n.cellSpacing=xt(o));let l=S(t,"w","tblInd");l&&(n.indent=xt(l));let a=S(t,"w","tblBorders");a&&(n.borders=we(a));let s=S(t,"w","tblCellMar");s&&(n.cellMargins=wa(s));let u=S(t,"w","tblLayout");if(u){let c=b(u,"w","type");(c==="fixed"||c==="autofit")&&(n.layout=c)}let p=S(t,"w","tblStyle");if(p){let c=b(p,"w","val");c&&(n.styleId=c)}let d=S(t,"w","tblLook");d&&(n.look=Zc(d));let f=S(t,"w","shd");f&&(n.shading=me(f));let h=S(t,"w","bidiVisual");return h&&(n.bidi=D(h)),Object.keys(n).length>0?n:void 0}function ca(t){if(!t)return;let e={},n=S(t,"w","trHeight");if(n){e.height=xt(n);let a=b(n,"w","hRule");a&&(e.heightRule=a)}let r=S(t,"w","tblHeader");r&&(e.header=D(r));let i=S(t,"w","cantSplit");i&&(e.cantSplit=D(i));let o=S(t,"w","jc");if(o){let a=b(o,"w","val");(a==="left"||a==="center"||a==="right")&&(e.justification=a)}let l=S(t,"w","hidden");return l&&(e.hidden=D(l)),Object.keys(e).length>0?e:void 0}function ha(t,e){if(!t)return;let n={},r=S(t,"w","tcW");r&&(n.width=xt(r));let i=S(t,"w","tcBorders");i&&(n.borders=we(i));let o=S(t,"w","tcMar");o&&(n.margins=wa(o));let l=S(t,"w","shd");l&&(n.shading=me(l));let a=S(t,"w","vAlign");if(a){let c=b(a,"w","val");(c==="top"||c==="center"||c==="bottom")&&(n.verticalAlign=c)}let s=S(t,"w","textDirection");if(s){let c=b(s,"w","val");c&&(n.textDirection=c)}let u=S(t,"w","gridSpan");if(u){let c=L(u,"w","val");c!==void 0&&(n.gridSpan=c)}let p=S(t,"w","vMerge");if(p){let c=b(p,"w","val");n.vMerge=c==="restart"?"restart":"continue"}let d=S(t,"w","tcFitText");d&&(n.fitText=D(d));let f=S(t,"w","noWrap");f&&(n.noWrap=D(f));let h=S(t,"w","hideMark");return h&&(n.hideMark=D(h)),Object.keys(n).length>0?n:void 0}function Kc(t,e){let n={styleId:b(t,"w","styleId")??"",type:b(t,"w","type")??"paragraph"},r=b(t,"w","default");r&&(n.default=r==="1"||r==="true");let i=S(t,"w","name");i&&(n.name=b(i,"w","val")??void 0);let o=S(t,"w","basedOn");o&&(n.basedOn=b(o,"w","val")??void 0);let l=S(t,"w","next");l&&(n.next=b(l,"w","val")??void 0);let a=S(t,"w","link");a&&(n.link=b(a,"w","val")??void 0);let s=S(t,"w","uiPriority");if(s){let k=L(s,"w","val");k!==void 0&&(n.uiPriority=k)}let u=S(t,"w","hidden");u&&(n.hidden=D(u));let p=S(t,"w","semiHidden");p&&(n.semiHidden=D(p));let d=S(t,"w","unhideWhenUsed");d&&(n.unhideWhenUsed=D(d));let f=S(t,"w","qFormat");f&&(n.qFormat=D(f));let h=S(t,"w","personal");h&&(n.personal=D(h));let c=S(t,"w","pPr");c&&(n.pPr=Dr(c,e));let m=S(t,"w","rPr");m&&(n.rPr=ge(m,e));let g=S(t,"w","tblPr");g&&(n.tblPr=fa(g));let v=S(t,"w","trPr");v&&(n.trPr=ca(v));let C=S(t,"w","tcPr");C&&(n.tcPr=ha(C));let y=J(t,"w","tblStylePr");if(y.length>0){n.tblStylePr=[];for(let k of y){let x=b(k,"w","type");if(x){let w={type:x},I=S(k,"w","pPr");I&&(w.pPr=Dr(I,e));let F=S(k,"w","rPr");F&&(w.rPr=ge(F,e));let $=S(k,"w","tblPr");$&&(w.tblPr=fa($));let E=S(k,"w","trPr");E&&(w.trPr=ca(E));let P=S(k,"w","tcPr");P&&(w.tcPr=ha(P)),n.tblStylePr.push(w)}}}return n}function Jc(t,e){if(!t)return;let n={},r=S(t,"w","rPrDefault");if(r){let o=S(r,"w","rPr");o&&(n.rPr=ge(o,e))}let i=S(t,"w","pPrDefault");if(i){let o=S(i,"w","pPr");o&&(n.pPr=Dr(o,e))}return n.rPr||n.pPr?n:void 0}function Qc(t,e){if(!e)return t;if(!t)return e?{...e}:void 0;let n={...t};for(let r of Object.keys(e)){let i=e[r];if(i!==void 0)if(r==="runProperties")n.runProperties=nt(n.runProperties,e.runProperties);else if(r==="borders"||r==="numPr"||r==="frame"){let o=n[r],l=i;n[r]={...o||{},...l||{}}}else r==="tabs"&&Array.isArray(i)?n.tabs=[...i]:n[r]=i}return n}function ya(t,e,n,r=new Set){if(r.has(t.styleId)||(r.add(t.styleId),!t.basedOn))return t;let i=e.get(t.basedOn);if(!i)return t;let o=ya(i,e,n,r),l={...t,pPr:Qc(o.pPr,t.pPr),rPr:nt(o.rPr,t.rPr)};return t.type==="table"&&((o.tblPr||t.tblPr)&&(l.tblPr={...o.tblPr||{},...t.tblPr||{}}),(o.trPr||t.trPr)&&(l.trPr={...o.trPr||{},...t.trPr||{}}),(o.tcPr||t.tcPr)&&(l.tcPr={...o.tcPr||{},...t.tcPr||{}})),l}function ba(t,e){let n=new Map;try{let r=kt(t);if(!r)return n;let i=J(r,"w","style");for(let o of i){let l=Kc(o,e);l.styleId&&n.set(l.styleId,l)}for(let[o,l]of n){let a=ya(l,n,e);n.set(o,a)}}catch(r){console.warn("Failed to parse styles:",r)}return n}function th(t,e){let n={styles:[]};try{let r=kt(t);if(!r)return n;let i=S(r,"w","docDefaults");n.docDefaults=Jc(i,e);let o=S(r,"w","latentStyles");o&&(n.latentStyles={defLockedState:b(o,"w","defLockedState")==="1",defUIPriority:L(o,"w","defUIPriority"),defSemiHidden:b(o,"w","defSemiHidden")==="1",defUnhideWhenUsed:b(o,"w","defUnhideWhenUsed")==="1",defQFormat:b(o,"w","defQFormat")==="1",count:L(o,"w","count")});let l=ba(t,e);n.styles=Array.from(l.values())}catch(r){console.warn("Failed to parse style definitions:",r)}return n}var ma=/\{([a-zA-Z_][a-zA-Z0-9_\-\.]*)\}/g;function xa(t){let e=[],n;for(ma.lastIndex=0;(n=ma.exec(t))!==null;){let r=n[1].trim();r&&!e.includes(r)&&e.push(r)}return e}function eh(t){let e=[];for(let n of t)if(n.type==="paragraph"){let r=gr(n),i=xa(r);for(let o of i)e.includes(o)||e.push(o)}else if(n.type==="table"){let r=va(n);for(let i of r)e.includes(i)||e.push(i)}return e}function va(t){let e=[];for(let n of t.rows)for(let r of n.cells)for(let i of r.content)if(i.type==="paragraph"){let o=gr(i),l=xa(o);for(let a of l)e.includes(a)||e.push(a)}else if(i.type==="table"){let o=va(i);for(let l of o)e.includes(l)||e.push(l)}return e}function nh(t,e){let n=[],r=[];for(let i of t)r.push(i),i.type==="paragraph"&&i.sectionProperties&&(n.push({properties:i.sectionProperties,content:r}),r=[]);return(r.length>0||n.length===0)&&n.push({properties:e??al(),content:r}),n}function rh(t,e=null,n=null,r=null,i=null,o=null){let l={content:[]};if(!t)return l;let a=ct(t);if(!a)return l;let s=(a.elements??[]).find(f=>f.type==="element"&&(f.name==="w:document"||f.name?.endsWith(":document")));if(!s)return l;let u=S(s,"w","body");if(!u)return l;l.content=Qt(u,e,n,r,i,o);let p=S(u,"w","sectPr");p&&(l.finalSectionProperties=cr(p,i));let d=nh(l.content,l.finalSectionProperties);return l.sections=sl(d),l.finalSectionProperties&&l.sections.length>0&&(l.finalSectionProperties=l.sections[l.sections.length-1].properties),l}function ih(t){let e=new Map,n=ct(t);if(!n)return e;let r=S(n,"w16cex","commentsExtensible")??n;for(let i of V(r)){if((i.name?.replace(/^.*:/,"")??"")!=="comment")continue;let o=b(i,"w16cex","paraId")??b(i,"w15","paraId")??i.attributes?.["w16cex:paraId"]??i.attributes?.["w15:paraId"],l=b(i,"w16cex","dateUtc")??b(i,"w15","dateUtc")??i.attributes?.["w16cex:dateUtc"]??i.attributes?.["w15:dateUtc"];o&&l&&e.set(String(o).toUpperCase(),String(l))}return e}function oh(t){let e=new Map,n=new Map,r=ct(t);if(!r)return{parentByParaId:e,doneByParaId:n};let i=S(r,"w15","commentsEx")??r;for(let o of V(i)){if((o.name?.replace(/^.*:/,"")??"")!=="commentEx")continue;let l=b(o,"w15","paraId")??o.attributes?.["w15:paraId"],a=b(o,"w15","paraIdParent")??o.attributes?.["w15:paraIdParent"],s=b(o,"w15","done")??o.attributes?.["w15:done"];if(l){let u=String(l).toUpperCase();a&&e.set(u,String(a).toUpperCase()),s==="1"&&n.set(u,!0)}}return{parentByParaId:e,doneByParaId:n}}function lh(t,e,n,r,i,o,l){if(!t)return[];let a=ct(t);if(!a)return[];let s=o?ih(o):new Map,u=l?oh(l):null,p=S(a,"w","comments")??a,d=V(p),f=[],h=[];for(let c of d){if((c.name?.replace(/^.*:/,"")??"")!=="comment")continue;let m=parseInt(b(c,"w","id")??"0",10),g=b(c,"w","author")??"Unknown",v=b(c,"w","initials"),C=v!=null?String(v):void 0,y=b(c,"w","date"),k=y!=null?String(y):void 0,x=b(c,"w14","paraId")??c.attributes?.["w14:paraId"]??b(c,"w","paraId"),w=(x?s.get(String(x).toUpperCase()):void 0)??k,I=b(c,"w","done")??c.attributes?.["w:done"],F=I==="1"||I==="true"?!0:void 0,$=b(c,"w16cid","parentId")??b(c,"w","parentId")??c.attributes?.["w16cid:parentId"]??c.attributes?.["w:parentId"],E=$!=null?parseInt(String($),10):void 0,P=[],R="";for(let T of V(c))if((T.name?.replace(/^.*:/,"")??"")==="p"){let M=ye(T,e,n,null,r,i);P.push(M);let B=b(T,"w14","paraId")??T.attributes?.["w14:paraId"];B&&(R=String(B).toUpperCase())}F==null&&u&&R&&u.doneByParaId.get(R)&&(F=!0),h.push(R),f.push({id:m,author:g,initials:C,date:w,content:P,...F!=null?{done:F}:{},...E!=null&&!isNaN(E)?{parentId:E}:{}})}if(u&&u.parentByParaId.size>0){let c=new Map;for(let m=0;m<f.length;m++){let g=h[m];g&&c.set(g,f[m].id)}for(let m=0;m<f.length;m++){if(f[m].parentId!=null)continue;let g=h[m];if(!g)continue;let v=u.parentByParaId.get(g);if(!v)continue;let C=c.get(v);C!=null&&(f[m]={...f[m],parentId:C})}}return f}function yt(t,e){if(t)for(let n of t)if(n.type==="paragraph")n.content=n.content.filter(r=>r.type!=="commentRangeStart"&&r.type!=="commentRangeEnd"||e.has(r.id));else if(n.type==="table")for(let r of n.rows)for(let i of r.cells)yt(i.content,e);else n.type==="blockSdt"&&yt(n.content,e)}function ah(t){let e=t.package,n=new Set((e.document.comments??[]).map(r=>r.id));yt(e.document.content,n);for(let r of e.headers?.values()??[])yt(r.content,n);for(let r of e.footers?.values()??[])yt(r.content,n);for(let r of e.footnotes??[])yt(r.content,n);for(let r of e.endnotes??[])yt(r.content,n);for(let r of e.footnoteSeparators??[])yt(r.content,n);for(let r of e.endnoteSeparators??[])yt(r.content,n)}function sh(t){let e=Vt();for(;t.has(e)||!fi(e);)e=Vt();return e}function ph(t,e){t.paraId!=null&&(e.has(t.paraId)&&(t.paraId=sh(e)),e.add(t.paraId))}function bt(t,e){if(t)for(let n of t)if(n.type==="paragraph")ph(n,e);else if(n.type==="table")for(let r of n.rows)for(let i of r.cells)bt(i.content,e);else n.type==="blockSdt"&&bt(n.content,e)}function uh(t){let e=t.package,n=new Set;bt(e.document.content,n);for(let r of e.headers?.values()??[])bt(r.content,n);for(let r of e.footers?.values()??[])bt(r.content,n);for(let r of e.footnotes??[])bt(r.content,n);for(let r of e.endnotes??[])bt(r.content,n);for(let r of e.footnoteSeparators??[])bt(r.content,n);for(let r of e.endnoteSeparators??[])bt(r.content,n)}var dh=new Set(["decorative","modern","roman","script","swiss","auto"]),fh=new Set(["default","fixed","variable"]);function wn(t,e){let n=S(t,"w",e);if(!n)return;let r=b(n,"r","id");if(!r)return;let i={relId:r},o=b(n,"w","fontKey");o&&(i.fontKey=o);let l=b(n,"w","subsetted");return(l==="true"||l==="1")&&(i.subsetted=!0),i}function ch(t){let e=b(t,"w","name");if(!e)return null;let n={name:e},r=S(t,"w","altName");if(r){let f=b(r,"w","val");f&&(n.altName=f)}let i=S(t,"w","family");if(i){let f=b(i,"w","val");f&&dh.has(f)&&(n.family=f)}let o=S(t,"w","pitch");if(o){let f=b(o,"w","val");f&&fh.has(f)&&(n.pitch=f)}let l=S(t,"w","charset");if(l){let f=b(l,"w","val");f&&(n.charset=f)}let a=S(t,"w","panose1");if(a){let f=b(a,"w","val");f&&(n.panose1=f)}let s=wn(t,"embedRegular");s&&(n.embedRegular=s);let u=wn(t,"embedBold");u&&(n.embedBold=u);let p=wn(t,"embedItalic");p&&(n.embedItalic=p);let d=wn(t,"embedBoldItalic");return d&&(n.embedBoldItalic=d),n}function hh(t){if(!t||t.trim().length===0)return{fonts:[]};let e=kt(t);if(!e)return console.warn("Failed to parse fontTable.xml"),{fonts:[]};let n=[];for(let r of J(e,"w","font")){let i=ch(r);i&&n.push(i)}return{fonts:n}}async function Wr(t,e={}){let n=t instanceof ArrayBuffer?t:await Ci(t),{onProgress:r=()=>{},preloadFonts:i=!0,parseHeadersFooters:o=!0,parseNotes:l=!0,detectVariables:a=!0}=e,s=[];try{let p=function(A,j){let H=performance.now(),Y=j(),U=performance.now()-H;return f.push({stage:A,ms:U}),U>1e3&&console.warn(`[parseDocx] ${A} took ${Math.round(U)}ms`),Y};var u=p;let d=performance.now(),f=[];async function h(A,j){let H=performance.now(),Y=await j(),U=performance.now()-H;return f.push({stage:A,ms:U}),U>1e3&&console.warn(`[parseDocx] ${A} took ${Math.round(U)}ms`),Y}r("Extracting DOCX...",0);let c=await h("unzip",()=>Vc(n));r("Extracted DOCX",10),r("Parsing relationships...",10);let m=p("relationships",()=>c.documentRels?Be(c.documentRels):new Map);r("Parsed relationships",15),r("Parsing theme...",15);let g=p("theme",()=>_o(c.themeXml)),v=p("settings",()=>Ii(c.settingsXml));Xo(g,v.themeFontLang),r("Parsed theme",20),r("Parsing styles...",20);let C=null,y;p("styles",()=>{c.stylesXml&&(C=ba(c.stylesXml,g),y=th(c.stylesXml,g))}),r("Parsed styles",30);let k=p("fontTable",()=>hh(c.fontTableXml));r("Parsing numbering...",30);let x=p("numbering",()=>ci(c.numberingXml));r("Parsed numbering",35),r("Processing media files...",35);let w=p("media",()=>gh(c,m));r("Processed media",40),r("Parsing document body...",40);let I={content:[]};p("documentBody",()=>{c.documentXml?I=rh(c.documentXml,C,g,x,m,w):s.push("No document.xml found in DOCX")}),r("Parsed document body",55);let F,$;if(o){r("Parsing headers/footers...",55);let A=p("headersFooters",()=>wh(c,C,g,x,m,w));F=A.headers,$=A.footers,r("Parsed headers/footers",65)}else r("Skipping headers/footers",65);let E,P,R,T;if(l){r("Parsing footnotes/endnotes...",65);let A=p("footnotesEndnotes",()=>yh(c,C,g,x,m,w));E=A.footnotes,P=A.endnotes,R=A.footnoteSeparators,T=A.endnoteSeparators,r("Parsed footnotes/endnotes",75)}else r("Skipping footnotes/endnotes",75);r("Parsing comments...",75);let M=p("comments",()=>lh(c.commentsXml,C,g,m,w,c.commentsExtensibleXml,c.commentsExtendedXml));M.length>0&&(I.comments=M);let B;a?(r("Detecting template variables...",75),B=p("variables",()=>eh(I.content)),r("Detected variables",80)):r("Skipping variable detection",80),i?(r("Loading fonts...",80),await h("fonts",()=>bh(g,y,I)),await h("embeddedFonts",()=>Si(k,c.fonts,mh(c))),r("Loaded fonts",95)):r("Skipping font loading",95),r("Assembling document...",95);let N={package:{document:I,styles:y,theme:g,numbering:x.definitions,settings:v,fontTable:k,headers:F,footers:$,footnotes:E,endnotes:P,footnoteSeparators:R,endnoteSeparators:T,relationships:m,media:w},originalBuffer:n,templateVariables:B,warnings:s.length>0?s:void 0};ah(N),uh(N);let z=performance.now()-d;if(z>2e3){let A=f.filter(j=>j.ms>100).map(j=>`${j.stage}: ${Math.round(j.ms)}ms`).join(", ");console.warn(`[parseDocx] Total: ${Math.round(z)}ms`+(A?` (${A})`:""))}return r("Complete",100),N}catch(p){let d=p instanceof Error?p.message:String(p);throw console.error("[parseDocx] Failed to parse DOCX:",d,p),new Error(`Failed to parse DOCX: ${d}`)}}function mh(t){for(let[e,n]of t.allXml)if(e.toLowerCase()==="word/_rels/fonttable.xml.rels")return n;return null}function gh(t,e){let n=new Map;for(let[r,i]of t.media.entries()){let o=r.split("/").pop()||r,l=Yc(r),a=new Uint8Array(i),s="";for(let h=0;h<a.length;h++)s+=String.fromCharCode(a[h]);let u=btoa(s),p=`data:${l};base64,${u}`,d={path:r,filename:o,mimeType:l,data:i,dataUrl:p};n.set(r,d);let f=r.replace(/^word\//,"");f!==r&&n.set(f,d)}return n}function yn(t,e){let n=e.toLowerCase();for(let[r,i]of t.entries())if(r.toLowerCase()===n)return i}function wh(t,e,n,r,i,o){let l=new Map,a=new Map;for(let[s,u]of i.entries())if(u.type===Z.header&&u.target){let p=u.target.split("/").pop()||u.target,d=yn(t.headers,p);if(d){let f=`word/_rels/${p}.rels`,h=yn(t.allXml,f),c=h?Be(h):i,m=Zo(d,"default",e,n,r,c,o);l.set(s,m)}}else if(u.type===Z.footer&&u.target){let p=u.target.split("/").pop()||u.target,d=yn(t.footers,p);if(d){let f=`word/_rels/${p}.rels`,h=yn(t.allXml,f),c=h?Be(h):i,m=Ko(d,"default",e,n,r,c,o);a.set(s,m)}}return{headers:l,footers:a}}function yh(t,e,n,r,i,o){let l=tl(t.footnotesXml,e,n,r,i,o),a=el(t.endnotesXml,e,n,r,i,o);return{footnotes:l.getNormalFootnotes(),endnotes:a.getNormalEndnotes(),footnoteSeparators:l.footnotes.filter(ol),endnoteSeparators:a.endnotes.filter(ll)}}async function bh(t,e,n){let r=new Set;if(t?.fontScheme){let{majorFont:i,minorFont:o}=t.fontScheme;i?.latin&&r.add(i.latin),o?.latin&&r.add(o.latin)}if(e?.docDefaults?.rPr?.fontFamily?.ascii&&r.add(e.docDefaults.rPr.fontFamily.ascii),e?.styles)for(let i of e.styles)i.rPr?.fontFamily?.ascii&&r.add(i.rPr.fontFamily.ascii),i.rPr?.fontFamily?.hAnsi&&r.add(i.rPr.fontFamily.hAnsi);if(n.content){for(let i of n.content)if(i.type==="paragraph")for(let o of i.content)o.type==="run"&&o.formatting?.fontFamily&&(o.formatting.fontFamily.ascii&&r.add(o.formatting.fontFamily.ascii),o.formatting.fontFamily.hAnsi&&r.add(o.formatting.fontFamily.hAnsi))}if(r.size>0)try{await ki(Array.from(r))}catch(i){console.warn("Failed to load some fonts:",i)}}function W(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")}function O(t){return t==null||!Number.isFinite(t)?"0":String(Math.round(t))}var ne='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:oel="http://schemas.microsoft.com/office/2019/extlst" 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:w16du="http://schemas.microsoft.com/office/word/2023/wordml/word16du" xmlns:w16sdtdh="http://schemas.microsoft.com/office/word/2020/wordml/sdtdatahash" xmlns:w16sdtfl="http://schemas.microsoft.com/office/word/2024/wordml/sdtformatlock" 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"',re='mc:Ignorable="w14 w15 w16se w16cid w16 w16cex w16sdtdh w16sdtfl w16du wp14"';function Xr(t,e){if(!t)return"";if(t.style==="none"||t.style==="nil")return`<w:${e} w:val="${t.style}"/>`;let n=[`w:val="${W(t.style)}"`];return t.size!==void 0&&n.push(`w:sz="${O(t.size)}"`),t.space!==void 0&&n.push(`w:space="${O(t.space)}"`),t.color&&(t.color.auto?n.push('w:color="auto"'):t.color.rgb&&n.push(`w:color="${W(t.color.rgb)}"`),t.color.themeColor&&n.push(`w:themeColor="${W(t.color.themeColor)}"`),t.color.themeTint&&n.push(`w:themeTint="${W(t.color.themeTint)}"`),t.color.themeShade&&n.push(`w:themeShade="${W(t.color.themeShade)}"`)),t.shadow&&n.push('w:shadow="true"'),t.frame&&n.push('w:frame="true"'),`<w:${e} ${n.join(" ")}/>`}function xh(t){return`<w:headerReference ${[`w:type="${t.type}"`,`r:id="${t.rId}"`].join(" ")}/>`}function vh(t){return`<w:footerReference ${[`w:type="${t.type}"`,`r:id="${t.rId}"`].join(" ")}/>`}function kh(t){if(!t)return"";let e=[];return t.position&&e.push(`<w:pos w:val="${t.position}"/>`),t.numFmt&&e.push(`<w:numFmt w:val="${t.numFmt}"/>`),t.numStart!==void 0&&e.push(`<w:numStart w:val="${t.numStart}"/>`),t.numRestart&&e.push(`<w:numRestart w:val="${t.numRestart}"/>`),e.length===0?"":`<w:footnotePr>${e.join("")}</w:footnotePr>`}function Sh(t){if(!t)return"";let e=[];return t.position&&e.push(`<w:pos w:val="${t.position}"/>`),t.numFmt&&e.push(`<w:numFmt w:val="${t.numFmt}"/>`),t.numStart!==void 0&&e.push(`<w:numStart w:val="${t.numStart}"/>`),t.numRestart&&e.push(`<w:numRestart w:val="${t.numRestart}"/>`),e.length===0?"":`<w:endnotePr>${e.join("")}</w:endnotePr>`}function Ch(t){let e=[];return t.pageWidth!==void 0&&e.push(`w:w="${O(t.pageWidth)}"`),t.pageHeight!==void 0&&e.push(`w:h="${O(t.pageHeight)}"`),t.orientation==="landscape"&&e.push('w:orient="landscape"'),e.length===0?"":`<w:pgSz ${e.join(" ")}/>`}function Th(t){let e=[];return t.marginTop!==void 0&&e.push(`w:top="${O(t.marginTop)}"`),t.marginRight!==void 0&&e.push(`w:right="${O(t.marginRight)}"`),t.marginBottom!==void 0&&e.push(`w:bottom="${O(t.marginBottom)}"`),t.marginLeft!==void 0&&e.push(`w:left="${O(t.marginLeft)}"`),t.headerDistance!==void 0&&e.push(`w:header="${O(t.headerDistance)}"`),t.footerDistance!==void 0&&e.push(`w:footer="${O(t.footerDistance)}"`),t.gutter!==void 0&&e.push(`w:gutter="${O(t.gutter)}"`),e.length===0?"":`<w:pgMar ${e.join(" ")}/>`}function $h(t){if(!t.columnCount&&!t.columns?.length)return"";let e=[];t.columnCount!==void 0&&t.columnCount>1&&e.push(`w:num="${O(t.columnCount)}"`),t.columnSpace!==void 0&&e.push(`w:space="${O(t.columnSpace)}"`),t.equalWidth!==void 0&&e.push(`w:equalWidth="${t.equalWidth?"1":"0"}"`),t.separator&&e.push('w:sep="1"');let n="";return t.columns&&t.columns.length>0&&(n=t.columns.map(r=>{let i=[];return r.width!==void 0&&i.push(`w:w="${O(r.width)}"`),r.space!==void 0&&i.push(`w:space="${O(r.space)}"`),`<w:col ${i.join(" ")}/>`}).join("")),e.length===0&&!n?"":`<w:cols${e.length>0?" "+e.join(" "):""}>${n}</w:cols>`}function Ih(t){if(!t.lineNumbers)return"";let e=t.lineNumbers,n=[];return e.countBy!==void 0&&n.push(`w:countBy="${O(e.countBy)}"`),e.start!==void 0&&n.push(`w:start="${O(e.start)}"`),e.distance!==void 0&&n.push(`w:distance="${O(e.distance)}"`),e.restart&&n.push(`w:restart="${e.restart}"`),n.length===0?"":`<w:lnNumType ${n.join(" ")}/>`}function Fh(t){if(!t.pageBorders)return"";let e=t.pageBorders,n=[],r=[];e.display&&n.push(`w:display="${W(e.display)}"`),e.offsetFrom&&n.push(`w:offsetFrom="${W(e.offsetFrom)}"`),e.zOrder&&n.push(`w:zOrder="${W(e.zOrder)}"`);for(let i of["top","left","bottom","right"]){let o=Xr(e[i],i);o&&r.push(o)}return r.length===0?"":`<w:pgBorders${n.length>0?" "+n.join(" "):""}>${r.join("")}</w:pgBorders>`}function Ph(t){if(!t.docGrid)return"";let e=t.docGrid,n=[];return e.type&&n.push(`w:type="${e.type}"`),e.linePitch!==void 0&&n.push(`w:linePitch="${e.linePitch}"`),e.charSpace!==void 0&&n.push(`w:charSpace="${e.charSpace}"`),n.length===0?"":`<w:docGrid ${n.join(" ")}/>`}function Fa(t){if(!t)return"";let e=[];if(t.headerReferences)for(let p of t.headerReferences)e.push(xh(p));if(t.footerReferences)for(let p of t.footerReferences)e.push(vh(p));let n=kh(t.footnotePr);n&&e.push(n);let r=Sh(t.endnotePr);r&&e.push(r),t.sectionStart&&e.push(`<w:type w:val="${t.sectionStart}"/>`);let i=Ch(t);i&&e.push(i);let o=Th(t);if(o&&e.push(o),t.paperSrcFirst!==void 0||t.paperSrcOther!==void 0){let p=[];t.paperSrcFirst!==void 0&&p.push(`w:first="${t.paperSrcFirst}"`),t.paperSrcOther!==void 0&&p.push(`w:other="${t.paperSrcOther}"`),e.push(`<w:paperSrc ${p.join(" ")}/>`)}let l=Fh(t);l&&e.push(l);let a=Ih(t);a&&e.push(a);let s=$h(t);s&&e.push(s),t.footnoteColumns!==void 0&&t.footnoteColumns>1&&e.push(`<w15:footnoteColumns w:val="${O(t.footnoteColumns)}"/>`),t.verticalAlign&&e.push(`<w:vAlign w:val="${t.verticalAlign}"/>`),t.titlePg&&e.push("<w:titlePg/>"),t.bidi&&e.push("<w:bidi/>");let u=Ph(t);return u&&e.push(u),t.evenAndOddHeaders&&e.push("<w:evenAndOddHeaders/>"),e.length===0?"":`<w:sectPr>${e.join("")}</w:sectPr>`}var Rh=["top","left","bottom","right","between","bar"];function Eh(t){if(!t)return"";let e=[];for(let n of Rh){let r=Xr(t[n],n);r&&e.push(r)}return e.length===0?"":`<w:pBdr>${e.join("")}</w:pBdr>`}function Mh(t){if(!t)return"";let e=[];return t.pattern?e.push(`w:val="${t.pattern}"`):e.push('w:val="clear"'),t.color?.rgb?e.push(`w:color="${t.color.rgb}"`):t.color?.auto&&e.push('w:color="auto"'),t.fill?.rgb?e.push(`w:fill="${t.fill.rgb}"`):t.fill?.auto&&e.push('w:fill="auto"'),t.fill?.themeColor&&e.push(`w:themeFill="${t.fill.themeColor}"`),t.fill?.themeTint&&e.push(`w:themeFillTint="${t.fill.themeTint}"`),t.fill?.themeShade&&e.push(`w:themeFillShade="${t.fill.themeShade}"`),e.length===0?"":`<w:shd ${e.join(" ")}/>`}function Bh(t){return!t||t.length===0?"":`<w:tabs>${t.map(e=>{let n=[`w:val="${e.alignment}"`,`w:pos="${O(e.position)}"`];return e.leader&&e.leader!=="none"&&n.push(`w:leader="${e.leader}"`),`<w:tab ${n.join(" ")}/>`}).join("")}</w:tabs>`}function Lh(t){let e=[];return t.spaceBefore!==void 0&&e.push(`w:before="${O(t.spaceBefore)}"`),t.spaceAfter!==void 0&&e.push(`w:after="${O(t.spaceAfter)}"`),t.lineSpacing!==void 0&&e.push(`w:line="${O(t.lineSpacing)}"`),t.lineSpacingRule&&e.push(`w:lineRule="${t.lineSpacingRule}"`),t.beforeAutospacing&&e.push('w:beforeAutospacing="1"'),t.afterAutospacing&&e.push('w:afterAutospacing="1"'),e.length===0?"":`<w:spacing ${e.join(" ")}/>`}function qr(t){let e=[];return t.indentLeft!==void 0&&e.push(`w:left="${O(t.indentLeft)}"`),t.indentRight!==void 0&&e.push(`w:right="${O(t.indentRight)}"`),t.indentFirstLine!==void 0&&(t.hangingIndent?e.push(`w:hanging="${O(Math.abs(t.indentFirstLine))}"`):t.indentFirstLine!==0&&e.push(`w:firstLine="${O(t.indentFirstLine)}"`)),e.length===0?"":`<w:ind ${e.join(" ")}/>`}function Ah(t){if(!t)return"";let e=[];return t.ilvl!==void 0&&e.push(`<w:ilvl w:val="${O(t.ilvl)}"/>`),t.numId!==void 0&&e.push(`<w:numId w:val="${O(t.numId)}"/>`),e.length===0?"":`<w:numPr>${e.join("")}</w:numPr>`}function zh(t){if(!t)return"";let e=[];return t.width!==void 0&&e.push(`w:w="${O(t.width)}"`),t.height!==void 0&&e.push(`w:h="${O(t.height)}"`),t.hAnchor&&e.push(`w:hAnchor="${t.hAnchor}"`),t.vAnchor&&e.push(`w:vAnchor="${t.vAnchor}"`),t.x!==void 0&&e.push(`w:x="${O(t.x)}"`),t.y!==void 0&&e.push(`w:y="${O(t.y)}"`),t.xAlign&&e.push(`w:xAlign="${t.xAlign}"`),t.yAlign&&e.push(`w:yAlign="${t.yAlign}"`),t.wrap&&e.push(`w:wrap="${t.wrap}"`),e.length===0?"":`<w:framePr ${e.join(" ")}/>`}function Pa(t){let e=[`w:id="${t.id}"`,`w:name="${W(t.name)}"`];return t.colFirst!==void 0&&e.push(`w:colFirst="${t.colFirst}"`),t.colLast!==void 0&&e.push(`w:colLast="${t.colLast}"`),`<w:bookmarkStart ${e.join(" ")}/>`}function Ra(t){return`<w:bookmarkEnd w:id="${t.id}"/>`}function Ur(t){let e=[];t.rId&&e.push(`r:id="${t.rId}"`),t.anchor&&e.push(`w:anchor="${W(t.anchor)}"`),t.tooltip&&e.push(`w:tooltip="${W(t.tooltip)}"`),t.target&&e.push(`w:tgtFrame="${W(t.target)}"`),t.history===!1&&e.push('w:history="0"'),t.docLocation&&e.push(`w:docLocation="${W(t.docLocation)}"`);let n=t.children.map(r=>r.type==="run"?_t(r):r.type==="bookmarkStart"?Pa(r):r.type==="bookmarkEnd"?Ra(r):"").join("");return e.length===0&&!t.href?n:`<w:hyperlink${e.length>0?" "+e.join(" "):""}>${n}</w:hyperlink>`}function Ea(t){let e=[],n=t.content.find(l=>l.type==="run"),r=n?.formatting?Fe(n.formatting):"",i=['w:fldCharType="begin"'];t.fldLock&&i.push('w:fldLock="true"'),e.push(`<w:r>${r}<w:fldChar ${i.join(" ")}/></w:r>`);let o=t.instruction.startsWith(" ")||t.instruction.endsWith(" ")||t.instruction.includes("  ")?' xml:space="preserve"':"";e.push(`<w:r>${r}<w:instrText${o}>${W(t.instruction)}</w:instrText></w:r>`),e.push(`<w:r>${r}<w:fldChar w:fldCharType="separate"/></w:r>`);for(let l of t.content)l.type==="run"&&e.push(_t(l));return e.push(`<w:r>${r}<w:fldChar w:fldCharType="end"/></w:r>`),e.join("")}function Ma(t){let e=[],n=t.fieldResult?.[0]?.formatting??t.formatting,r=n?Fe(n):"",i=['w:fldCharType="begin"'];if(t.fldLock&&i.push('w:fldLock="true"'),e.push(`<w:r>${r}<w:fldChar ${i.join(" ")}/></w:r>`),t.fieldCode.length>0)e.push(...t.fieldCode.map(o=>_t(o)));else{let o=t.instruction.startsWith(" ")||t.instruction.endsWith(" ")||t.instruction.includes("  ")?' xml:space="preserve"':"";e.push(`<w:r>${r}<w:instrText${o}>${W(t.instruction)}</w:instrText></w:r>`)}return e.push(`<w:r>${r}<w:fldChar w:fldCharType="separate"/></w:r>`),e.push(...t.fieldResult.map(o=>_t(o))),e.push(`<w:r>${r}<w:fldChar w:fldCharType="end"/></w:r>`),e.join("")}function Nh(t){let e=[];switch(t.alias&&e.push(`<w:alias w:val="${W(t.alias)}"/>`),t.tag&&e.push(`<w:tag w:val="${W(t.tag)}"/>`),t.id!=null&&e.push(`<w:id w:val="${t.id}"/>`),t.lock&&t.lock!=="unlocked"&&e.push(`<w:lock w:val="${t.lock}"/>`),t.placeholder&&e.push(`<w:placeholder><w:docPart w:val="${W(t.placeholder)}"/></w:placeholder>`),t.showingPlaceholder&&e.push("<w:showingPlcHdr/>"),t.sdtType){case"plainText":e.push("<w:text/>");break;case"date":t.dateFormat?e.push(`<w:date><w:dateFormat w:val="${W(t.dateFormat)}"/></w:date>`):e.push("<w:date/>");break;case"dropDownList":{let n=(t.listItems??[]).map(r=>`<w:listItem w:displayText="${W(r.displayText)}" w:value="${W(r.value)}"/>`).join("");e.push(`<w:dropDownList w:lastValue="">${n}</w:dropDownList>`);break}case"comboBox":{let n=(t.listItems??[]).map(r=>`<w:listItem w:displayText="${W(r.displayText)}" w:value="${W(r.value)}"/>`).join("");e.push(`<w:comboBox w:lastValue="">${n}</w:comboBox>`);break}case"checkbox":e.push(`<w14:checkbox><w14:checked w14:val="${t.checked?"1":"0"}"/><w14:checkedState w14:val="2612" w14:font="MS Gothic"/><w14:uncheckedState w14:val="2610" w14:font="MS Gothic"/></w14:checkbox>`);break;case"picture":e.push("<w:picture/>");break}return`<w:sdtPr>${e.join("")}</w:sdtPr>`}function Ba(t){let e=t.properties,n=t.content.map(o=>{switch(o.type){case"run":return _t(o);case"hyperlink":return Ur(o);case"simpleField":return Ea(o);case"complexField":return Ma(o);case"inlineSdt":return Ba(o);case"mathEquation":return o.ommlXml||"";default:return o}}).join(""),r=e.rawPropertiesXml??Nh(e),i=e.rawEndPropertiesXml??"";return`<w:sdt>${r}${i}<w:sdtContent>${n}</w:sdtContent></w:sdt>`}function ka(t,e){let n=[`w:id="${e.id}"`,`w:name="${W(e.name)}"`];return`<w:${t} ${n.join(" ")}/>`}function bn(t,e){let n=e.info,r=Number.isInteger(n.id)&&n.id>=0?n.id:0,i=typeof n.author=="string"?n.author.trim():"",o=i.length>0?i:"Unknown",l=typeof n.date=="string"?n.date.trim():void 0,a=[`w:id="${r}"`,`w:author="${W(o)}"`];l&&a.push(`w:date="${W(l)}"`);let s=e.content.map(u=>{if(u.type==="run"){let p=_t(u),d=u.content.some(f=>f.type==="drawing");return(t==="del"||t==="moveFrom")&&!d?p.replace(/<w:t\b/g,"<w:delText").replace(/<\/w:t>/g,"</w:delText>").replace(/<w:instrText\b/g,"<w:delInstrText").replace(/<\/w:instrText>/g,"</w:delInstrText>"):p}return u.type==="hyperlink"?Ur(u):""}).join("");return`<w:${t} ${a.join(" ")}>${s}</w:${t}>`}function Oh(t){switch(t.type){case"run":return _t(t);case"hyperlink":return Ur(t);case"bookmarkStart":return Pa(t);case"bookmarkEnd":return Ra(t);case"simpleField":return Ea(t);case"complexField":return Ma(t);case"inlineSdt":return Ba(t);case"commentRangeStart":return`<w:commentRangeStart w:id="${t.id}"/>`;case"commentRangeEnd":return`<w:commentRangeEnd w:id="${t.id}"/><w:r><w:rPr><w:rStyle w:val="CommentReference"/></w:rPr><w:commentReference w:id="${t.id}"/></w:r>`;case"insertion":return bn("ins",t);case"deletion":return bn("del",t);case"moveFrom":return bn("moveFrom",t);case"moveTo":return bn("moveTo",t);case"moveFromRangeStart":return ka("moveFromRangeStart",t);case"moveFromRangeEnd":return`<w:moveFromRangeEnd w:id="${t.id}"/>`;case"moveToRangeStart":return ka("moveToRangeStart",t);case"moveToRangeEnd":return`<w:moveToRangeEnd w:id="${t.id}"/>`;case"mathEquation":return t.ommlXml||"";default:return""}}function Sa(t){let e=Number.isInteger(t.id)&&t.id>=0?t.id:0,n=typeof t.author=="string"&&t.author.length>0?t.author:"Unknown",r=[`w:id="${e}"`,`w:author="${W(n)}"`],i=typeof t.date=="string"&&t.date.length>0?t.date:void 0;return i&&r.push(`w:date="${W(i)}"`),r.join(" ")}function Hh(t,e,n){let r=[];if(e&&r.push(`<w:ins ${Sa(e)}/>`),n&&r.push(`<w:del ${Sa(n)}/>`),t?.runProperties){let i=Fe(t.runProperties);if(i)if(i.startsWith("<w:rPr>")&&i.endsWith("</w:rPr>")){let o=i.slice(7,-8);o.length>0&&r.push(o)}else i.startsWith("<w:rPr/>")||r.push(i)}return r.length===0?"":`<w:rPr>${r.join("")}</w:rPr>`}function La(t,e,n,r,i){let o=[];if(t){t.styleId&&o.push(`<w:pStyle w:val="${W(t.styleId)}"/>`),t.keepNext===!0?o.push("<w:keepNext/>"):t.keepNext===!1&&o.push('<w:keepNext w:val="0"/>'),t.keepLines===!0?o.push("<w:keepLines/>"):t.keepLines===!1&&o.push('<w:keepLines w:val="0"/>'),t.contextualSpacing===!0?o.push("<w:contextualSpacing/>"):t.contextualSpacing===!1&&o.push('<w:contextualSpacing w:val="0"/>'),t.pageBreakBefore===!0?o.push("<w:pageBreakBefore/>"):t.pageBreakBefore===!1&&o.push('<w:pageBreakBefore w:val="0"/>');let l=zh(t.frame);l&&o.push(l),t.widowControl===!1?o.push('<w:widowControl w:val="0"/>'):t.widowControl===!0&&o.push("<w:widowControl/>");let a=t.numPrFromStyle!=null&&JSON.stringify(t.numPr)===JSON.stringify(t.numPrFromStyle)?"":Ah(t.numPr);a&&o.push(a);let s=Eh(t.borders);s&&o.push(s);let u=Mh(t.shading);u&&o.push(u);let p=Bh(t.tabs);p&&o.push(p),t.suppressLineNumbers===!0?o.push("<w:suppressLineNumbers/>"):t.suppressLineNumbers===!1&&o.push('<w:suppressLineNumbers w:val="0"/>'),t.suppressAutoHyphens===!0?o.push("<w:suppressAutoHyphens/>"):t.suppressAutoHyphens===!1&&o.push('<w:suppressAutoHyphens w:val="0"/>');let d=Lh(t);d&&o.push(d);let f=qr(t);f&&o.push(f),t.bidi===!0?o.push("<w:bidi/>"):t.bidi===!1&&o.push('<w:bidi w:val="0"/>'),t.alignment&&o.push(`<w:jc w:val="${t.alignment}"/>`),t.outlineLevel!==void 0&&o.push(`<w:outlineLvl w:val="${t.outlineLevel}"/>`)}if(!i?.baseOnly){let l=Hh(t,n??void 0,r??void 0);if(l&&o.push(l),i?.sectionProperties){let a=Fa(i.sectionProperties);a&&o.push(a)}e&&e.length>0&&o.push(Wh(e[0]))}return o.length===0?"":`<w:pPr>${o.join("")}</w:pPr>`}function Dh(t){return!t.startsWith("<w:pPr>")||!t.endsWith("</w:pPr>")?"":t.slice(7,-8)}function Wh(t){let e=Number.isInteger(t.info.id)&&t.info.id>=0?t.info.id:0,n=typeof t.info.author=="string"?t.info.author.trim():"",r=n.length>0?n:"Unknown",i=typeof t.info.date=="string"?t.info.date.trim():void 0,o=[`w:id="${e}"`,`w:author="${W(r)}"`];i&&o.push(`w:date="${W(i)}"`);let l=La(t.previousFormatting,void 0,void 0,void 0,{baseOnly:!0})||"<w:pPr/>",a=Dh(l),s=a.length>0?`<w:pPr>${a}</w:pPr>`:"<w:pPr/>";return`<w:pPrChange ${o.join(" ")}>${s}</w:pPrChange>`}function xn(t){let e=[],n=[];t.paraId&&n.push(`w14:paraId="${t.paraId}"`),t.textId&&n.push(`w14:textId="${t.textId}"`);let r=n.length>0?" "+n.join(" "):"",i=La(t.formatting,t.propertyChanges,t.pPrIns,t.pPrDel,t.sectionProperties?{sectionProperties:t.sectionProperties}:void 0);i&&e.push(i);let o=!!t.renderedPageBreakBefore;for(let l of t.content){let a=Oh(l);if(a){if(o){let s=jh(a);s&&(a=s,o=!1)}e.push(a)}}return`<w:p${r}>${e.join("")}</w:p>`}function jh(t){let e=/<w:r(?=[\s>/])[^>]*>/;return e.test(t)?t.replace(e,n=>`${n}<w:lastRenderedPageBreak/>`):null}var Aa=1e5;function _h(){Aa=1e5}function za(t){return t!=null&&t!==""&&t!==0?String(t):String(Aa++)}function jr(t){if(!t)return"";if(t.rgb)return`<a:srgbClr val="${t.rgb.replace("#","")}"/>`;if(t.themeColor){let e=`<a:schemeClr val="${t.themeColor}"`;return t.themeTint?e+=`><a:tint val="${t.themeTint}"/></a:schemeClr>`:t.themeShade?e+=`><a:shade val="${t.themeShade}"/></a:schemeClr>`:e+="/>",e}return""}function Xh(t){if(!t||t.type==="none")return"<a:noFill/>";if(t.type==="solid"&&t.color)return`<a:solidFill>${jr(t.color)}</a:solidFill>`;if(t.type==="gradient"&&t.gradient){let e=t.gradient,n=e.stops.map(i=>`<a:gs pos="${i.position}">${jr(i.color)}</a:gs>`).join(""),r=e.type==="linear"?`<a:lin ang="${(e.angle||0)*6e4}" scaled="1"/>`:"";return`<a:gradFill><a:gsLst>${n}</a:gsLst>${r}</a:gradFill>`}return""}function Na(t){if(!t)return"";let e=[];t.width!=null&&e.push(`w="${t.width}"`),t.cap&&e.push(`cap="${t.cap}"`);let n=[];return t.color&&n.push(`<a:solidFill>${jr(t.color)}</a:solidFill>`),t.style&&t.style!=="solid"&&n.push(`<a:prstDash val="${t.style}"/>`),t.headEnd&&n.push(`<a:headEnd type="${t.headEnd.type}"${t.headEnd.width?` w="${t.headEnd.width}"`:""}${t.headEnd.length?` len="${t.headEnd.length}"`:""}/>`),t.tailEnd&&n.push(`<a:tailEnd type="${t.tailEnd.type}"${t.tailEnd.width?` w="${t.tailEnd.width}"`:""}${t.tailEnd.length?` len="${t.tailEnd.length}"`:""}/>`),n.length===0&&e.length===0?"":`<a:ln${e.length?" "+e.join(" "):""}>${n.join("")}</a:ln>`}function Oa(t){let e=[],n=t.horizontal;e.push(`<wp:positionH relativeFrom="${n.relativeTo}">`),n.alignment?e.push(`<wp:align>${n.alignment}</wp:align>`):e.push(`<wp:posOffset>${O(n.posOffset)}</wp:posOffset>`),e.push("</wp:positionH>");let r=t.vertical;return e.push(`<wp:positionV relativeFrom="${r.relativeTo}">`),r.alignment?e.push(`<wp:align>${r.alignment}</wp:align>`):e.push(`<wp:posOffset>${O(r.posOffset)}</wp:posOffset>`),e.push("</wp:positionV>"),e.join("")}function Ha(t){let e=t.wrapText?` wrapText="${t.wrapText}"`:' wrapText="bothSides"';switch(t.type){case"square":return`<wp:wrapSquare${e}/>`;case"tight":return`<wp:wrapTight${e}><wp:wrapPolygon edited="0"><wp:start x="0" y="0"/><wp:lineTo x="0" y="21600"/><wp:lineTo x="21600" y="21600"/><wp:lineTo x="21600" y="0"/><wp:lineTo x="0" y="0"/></wp:wrapPolygon></wp:wrapTight>`;case"through":return`<wp:wrapThrough${e}><wp:wrapPolygon edited="0"><wp:start x="0" y="0"/><wp:lineTo x="0" y="21600"/><wp:lineTo x="21600" y="21600"/><wp:lineTo x="21600" y="0"/><wp:lineTo x="0" y="0"/></wp:wrapPolygon></wp:wrapThrough>`;case"topAndBottom":return"<wp:wrapTopAndBottom/>";case"behind":case"inFront":return"<wp:wrapNone/>";default:return"<wp:wrapNone/>"}}function qh(t,e){let n=t.size.width,r=t.size.height,i=t.rId||"rId1",o=e,l=t.filename||`image${o}`,a="";t.transform?.rotation&&(a+=` rot="${Math.round(t.transform.rotation*6e4)}"`),t.transform?.flipH&&(a+=' flipH="1"'),t.transform?.flipV&&(a+=' flipV="1"');let s=t.opacity!==void 0&&t.opacity<1?`<a:alphaModFix amt="${Math.round(Math.max(0,Math.min(1,t.opacity))*1e5)}"/>`:"",u=s?`<a:blip r:embed="${i}">${s}</a:blip>`:`<a:blip r:embed="${i}"/>`,p=[];t.crop?.left&&p.push(`l="${Math.round(t.crop.left*1e5)}"`),t.crop?.top&&p.push(`t="${Math.round(t.crop.top*1e5)}"`),t.crop?.right&&p.push(`r="${Math.round(t.crop.right*1e5)}"`),t.crop?.bottom&&p.push(`b="${Math.round(t.crop.bottom*1e5)}"`);let d=p.length>0?`<a:srcRect ${p.join(" ")}/>`:"";return['<a:graphic xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main">','<a:graphicData uri="http://schemas.openxmlformats.org/drawingml/2006/picture">','<pic:pic xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture">',"<pic:nvPicPr>",`<pic:cNvPr id="${o}" name="${W(l)}"${t.alt?` descr="${W(t.alt)}"`:""}/>`,"<pic:cNvPicPr/>","</pic:nvPicPr>","<pic:blipFill>",u,d,"<a:stretch><a:fillRect/></a:stretch>","</pic:blipFill>","<pic:spPr>",`<a:xfrm${a}>`,'<a:off x="0" y="0"/>',`<a:ext cx="${O(n)}" cy="${O(r)}"/>`,"</a:xfrm>",'<a:prstGeom prst="rect"><a:avLst/></a:prstGeom>',t.outline?Na(t.outline):"","</pic:spPr>","</pic:pic>","</a:graphicData>","</a:graphic>"].join("")}function Uh(t){let e=t.image,n=e.wrap.type!=="inline",r=e.size.width,i=e.size.height,o=e.wrap.distT??0,l=e.wrap.distB??0,a=e.wrap.distL??0,s=e.wrap.distR??0,u=e.padding?.left??0,p=e.padding?.top??0,d=e.padding?.right??0,f=e.padding?.bottom??0,h=`<wp:effectExtent l="${O(u)}" t="${O(p)}" r="${O(d)}" b="${O(f)}"/>`,c=za(e.id),m=e.title||e.filename||`Picture ${c}`,g=qh(e,c);if(!n)return["<w:drawing>",`<wp:inline distT="${O(o)}" distB="${O(l)}" distL="${O(a)}" distR="${O(s)}">`,`<wp:extent cx="${O(r)}" cy="${O(i)}"/>`,h,`<wp:docPr id="${c}" name="${W(m)}"${e.alt?` descr="${W(e.alt)}"`:""}${e.decorative?' hidden="1"':""}/>`,'<wp:cNvGraphicFramePr><a:graphicFrameLocks xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" noChangeAspect="1"/></wp:cNvGraphicFramePr>',g,"</wp:inline>","</w:drawing>"].join("");let v=e.wrap.type==="behind"?"1":"0",C=e.position?Oa(e.position):'<wp:positionH relativeFrom="column"><wp:posOffset>0</wp:posOffset></wp:positionH><wp:positionV relativeFrom="paragraph"><wp:posOffset>0</wp:posOffset></wp:positionV>',y=Ha(e.wrap);return["<w:drawing>",`<wp:anchor distT="${O(o)}" distB="${O(l)}" distL="${O(a)}" distR="${O(s)}" simplePos="0" relativeHeight="251658240" behindDoc="${v}" locked="0" layoutInCell="${e.layoutInCell===!1?"0":"1"}" allowOverlap="${e.allowOverlap===!1?"0":"1"}">`,'<wp:simplePos x="0" y="0"/>',C,`<wp:extent cx="${O(r)}" cy="${O(i)}"/>`,h,y,`<wp:docPr id="${c}" name="${W(m)}"${e.alt?` descr="${W(e.alt)}"`:""}/>`,'<wp:cNvGraphicFramePr><a:graphicFrameLocks xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" noChangeAspect="1"/></wp:cNvGraphicFramePr>',g,"</wp:anchor>","</w:drawing>"].join("")}function Vh(t){return t.map(e=>xn(e)).join("")}function Yh(t){let e=t.shape,n=e.size.width,r=e.size.height,i=e.shapeType==="textBox",o=e.wrap&&e.wrap.type!=="inline",l=e.wrap?.distT??0,a=e.wrap?.distB??0,s=e.wrap?.distL??0,u=e.wrap?.distR??0,p=za(e.id),d=e.name||(i?`TextBox ${p}`:`Shape ${p}`),f="";e.transform?.rotation&&(f+=` rot="${Math.round(e.transform.rotation*6e4)}"`),e.transform?.flipH&&(f+=' flipH="1"'),e.transform?.flipV&&(f+=' flipV="1"');let h=["<wps:spPr>",`<a:xfrm${f}>`,'<a:off x="0" y="0"/>',`<a:ext cx="${O(n)}" cy="${O(r)}"/>`,"</a:xfrm>",`<a:prstGeom prst="${e.shapeType==="textBox"?"rect":e.shapeType}"><a:avLst/></a:prstGeom>`,Xh(e.fill),Na(e.outline),"</wps:spPr>"].join(""),c="";if(e.textBody){let y=e.textBody,k=['rot="0"','vert="horz"'];y.anchor&&k.push(`anchor="${y.anchor==="middle"?"ctr":y.anchor}"`),y.anchorCenter&&k.push('anchorCtr="1"'),y.margins&&(y.margins.left!=null&&k.push(`lIns="${O(y.margins.left)}"`),y.margins.top!=null&&k.push(`tIns="${O(y.margins.top)}"`),y.margins.right!=null&&k.push(`rIns="${O(y.margins.right)}"`),y.margins.bottom!=null&&k.push(`bIns="${O(y.margins.bottom)}"`)),i?c=["<wps:txbx><w:txbxContent>",Vh(y.content),"</w:txbxContent></wps:txbx>",`<wps:bodyPr ${k.join(" ")}/>`].join(""):c=[`<wps:bodyPr ${k.join(" ")}/>`].join("")}let m=['<a:graphic xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main">','<a:graphicData uri="http://schemas.microsoft.com/office/word/2010/wordprocessingShape">',["<wps:wsp>",`<wps:cNvSpPr${i?' txBox="1"':""}/>`,h,c,"</wps:wsp>"].join(""),"</a:graphicData>","</a:graphic>"].join("");if(!o)return["<w:drawing>",`<wp:inline distT="${O(l)}" distB="${O(a)}" distL="${O(s)}" distR="${O(u)}">`,`<wp:extent cx="${O(n)}" cy="${O(r)}"/>`,'<wp:effectExtent l="0" t="0" r="0" b="0"/>',`<wp:docPr id="${p}" name="${W(d)}"/>`,"<wp:cNvGraphicFramePr/>",m,"</wp:inline>","</w:drawing>"].join("");let g=e.wrap?.type==="behind"?"1":"0",v=e.position?Oa(e.position):'<wp:positionH relativeFrom="column"><wp:posOffset>0</wp:posOffset></wp:positionH><wp:positionV relativeFrom="paragraph"><wp:posOffset>0</wp:posOffset></wp:positionV>',C=Ha(e.wrap);return["<w:drawing>",`<wp:anchor distT="${O(l)}" distB="${O(a)}" distL="${O(s)}" distR="${O(u)}" simplePos="0" relativeHeight="251658240" behindDoc="${g}" locked="0" layoutInCell="1" allowOverlap="1">`,'<wp:simplePos x="0" y="0"/>',v,`<wp:extent cx="${O(n)}" cy="${O(r)}"/>`,'<wp:effectExtent l="0" t="0" r="0" b="0"/>',C,`<wp:docPr id="${p}" name="${W(d)}"/>`,"<wp:cNvGraphicFramePr/>",m,"</wp:anchor>","</w:drawing>"].join("")}var Gh=new Set(["black","blue","cyan","darkBlue","darkCyan","darkGray","darkGreen","darkMagenta","darkRed","darkYellow","green","lightGray","magenta","red","white","yellow"]);function Zh(t){if(!t)return"";let e=[];return t.auto?e.push('w:val="auto"'):t.rgb&&e.push(`w:val="${t.rgb}"`),t.themeColor&&e.push(`w:themeColor="${t.themeColor}"`),t.themeTint&&e.push(`w:themeTint="${t.themeTint}"`),t.themeShade&&e.push(`w:themeShade="${t.themeShade}"`),e.length===0?"":`<w:color ${e.join(" ")}/>`}function Kh(t){if(!t)return"";let e=[];return t.pattern?e.push(`w:val="${t.pattern}"`):e.push('w:val="clear"'),t.color?.rgb?e.push(`w:color="${t.color.rgb}"`):t.color?.auto&&e.push('w:color="auto"'),t.fill?.rgb?e.push(`w:fill="${t.fill.rgb}"`):t.fill?.auto&&e.push('w:fill="auto"'),t.fill?.themeColor&&e.push(`w:themeFill="${t.fill.themeColor}"`),t.fill?.themeTint&&e.push(`w:themeFillTint="${t.fill.themeTint}"`),t.fill?.themeShade&&e.push(`w:themeFillShade="${t.fill.themeShade}"`),e.length===0?"":`<w:shd ${e.join(" ")}/>`}function Fe(t){if(!t)return"";let e=[];if(t.styleId&&e.push(`<w:rStyle w:val="${W(t.styleId)}"/>`),t.fontFamily){let i=[];t.fontFamily.ascii&&i.push(`w:ascii="${W(t.fontFamily.ascii)}"`),t.fontFamily.hAnsi&&i.push(`w:hAnsi="${W(t.fontFamily.hAnsi)}"`),t.fontFamily.eastAsia&&i.push(`w:eastAsia="${W(t.fontFamily.eastAsia)}"`),t.fontFamily.cs&&i.push(`w:cs="${W(t.fontFamily.cs)}"`),t.fontFamily.asciiTheme&&i.push(`w:asciiTheme="${t.fontFamily.asciiTheme}"`),t.fontFamily.hAnsiTheme&&i.push(`w:hAnsiTheme="${t.fontFamily.hAnsiTheme}"`),t.fontFamily.eastAsiaTheme&&i.push(`w:eastAsiaTheme="${t.fontFamily.eastAsiaTheme}"`),t.fontFamily.csTheme&&i.push(`w:csTheme="${t.fontFamily.csTheme}"`),i.length>0&&e.push(`<w:rFonts ${i.join(" ")}/>`)}t.bold===!0?e.push("<w:b/>"):t.bold===!1&&e.push('<w:b w:val="0"/>'),t.boldCs===!0?e.push("<w:bCs/>"):t.boldCs===!1&&e.push('<w:bCs w:val="0"/>'),t.italic===!0?e.push("<w:i/>"):t.italic===!1&&e.push('<w:i w:val="0"/>'),t.italicCs===!0?e.push("<w:iCs/>"):t.italicCs===!1&&e.push('<w:iCs w:val="0"/>'),t.allCaps===!0?e.push("<w:caps/>"):t.allCaps===!1&&e.push('<w:caps w:val="0"/>'),t.smallCaps===!0?e.push("<w:smallCaps/>"):t.smallCaps===!1&&e.push('<w:smallCaps w:val="0"/>'),t.strike===!0?e.push("<w:strike/>"):t.strike===!1&&e.push('<w:strike w:val="0"/>'),t.doubleStrike===!0?e.push("<w:dstrike/>"):t.doubleStrike===!1&&e.push('<w:dstrike w:val="0"/>'),t.outline===!0?e.push("<w:outline/>"):t.outline===!1&&e.push('<w:outline w:val="0"/>'),t.shadow===!0?e.push("<w:shadow/>"):t.shadow===!1&&e.push('<w:shadow w:val="0"/>'),t.emboss===!0?e.push("<w:emboss/>"):t.emboss===!1&&e.push('<w:emboss w:val="0"/>'),t.imprint===!0?e.push("<w:imprint/>"):t.imprint===!1&&e.push('<w:imprint w:val="0"/>'),t.hidden===!0?e.push("<w:vanish/>"):t.hidden===!1&&e.push('<w:vanish w:val="0"/>');let n=Zh(t.color);if(n&&e.push(n),t.spacing!==void 0&&e.push(`<w:spacing w:val="${O(t.spacing)}"/>`),t.scale!==void 0&&e.push(`<w:w w:val="${O(t.scale)}"/>`),t.kerning!==void 0&&e.push(`<w:kern w:val="${O(t.kerning)}"/>`),t.position!==void 0&&e.push(`<w:position w:val="${O(t.position)}"/>`),t.fontSize!==void 0&&e.push(`<w:sz w:val="${O(t.fontSize)}"/>`),t.fontSizeCs!==void 0&&e.push(`<w:szCs w:val="${O(t.fontSizeCs)}"/>`),t.highlight&&t.highlight!=="none"){if(Gh.has(t.highlight))e.push(`<w:highlight w:val="${t.highlight}"/>`);else if(!t.shading){let i=t.highlight.replace(/^#/,"");/^[0-9a-fA-F]{6}$/.test(i)&&e.push(`<w:shd w:val="clear" w:color="auto" w:fill="${i}"/>`)}}if(t.underline){let i=[`w:val="${t.underline.style}"`];t.underline.color&&(t.underline.color.rgb&&i.push(`w:color="${t.underline.color.rgb}"`),t.underline.color.themeColor&&i.push(`w:themeColor="${t.underline.color.themeColor}"`),t.underline.color.themeTint&&i.push(`w:themeTint="${t.underline.color.themeTint}"`),t.underline.color.themeShade&&i.push(`w:themeShade="${t.underline.color.themeShade}"`)),e.push(`<w:u ${i.join(" ")}/>`)}t.effect&&t.effect!=="none"&&e.push(`<w:effect w:val="${t.effect}"/>`),t.emphasisMark&&t.emphasisMark!=="none"&&e.push(`<w:em w:val="${t.emphasisMark}"/>`);let r=Kh(t.shading);return r&&e.push(r),t.vertAlign&&t.vertAlign!=="baseline"&&e.push(`<w:vertAlign w:val="${t.vertAlign}"/>`),t.rtl===!0?e.push("<w:rtl/>"):t.rtl===!1&&e.push('<w:rtl w:val="0"/>'),t.cs===!0?e.push("<w:cs/>"):t.cs===!1&&e.push('<w:cs w:val="0"/>'),e.length===0?"":`<w:rPr>${e.join("")}</w:rPr>`}function Jh(t){return!t.startsWith("<w:rPr>")||!t.endsWith("</w:rPr>")?"":t.slice(7,-8)}function Qh(t){let e=Number.isInteger(t.info.id)&&t.info.id>=0?t.info.id:0,n=typeof t.info.author=="string"?t.info.author.trim():"",r=n.length>0?n:"Unknown",i=typeof t.info.date=="string"?t.info.date.trim():void 0,o=[`w:id="${e}"`,`w:author="${W(r)}"`];i&&o.push(`w:date="${W(i)}"`);let l=Fe(t.previousFormatting)||"<w:rPr/>";return`<w:rPrChange ${o.join(" ")}>${l}</w:rPrChange>`}function tm(t,e){let n=Fe(t),r=n?Jh(n):"",i=(e??[]).map(Qh).join(""),o=`${r}${i}`;return o?`<w:rPr>${o}</w:rPr>`:""}function em(t){return`<w:t${t.preserveSpace||t.text.startsWith(" ")||t.text.endsWith(" ")||t.text.includes("  ")?' xml:space="preserve"':""}>${W(t.text)}</w:t>`}function nm(t){return"<w:tab/>"}function rm(t){let e=[];return t.breakType==="page"?e.push('w:type="page"'):t.breakType==="column"?e.push('w:type="column"'):t.breakType==="textWrapping"&&(e.push('w:type="textWrapping"'),t.clear&&t.clear!=="none"&&e.push(`w:clear="${t.clear}"`)),e.length===0?"<w:br/>":`<w:br ${e.join(" ")}/>`}function im(t){return`<w:sym w:font="${W(t.font)}" w:char="${W(t.char)}"/>`}function om(t){return t.type==="footnoteRef"?`<w:footnoteReference w:id="${t.id}"/>`:`<w:endnoteReference w:id="${t.id}"/>`}function lm(t){let e=[`w:fldCharType="${t.charType}"`];return t.fldLock&&e.push('w:fldLock="true"'),t.dirty&&e.push('w:dirty="true"'),`<w:fldChar ${e.join(" ")}/>`}function am(t){return`<w:instrText${t.text.startsWith(" ")||t.text.endsWith(" ")||t.text.includes("  ")?' xml:space="preserve"':""}>${W(t.text)}</w:instrText>`}function sm(t){return"<w:softHyphen/>"}function pm(t){return"<w:noBreakHyphen/>"}function um(t){switch(t.type){case"text":return em(t);case"tab":return nm();case"break":return rm(t);case"symbol":return im(t);case"footnoteRef":case"endnoteRef":return om(t);case"footnoteRefMark":return"<w:footnoteRef/>";case"endnoteRefMark":return"<w:endnoteRef/>";case"separator":return"<w:separator/>";case"continuationSeparator":return"<w:continuationSeparator/>";case"fieldChar":return lm(t);case"instrText":return am(t);case"softHyphen":return sm();case"noBreakHyphen":return pm();case"drawing":return Uh(t);case"shape":return Yh(t);default:return""}}function _t(t){let e=[],n=tm(t.formatting,t.propertyChanges);n&&e.push(n);for(let r of t.content){let i=um(r);i&&e.push(i)}return`<w:r>${e.join("")}</w:r>`}function Da(t){if(!t)return"";let e=[t.firstRow?"1":"0",t.lastRow?"1":"0",t.firstColumn?"1":"0",t.lastColumn?"1":"0",t.oddVBand?"1":"0",t.evenVBand?"1":"0",t.oddHBand?"1":"0",t.evenHBand?"1":"0",t.nwCell?"1":"0",t.neCell?"1":"0",t.swCell?"1":"0",t.seCell?"1":"0"].join("");return e==="000000000000"?"":`<w:cnfStyle w:val="${e}"/>`}function _r(t){if(!(t==null||!Number.isFinite(t)||t<=0))return Math.max(1,Math.round(t))}function dm(t){return t.columnWidths&&t.columnWidths.length>0?t.columnWidths.length:t.rows.reduce((e,n)=>{let r=n.cells.reduce((i,o)=>i+Math.max(1,Math.round(o.formatting?.gridSpan??1)),0);return Math.max(e,r)},0)}function fm(t){let e=[];for(let n of t.cells){let r=_r(n.formatting?.width?.value);if(r==null)return;let i=Math.max(1,Math.round(n.formatting?.gridSpan??1));e.push(...En(r,i))}return e}function cm(t){let e=t.columnWidths?.map(l=>_r(l)).filter(l=>l!=null);if(e&&e.length>0)return e;let n=dm(t);if(n<=0)return[];let r,i=-1;for(let l of t.rows){let a=fm(l);a&&a.length===n&&l.cells.length>i&&(r=a,i=l.cells.length)}if(r)return r;let o=t.formatting?.width?.type==="dxa"?_r(t.formatting.width.value):void 0;return En(o??9360,n)}function hm(t){let e=cm(t);return e.length===0?"":`<w:tblGrid>${e.map(n=>`<w:gridCol w:w="${O(n)}"/>`).join("")}</w:tblGrid>`}function mm(t){let e=Number.isInteger(t.id)&&t.id>=0?t.id:0,n=typeof t.author=="string"?t.author.trim():"",r=n.length>0?n:"Unknown",i=typeof t.date=="string"?t.date.trim():void 0;return{id:e,author:r,date:i}}function At(t){let e=mm(t),n=[`w:id="${e.id}"`,`w:author="${W(e.author)}"`];return e.date&&n.push(`w:date="${W(e.date)}"`),n.join(" ")}function Lt(t,e){if(!t)return"";let n=[`w:w="${O(t.value)}"`,`w:type="${t.type}"`];return`<w:${e} ${n.join(" ")}/>`}var gm=["top","left","bottom","right","insideH","insideV"];function Wa(t,e){if(!t)return"";let n=[];for(let r of gm){let i=Xr(t[r],r);i&&n.push(i)}return n.length===0?"":`<w:${e}>${n.join("")}</w:${e}>`}function ja(t,e){if(!t)return"";let n=[];return t.top&&n.push(Lt(t.top,"top")),t.left&&n.push(Lt(t.left,"left")),t.bottom&&n.push(Lt(t.bottom,"bottom")),t.right&&n.push(Lt(t.right,"right")),n.length===0?"":`<w:${e}>${n.join("")}</w:${e}>`}function _a(t){if(!t)return"";let e=[];return t.pattern?e.push(`w:val="${t.pattern}"`):e.push('w:val="clear"'),t.color?.rgb?e.push(`w:color="${t.color.rgb}"`):t.color?.auto&&e.push('w:color="auto"'),t.fill?.rgb?e.push(`w:fill="${t.fill.rgb}"`):t.fill?.auto&&e.push('w:fill="auto"'),t.fill?.themeColor&&e.push(`w:themeFill="${t.fill.themeColor}"`),t.fill?.themeTint&&e.push(`w:themeFillTint="${t.fill.themeTint}"`),t.fill?.themeShade&&e.push(`w:themeFillShade="${t.fill.themeShade}"`),e.length===0?"":`<w:shd ${e.join(" ")}/>`}function wm(t){if(!t)return"";let e=[];return t.firstRow&&e.push('w:firstRow="1"'),t.lastRow&&e.push('w:lastRow="1"'),t.firstColumn&&e.push('w:firstColumn="1"'),t.lastColumn&&e.push('w:lastColumn="1"'),t.noHBand&&e.push('w:noHBand="1"'),t.noVBand&&e.push('w:noVBand="1"'),e.length===0?"":`<w:tblLook ${e.join(" ")}/>`}function ym(t){if(!t)return"";let e=[];return t.horzAnchor&&e.push(`w:horzAnchor="${t.horzAnchor}"`),t.vertAnchor&&e.push(`w:vertAnchor="${t.vertAnchor}"`),t.tblpX!==void 0&&e.push(`w:tblpX="${O(t.tblpX)}"`),t.tblpXSpec&&e.push(`w:tblpXSpec="${t.tblpXSpec}"`),t.tblpY!==void 0&&e.push(`w:tblpY="${O(t.tblpY)}"`),t.tblpYSpec&&e.push(`w:tblpYSpec="${t.tblpYSpec}"`),t.topFromText!==void 0&&e.push(`w:topFromText="${O(t.topFromText)}"`),t.bottomFromText!==void 0&&e.push(`w:bottomFromText="${O(t.bottomFromText)}"`),t.leftFromText!==void 0&&e.push(`w:leftFromText="${O(t.leftFromText)}"`),t.rightFromText!==void 0&&e.push(`w:rightFromText="${O(t.rightFromText)}"`),e.length===0?"":`<w:tblpPr ${e.join(" ")}/>`}function Xa(t,e){let n=[];if(t){t.styleId&&n.push(`<w:tblStyle w:val="${W(t.styleId)}"/>`);let r=ym(t.floating);r&&n.push(r),t.overlap&&n.push(`<w:tblOverlap w:val="${t.overlap}"/>`),t.bidi&&n.push("<w:bidiVisual/>");let i=Lt(t.width,"tblW");i&&n.push(i),t.justification&&n.push(`<w:jc w:val="${t.justification}"/>`);let o=Lt(t.cellSpacing,"tblCellSpacing");o&&n.push(o);let l=Lt(t.indent,"tblInd");l&&n.push(l);let a=Wa(t.borders,"tblBorders");a&&n.push(a);let s=_a(t.shading);s&&n.push(s),t.layout&&n.push(`<w:tblLayout w:type="${t.layout}"/>`);let u=ja(t.cellMargins,"tblCellMar");u&&n.push(u);let p=wm(t.look);p&&n.push(p)}return e&&e.length>0&&n.push(xm(e[0])),n.length===0?"":`<w:tblPr>${n.join("")}</w:tblPr>`}function bm(t){return!t.startsWith("<w:tblPr>")||!t.endsWith("</w:tblPr>")?"":t.slice(9,-10)}function xm(t){let e=At(t.info),n=Xa(t.previousFormatting)||"<w:tblPr/>",r=bm(n),i=r.length>0?`<w:tblPr>${r}</w:tblPr>`:"<w:tblPr/>";return`<w:tblPrChange ${e}>${i}</w:tblPrChange>`}function qa(t,e,n){let r=[];if(t){let i=Da(t.conditionalFormat);if(i&&r.push(i),t.cantSplit&&r.push("<w:cantSplit/>"),t.header&&r.push("<w:tblHeader/>"),t.height){let o=[`w:val="${O(t.height.value)}"`];t.heightRule&&o.push(`w:hRule="${t.heightRule}"`),r.push(`<w:trHeight ${o.join(" ")}/>`)}t.justification&&r.push(`<w:jc w:val="${t.justification}"/>`),t.hidden&&r.push("<w:hidden/>")}return n&&(n.type==="tableRowInsertion"?r.push(`<w:ins ${At(n.info)}/>`):n.type==="tableRowDeletion"&&r.push(`<w:del ${At(n.info)}/>`)),e&&e.length>0&&r.push(km(e[0])),r.length===0?"":`<w:trPr>${r.join("")}</w:trPr>`}function vm(t){return!t.startsWith("<w:trPr>")||!t.endsWith("</w:trPr>")?"":t.slice(8,-9)}function km(t){let e=At(t.info),n=qa(t.previousFormatting)||"<w:trPr/>",r=vm(n),i=r.length>0?`<w:trPr>${r}</w:trPr>`:"<w:trPr/>";return`<w:trPrChange ${e}>${i}</w:trPrChange>`}function Ua(t,e,n){let r=[];if(t){let i=Da(t.conditionalFormat);i&&r.push(i);let o=Lt(t.width,"tcW");o&&r.push(o),t.gridSpan&&t.gridSpan>1&&r.push(`<w:gridSpan w:val="${O(t.gridSpan)}"/>`),t.vMerge&&(t.vMerge==="restart"?r.push('<w:vMerge w:val="restart"/>'):r.push("<w:vMerge/>"));let l=Wa(t.borders,"tcBorders");l&&r.push(l);let a=_a(t.shading);a&&r.push(a),t.noWrap&&r.push("<w:noWrap/>");let s=ja(t.margins,"tcMar");s&&r.push(s),t.textDirection&&r.push(`<w:textDirection w:val="${t.textDirection}"/>`),t.fitText&&r.push("<w:tcFitText/>"),t.verticalAlign&&r.push(`<w:vAlign w:val="${t.verticalAlign}"/>`),t.hideMark&&r.push("<w:hideMark/>")}if(n){if(n.type==="tableCellInsertion")r.push(`<w:cellIns ${At(n.info)}/>`);else if(n.type==="tableCellDeletion")r.push(`<w:cellDel ${At(n.info)}/>`);else if(n.type==="tableCellMerge"){let i=n.vMerge?` w:vMerge="${n.vMerge}"`:"",o=n.vMergeOrig?` w:vMergeOrig="${n.vMergeOrig}"`:"";r.push(`<w:cellMerge ${At(n.info)}${i}${o}/>`)}}return e&&e.length>0&&r.push(Cm(e[0])),r.length===0?"":`<w:tcPr>${r.join("")}</w:tcPr>`}function Sm(t){return!t.startsWith("<w:tcPr>")||!t.endsWith("</w:tcPr>")?"":t.slice(8,-9)}function Cm(t){let e=At(t.info),n=Ua(t.previousFormatting)||"<w:tcPr/>",r=Sm(n),i=r.length>0?`<w:tcPr>${r}</w:tcPr>`:"<w:tcPr/>";return`<w:tcPrChange ${e}>${i}</w:tcPrChange>`}function Tm(t){let e=[];for(let n of t)n.type==="paragraph"?e.push(xn(n)):n.type==="table"&&e.push(Vr(n));return e.length===0&&e.push("<w:p/>"),e.join("")}function $m(t){let e=[],n=Ua(t.formatting,t.propertyChanges,t.structuralChange);return n&&e.push(n),e.push(Tm(t.content)),`<w:tc>${e.join("")}</w:tc>`}function Im(t){let e=[],n=qa(t.formatting,t.propertyChanges,t.structuralChange);n&&e.push(n);for(let r of t.cells)e.push($m(r));return`<w:tr>${e.join("")}</w:tr>`}function Vr(t){let e=[],n=Xa(t.formatting,t.propertyChanges),r=hm(t);n?e.push(n):r&&e.push("<w:tblPr/>"),r&&e.push(r);for(let i of t.rows)e.push(Im(i));return`<w:tbl>${e.join("")}</w:tbl>`}function Va(t,e){let n=t.content.map(e).join(""),r=t.properties.rawPropertiesXml??"",i=t.properties.rawEndPropertiesXml??"";return`<w:sdt>${r}${i}<w:sdtContent>${n}</w:sdtContent></w:sdt>`}var Q={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",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",wpg:"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup",wne:"http://schemas.microsoft.com/office/word/2006/wordml",wps:"http://schemas.microsoft.com/office/word/2010/wordprocessingShape"};function Fm(){let t={wpc:Q.wpc,mc:Q.mc,o:Q.o,r:Q.r,m:Q.m,v:Q.v,wp14:Q.wp14,wp:Q.wp,w10:Q.w10,w:Q.w,w14:Q.w14,w15:Q.w15,w16se:Q.w16se,w16cid:Q.w16cid,w16:Q.w16,w16cex:Q.w16cex,w16sdtdh:Q.w16sdtdh,wne:Q.wne,wpg:Q.wpg,wps:Q.wps};return Object.entries(t).map(([e,n])=>`xmlns:${e}="${n}"`).join(" ")}function Yr(t){return t.type==="paragraph"?xn(t):t.type==="table"?Vr(t):t.type==="blockSdt"?Va(t,Yr):""}function Pm(t){return t.map(e=>Yr(e)).join("")}function Rm(t){let e=[];return e.push(Pm(t.content)),t.finalSectionProperties&&e.push(Fa(t.finalSectionProperties)),e.join("")}function vn(t){_h();let e=[];e.push('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>');let n=Fm();return e.push(`<w:document ${n} mc:Ignorable="w14 w15 w16se w16cid w16 w16cex w16sdtdh wp14">`),e.push("<w:body>"),e.push(Rm(t.package.document)),e.push("</w:body>"),e.push("</w:document>"),e.join("")}var Em='<v:shapetype id="_x0000_t136" coordsize="21600,21600" o:spt="136" adj="10800" path="m@7,l@8,m@5,21600l@6,21600e"><v:formulas><v:f eqn="sum #0 0 10800"/><v:f eqn="prod #0 2 1"/><v:f eqn="sum 21600 0 @1"/><v:f eqn="sum 0 0 @2"/><v:f eqn="sum 21600 0 @3"/><v:f eqn="if @0 @3 0"/><v:f eqn="if @0 21600 @1"/><v:f eqn="if @0 0 @2"/><v:f eqn="if @0 @4 21600"/><v:f eqn="mid @5 @6"/><v:f eqn="mid @8 @5"/><v:f eqn="mid @7 @8"/><v:f eqn="mid @6 @7"/><v:f eqn="sum @6 0 @5"/></v:formulas><v:path textpathok="t" o:connecttype="custom" o:connectlocs="@9,0;@10,10800;@9,21600;@11,10800" o:connectangles="270,180,90,0"/><v:textpath on="t" fitshape="t"/><v:handles><v:h position="#0,bottomRight" xrange="6629,14971"/></v:handles><o:lock v:ext="edit" text="t" shapetype="t"/></v:shapetype>',Mm='<v:shapetype id="_x0000_t75" coordsize="21600,21600" o:spt="75" o:preferrelative="t" path="m@4@5l@4@11@9@11@9@5xe" filled="f" stroked="f"><v:stroke joinstyle="miter"/><v:formulas><v:f eqn="if lineDrawn pixelLineWidth 0"/><v:f eqn="sum @0 1 0"/><v:f eqn="sum 0 0 @1"/><v:f eqn="prod @2 1 2"/><v:f eqn="prod @3 21600 pixelWidth"/><v:f eqn="prod @3 21600 pixelHeight"/><v:f eqn="sum @0 0 1"/><v:f eqn="prod @6 1 2"/><v:f eqn="prod @7 21600 pixelWidth"/><v:f eqn="sum @8 21600 0"/><v:f eqn="prod @7 21600 pixelHeight"/><v:f eqn="sum @10 21600 0"/></v:formulas><v:path o:extrusionok="f" gradientshapeok="t" o:connecttype="rect"/><o:lock v:ext="edit" aspectratio="t"/></v:shapetype>';function Bm(t){let e=Math.max(t.text.trim().length,1),n=Math.min(Math.max(e*26,120),468);return{width:n,height:n/2}}var Ca=12700;function Lm(t){let e=t.widthEmu!==void 0?t.widthEmu/Ca:311.4,n=t.heightEmu!==void 0?t.heightEmu/Ca:e;return{width:e*(t.scale||1),height:n*(t.scale||1)}}function Am(t){let{width:e,height:n}=Bm(t),r=t.layout==="diagonal"?";rotation:315":"",i=`position:absolute;margin-left:0;margin-top:0;width:${e}pt;height:${n}pt${r};z-index:-251658240;mso-position-horizontal:center;mso-position-horizontal-relative:margin;mso-position-vertical:center;mso-position-vertical-relative:margin`,o=t.semitransparent?'<v:fill opacity=".5"/>':"",l=t.fontSize!==void 0?t.fontSize:1,a=`font-family:&quot;${W(t.font)}&quot;;font-size:${l}pt`;return"<w:p><w:r><w:rPr><w:noProof/></w:rPr><w:pict>"+Em+`<v:shape id="PowerPlusWaterMarkObject1" o:spid="_x0000_s2049" type="#_x0000_t136" style="${i}" o:allowincell="f" fillcolor="${W(t.color)}" stroked="f">`+o+`<v:textpath style="${a}" string="${W(t.text)}"/></v:shape></w:pict></w:r></w:p>`}function zm(t){if(!t.relId)return"";let{width:e,height:n}=Lm(t),r=`position:absolute;margin-left:0;margin-top:0;width:${e}pt;height:${n}pt;z-index:-251657216;mso-position-horizontal:center;mso-position-horizontal-relative:margin;mso-position-vertical:center;mso-position-vertical-relative:margin`,i=t.washout?' gain="19661f" blacklevel="22938f"':"";return"<w:p><w:r><w:rPr><w:noProof/></w:rPr><w:pict>"+Mm+`<v:shape id="WordPictureWatermark1" o:spid="_x0000_s2050" type="#_x0000_t75" style="${r}" o:allowincell="f"><v:imagedata r:id="${W(t.relId)}" o:title="watermark"${i}/></v:shape></w:pict></w:r></w:p>`}function Nm(t){return t.kind==="text"?Am(t):zm(t)}var Om={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",w16se:"http://schemas.microsoft.com/office/word/2015/wordml/symex",w16cid:"http://schemas.microsoft.com/office/word/2016/wordml/cid",w16:"http://schemas.microsoft.com/office/word/2018/wordml",w16cex:"http://schemas.microsoft.com/office/word/2018/wordml/cex",w16sdtdh:"http://schemas.microsoft.com/office/word/2020/wordml/sdtdatahash",wne:"http://schemas.microsoft.com/office/word/2006/wordml",wpg:"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup",wps:"http://schemas.microsoft.com/office/word/2010/wordprocessingShape"};function Hm(){return Object.entries(Om).map(([t,e])=>`xmlns:${t}="${e}"`).join(" ")}function Ya(t){return t.type==="paragraph"?xn(t):t.type==="table"?Vr(t):t.type==="blockSdt"?Va(t,Ya):""}function Ga(t){let e=t.type==="header"?"w:hdr":"w:ftr",n=Hm(),r=t.content.map(i=>Ya(i)).join("");return t.watermark&&(r=Nm(t.watermark)+r),r||(r="<w:p><w:pPr/></w:p>"),`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<${e} ${n}>${r}</${e}>`}function Za(t){let e="<w:r>",n=[];t.formatting?.bold&&n.push("<w:b/>"),t.formatting?.italic&&n.push("<w:i/>"),n.length>0&&(e+=`<w:rPr>${n.join("")}</w:rPr>`);for(let r of t.content)if(r.type==="text"){let i=r.text!==r.text.trim()||r.text.includes("  ");e+=i?`<w:t xml:space="preserve">${W(r.text)}</w:t>`:`<w:t>${W(r.text)}</w:t>`}else r.type==="break"&&(e+="<w:br/>");return e+="</w:r>",e}function Ta(t,e){let n=e?`<w:p w14:paraId="${e}">`:"<w:p>";for(let r of t.content)r.type==="run"&&(n+=Za(r));return n+="</w:p>",n}function $a(t,e){let n=e?`<w:p w14:paraId="${e}">`:"<w:p>";n+='<w:r><w:rPr><w:rStyle w:val="CommentReference"/></w:rPr><w:annotationRef/></w:r>';for(let r of t.content)r.type==="run"&&(n+=Za(r));return n+="</w:p>",n}function Ia(t,e){let n=Vt(),r=[`w:id="${t.id}"`];if(t.author&&r.push(`w:author="${W(t.author)}"`),t.initials?r.push(`w:initials="${W(t.initials)}"`):r.push('w:initials=""'),t.date){let o=t.date.replace(/\.\d{3}Z$/,"Z");r.push(`w:date="${W(o)}"`)}let i=`<w:comment ${r.join(" ")}>`;if(t.content&&t.content.length>0)if(t.content.length===1)i+=$a(t.content[0],n);else{i+=$a(t.content[0]);for(let o=1;o<t.content.length-1;o++)i+=Ta(t.content[o]);i+=Ta(t.content[t.content.length-1],n)}else i+=`<w:p w14:paraId="${n}"><w:r><w:rPr><w:rStyle w:val="CommentReference"/></w:rPr><w:annotationRef/></w:r></w:p>`;return i+="</w:comment>",e.push({commentId:t.id,lastParaId:n,durableId:Vt(),parentId:t.parentId,done:t.done}),i}function kn(t){if(!t||t.length===0)return{xml:"",paraInfos:[]};let e=[],n=[];for(let o of t)(o.parentId==null?e:n).push(o);let r=[],i=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?><w:comments ${ne} ${re}>`;for(let o of e)i+=Ia(o,r);for(let o of n)i+=Ia(o,r);return i+="</w:comments>",{xml:i,paraInfos:r}}function Sn(t){if(t.length===0)return"";let e=new Map;for(let r of t)e.set(r.commentId,r.lastParaId);let n=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?><w15:commentsEx ${ne} ${re}>`;for(let r of t){let i=`w15:paraId="${r.lastParaId}" w15:done="${r.done?"1":"0"}"`;if(r.parentId!=null){let o=e.get(r.parentId);o&&(i+=` w15:paraIdParent="${o}"`)}n+=`<w15:commentEx ${i} />`}return n+="</w15:commentsEx>",n}function Cn(t){if(t.length===0)return"";let e=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?><w16cid:commentsIds ${ne} ${re}>`;for(let n of t)e+=`<w16cid:commentId w16cid:paraId="${n.lastParaId}" w16cid:durableId="${n.durableId}" />`;return e+="</w16cid:commentsIds>",e}function Tn(t,e){if(t.length===0)return"";let n=new Map;for(let i of e)n.set(i.id,i);let r=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?><w16cex:commentsExtensible ${ne} ${re}>`;for(let i of t){let o=n.get(i.commentId);if(!o?.date)continue;let l=i.durableId,a=(o.date.endsWith("Z")?o.date:o.date+"Z").replace(/\.\d{3}Z$/,"Z");r+=`<w16cex:commentExtensible w16cex:durableId="${l}" w16cex:dateUtc="${a}"/>`}return r+="</w16cex:commentsExtensible>",r}var Ka='<?xml version="1.0" encoding="UTF-8" standalone="yes"?>';function Ja(t,e){if(e.verbatimXml)return e.verbatimXml;let n=[];e.noteType&&e.noteType!=="normal"&&n.push(`w:type="${e.noteType}"`),n.push(`w:id="${e.id}"`);let r=e.content.map(i=>Yr(i)).join("");return`<w:${t} ${n.join(" ")}>${r}</w:${t}>`}function Qa(t){let e=t.map(n=>Ja("footnote",n)).join("");return`${Ka}<w:footnotes ${ne} ${re}>${e}</w:footnotes>`}function ts(t){let e=t.map(n=>Ja("endnote",n)).join("");return`${Ka}<w:endnotes ${ne} ${re}>${e}</w:endnotes>`}var $n=ai(bi(),1),Dm=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"></Relationships>`;function Pe(t){return t.startsWith("/")?t.slice(1):`word/${t}`}function Wm(t){let e=[{relsPath:"word/_rels/document.xml.rels",blocks:t.package.document.content}],n=a=>(a??[]).flatMap(s=>s.content),r=[...n(t.package.footnoteSeparators),...n(t.package.footnotes)];r.length>0&&e.push({relsPath:"word/_rels/footnotes.xml.rels",blocks:r});let i=[...n(t.package.endnoteSeparators),...n(t.package.endnotes)];i.length>0&&e.push({relsPath:"word/_rels/endnotes.xml.rels",blocks:i});let o=t.package.relationships;if(!o)return e;let l=(a,s)=>{if(a)for(let[u,p]of a.entries()){let d=o.get(u);if(!d||d.type!==s||!d.target)continue;let f=Pe(d.target).replace(/^word\//,"");e.push({relsPath:`word/_rels/${f}.rels`,blocks:p.content})}};return l(t.package.headers,Z.header),l(t.package.footers,Z.footer),e}async function Re(t,e){let n=t.file(e);return(n?await n.async("text"):Dm).replace(/<Relationships([^>]*)\/>/,"<Relationships$1></Relationships>")}function Xt(t){let e=0;for(let n of t.matchAll(/Id="rId(\d+)"/g)){let r=parseInt(n[1],10);r>e&&(e=r)}return e}function jm(t,e){return e||{png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",bmp:"image/bmp",tif:"image/tiff",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp",wmf:"image/x-wmf",emf:"image/x-emf"}[t]||"application/octet-stream"}function ns(t){let e=[],n=r=>{for(let i of r.content)i.type==="drawing"&&i.image?.src?.startsWith("data:")&&e.push(i.image)};for(let r of t)if(r.type==="paragraph"){for(let i of r.content)if(i.type==="run")n(i);else if(i.type==="insertion"||i.type==="deletion"||i.type==="moveFrom"||i.type==="moveTo")for(let o of i.content)o.type==="run"&&n(o)}else if(r.type==="table")for(let i of r.rows)for(let o of i.cells)e.push(...ns(o.content));return e}var _m={"image/png":"png","image/jpeg":"jpeg","image/gif":"gif","image/bmp":"bmp","image/tiff":"tiff","image/webp":"webp","image/svg+xml":"svg"};function rs(t){let e=t.match(/^data:([^;]+);base64,(.+)$/);if(!e)throw new Error("Invalid data URL");let n=atob(e[2]),r=new Uint8Array(n.length);for(let i=0;i<n.length;i++)r[i]=n.charCodeAt(i);return{data:r.buffer,extension:_m[e[1]]||"png"}}async function is(t,e,n){if(e.size===0)return;let r=t.file("[Content_Types].xml");if(!r)return;let i=await r.async("text"),o=!1;for(let l of e)if(!i.includes(`Extension="${l}"`)){let a=jm(l,"");i=i.replace("</Types>",`<Default Extension="${l}" ContentType="${a}"/></Types>`),o=!0}o&&t.file("[Content_Types].xml",i,{compression:"DEFLATE",compressionOptions:{level:n}})}function os(t){let e=0;return t.forEach(n=>{let r=n.match(/^word\/media\/image(\d+)\./);if(r){let i=parseInt(r[1],10);i>e&&(e=i)}}),e}async function Xm(t,e,n){let r=os(e),i=new Set;for(let{relsPath:o,blocks:l}of t){let a=ns(l);if(a.length===0)continue;let s=await Re(e,o),u=Xt(s),p=[];for(let f of a){let{data:h,extension:c}=rs(f.src);r++,u++;let m=`image${r}.${c}`,g=`rId${u}`;e.file(`word/media/${m}`,h,{compression:"DEFLATE",compressionOptions:{level:n}}),p.push(`<Relationship Id="${g}" Type="${Z.image}" Target="media/${m}"/>`),i.add(c),f.rId=g}let d=s.replace("</Relationships>",p.join("")+"</Relationships>");e.file(o,d,{compression:"DEFLATE",compressionOptions:{level:n}})}await is(e,i,n)}function es(t){return t.replace(/^\.?\/?(?:word\/)?/,"")}function qm(t,e){let n=es(e),r=/<Relationship\b[^>]*?>/g,i;for(;(i=r.exec(t))!==null;){let o=i[0],l=/Target="([^"]*)"/.exec(o)?.[1];if(l&&es(l)===n)return/Id="([^"]*)"/.exec(o)?.[1]??null}return null}async function Um(t,e,n){let r=t.package.headers,i=t.package.relationships;if(!r||!i)return;let o=new Set,l=new Map,a=os(e);function s(u){if(u.mediaPath){let p=u.mediaPath.split("/").pop();if(p)return p}if(u.dataUrl&&u.dataUrl.startsWith("data:")){let p=l.get(u.dataUrl);if(p)return p;let{data:d,extension:f}=rs(u.dataUrl);a++;let h=`image${a}.${f}`;return e.file(`word/media/${h}`,d,{compression:"DEFLATE",compressionOptions:{level:n}}),o.add(f),l.set(u.dataUrl,h),h}return null}for(let[u,p]of r.entries()){let d=p.watermark;if(!d||d.kind!=="picture")continue;let f=i.get(u);if(!f?.target)continue;let h=`word/_rels/${Pe(f.target).replace(/^word\//,"")}.rels`,c=await Re(e,h);if(d.relId&&new RegExp(`Id="${d.relId}"`).test(c))continue;let m=s(d);if(!m)continue;let g=`media/${m}`,v=qm(c,g);if(v){d.relId=v;continue}let C=`rId${Xt(c)+1}`,y=c.replace("</Relationships>",`<Relationship Id="${C}" Type="${Z.image}" Target="${g}"/></Relationships>`);e.file(h,y,{compression:"DEFLATE",compressionOptions:{level:n}}),d.relId=C}await is(e,o,n)}function Gr(t){let e=[];for(let n of t)if(n.type==="paragraph")for(let r of n.content)r.type==="hyperlink"&&(r.href||r.rId)&&!r.anchor&&e.push(r);else if(n.type==="table")for(let r of n.rows)for(let i of r.cells)e.push(...Gr(i.content));else n.type==="blockSdt"&&e.push(...Gr(n.content));return e}function Vm(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ym(t,e){return t.match(new RegExp(`<Relationship\\b(?=[^>]*\\bId="${Vm(e)}")[^>]*/?>`))?.[0]}function ls(t){return!!t&&t.includes(`Type="${Z.hyperlink}"`)&&t.includes('TargetMode="External"')}function Gm(t){return t.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&apos;/g,"'").replace(/&#(\d+);/g,(e,n)=>String.fromCodePoint(Number(n))).replace(/&#x([0-9A-Fa-f]+);/g,(e,n)=>String.fromCodePoint(parseInt(n,16))).replace(/&amp;/g,"&")}function as(t,e){let n=t?.match(/\bTarget="([^"]*)"/)?.[1];return n!=null&&Gm(n)===e}function ss(t,e){return ls(t)&&as(t,e)}function Zm(t,e){for(let n of t.matchAll(/<Relationship\b[^>]*\/?>/g))if(ss(n[0],e))return n[0].match(/\bId="([^"]+)"/)?.[1]}async function Km(t,e,n){for(let{relsPath:r,blocks:i}of t){let o=Gr(i);if(o.length===0)continue;let l=await Re(e,r),a=Xt(l),s=[];for(let p of o){let d=p.href,f=p.rId?Ym(l,p.rId):void 0;if(!d){f||(p.rId=void 0);continue}if(ss(f,d)||f&&!ls(f)&&as(f,d))continue;let h=Zm(l,d);if(h){p.rId=h;continue}a++;let c=`rId${a}`;s.push(`<Relationship Id="${c}" Type="${Z.hyperlink}" Target="${W(d)}" TargetMode="External"/>`),p.rId=c}if(s.length===0)continue;let u=l.replace("</Relationships>",s.join("")+"</Relationships>");e.file(r,u,{compression:"DEFLATE",compressionOptions:{level:n}})}}var Jm="http://schemas.openxmlformats.org/wordprocessingml/2006/main";function ps(t){let e=[];t.start!==void 0&&e.push(`<w:start w:val="${O(t.start)}"/>`),e.push(`<w:numFmt w:val="${W(t.numFmt)}"/>`),t.suffix&&e.push(`<w:suff w:val="${t.suffix}"/>`),e.push(`<w:lvlText w:val="${W(t.lvlText)}"/>`),t.lvlJc&&e.push(`<w:lvlJc w:val="${t.lvlJc}"/>`);let n=t.pPr?qr(t.pPr):"";return n&&e.push(`<w:pPr>${n}</w:pPr>`),`<w:lvl w:ilvl="${O(t.ilvl)}">${e.join("")}</w:lvl>`}function Qm(t){let e=[];t.multiLevelType&&e.push(`<w:multiLevelType w:val="${t.multiLevelType}"/>`);let n=[...t.levels].sort((r,i)=>r.ilvl-i.ilvl);for(let r of n)e.push(ps(r));return`<w:abstractNum w:abstractNumId="${O(t.abstractNumId)}">${e.join("")}</w:abstractNum>`}function tg(t){let e=[`<w:abstractNumId w:val="${O(t.abstractNumId)}"/>`];for(let n of t.levelOverrides??[]){let r=[];n.startOverride!==void 0&&r.push(`<w:startOverride w:val="${O(n.startOverride)}"/>`),n.lvl&&r.push(ps(n.lvl)),e.push(`<w:lvlOverride w:ilvl="${O(n.ilvl)}">${r.join("")}</w:lvlOverride>`)}return`<w:num w:numId="${O(t.numId)}">${e.join("")}</w:num>`}function eg(t){let e=t.abstractNums.map(Qm).join(""),n=t.nums.map(tg).join("");return`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<w:numbering xmlns:w="${Jm}">${e}${n}</w:numbering>`}var ng="application/vnd.openxmlformats-officedocument.wordprocessingml.header+xml",rg="application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml",Zr="application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml",Kr="application/vnd.openxmlformats-officedocument.wordprocessingml.commentsExtended+xml",Jr="application/vnd.openxmlformats-officedocument.wordprocessingml.commentsIds+xml",Qr="application/vnd.openxmlformats-officedocument.wordprocessingml.commentsExtensible+xml",ig="application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml";async function og(t,e,n){let r=t.package.relationships;if(!r)return;let i=[];for(let[u,p]of r){if(!p.target)continue;let d=p.type===Z.header?ng:p.type===Z.footer?rg:null;d&&i.push({rId:u,target:p.target.replace(/^(\/?word\/)/,""),contentType:d,relType:p.type})}if(i.length===0)return;let o=e.file("[Content_Types].xml");if(o){let u=await o.async("text"),p=!1;for(let{target:d,contentType:f}of i){let h=`/word/${d}`;u.includes(`PartName="${h}"`)||(u=u.replace("</Types>",`<Override PartName="${h}" ContentType="${f}"/></Types>`),p=!0)}p&&e.file("[Content_Types].xml",u,{compression:"DEFLATE",compressionOptions:{level:n}})}let l="word/_rels/document.xml.rels",a=await Re(e,l),s=!1;for(let{rId:u,relType:p,target:d}of i)a.includes(`Id="${u}"`)||(a=a.replace("</Relationships>",`<Relationship Id="${u}" Type="${p}" Target="${d}"/></Relationships>`),s=!0);s&&e.file(l,a,{compression:"DEFLATE",compressionOptions:{level:n}})}async function lg(t,e,n){let r=t.package.numbering;if(!r||r.abstractNums.length===0&&r.nums.length===0||e.file("word/numbering.xml"))return;e.file("word/numbering.xml",eg(r),{compression:"DEFLATE",compressionOptions:{level:n}});let i=e.file("[Content_Types].xml");if(i){let a=await i.async("text");a.includes('PartName="/word/numbering.xml"')||(a=a.replace("</Types>",`<Override PartName="/word/numbering.xml" ContentType="${ig}"/></Types>`),e.file("[Content_Types].xml",a,{compression:"DEFLATE",compressionOptions:{level:n}}))}let o="word/_rels/document.xml.rels",l=await Re(e,o);if(!l.includes('Target="numbering.xml"')){let a=`rId${Xt(l)+1}`;l=l.replace("</Relationships>",`<Relationship Id="${a}" Type="${Z.numbering}" Target="numbering.xml"/></Relationships>`),e.file(o,l,{compression:"DEFLATE",compressionOptions:{level:n}})}}async function ag(t,e){let n=[{partName:"/word/comments.xml",contentType:Zr,target:"comments.xml",relType:Z.comments},{partName:"/word/commentsExtended.xml",contentType:Kr,target:"commentsExtended.xml",relType:Z.commentsExtended},{partName:"/word/commentsIds.xml",contentType:Jr,target:"commentsIds.xml",relType:Z.commentsIds},{partName:"/word/commentsExtensible.xml",contentType:Qr,target:"commentsExtensible.xml",relType:Z.commentsExtensible}],r=t.file("[Content_Types].xml");if(r){let l=await r.async("text"),a=!1;for(let{partName:s,contentType:u}of n)l.includes(s)||(l=l.replace("</Types>",`<Override PartName="${s}" ContentType="${u}"/></Types>`),a=!0);a&&t.file("[Content_Types].xml",l,{compression:"DEFLATE",compressionOptions:{level:e}})}let i="word/_rels/document.xml.rels",o=t.file(i);if(o){let l=await o.async("text"),a=!1;for(let{target:s,relType:u}of n)if(!l.includes(s)){let p=`rId${Xt(l)+1}`;l=l.replace("</Relationships>",`<Relationship Id="${p}" Type="${u}" Target="${s}"/></Relationships>`),a=!0}a&&t.file(i,l,{compression:"DEFLATE",compressionOptions:{level:e}})}}async function sg(t,e,n){let r=t.package.document.comments;if(!r||r.length===0)return;let{xml:i,paraInfos:o}=kn(r);e.file("word/comments.xml",i,{compression:"DEFLATE",compressionOptions:{level:n}});let l=Sn(o);l&&e.file("word/commentsExtended.xml",l,{compression:"DEFLATE",compressionOptions:{level:n}});let a=Cn(o);a&&e.file("word/commentsIds.xml",a,{compression:"DEFLATE",compressionOptions:{level:n}});let s=Tn(o,r);s&&e.file("word/commentsExtensible.xml",s,{compression:"DEFLATE",compressionOptions:{level:n}}),await ag(e,n)}function pg(t,e,n){let r=t.package.footnotes??[],i=t.package.footnoteSeparators??[];if(r.length===0&&i.length===0)return;let o=Qa([...i,...r]);e.file("word/footnotes.xml",o,{compression:"DEFLATE",compressionOptions:{level:n}})}function ug(t,e,n){let r=t.package.endnotes??[],i=t.package.endnoteSeparators??[];if(r.length===0&&i.length===0)return;let o=ts([...i,...r]);e.file("word/endnotes.xml",o,{compression:"DEFLATE",compressionOptions:{level:n}})}function ti(t){let e=new Map,n=t.package.relationships;if(!n)return e;let r=[{map:t.package.headers,type:Z.header},{map:t.package.footers,type:Z.footer}];for(let{map:i,type:o}of r)if(i)for(let[l,a]of i.entries()){let s=n.get(l);s&&s.type===o&&s.target&&e.set(Pe(s.target),Ga(a))}return e}function dg(t,e,n){let r={level:n};for(let[i,o]of ti(t))e.file(i,o,{compression:"DEFLATE",compressionOptions:r})}async function fg(){let t=new $n.default;t.file("[Content_Types].xml",`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">
  <Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/>
  <Default Extension="xml" ContentType="application/xml"/>
  <Override PartName="/word/document.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml"/>
  <Override PartName="/word/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml"/>
  <Override PartName="/docProps/core.xml" ContentType="application/vnd.openxmlformats-package.core-properties+xml"/>
  <Override PartName="/docProps/app.xml" ContentType="application/vnd.openxmlformats-officedocument.extended-properties+xml"/>
</Types>`),t.file("_rels/.rels",`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
  <Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="word/document.xml"/>
  <Relationship Id="rId2" Type="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties" Target="docProps/core.xml"/>
  <Relationship Id="rId3" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties" Target="docProps/app.xml"/>
</Relationships>`),t.file("word/_rels/document.xml.rels",`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
  <Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" Target="styles.xml"/>
</Relationships>`),t.file("word/document.xml",`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<w:document xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships">
  <w:body>
    <w:p>
      <w:r>
        <w:t></w:t>
      </w:r>
    </w:p>
    <w:sectPr>
      <w:pgSz w:w="12240" w:h="15840"/>
      <w:pgMar w:top="1440" w:right="1440" w:bottom="1440" w:left="1440" w:header="720" w:footer="720" w:gutter="0"/>
    </w:sectPr>
  </w:body>
</w:document>`),t.file("word/styles.xml",`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<w:styles xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main">
  <w:docDefaults>
    <w:rPrDefault>
      <w:rPr>
        <w:rFonts w:ascii="Calibri" w:hAnsi="Calibri"/>
        <w:sz w:val="22"/>
      </w:rPr>
    </w:rPrDefault>
    <w:pPrDefault>
      <w:pPr>
        <w:spacing w:after="200" w:line="276" w:lineRule="auto"/>
      </w:pPr>
    </w:pPrDefault>
  </w:docDefaults>
  <w:style w:type="paragraph" w:default="1" w:styleId="Normal">
    <w:name w:val="Normal"/>
  </w:style>
</w:styles>`);let e=new Date().toISOString();return t.file("docProps/core.xml",`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<cp:coreProperties xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <dc:creator>EigenPal DOCX Editor</dc:creator>
  <dcterms:created xsi:type="dcterms:W3CDTF">${e}</dcterms:created>
  <dcterms:modified xsi:type="dcterms:W3CDTF">${e}</dcterms:modified>
</cp:coreProperties>`),t.file("docProps/app.xml",`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Properties xmlns="http://schemas.openxmlformats.org/officeDocument/2006/extended-properties">
  <Application>EigenPal DOCX Editor</Application>
  <AppVersion>1.0.0</AppVersion>
</Properties>`),t.generateAsync({type:"arraybuffer",compression:"DEFLATE",compressionOptions:{level:6}})}async function ei(t,e={}){if(!t.originalBuffer)throw new Error("Cannot repack document: no original buffer for round-trip. Use createDocx() for new documents.");let{compressionLevel:n=6,updateModifiedDate:r=!0,modifiedBy:i}=e,o=t,l=await $n.default.loadAsync(t.originalBuffer),a=new $n.default;for(let[p,d]of Object.entries(l.files)){if(d.dir){a.folder(p.replace(/\/$/,""));continue}let f=await d.async("arraybuffer");a.file(p,f,{compression:"DEFLATE",compressionOptions:{level:n}})}let s=Wm(o);await Xm(s,a,n),await Um(o,a,n),await Km(s,a,n);let u=vn(o);if(a.file("word/document.xml",u,{compression:"DEFLATE",compressionOptions:{level:n}}),dg(o,a,n),await og(o,a,n),await lg(o,a,n),await sg(o,a,n),pg(o,a,n),ug(o,a,n),r){let p="docProps/core.xml",d=l.file(p);if(d){let f=await d.async("text"),h=ni(f,{updateModifiedDate:r,modifiedBy:i});a.file(p,h,{compression:"DEFLATE",compressionOptions:{level:n}})}}return await a.generateAsync({type:"arraybuffer",compression:"DEFLATE",compressionOptions:{level:n}})}async function us(t,e,n={}){let{compressionLevel:r=6}=n;for(let[i,o]of e)t.file(i,o,{compression:"DEFLATE",compressionOptions:{level:r}});return t.generateAsync({type:"arraybuffer",compression:"DEFLATE",compressionOptions:{level:r}})}function ni(t,e){let n=t;if(e.updateModifiedDate){let r=new Date().toISOString();n.includes("<dcterms:modified")?n=n.replace(/<dcterms:modified[^<>]*>[^<]*<\/dcterms:modified>/,`<dcterms:modified xsi:type="dcterms:W3CDTF">${r}</dcterms:modified>`):n=n.replace("</cp:coreProperties>",`<dcterms:modified xsi:type="dcterms:W3CDTF">${r}</dcterms:modified></cp:coreProperties>`)}return e.modifiedBy&&(n.includes("<cp:lastModifiedBy")?n=n.replace(/<cp:lastModifiedBy>[^<]*<\/cp:lastModifiedBy>/,`<cp:lastModifiedBy>${W(e.modifiedBy)}</cp:lastModifiedBy>`):n=n.replace("</cp:coreProperties>",`<cp:lastModifiedBy>${W(e.modifiedBy)}</cp:lastModifiedBy></cp:coreProperties>`)),n}async function ds(t){let e=await fg(),n={...t,originalBuffer:e};return ei(n)}function hs(t,e){let n=gg(e),r=new RegExp(`<w:p[\\s][^>]*w14:paraId="${n}"`,"g"),i=[],o;for(;(o=r.exec(t))!==null;)i.push(o.index);if(i.length===0||i.length>1)return null;let l=i[0],a=l,s=0;for(;a<t.length;){let u=t.indexOf("<",a);if(u===-1)break;if(t.startsWith("<w:p",u)){let p=t[u+4];if(p===">"||p===" "||p==="/"){let d=t.indexOf(">",u);if(d===-1)break;if(t[d-1]==="/"){if(s===0)return{start:l,end:d+1};a=d+1}else s++,a=d+1}else a=u+1}else if(t.startsWith("</w:p>",u)){if(s--,s===0)return{start:l,end:u+6};a=u+6}else a=u+1}return null}function cg(t,e){let n=hs(t,e);return n?t.substring(n.start,n.end):null}function fs(t){let e=0,n=/<w:p[\s>]/g,r;for(;(r=n.exec(t))!==null;){let i=r.index,o=t[i+4];(o===">"||o===" ")&&e++}return e}function cs(t){let e=new Map,n=/w14:paraId="([^"]+)"/g,r;for(;(r=n.exec(t))!==null;){let i=r[1];e.set(i,(e.get(i)||0)+1)}return e}function hg(t,e,n){if(n.size===0)return{safe:!0};let r=cs(t),i=cs(e);for(let a of n){let s=r.get(a)||0;if(s===0)return{safe:!1,reason:`paraId-not-found-in-original: ${a}`};if(s>1)return{safe:!1,reason:`duplicate-paraId-in-original: ${a}`}}for(let a of n){let s=i.get(a)||0;if(s===0)return{safe:!1,reason:`paraId-not-found-in-serialized: ${a}`};if(s>1)return{safe:!1,reason:`duplicate-paraId-in-serialized: ${a}`}}let o=fs(t),l=fs(e);return o!==l?{safe:!1,reason:`paragraph-count-mismatch: original=${o}, serialized=${l}`}:{safe:!0}}function mg(t,e,n){if(n.size===0)return t;if(!hg(t,e,n).safe)return null;let r=[];for(let o of n){let l=hs(t,o);if(!l)return null;let a=cg(e,o);if(!a)return null;r.push({start:l.start,end:l.end,newXml:a})}r.sort((o,l)=>l.start-o.start);let i=t;for(let{start:o,end:l,newXml:a}of r)i=i.substring(0,o)+a+i.substring(l);return i}function gg(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ms(t){let e=n=>n.content.some(r=>r.type==="drawing"&&r.image?.src?.startsWith("data:")&&!r.image?.rId);for(let n of t)if(n.type==="paragraph")for(let r of n.content)if(r.type==="run"){if(e(r))return!0}else{if(r.type==="hyperlink"&&r.href&&!r.rId&&!r.anchor)return!0;if(r.type==="insertion"||r.type==="deletion"||r.type==="moveFrom"||r.type==="moveTo"){for(let i of r.content)if(i.type==="run"&&e(i))return!0}}else if(n.type==="table"){for(let r of n.rows)for(let i of r.cells)if(ms(i.content))return!0}return!1}async function gs(t,e,n){let{changedParaIds:r,structuralChange:i,hasUntrackedChanges:o}=n;if(i||o||!e)return null;let l=t.package.document.content;if(ms(l))return null;let a=t.package.document.comments,s=a&&a.length>0,u=ti(t);try{let p=await(await import("./chunk-LKVENP42.js")).default.loadAsync(e),d=new Map,f=t.package.relationships;if(f)for(let c of f.values()){if(!c.target||c.type!==Z.header&&c.type!==Z.footer)continue;let m=Pe(c.target).replace(/^\//,"");if(!p.file(m))return null}if(r.size>0){let c=p.file("word/document.xml");if(!c)return null;let m=await c.async("text"),g=vn(t),v=mg(m,g,r);if(!v)return null;d.set("word/document.xml",v)}if(s){let{xml:c,paraInfos:m}=kn(a);d.set("word/comments.xml",c);let g=Sn(m);g&&d.set("word/commentsExtended.xml",g);let v=Cn(m);v&&d.set("word/commentsIds.xml",v);let C=Tn(m,a);C&&d.set("word/commentsExtensible.xml",C);let y=p.file("[Content_Types].xml");if(y){let w=d.get("[Content_Types].xml")??await y.async("text"),I=!1,F=[["/word/comments.xml",Zr],["/word/commentsExtended.xml",Kr],["/word/commentsIds.xml",Jr],["/word/commentsExtensible.xml",Qr]];for(let[$,E]of F)w.includes($)||(w=w.replace("</Types>",`<Override PartName="${$}" ContentType="${E}"/></Types>`),I=!0);I&&d.set("[Content_Types].xml",w)}let k="word/_rels/document.xml.rels",x=p.file(k);if(x){let w=d.get(k)??await x.async("text"),I=!1,F=[["comments.xml",Z.comments],["commentsExtended.xml",Z.commentsExtended],["commentsIds.xml",Z.commentsIds],["commentsExtensible.xml",Z.commentsExtensible]];for(let[$,E]of F)if(!w.includes($)){let P=Xt(w);w=w.replace("</Relationships>",`<Relationship Id="rId${P+1}" Type="${E}" Target="${$}"/></Relationships>`),I=!0}I&&d.set(k,w)}}for(let[c,m]of u)d.set(c,m);let h=p.file("docProps/core.xml");if(h){let c=await h.async("text");d.set("docProps/core.xml",ni(c,{updateModifiedDate:!0}))}return await us(p,d)}catch{return null}}function bs(t){return wg(t).variables}function wg(t){let e=[],n={body:[],headers:[],footers:[],footnotes:[],endnotes:[],textBoxes:[]};if(t.package?.document){let i=yg(t.package.document);i.forEach(o=>{e.push({name:o,location:"body"})}),n.body=Array.from(new Set(i)).sort()}if(t.package?.document?.sections&&t.package.document.sections.forEach((i,o)=>{i.properties.headerReferences&&i.properties.headerReferences.forEach(l=>{})}),t.package?.footnotes){let i=ys(t.package.footnotes);i.forEach(o=>{e.push({name:o,location:"footnote"})}),n.footnotes=Array.from(new Set(i)).sort()}if(t.package?.endnotes){let i=ys(t.package.endnotes);i.forEach(o=>{e.push({name:o,location:"endnote"})}),n.endnotes=Array.from(new Set(i)).sort()}t.templateVariables&&t.templateVariables.forEach(i=>{e.some(o=>o.name===i)||e.push({name:i,location:"body"})});let r=new Set;return e.forEach(i=>r.add(i.name)),{variables:Array.from(r).sort(),totalOccurrences:e.length,byLocation:n,occurrences:e}}function yg(t){let e=[];if(t.content&&e.push(...ws(t.content)),t.sections)for(let n of t.sections)n.content&&e.push(...ws(n.content));return e}function ws(t){let e=[];for(let n of t)n.type==="paragraph"?e.push(...ri(n)):n.type==="table"&&e.push(...xs(n));return e}function ri(t){let e=[];if(!t.content)return e;for(let n of t.content)n.type==="run"?e.push(...Ee(n)):n.type==="hyperlink"?e.push(...bg(n)):n.type==="simpleField"?e.push(...xg(n)):n.type==="complexField"&&e.push(...vg(n));return e}function Ee(t){let e=[];if(!t.content)return e;for(let n of t.content)n.type==="text"&&n.text&&e.push(...vs(n.text));return e}function bg(t){let e=[];if(!t.children)return e;for(let n of t.children)n.type==="run"&&e.push(...Ee(n));return e}function xg(t){let e=[];if(t.instruction&&e.push(...vs(t.instruction)),t.content)for(let n of t.content)n.type==="run"&&e.push(...Ee(n));return e}function vg(t){let e=[];if(t.fieldCode)for(let n of t.fieldCode)n.type==="run"&&e.push(...Ee(n));if(t.fieldResult)for(let n of t.fieldResult)n.type==="run"&&e.push(...Ee(n));return e}function xs(t){let e=[];if(!t.rows)return e;for(let n of t.rows)if(n.cells)for(let r of n.cells)e.push(...kg(r));return e}function kg(t){let e=[];if(!t.content)return e;for(let n of t.content)n.type==="paragraph"?e.push(...ri(n)):n.type==="table"&&e.push(...xs(n));return e}function ys(t){let e=[];for(let n of t)if(n.content)for(let r of n.content)r.type==="paragraph"&&e.push(...ri(r));return e}var Sg=/\{([a-zA-Z_][a-zA-Z0-9_\-\.]*)\}/g;function vs(t){if(!t)return[];let e=[],n=new RegExp(Sg),r;for(;(r=n.exec(t))!==null;)e.push(r[1]);return e}var dy=class ie{constructor(e){tt(this,"_document"),tt(this,"_pendingVariables"),e instanceof ArrayBuffer||ArrayBuffer.isView(e)?this._document={package:{document:{content:[]}},originalBuffer:e instanceof ArrayBuffer?e:e.buffer}:this._document=e,this._pendingVariables={}}static async fromBuffer(e){let n=await Wr(e);return new ie(n)}static fromDocument(e){return new ie(e)}getDocument(){return this._document}getText(){let e=this._document.package.document;return this._getBodyText(e)}getFormattedText(){let e=[],n=this._document.package.document;for(let r of n.content)r.type==="paragraph"&&this._extractParagraphSegments(r,e);return e}getVariables(){return bs(this._document)}getStyles(){let e=this._document.package.styles;if(!e?.styles)return[];let n=[];for(let[r,i]of Object.entries(e.styles))if(typeof i=="object"&&i!==null){let o=i;n.push({id:r,name:o.name||r,type:o.type==="numbering"?"paragraph":o.type||"paragraph",builtIn:o.default})}return n}getPageCount(){let e=this.getWordCount();return Math.max(1,Math.ceil(e/500))}getWordCount(){return this.getText().split(/\s+/).filter(e=>e.length>0).length}getCharacterCount(e=!0){let n=this.getText();return e?n.length:n.replace(/\s/g,"").length}getParagraphCount(){return this._document.package.document.content.filter(e=>e.type==="paragraph").length}getTableCount(){return this._document.package.document.content.filter(e=>e.type==="table").length}getAgentContext(e=100){let n=this._document.package.document,r=n.content.filter(l=>l.type==="paragraph"),i=r.map((l,a)=>{let s=this._getParagraphText(l),u=l.formatting?.styleId;return{index:a,preview:s.slice(0,e),style:u,isHeading:u?.toLowerCase().includes("heading")||!1,headingLevel:this._parseHeadingLevel(u),isListItem:!!l.listRendering,isEmpty:s.trim().length===0}}),o=(n.sections||[]).map((l,a)=>({index:a,paragraphCount:l.content?.length||0,pageSize:l.properties?.pageWidth&&l.properties?.pageHeight?{width:l.properties.pageWidth,height:l.properties.pageHeight}:void 0,isLandscape:l.properties?.orientation==="landscape",hasHeader:!!l.properties?.headerReferences?.length,hasFooter:!!l.properties?.footerReferences?.length}));return{paragraphCount:r.length,wordCount:this.getWordCount(),characterCount:this.getCharacterCount(),variables:this.getVariables(),variableCount:this.getVariables().length,availableStyles:this.getStyles(),outline:i,sections:o,hasTables:this.getTableCount()>0,hasImages:this._hasImages(),hasHyperlinks:this._hasHyperlinks()}}insertText(e,n,r={}){let i={type:"insertText",position:e,text:n,formatting:r.formatting};return this._executeCommand(i)}replaceRange(e,n,r={}){let i={type:"replaceText",range:e,text:n,formatting:r.formatting};return this._executeCommand(i)}deleteRange(e){let n={type:"deleteText",range:e};return this._executeCommand(n)}applyFormatting(e,n){let r={type:"formatText",range:e,formatting:n};return this._executeCommand(r)}applyStyle(e,n){let r={type:"applyStyle",paragraphIndex:e,styleId:n};return this._executeCommand(r)}applyParagraphFormatting(e,n){let r={type:"formatParagraph",paragraphIndex:e,formatting:n};return this._executeCommand(r)}insertTable(e,n,r,i={}){let o={type:"insertTable",position:e,rows:n,columns:r,data:i.data,hasHeader:i.hasHeader};return this._executeCommand(o)}insertImage(e,n,r={}){let i={type:"insertImage",position:e,src:n,width:r.width,height:r.height,alt:r.alt};return this._executeCommand(i)}insertHyperlink(e,n,r={}){let i={type:"insertHyperlink",range:e,url:n,displayText:r.displayText,tooltip:r.tooltip};return this._executeCommand(i)}removeHyperlink(e){let n={type:"removeHyperlink",range:e};return this._executeCommand(n)}insertParagraphBreak(e){let n={type:"insertParagraphBreak",position:e};return this._executeCommand(n)}mergeParagraphs(e,n){let r={type:"mergeParagraphs",paragraphIndex:e,count:n};return this._executeCommand(r)}setVariable(e,n){return this._pendingVariables[e]=n,this}setVariables(e){for(let[n,r]of Object.entries(e))this._pendingVariables[n]=r;return this}getPendingVariables(){return{...this._pendingVariables}}clearPendingVariables(){return this._pendingVariables={},this}async applyVariables(e){let n={...this._pendingVariables,...e};if(Object.keys(n).length===0)return this;let r=this._document.originalBuffer;if(!r)throw new Error("Cannot apply variables: no original buffer for processing");let{processTemplate:i}=await import("./chunk-HSZ7W6GQ.js"),o=i(r,n),l=await Wr(o),a=new ie(l);return a._pendingVariables={},a}async toBuffer(e){if(this._document.originalBuffer){if(e?.selective){let r=await gs(this._document,this._document.originalBuffer,e.selective);if(r)return this._document.originalBuffer=r,r}let n=await ei(this._document);return this._document.originalBuffer=n,n}return ds(this._document)}async toBlob(e="application/vnd.openxmlformats-officedocument.wordprocessingml.document"){let n=await this.toBuffer();return new Blob([n],{type:e})}executeCommands(e){return new ie(vi(this._document,e))}_executeCommand(e){let n=new ie(xi(this._document,e));return n._pendingVariables={...this._pendingVariables},n}_getBodyText(e){let n=[];for(let r of e.content)r.type==="paragraph"?n.push(this._getParagraphText(r)):r.type==="table"&&n.push(this._getTableText(r));return n.join(`
`)}_getParagraphText(e){let n=[];for(let r of e.content)r.type==="run"?n.push(this._getRunText(r)):r.type==="hyperlink"&&n.push(this._getHyperlinkText(r));return n.join("")}_getRunText(e){return e.content.filter(n=>n.type==="text").map(n=>n.text).join("")}_getHyperlinkText(e){let n=[];for(let r of e.children)r.type==="run"&&n.push(this._getRunText(r));return n.join("")}_getTableText(e){let n=[];for(let r of e.rows)for(let i of r.cells)for(let o of i.content)o.type==="paragraph"&&n.push(this._getParagraphText(o));return n.join("	")}_extractParagraphSegments(e,n){for(let r of e.content)if(r.type==="run"){let i=this._getRunText(r);i&&n.push({text:i,formatting:r.formatting})}else if(r.type==="hyperlink"){let i=r.href||"";for(let o of r.children)if(o.type==="run"){let l=this._getRunText(o);l&&n.push({text:l,formatting:o.formatting,isHyperlink:!0,hyperlinkUrl:i})}}}_parseHeadingLevel(e){if(!e)return;let n=e.match(/heading\s*(\d)/i);if(n)return parseInt(n[1],10)}_hasImages(){let e=this._document.package.document;for(let n of e.content)if(n.type==="paragraph"){for(let r of n.content)if(r.type==="run"){for(let i of r.content)if(i.type==="drawing")return!0}}return!1}_hasHyperlinks(){let e=this._document.package.document;for(let n of e.content)if(n.type==="paragraph"){for(let r of n.content)if(r.type==="hyperlink")return!0}return!1}};function cy(t,e){if(!e||!e.trim())return null;let n=null;return t.descendants((r,i)=>n!==null?!1:r.attrs?.paraId===e&&r.isTextblock?(n=i,!1):!0),n}var Me=class{constructor(t){tt(this,"listeners",new Set),tt(this,"snapshot"),tt(this,"subscribe",e=>(this.listeners.add(e),()=>{this.listeners.delete(e)})),tt(this,"getSnapshot",()=>this.snapshot),this.snapshot=t}setSnapshot(t){this.snapshot=t,this.notify()}notify(){for(let t of this.listeners)t()}};function Cg(t,e){if(!t.package?.document?.content)return null;let n=0;for(let r of t.package.document.content)if(r.type==="table"){if(n===e)return r;n++}return null}function Tg(t,e,n){if(!t.package?.document?.content)return t;let r=0,i=t.package.document.content.map(o=>{if(o.type==="table"){if(r===e)return r++,n;r++}return o});return{...t,package:{...t.package,document:{...t.package.document,content:i}}}}function $g(t,e){if(!t.package?.document?.content)return t;let n=0,r=t.package.document.content.filter(i=>{if(i.type==="table"){let o=n===e;return n++,!o}return!0});return{...t,package:{...t.package,document:{...t.package.document,content:r}}}}var Ig=class extends Me{constructor(){super({selectedCell:null})}selectCell(t){this.setSnapshot({selectedCell:t})}clearSelection(){this.setSnapshot({selectedCell:null})}isCellSelected(t,e,n){let{selectedCell:r}=this.getSnapshot();return r?r.tableIndex===t&&r.rowIndex===e&&r.columnIndex===n:!1}getSelectedCell(){return this.getSnapshot().selectedCell}};var Iy=class extends Me{constructor(){super({notifications:[]}),tt(this,"notifications",[]),tt(this,"idCounter",0),tt(this,"timers",new Set)}showError(t,e){return this.addNotification(t,"error",e)}showWarning(t,e){return this.addNotification(t,"warning",e)}showInfo(t,e){return this.addNotification(t,"info",e)}dismiss(t){this.notifications=this.notifications.map(n=>n.id===t?{...n,dismissed:!0}:n),this.emitSnapshot();let e=setTimeout(()=>{this.timers.delete(e),this.notifications=this.notifications.filter(n=>n.id!==t),this.emitSnapshot()},300);this.timers.add(e)}clearAll(){this.notifications=[];for(let t of this.timers)clearTimeout(t);this.timers.clear(),this.emitSnapshot()}destroy(){for(let t of this.timers)clearTimeout(t);this.timers.clear(),this.notifications=[]}addNotification(t,e,n){let r=`error-${++this.idCounter}-${Date.now()}`,i={id:r,message:t,severity:e,details:n,timestamp:Date.now()};if(this.notifications=[...this.notifications,i],this.emitSnapshot(),e!=="error"){let o=setTimeout(()=>{this.timers.delete(o),this.dismiss(r)},5e3);this.timers.add(o)}return r}emitSnapshot(){this.setSnapshot({notifications:this.notifications})}};function Fy(t,e){let n=`plugin-styles-${t}`,r=document.getElementById(n);r&&r.remove();let i=document.createElement("style");return i.id=n,i.textContent=e,document.head.appendChild(i),()=>{let o=document.getElementById(n);o&&o.remove()}}var Py=class extends Me{constructor(){super({states:new Map,version:0}),tt(this,"plugins",[]),tt(this,"pluginStates",new Map),tt(this,"version",0)}initialize(t,e){this.destroyPlugins(),this.plugins=t;for(let n of t)n.initialize&&!this.pluginStates.has(n.id)&&this.pluginStates.set(n.id,n.initialize(e));this.emitSnapshot()}updateStates(t){let e=!1;for(let n of this.plugins)if(n.onStateChange){let r=n.onStateChange(t);r!==void 0&&(this.pluginStates.set(n.id,r),e=!0)}return e&&(this.version++,this.emitSnapshot()),e}getPluginState(t){return this.pluginStates.get(t)}setPluginState(t,e){this.pluginStates.set(t,e),this.version++,this.emitSnapshot()}destroy(){this.destroyPlugins(),this.emitSnapshot()}destroyPlugins(){for(let t of this.plugins)t.destroy&&t.destroy();this.pluginStates.clear(),this.plugins=[]}emitSnapshot(){this.setSnapshot({states:new Map(this.pluginStates),version:this.version})}};export{Ti as a,Cs as b,Cg as c,Tg as d,$g as e,Ig as f,zt as g,$i as h,ze as i,en as j,qg as k,Gn as l,Ug as m,qe as n,Kn as o,Zg as p,Kg as q,Jg as r,Qg as s,bp as t,Ki as u,Ji as v,Qi as w,nw as x,cw as y,or as z,hw as A,Hw as B,Il as C,Dw as D,Ww as E,jw as F,_w as G,Xw as H,qw as I,Uw as J,ef as K,Vw as L,Yw as M,Gw as N,Zw as O,rf as P,ln as Q,Kw as R,Jw as S,Qw as T,t0 as U,e0 as V,zl as W,ff as X,l0 as Y,a0 as Z,s0 as _,p0 as $,x0 as aa,v0 as ba,Dl as ca,Br as da,Ie as ea,Lr as fa,Ar as ga,Gl as ha,k0 as ia,S0 as ja,C0 as ka,T0 as la,$0 as ma,I0 as na,R0 as oa,E0 as pa,ua as qa,B0 as ra,L0 as sa,A0 as ta,z0 as ua,N0 as va,Wr as wa,dy as xa,cy as ya,Iy as za,Fy as Aa,Py as Ba};
