@docx-editor.dev/core 2.13.0 → 2.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/automation.cjs +1 -1
- package/dist/automation.d.cts +3 -3
- package/dist/automation.d.ts +3 -3
- package/dist/automation.js +1 -1
- package/dist/binding.cjs +1 -1
- package/dist/binding.d.cts +4 -4
- package/dist/binding.d.ts +4 -4
- package/dist/binding.js +1 -1
- package/dist/{chunk-PFSJVAWJ.cjs → chunk-2PIHW2QM.cjs} +1 -1
- package/dist/chunk-2QTY5S6T.js +1 -0
- package/dist/chunk-4Z5MODAE.cjs +2 -0
- package/dist/{chunk-WANKXD34.cjs → chunk-5TKAPFZT.cjs} +1 -1
- package/dist/chunk-DRQHIQ4R.cjs +1 -0
- package/dist/chunk-F2K6SDHA.cjs +20 -0
- package/dist/chunk-FBA57EUJ.js +2 -0
- package/dist/{chunk-67S7OHE6.cjs → chunk-KIAP7PFQ.cjs} +1 -1
- package/dist/chunk-KTAQ7BRQ.js +20 -0
- package/dist/chunk-LBAHXZCU.cjs +5 -0
- package/dist/chunk-MCDUQYWP.js +5 -0
- package/dist/chunk-MQP26KCF.js +1 -0
- package/dist/chunk-NDJGSR6M.cjs +19 -0
- package/dist/chunk-NJNFJPGB.cjs +11 -0
- package/dist/chunk-O5M4CR4P.cjs +2 -0
- package/dist/{chunk-HWWHGREA.js → chunk-OKEDGR65.js} +1 -1
- package/dist/chunk-UKUOZXUD.js +19 -0
- package/dist/chunk-VQ4R5LTU.js +2 -0
- package/dist/chunk-ZBEJHJN2.js +11 -0
- package/dist/{chunk-PRIBU3UH.js → chunk-ZVTW7RGD.js} +1 -1
- package/dist/collaboration/replication.cjs +1 -1
- package/dist/collaboration/replication.d.cts +1 -1
- package/dist/collaboration/replication.d.ts +1 -1
- package/dist/collaboration/replication.js +1 -1
- package/dist/collaboration.d.cts +1 -1
- package/dist/collaboration.d.ts +1 -1
- package/dist/contracts/editor.d.cts +4 -4
- package/dist/contracts/editor.d.ts +4 -4
- package/dist/contracts/interaction.d.cts +4 -4
- package/dist/contracts/interaction.d.ts +4 -4
- package/dist/contracts/modules.d.cts +2 -2
- package/dist/contracts/modules.d.ts +2 -2
- package/dist/{editor-DLrTueVe.d.cts → editor-AJ06hyyg.d.cts} +26 -2
- package/dist/{editor-KiB6JNvk.d.ts → editor-a6VvsfYU.d.ts} +26 -2
- package/dist/editor.cjs +1 -1
- package/dist/editor.css +1 -1
- package/dist/editor.d.cts +15 -15
- package/dist/editor.d.ts +15 -15
- package/dist/editor.js +1 -1
- package/dist/{index-D4Pxdo_p.d.ts → index-C5ZnSRkF.d.ts} +49 -15
- package/dist/{index-D_PA2Xv6.d.cts → index-Cbw4lkOt.d.cts} +49 -15
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +9 -9
- package/dist/index.d.ts +9 -9
- package/dist/index.js +1 -1
- package/dist/layout.cjs +1 -1
- package/dist/layout.d.cts +36 -86
- package/dist/layout.d.ts +36 -86
- package/dist/layout.js +1 -1
- package/dist/output.cjs +1 -1
- package/dist/output.d.cts +4 -4
- package/dist/output.d.ts +4 -4
- package/dist/output.js +1 -1
- package/dist/{protocol-DjgYKCAy.d.ts → protocol-BsmQgblT.d.ts} +1 -1
- package/dist/{protocol-C8L58j66.d.cts → protocol-gOY5GA8K.d.cts} +1 -1
- package/dist/{review-reads-DcGYCH0w.d.ts → review-reads-BjZYeMd4.d.ts} +6 -19
- package/dist/{review-reads-BrTDmoYH.d.cts → review-reads-DEsV0OOW.d.cts} +6 -19
- package/dist/{revision-projection-BmLtLPxH.d.ts → revision-projection-BeXVrSSV.d.ts} +23 -2
- package/dist/{revision-projection-Dknlar93.d.cts → revision-projection-DXbrfNGD.d.cts} +23 -2
- package/dist/{semantic-cell-selection-BZ50i-Fu.d.ts → semantic-cell-selection-BK91NCCG.d.ts} +15 -6
- package/dist/{semantic-cell-selection-COnfaOZO.d.cts → semantic-cell-selection-BMhku3B1.d.cts} +15 -6
- package/dist/{semantic-interaction-BDJ4TBjm.d.ts → semantic-interaction-BmQ7h2cq.d.ts} +1 -1
- package/dist/{semantic-interaction-Bq3ixB0I.d.cts → semantic-interaction-DUAnxbgf.d.cts} +1 -1
- package/dist/{semantic-paint-C5SMTO8Y.d.cts → semantic-paint-DufNL1Zr.d.cts} +1 -1
- package/dist/{semantic-paint-DuhhY5-R.d.ts → semantic-paint-WJD2KeG1.d.ts} +1 -1
- package/dist/{semantic-records-BI1jpft7.d.ts → semantic-records-92UnKeU_.d.ts} +546 -5
- package/dist/{semantic-records-Btw3Ao4v.d.cts → semantic-records-BpozY7-j.d.cts} +546 -5
- package/dist/shaped-measurer-BWbindlI.d.ts +168 -0
- package/dist/shaped-measurer-CFPnXFs9.d.cts +168 -0
- package/dist/store.cjs +1 -1
- package/dist/store.d.cts +14 -7
- package/dist/store.d.ts +14 -7
- package/dist/store.js +1 -1
- package/dist/{tree-package-fragment-B1supBtE.d.ts → tree-package-fragment-CWFjgH6a.d.ts} +1 -9
- package/dist/{tree-package-fragment-ByN5yzll.d.cts → tree-package-fragment-Dhyw7oPm.d.cts} +1 -9
- package/dist/{tree-session-contract-BasiwZgZ.d.ts → tree-session-contract-B2HfGt79.d.ts} +6 -2
- package/dist/{tree-session-contract-DbeBenMR.d.cts → tree-session-contract-BY9xd7s_.d.cts} +6 -2
- package/package.json +2 -2
- package/dist/chunk-3AT4RUQ3.cjs +0 -19
- package/dist/chunk-4NAQLFXA.cjs +0 -2
- package/dist/chunk-BHAUFJO6.js +0 -20
- package/dist/chunk-F7U4OLMS.cjs +0 -2
- package/dist/chunk-FNMXRLGW.cjs +0 -5
- package/dist/chunk-I36WS6XX.cjs +0 -20
- package/dist/chunk-IOTL2GGW.js +0 -1
- package/dist/chunk-OF2QZCTN.js +0 -19
- package/dist/chunk-RO3HFCML.js +0 -5
- package/dist/chunk-SFOUCTKA.js +0 -2
- package/dist/chunk-VBEKERLJ.js +0 -2
- package/dist/chunk-XETEMUIP.cjs +0 -11
- package/dist/chunk-YMW34EBA.js +0 -11
- package/dist/shaped-measurer-CqdYa0fa.d.cts +0 -619
- package/dist/shaped-measurer-qnBJziPx.d.ts +0 -619
package/dist/chunk-4NAQLFXA.cjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
'use strict';var chunkXETEMUIP_cjs=require('./chunk-XETEMUIP.cjs'),fflate=require('fflate');function G(e){return e.kind!=="textValue"}function F(e,t){return e.kind!=="textValue"&&e.localName===t&&e.namespaceUri===chunkXETEMUIP_cjs.ca}function re(e,t){for(let n of e)t(n),n.kind!=="textValue"&&re(n.children,t);}function he(e){if(e.kind==="textValue")return `T(${e.value})`;if(e.namespaceUri===chunkXETEMUIP_cjs.ca&&e.localName.startsWith("rsid"))return "";let t=e.attributes.filter(r=>!r.localName.startsWith("rsid")&&!(r.namespaceUri===chunkXETEMUIP_cjs.fa&&(r.localName==="paraId"||r.localName==="textId"))).map(r=>`${r.namespaceUri}|${r.localName}=${r.value}`).sort().join(","),n=e.children.map(he).join("");return `E(${e.namespaceUri}:${e.localName}[${t}]{${n}})`}function at(e){return `S[${e.attributes.filter(n=>n.localName!=="styleId").map(n=>`${n.localName}=${n.value}`).sort().join(",")}]${e.children.map(he).join("")}`}function St(e){let t=[],n=new Map,r=new Set,a=null;if(e&&G(e.root))for(let i of e.root.children){if(!G(i))continue;if(F(i,"docDefaults")){a=i;continue}if(!F(i,"style"))continue;t.push(i);let o=chunkXETEMUIP_cjs.ze(i,"styleId");o&&n.set(o,i);let s=i.children.find(d=>F(d,"name")),l=s?chunkXETEMUIP_cjs.ze(s,"val"):void 0;l&&r.add(l);}return {part:e,styles:t,docDefaults:a,byId:n,names:r}}function Nt(e,t,n){let r=new Map;if(!e)return r;let a=e.children.find(o=>F(o,t));if(!a||!G(a))return r;let i=a.children.find(o=>F(o,n));if(!i||!G(i))return r;for(let o of i.children)o.kind!=="textValue"&&r.set(o.localName,o);return r}function sn(e,t,n,r){let a=t;for(let i=0;i<16&&a;i+=1){let o=e.byId.get(a);if(!o)return false;let s=o.children.find(d=>F(d,n));if(s&&G(s)&&s.children.some(d=>d.kind!=="textValue"&&d.localName===r))return true;let l=o.children.find(d=>F(d,"basedOn"));a=l?chunkXETEMUIP_cjs.ze(l,"val"):void 0;}return false}function ki(e,t){for(let n of e.styles){if(chunkXETEMUIP_cjs.ze(n,"type")!==t)continue;let r=chunkXETEMUIP_cjs.ze(n,"default");if(r==="1"||r==="true")return chunkXETEMUIP_cjs.ze(n,"styleId")}}function vt(e,t){let n=e.children.find(r=>F(r,t));return n&&G(n)?n:null}var Pi=new Map(["pStyle","keepNext","keepLines","pageBreakBefore","framePr","widowControl","numPr","suppressLineNumbers","pBdr","shd","tabs","suppressAutoHyphens","kinsoku","wordWrap","overflowPunct","topLinePunct","autoSpaceDE","autoSpaceDN","bidi","adjustRightInd","snapToGrid","spacing","ind","contextualSpacing","mirrorIndents","suppressOverlap","jc","textDirection","textAlignment","textboxTightWrap","outlineLvl","divId","cnfStyle","rPr","sectPr","pPrChange"].map((e,t)=>[e,t])),Oi=new Map(["rStyle","rFonts","b","bCs","i","iCs","caps","smallCaps","strike","dstrike","outline","shadow","emboss","imprint","noProof","snapToGrid","vanish","webHidden","color","spacing","w","kern","position","sz","szCs","highlight","u","effect","bdr","shd","fitText","vertAlign","rtl","cs","em","lang","eastAsianLayout","specVanish","oMath","rPrChange"].map((e,t)=>[e,t]));function ln(e,t,n){let r=Nt(t.docDefaults,"rPrDefault","rPr"),a=Nt(n.docDefaults,"rPrDefault","rPr"),i=Nt(t.docDefaults,"pPrDefault","pPr"),o=Nt(n.docDefaults,"pPrDefault","pPr"),s=(f,k,p)=>{let y=ki(f,"paragraph"),w=y?f.byId.get(y):void 0;if(!w)return y;for(let[T,R]of [["rPr",k],["pPr",p]]){let S=vt(w,T);if(S)for(let D of S.children)D.kind!=="textValue"&&R.set(D.localName,D);}return y};s(t,r,i),s(n,a,o);let l=new Map;for(let[f,k]of r){let p=a.get(f);(!p||he(p)!==he(k))&&l.set(f,k);}let d=new Map;for(let[f,k]of i){if(f==="sectPr")continue;let p=o.get(f);(!p||he(p)!==he(k))&&d.set(f,k);}if(l.size===0&&d.size===0)return e;let c=0,u=()=>`fragment#materialized-${c++}`,m=f=>{let k=p=>p.kind==="textValue"?{id:u(),kind:"textValue",value:p.value}:{...p,id:u(),children:p.children.map(k)};return k(f)},x=(f,k,p)=>{if(p.length===0)return f;let y=vt(f,k);if(y){let T=k==="rPr"?Oi:Pi,R=[...y.children];for(let D of p){let W=D.kind==="textValue"?Number.MAX_SAFE_INTEGER:T.get(D.localName)??Number.MAX_SAFE_INTEGER,Q=R.length;for(let A=0;A<R.length;A+=1){let B=R[A];if(B.kind==="textValue")continue;let L=T.get(B.localName);if(L!==void 0&&L>W){Q=A;break}}R.splice(Q,0,D);}let S={...y,children:R};return {...f,children:f.children.map(D=>D===y?S:D)}}let w={id:u(),kind:k==="rPr"?"runProperties":"paragraphProperties",namespaceUri:chunkXETEMUIP_cjs.ca,localName:k,prefix:"w",namespaceBindings:[],attributes:[],children:p};return {...f,children:[w,...f.children]}},h=f=>{let k=vt(f,"pPr"),p=k?.children.find(S=>F(S,"pStyle")),y=p?chunkXETEMUIP_cjs.ze(p,"val"):void 0,w=[];for(let[S,D]of d)k?.children.some(Q=>Q.kind!=="textValue"&&Q.localName===S)||y&&sn(t,y,"pPr",S)||w.push(m(D));let T=S=>{if(S.kind==="textValue")return S;if(S.kind==="run"){let W=vt(S,"rPr"),Q=W?.children.find(L=>F(L,"rStyle")),A=Q?chunkXETEMUIP_cjs.ze(Q,"val"):void 0,B=[];for(let[L,X]of l)W?.children.some(M=>M.kind!=="textValue"&&M.localName===L)||A&&sn(t,A,"rPr",L)||y&&sn(t,y,"rPr",L)||B.push(m(X));return x(S,"rPr",B)}if(S.kind==="paragraphProperties"||S.kind==="runProperties")return S;let D=S.children.map(T);return D.some((W,Q)=>W!==S.children[Q])?{...S,children:D}:S};return T(x(f,"pPr",w))},P=f=>{if(f.kind==="textValue")return f;if(f.kind==="paragraph")return h(f);let k=f.children.map(P);return k.some((p,y)=>p!==f.children[y])?{...f,children:k}:f};return e.map(P)}function Ii(e,t){return {...e,children:t}}function Ri(e,t){return e.kind!=="textValue"&&e.localName===t&&e.namespaceUri===chunkXETEMUIP_cjs.ca}var bi=new Set(["commentRangeStart","commentRangeEnd"]),Ni=new Set(["altChunk","subDoc"]);function vi(e){return e.kind==="run"&&e.children.some(t=>t.kind==="commentReference")}var Si=new Set(["DDE","DDEAUTO","INCLUDE","INCLUDEPICTURE","INCLUDETEXT","IMPORT","LINK","DATABASE","AUTOTEXT","AUTOTEXTLIST","GOTOBUTTON","MACROBUTTON","PRINT","ADDIN"]);function go(e){if(e===void 0)return false;let t=e.trim().replace(/^"+/,"").split(/\s+/,1)[0]??"";return Si.has(t.toUpperCase())}function Ti(e){if(e.kind!=="run")return null;for(let t of e.children)if(t.kind==="fldChar"){let n=chunkXETEMUIP_cjs.ze(t,"fldCharType");return n==="separate"||n==="end"?n:"begin"}return null}function wi(e){if(e.kind!=="run")return null;let t="",n=false;for(let r of e.children)if(r.kind==="instrText"){n=true;for(let a of r.children)a.kind==="textValue"&&(t+=a.value);}return n?t:null}function Ei(e){let t=[],n=new Set,r=i=>{if(i.dangerous){for(let o of i.machinery)n.add(o);for(let o of i.instr)n.add(o);for(let o of i.preResult)n.add(o);}},a=i=>{if(i.kind!=="textValue"){if(i.kind==="run"){let o=Ti(i);if(o==="begin"){t.push({dangerous:false,afterSeparate:false,machinery:[i.id],instr:[],preResult:[]});return}let s=t[t.length-1];if(s){if(o==="separate"){s.afterSeparate=true,s.machinery.push(i.id);return}if(o==="end"){s.machinery.push(i.id),t.pop(),r(s);return}let l=wi(i);if(l!==null){s.instr.push(i.id),go(l)&&(s.dangerous=true);return}s.afterSeparate||s.preResult.push(i.id);return}return}for(let o of i.children)a(o);}};for(let i of e)a(i);for(;t.length>0;){let i=t.pop();i.dangerous=true,r(i);}return n}function Ci(e,t){if(e.kind==="textValue")return e;if(e.namespaceUri===chunkXETEMUIP_cjs.ca&&(bi.has(e.localName)||e.localName==="sectPr"||Ni.has(e.localName))||vi(e)||t.has(e.id))return "drop";if(Ri(e,"fldSimple")&&go(chunkXETEMUIP_cjs.ze(e,"instr")))return dn(e.children,t);let n=dn(e.children,t);return n.length===e.children.length&&n.every((r,a)=>r===e.children[a])?e:Ii(e,n)}function dn(e,t){let n=[];for(let r of e){let a=Ci(r,t);a!=="drop"&&(Array.isArray(a)?n.push(...a):n.push(a));}return n}function cn(e){let t=Ei(e);return dn(e,t)}var Se="http://schemas.openxmlformats.org/officeDocument/2006/relationships",Mi="http://schemas.openxmlformats.org/package/2006/relationships",Di="http://schemas.openxmlformats.org/drawingml/2006/main",td="application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml",nd="application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml",rd="application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml",od="application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml",ad="application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml",id="application/vnd.openxmlformats-package.relationships+xml",Ai=`${Se}/styles`,_i=`${Se}/numbering`,sd=`${Se}/footnotes`,ld=`${Se}/endnotes`,dd=`${Se}/officeDocument`,Ui=`${Se}/theme`;function de(e){return e.kind!=="textValue"}function ho(e,t){return {...e,children:t}}function Be(e,t){if(t(e),e.kind!=="textValue")for(let n of e.children)Be(n,t);}var Fi=new Set(["pStyle","rStyle","tblStyle"]);function cd(e,t){for(let n of e)Be(n,r=>{if(r.kind!=="textValue"&&Fi.has(r.localName)&&r.namespaceUri===chunkXETEMUIP_cjs.ca){let a=chunkXETEMUIP_cjs.ze(r,"val");a&&t.add(a);}});}function md(e,t){for(let n of e)Be(n,r=>{if(r.kind!=="textValue"&&r.localName==="numId"&&r.namespaceUri===chunkXETEMUIP_cjs.ca){let a=chunkXETEMUIP_cjs.ze(r,"val");a&&t.add(a);}});}function ud(e,t){for(let n of e)Be(n,r=>{if(r.kind!=="textValue")for(let a of r.attributes)a.namespaceUri===Se&&a.value.length>0&&t.add(a.value);});}function ye(e){return /^\d+$/.test(e)?e.replace(/^0+(?=\d)/,""):e}function xo(e,t){let n={footnote:new Set,endnote:new Set},r=[],a=i=>{for(let o of i)Be(o,s=>{if(s.kind!=="noteReference")return;let l=s.localName==="footnoteReference"?"footnote":"endnote",d=chunkXETEMUIP_cjs.ze(s,"id");if(d===void 0)return;let c=ye(d);n[l].has(c)||(n[l].add(c),r.push({kind:l,id:c}));});};for(a(e);r.length>0;){let i=r.pop(),o=t(i.kind,i.id);o!==null&&a([o]);}return n}function mn(e,t,n){if(e.kind==="textValue")return e;let r=[],a=false;for(let i of e.children){if(i.kind!=="textValue"&&i.namespaceUri===chunkXETEMUIP_cjs.ca&&(i.localName==="footnoteReference"||i.localName==="endnoteReference")){let l=i.localName==="footnoteReference"?t:n,d=chunkXETEMUIP_cjs.ze(i,"id");if(i.kind!=="noteReference"||d===void 0||!l.has(ye(d))){a=true;continue}}let s=mn(i,t,n);s!==i&&(a=true),r.push(s);}return a?{...e,children:r}:e}function Li(e,t){for(let n of chunkXETEMUIP_cjs.Zb(e,t)){if(n.type!==Ai||n.targetMode==="External")continue;let r=chunkXETEMUIP_cjs.w(n.ownerPart,n.rawTarget);if(r.ok)return e.parts.get(r.partName)??null}return e.parts.get("/word/styles.xml")??null}function ko(e,t,n){for(let r of chunkXETEMUIP_cjs.Zb(e,t)){if(r.type!==n||r.targetMode==="External")continue;let a=chunkXETEMUIP_cjs.w(r.ownerPart,r.rawTarget);if(a.ok)return e.parts.get(a.partName)??null}return null}function pd(e,t){let n=Li(e,t),r=new Map,a=[],i=null;if(n&&de(n.root))for(let o of n.root.children){if(!de(o))continue;if(o.localName==="docDefaults"&&o.namespaceUri===chunkXETEMUIP_cjs.ca){i=o;continue}if(o.localName!=="style"||o.namespaceUri!==chunkXETEMUIP_cjs.ca)continue;let s=chunkXETEMUIP_cjs.ze(o,"styleId");s&&r.set(s,o),(chunkXETEMUIP_cjs.ze(o,"default")==="1"||chunkXETEMUIP_cjs.ze(o,"default")==="true")&&a.push(o);}return {part:n,byId:r,defaults:a,docDefaults:i}}var $i=new Set(["basedOn","link","next"]);function fd(e,t){let n=new Set,r=[...t];for(let o of e.defaults){let s=chunkXETEMUIP_cjs.ze(o,"styleId");s&&r.push(s);}let a=[];for(;r.length>0;){let o=r.pop();if(n.has(o))continue;n.add(o);let s=e.byId.get(o);if(s){a.push(s);for(let l of s.children)if(de(l)&&$i.has(l.localName)&&l.namespaceUri===chunkXETEMUIP_cjs.ca){let d=chunkXETEMUIP_cjs.ze(l,"val");d&&r.push(d);}}}if(!e.part||!de(e.part.root))return a;let i=new Map;return e.part.root.children.forEach((o,s)=>i.set(o,s)),a.sort((o,s)=>(i.get(o)??0)-(i.get(s)??0))}function gd(e,t,n){let r=ko(e,t,_i)??e.parts.get("/word/numbering.xml")??null;if(!r||!de(r.root)||n.size===0)return {part:r,nums:[],abstracts:[]};let a=[],i=new Set;for(let s of r.root.children){if(!de(s)||s.localName!=="num"||s.namespaceUri!==chunkXETEMUIP_cjs.ca)continue;let l=chunkXETEMUIP_cjs.ze(s,"numId");if(!(!l||!n.has(l))){a.push(s);for(let d of s.children)if(de(d)&&d.localName==="abstractNumId"){let c=chunkXETEMUIP_cjs.ze(d,"val");c&&i.add(c);}}}let o=[];for(let s of r.root.children){if(!de(s)||s.localName!=="abstractNum"||s.namespaceUri!==chunkXETEMUIP_cjs.ca)continue;let l=chunkXETEMUIP_cjs.ze(s,"abstractNumId");l&&i.has(l)&&o.push(s);}return {part:r,nums:a,abstracts:o}}var Tt={latin:null,eastAsia:null,cs:null};function hd(e,t){let n=ko(e,t,Ui);if(!n)return {major:Tt,minor:Tt};let r={major:{...Tt},minor:{...Tt}};return Be(n.root,a=>{if(a.kind==="textValue"||a.namespaceUri!==Di||a.localName!=="majorFont"&&a.localName!=="minorFont")return;let i=a.localName==="majorFont"?r.major:r.minor;for(let o of a.children){if(!de(o))continue;let s=chunkXETEMUIP_cjs.ze(o,"typeface");s&&(o.localName==="latin"?i.latin=s:o.localName==="ea"?i.eastAsia=s:o.localName==="cs"&&(i.cs=s));}}),{major:r.major,minor:r.minor}}function Bi(e,t){let n=t.startsWith("major")?e.major:e.minor;return t.endsWith("EastAsia")?n.eastAsia??n.latin:t.endsWith("Bidi")?n.cs??n.latin:n.latin}var Hi=[["asciiTheme","ascii"],["hAnsiTheme","hAnsi"],["eastAsiaTheme","eastAsia"],["cstheme","cs"]],yo=new Set(["themeColor","themeTint","themeShade","themeFill","themeFillTint","themeFillShade"]);function ji(e,t){if(e.kind==="textValue")return e;let n=e.attributes;if(e.localName==="rFonts"&&e.namespaceUri===chunkXETEMUIP_cjs.ca){let i=[],o=new Map;for(let s of e.attributes){let l=Hi.find(([d])=>d===s.localName);if(l&&s.namespaceUri===chunkXETEMUIP_cjs.ca){let d=Bi(t,s.value);d&&o.set(l[1],d);continue}i.push(s);}for(let[s,l]of o)i.some(d=>d.localName===s)||i.push({kind:"genericExtension",namespaceUri:chunkXETEMUIP_cjs.ca,localName:s,prefix:"w",value:l});n=i;}else e.attributes.some(i=>yo.has(i.localName)&&i.namespaceUri===chunkXETEMUIP_cjs.ca&&e.attributes.some(o=>o.localName==="val"))&&(n=e.attributes.filter(i=>!(yo.has(i.localName)&&i.namespaceUri===chunkXETEMUIP_cjs.ca)));let r=e.children.map(i=>ji(i,t)),a=r.some((i,o)=>i!==e.children[o]);return n===e.attributes&&!a?e:{...e,attributes:n,children:r}}function yd(e,t,n){return {id:e,name:e,contentType:t,root:n}}function xd(e,t){if(e.root.kind==="document"){let r=e.root.children.find(i=>i.kind==="body"),a=r&&de(r)?ho(r,t):{id:"fragment#body",kind:"body",namespaceUri:chunkXETEMUIP_cjs.ca,localName:"body",prefix:"w",namespaceBindings:[],attributes:[],children:t};return ho(e.root,[a])}let n={id:"fragment#body",kind:"body",namespaceUri:chunkXETEMUIP_cjs.ca,localName:"body",prefix:"w",namespaceBindings:[],attributes:[],children:t};return {id:"fragment#document",kind:"document",namespaceUri:chunkXETEMUIP_cjs.ca,localName:"document",prefix:"w",namespaceBindings:de(e.root)?e.root.namespaceBindings:[],attributes:[],children:[n]}}function kd(e){let t=e.map(n=>{let r=n.targetMode==="External"?' TargetMode="External"':"";return `<Relationship Id="${chunkXETEMUIP_cjs.N(n.id)}" Type="${chunkXETEMUIP_cjs.N(n.type)}" Target="${chunkXETEMUIP_cjs.N(n.rawTarget)}"${r}/>`}).join("");return `<Relationships xmlns="${Mi}">${t}</Relationships>`}function Pd(e,t){let n=t;for(;e.has(`rId${n}`);)n+=1;return `rId${n}`}function Od(e){let t=e.lastIndexOf(".");return t===-1?"":e.slice(t+1).toLowerCase()}var Po="http://schemas.openxmlformats.org/officeDocument/2006/relationships";function q(e,t,n,r){return {...e,attributes:e.attributes.map(a=>a.localName===n&&a.namespaceUri===t?{...a,value:r}:a)}}var Vi=new Set(["pStyle","rStyle","tblStyle","basedOn","link","next","styleLink","numStyleLink"]),un=chunkXETEMUIP_cjs.We,xe=new Map;function He(e,t){let n=t.styleIds??xe,r=t.numIds??xe,a=t.relIds??xe,i=t.footnoteIds??xe,o=t.endnoteIds??xe,s=t.bookmarkIds??xe,l=t.sdtIds??xe,d=t.revisionIds??xe,c=t.docPrIds??xe,u=(m,x)=>{if(m.kind==="textValue")return m;let h=m;if(m.namespaceUri===chunkXETEMUIP_cjs.ca&&Vi.has(m.localName)){let p=chunkXETEMUIP_cjs.ze(m,"val"),y=p!==void 0?n.get(p):void 0;y!==void 0&&(h=q(h,chunkXETEMUIP_cjs.ca,"val",y));}if(F(m,"numId")){let p=chunkXETEMUIP_cjs.ze(m,"val"),y=p!==void 0?r.get(p):void 0;y!==void 0&&(h=q(h,chunkXETEMUIP_cjs.ca,"val",y));}if(m.kind==="noteReference"){let p=m.localName==="footnoteReference"?i:o,y=chunkXETEMUIP_cjs.ze(m,"id"),w=y!==void 0?p.get(ye(y)):void 0;w!==void 0&&(h=q(h,chunkXETEMUIP_cjs.ca,"id",w));}if(m.kind==="bookmarkStart"||m.kind==="bookmarkEnd"){let p=chunkXETEMUIP_cjs.ze(m,"id"),y=p!==void 0?s.get(p):void 0;y!==void 0&&(h=q(h,chunkXETEMUIP_cjs.ca,"id",y));}if(F(m,"id")&&x==="sdtPr"){let p=chunkXETEMUIP_cjs.ze(m,"val"),y=p!==void 0?l.get(p):void 0;y!==void 0&&(h=q(h,chunkXETEMUIP_cjs.ca,"val",y));}if(un(m)){let p=chunkXETEMUIP_cjs.ze(m,"id"),y=p!==void 0?d.get(p):void 0;y!==void 0&&(h=q(h,chunkXETEMUIP_cjs.ca,"id",y));}if(m.kind==="drawingDocPr"){let p=m.attributes.find(w=>w.localName==="id"&&w.namespaceUri==="")?.value,y=p!==void 0?c.get(p):void 0;y!==void 0&&(h=q(h,"","id",y));}for(let p of h.attributes){if(p.namespaceUri!==Po)continue;let y=a.get(p.value);y!==void 0&&y!==p.value&&(h=q(h,Po,p.localName,y));}let P=m.localName,f=h.children.map(p=>u(p,P));return h!==m||f.some((p,y)=>p!==h.children[y])?{...h,children:f}:m};return u(e,"")}function Oo(e,t,n){let r=e,a=n.get(e)??2;for(;t.has(r);)r=`${e}${a}`,a+=1;return n.set(e,a),r}function Io(e,t,n){let r=`${e} (pasted)`,a=n.get(e)??2;for(;t.has(r);)r=`${e} (pasted ${a})`,a+=1;return n.set(e,a),r}var Wi=1e5;function Ro(e){let t=chunkXETEMUIP_cjs.Eb(),n=Ki(e,t),r=zi(e,t),a=Gi(e,t);return !n||!r||!a?null:{bookmarkIds:n,revisionIds:r,docPrIds:a}}function pn(e,t,n,r){if(e)return chunkXETEMUIP_cjs.Gb(t,e,r);let a=n;return ()=>String(a++)}function bo(e,t){if(e.add(t),!/^\d{1,10}$/.test(t))return;let n=Number(t);n<=chunkXETEMUIP_cjs.Cb&&e.add(String(n));}function No(e,t){if(t===void 0)return e;let n=Number(t);return Number.isInteger(n)&&n>e?n:e}function Ki(e,t){let n=new Map;if(e.fragmentBookmarkIds.length===0)return n;let r=0,a=new Set;for(let o of [e.ownerPart,...e.notesParts])re([o.root],s=>{if(s.kind!=="bookmarkStart"&&s.kind!=="bookmarkEnd")return;let l=chunkXETEMUIP_cjs.ze(s,"id");l!==void 0&&(bo(a,l),s.kind==="bookmarkStart"&&(r=No(r,l)));});let i=pn(t,a,r+1,chunkXETEMUIP_cjs.Cb);for(let o of e.fragmentBookmarkIds){if(n.has(o))continue;let s=i();if(s===null)return null;n.set(o,s);}return n}function zi(e,t){let n=new Map;if(!e.hasRevision)return n;let r=0,a=new Set;for(let s of [e.ownerPart,...e.notesParts]){let l=s===e.ownerPart;re([s.root],d=>{if(!chunkXETEMUIP_cjs.We(d))return;let c=chunkXETEMUIP_cjs.ze(d,"id");c!==void 0&&bo(a,c),l&&(r=No(r,c));});}let i=pn(t,a,r+1,chunkXETEMUIP_cjs.Cb),o=false;return re(e.travelling,s=>{if(o||!chunkXETEMUIP_cjs.We(s))return;let l=chunkXETEMUIP_cjs.ze(s,"id");if(l===void 0||n.has(l))return;let d=i();d===null?o=true:n.set(l,d);}),o?null:n}function Gi(e,t){let n=new Map;if(!e.hasDocPr)return n;let{used:r}=chunkXETEMUIP_cjs.Ib(e.pkg),a=Wi;if(!t){let s=chunkXETEMUIP_cjs.Jb(e.pkg);s.ok&&(a=s.id);}let i=pn(t,r,a,chunkXETEMUIP_cjs.Hb),o=false;return re(e.travelling,s=>{if(o||s.kind==="textValue"||s.kind!=="drawingDocPr")return;let l=s.attributes.find(c=>c.localName==="id"&&c.namespaceUri==="")?.value;if(l===void 0||n.has(l))return;let d=i();d===null?o=true:n.set(l,d);}),o?null:n}var Te="http://schemas.openxmlformats.org/officeDocument/2006/relationships",Xi=`${Te}/hyperlink`,vo=`${Te}/image`,wt=`${Te}/numbering`,fn=`${Te}/styles`,So="application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml",To="application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml";function it(e,t,n,r){for(let a of chunkXETEMUIP_cjs.Zb(e,t)){if(a.type!==n||a.targetMode==="External")continue;let i=chunkXETEMUIP_cjs.w(a.ownerPart,a.rawTarget);if(i.ok){let o=e.parts.get(i.partName);if(o)return o}}return e.parts.get(r)??null}function gn(e,t){let n=0;return re([e],r=>{let a=t(r);if(a===void 0)return;let i=Number(a);Number.isInteger(i)&&i>n&&(n=i);}),n}function Et(e,t,n,r){if(n.length===0)return e;let a=chunkXETEMUIP_cjs.Aa(t,"paste"),i=n.map(d=>chunkXETEMUIP_cjs.De(d,a)),o=chunkXETEMUIP_cjs.gh(t,i),s=r??o.root.children.length,l=chunkXETEMUIP_cjs.Ga(o,o.root.id,s,i,{deferValidation:true});return l.ok?chunkXETEMUIP_cjs.Xb(e,l.part):null}function wo(e){let t=new Set;return re(e,n=>{if(n.kind!=="textValue")for(let r of n.attributes)r.namespaceUri===Te&&r.value.length>0&&t.add(r.value);}),t}function Eo(e,t){if(t.size===0)return [...e];let n=a=>{if(a.kind==="textValue")return a;if(a.kind==="drawing"){let o=false;return re([a],s=>{if(s.kind!=="textValue")for(let l of s.attributes)l.namespaceUri===Te&&t.has(l.value)&&(o=true);}),o?null:a}if(a.kind==="hyperlink"){let o=a.attributes.find(s=>s.namespaceUri===Te)?.value;if(o!==void 0&&t.has(o))return r(a.children)}let i=r(a.children);return i.length===a.children.length&&i.every((o,s)=>o===a.children[s])?a:{...a,children:i}};function r(a){let i=[];for(let o of a){let s=n(o);s!==null&&(Array.isArray(s)?i.push(...s):i.push(s));}return i}return r(e)}var Yi=new Set(["image/png","image/jpeg","image/gif","image/bmp","image/webp"]),Co={"image/jpg":"image/jpeg","image/x-ms-bmp":"image/bmp","image/x-bmp":"image/bmp"};function qi(e,t){let n=chunkXETEMUIP_cjs.lb(e);return n==="unknown"||(Object.hasOwn(Co,t)?Co[t]:t)!==n||Yi.has(n)&&!chunkXETEMUIP_cjs.Kb(e,n)?null:n}function Mo(e,t,n){let r=t.parts.get(t.mainDocumentPart);if(!r)return {ok:false,reason:"no-fragment-document"};if(!e.parts.has(n))return {ok:false,reason:"no-target-part"};let a=r.root.kind==="document"?r.root.children.find(g=>g.kind==="body"):null;if(!a||!G(a))return {ok:false,reason:"no-fragment-document"};let i=cn(a.children.filter(g=>g.kind==="paragraph"||g.kind==="table"||g.kind==="contentControl"));if(i.length===0)return {ok:false,reason:"no-fragment-document"};let o=e,s=it(t,t.mainDocumentPart,wt,"/word/numbering.xml"),l=new Map,d=[],c=[];if(s&&G(s.root)){let g=new Map,I=[];for(let E of s.root.children)if(G(E))if(F(E,"abstractNum")){let H=chunkXETEMUIP_cjs.ze(E,"abstractNumId");H&&g.set(H,E);}else F(E,"num")&&I.push(E);let O=it(o,o.mainDocumentPart,wt,"/word/numbering.xml"),v=new Map,C=new Map;if(O&&G(O.root)){for(let E of O.root.children)if(G(E)&&F(E,"abstractNum")){let H=chunkXETEMUIP_cjs.ze(E,"abstractNumId");H&&C.set(H,E);}for(let E of O.root.children){if(!G(E)||!F(E,"num"))continue;let H=chunkXETEMUIP_cjs.ze(E,"numId");if(!H)continue;let ae=E.children.find($=>F($,"abstractNumId")),z=ae?chunkXETEMUIP_cjs.ze(ae,"val"):void 0,pe=z?C.get(z):void 0;v.set(`${pe?at(pe):"none"}::${E.children.filter($=>F($,"lvlOverride")).map(he).join("")}`,H);}}let _=(O?gn(O.root,E=>E.kind!=="textValue"&&F(E,"abstractNum")?chunkXETEMUIP_cjs.ze(E,"abstractNumId"):void 0):0)+1,j=(O?gn(O.root,E=>E.kind!=="textValue"&&F(E,"num")?chunkXETEMUIP_cjs.ze(E,"numId"):void 0):0)+1,te=new Map;for(let E of I){let H=chunkXETEMUIP_cjs.ze(E,"numId");if(!H)continue;let ae=E.children.find(Pe=>F(Pe,"abstractNumId")),z=ae?chunkXETEMUIP_cjs.ze(ae,"val"):void 0,pe=z?g.get(z):void 0,$=`${pe?at(pe):"none"}::${E.children.filter(Pe=>F(Pe,"lvlOverride")).map(he).join("")}`,K=v.get($);if(K!==void 0){l.set(H,K);continue}let Z=z?te.get(z):void 0;Z===void 0&&pe&&z&&(Z=String(_++),te.set(z,Z),c.push(q(pe,chunkXETEMUIP_cjs.ca,"abstractNumId",Z)));let Ce=String(j++);l.set(H,Ce);let Re=q(E,chunkXETEMUIP_cjs.ca,"numId",Ce);if(Z!==void 0){let Pe=Re.children.map(Me=>F(Me,"abstractNumId")?q(Me,chunkXETEMUIP_cjs.ca,"val",Z):Me);Re={...Re,children:Pe};}d.push(Re),v.set($,Ce);}}let u=St(it(t,t.mainDocumentPart,fn,"/word/styles.xml")),m=it(o,o.mainDocumentPart,fn,"/word/styles.xml"),x=St(m),h=new Map,P=[],f=new Set(x.byId.keys()),k=new Set(x.names),p=new Map,y=new Map,w=new Map,T=(g,I)=>{let O=w.get(g);return O===void 0&&(O=at(I),w.set(g,O)),O},R=g=>({...g,attributes:g.attributes.filter(I=>!(I.localName==="default"&&I.namespaceUri===chunkXETEMUIP_cjs.ca))});for(let g of u.styles){let I=chunkXETEMUIP_cjs.ze(g,"styleId");if(!I)continue;let O=x.byId.get(I),v=at(He(g,{styleIds:h,numIds:l}));if(O&&T(I,O)===v){h.set(I,I);continue}if(!O){h.set(I,I),f.add(I),P.push(R(g));continue}let C=Oo(`${I}Pasted`,f,p);f.add(C),h.set(I,C),P.push(R(q(g,chunkXETEMUIP_cjs.ca,"styleId",C)));}let S=P.map(g=>{let I=g.children.find(_=>F(_,"name")),O=I?chunkXETEMUIP_cjs.ze(I,"val"):void 0;if(!O||!k.has(O))return O&&k.add(O),g;let v=Io(O,k,y);k.add(v);let C=g.children.map(_=>F(_,"name")?q(_,chunkXETEMUIP_cjs.ca,"val",v):_);return {...g,children:C}}),D=null,W=1,Q=()=>{if(D)return D;let g=new Map;for(let[I,O]of o.partBytes){let v=I.startsWith("/")?I:`/${I}`;if(!v.startsWith("/word/media/"))continue;g.set(chunkXETEMUIP_cjs.a(O),v);let C=/\/image(\d+)\./.exec(v);C&&(W=Math.max(W,Number(C[1])+1));}return D=g,g},A=new Map,B=g=>{let I=A.get(g);if(!I){I=new Map;for(let O of chunkXETEMUIP_cjs.Zb(o,g)){if(O.targetMode==="External"||O.type!==vo)continue;let v=chunkXETEMUIP_cjs.w(O.ownerPart,O.rawTarget);v.ok&&I.set(v.partName,O.id);}A.set(g,I);}return I},L=(g,I)=>{let O=g.lastIndexOf("."),v=O===-1?"":g.slice(O+1);return /^[A-Za-z0-9]{1,8}$/.test(v)?v.toLowerCase():I==="image/jpeg"?"jpeg":I==="image/gif"?"gif":"png"},X=(g,I,O)=>{let v=new Map,C=new Set,_=B(I),j=[],te=new Set,E=[],H=[],ae=new Map,z=[],pe=t.relationships.get(g)??[];for(let $ of pe){if(!O.has($.id))continue;if($.targetMode==="External"){if($.type===Xi){let De=chunkXETEMUIP_cjs.Ed(o,$.rawTarget,I);De?(o=De.pkg,v.set($.id,De.relationshipId)):C.add($.id);}else C.add($.id);continue}let K=chunkXETEMUIP_cjs.w($.ownerPart,$.rawTarget);if(!K.ok){C.add($.id);continue}let Z=t.partBytes.get(K.partName)??t.partBytes.get(K.partName.replace(/^\//,"")),Ce=(chunkXETEMUIP_cjs._b(t,K.partName)??"").toLowerCase();if(!Z||!Ce.startsWith("image/")){C.add($.id);continue}let Re=qi(Z,Ce);if(Re===null){C.add($.id);continue}let Pe=Re,Me=Q(),Qn=chunkXETEMUIP_cjs.a(Z),ne=Me.get(Qn);if(!ne){let De=L(K.partName,Pe),xi=ft=>o.partBytes.has(ft)||o.partBytes.has(ft.slice(1))||o.parts.has(ft)||te.has(ft),jt=`/word/media/image${W}.${De}`;for(;xi(jt);)W+=1,jt=`/word/media/image${W}.${De}`;W+=1,ne=jt,j.push({partName:ne,bytes:Z,contentType:Pe}),te.add(ne),Me.set(Qn,ne);}let yi=ne.startsWith("/word/")?ne.slice(6):ne,Zn=_.get(ne);if(Zn!==void 0){v.set($.id,Zn);continue}let pt=ae.get(ne);pt===void 0&&(pt=E.length,ae.set(ne,pt),E.push(yi),H.push(ne)),z.push({recordId:$.id,index:pt});}if(j.length>0&&(o=chunkXETEMUIP_cjs.Ob(o,j)),E.length>0){let $=chunkXETEMUIP_cjs.bc(chunkXETEMUIP_cjs.cc(o,I),I,E.map(K=>[vo,K]));if($.ok){o=$.pkg,$.ids.forEach((K,Z)=>{_.set(H[Z],K);});for(let K of z)v.set(K.recordId,$.ids[K.index]);}else for(let K of z)C.add(K.recordId);}return {relIdMap:v,dropRelIds:C}},oe=X(t.mainDocumentPart,n,wo(i));i=Eo(i,oe.dropRelIds);let M=new Map,Ye=new Map,J=[],Bt=(g,I)=>G(g)&&g.namespaceUri===chunkXETEMUIP_cjs.ca&&g.localName===I,Vn={},gi=xo(i,(g,I)=>{let O=Vn[g];if(O===void 0){O=new Map,Vn[g]=O;let v=chunkXETEMUIP_cjs.Pe(t,g);if(v&&G(v.root))for(let C of v.root.children){if(!Bt(C,g))continue;let _=chunkXETEMUIP_cjs.ze(C,"id");if(_===void 0)continue;let j=ye(_);O.has(j)||O.set(j,C);}}return O.get(I)??null});for(let g of ["footnote","endnote"]){let I=g==="footnote"?M:Ye,O=gi[g];if(O.size===0)continue;let v=chunkXETEMUIP_cjs.Pe(t,g);if(!v||!G(v.root))continue;let C=chunkXETEMUIP_cjs.df(o,g);if(!C.ok||!C.package)return {ok:false,reason:"merge-refused"};o=C.package;let _=chunkXETEMUIP_cjs.Pe(o,g);if(!_)return {ok:false,reason:"merge-refused"};let j=gn(_.root,E=>Bt(E,g)?chunkXETEMUIP_cjs.ze(E,"id"):void 0)+1,te=[];for(let E of v.root.children){if(!Bt(E,g))continue;let H=chunkXETEMUIP_cjs.ze(E,"id"),ae=chunkXETEMUIP_cjs.ze(E,"type");if(ae==="separator"||ae==="continuationSeparator"||H===void 0||!O.has(ye(H))||I.has(ye(H)))continue;let z=String(j++);I.set(ye(H),z),te.push(q(E,chunkXETEMUIP_cjs.ca,"id",z));}te.length>0&&J.push({kind:g,fragmentPartName:v.name,bodies:cn(te)});}let Ee=o.parts.get(n),Wn=[...i,...J.flatMap(g=>g.bodies)],Kn=[],Ht=new Set,zn=false,Gn=false,qe=new Map;re(Wn,g=>{if(g.kind!=="textValue"){if(g.kind==="bookmarkStart"||g.kind==="bookmarkEnd"){let I=chunkXETEMUIP_cjs.ze(g,"id");if(I!==void 0&&Kn.push(I),g.kind==="bookmarkStart"){let O=chunkXETEMUIP_cjs.ze(g,"name");O&&Ht.add(O);}return}if(un(g)){zn=true;return}if(g.kind==="drawingDocPr"){Gn=true;return}if(g.kind==="contentControlProperties")for(let I of g.children){if(!F(I,"id"))continue;let O=chunkXETEMUIP_cjs.ze(I,"val");if(O!==void 0&&!qe.has(O)){let v=0,C=`${O}:${qe.size}`;for(let _=0;_<C.length;_+=1)v=v*31+C.charCodeAt(_)>>>0;qe.set(O,String(v%2147483647||1));}}}});let ut=Ro({pkg:o,ownerPart:Ee,notesParts:J.map(g=>chunkXETEMUIP_cjs.Pe(o,g.kind)).filter(g=>g!==null),travelling:Wn,fragmentBookmarkIds:Kn,hasRevision:zn,hasDocPr:Gn});if(!ut)return {ok:false,reason:"merge-refused"};let Xn=ut.bookmarkIds,Yn=ut.revisionIds,qn=ut.docPrIds;if(Ht.size>0){let g=new Set;if(re([Ee.root],I=>{if(I.kind!=="textValue"&&I.kind==="bookmarkStart"){let O=chunkXETEMUIP_cjs.ze(I,"name"),v=chunkXETEMUIP_cjs.ze(I,"id");O&&v!==void 0&&Ht.has(O)&&g.add(v);}}),g.size>0){let I=v=>{if(v.kind==="textValue")return v;let C=[],_=false;for(let j of v.children){if((j.kind==="bookmarkStart"||j.kind==="bookmarkEnd")&&g.has(chunkXETEMUIP_cjs.ze(j,"id")??"")){_=true;continue}let te=I(j);te!==j&&(_=true),C.push(te);}return _?{...v,children:C}:v},O=I(Ee.root);O!==Ee.root&&(chunkXETEMUIP_cjs.Ea(Ee.root,O),o=chunkXETEMUIP_cjs.Xb(o,{...Ee,root:O}));}}let Jn=g=>mn(g,M,Ye);for(let g of J){g.bodies=g.bodies.map(Jn);let I=chunkXETEMUIP_cjs.Pe(o,g.kind);if(!I)return {ok:false,reason:"merge-refused"};let O=X(g.fragmentPartName,I.name,wo(g.bodies)),v=Eo(g.bodies,O.dropRelIds);v=[...ln(v,u,x)],v=v.map(_=>He(_,{styleIds:h,numIds:l,relIds:O.relIdMap,footnoteIds:M,endnoteIds:Ye,bookmarkIds:Xn,sdtIds:qe,revisionIds:Yn,docPrIds:qn}));let C=Et(o,o.parts.get(I.name),v);if(!C)return {ok:false,reason:"merge-refused"};o=C;}if(S.length>0){let g=S.map(O=>He(O,{styleIds:h,numIds:l}));if(!m){let O=chunkXETEMUIP_cjs.ta(`<w:styles xmlns:w="${chunkXETEMUIP_cjs.ca}"></w:styles>`,{name:"/word/styles.xml",contentType:To});if(!O.ok)return {ok:false,reason:"merge-refused"};o=chunkXETEMUIP_cjs.ec(o,"/word/styles.xml",O.part.root,To);let v=chunkXETEMUIP_cjs.dc(chunkXETEMUIP_cjs.cc(o,o.mainDocumentPart),o.mainDocumentPart,fn,"styles.xml");if(!v.ok)return {ok:false,reason:"merge-refused"};o=v.pkg,m=o.parts.get("/word/styles.xml")??null;}if(!m)return {ok:false,reason:"merge-refused"};let I=Et(o,o.parts.get(m.name),g);if(!I)return {ok:false,reason:"merge-refused"};o=I,x=St(o.parts.get(m.name)??null);}if(c.length>0||d.length>0){let g=it(o,o.mainDocumentPart,wt,"/word/numbering.xml");if(!g){let _=chunkXETEMUIP_cjs.ta(`<w:numbering xmlns:w="${chunkXETEMUIP_cjs.ca}"></w:numbering>`,{name:"/word/numbering.xml",contentType:So});if(!_.ok)return {ok:false,reason:"merge-refused"};o=chunkXETEMUIP_cjs.ec(o,"/word/numbering.xml",_.part.root,So);let j=chunkXETEMUIP_cjs.dc(chunkXETEMUIP_cjs.cc(o,o.mainDocumentPart),o.mainDocumentPart,wt,"numbering.xml");if(!j.ok)return {ok:false,reason:"merge-refused"};o=j.pkg,g=o.parts.get("/word/numbering.xml")??null;}if(!g)return {ok:false,reason:"merge-refused"};let I=o.parts.get(g.name),O=I.root.children.findIndex(_=>F(_,"num")),v=c.map(_=>He(_,{styleIds:h,numIds:l})),C=Et(o,I,v,O===-1?void 0:O);if(!C)return {ok:false,reason:"merge-refused"};if(o=C,C=Et(o,o.parts.get(g.name),d),!C)return {ok:false,reason:"merge-refused"};o=C;}let hi=[...ln(i,u,x)].map(Jn).map(g=>He(g,{styleIds:h,numIds:l,relIds:oe.relIdMap,footnoteIds:M,endnoteIds:Ye,bookmarkIds:Xn,sdtIds:qe,revisionIds:Yn,docPrIds:qn}));return {ok:true,pkg:o,blocks:hi}}var Ji=16*1024*1024;function Qi(e){let t=e.parts.get(e.mainDocumentPart);if(!t||t.root.kind!=="document")return false;let n=t.root.children.find(i=>i.kind==="body");if(!n||n.kind!=="body"||n.children.length>chunkXETEMUIP_cjs.dh)return false;let r=0,a=(i,o,s)=>{if(o>s||(r+=1,r>chunkXETEMUIP_cjs.fh))return false;if(i.kind==="textValue")return true;for(let l of i.children)if(!a(l,o+1,s))return false;return true};for(let i of n.children)if(!a(i,1,chunkXETEMUIP_cjs.eh))return false;for(let[i,o]of e.parts)if(i!==e.mainDocumentPart&&/\/(styles|numbering|footnotes|endnotes)\.xml$/.test(i)&&!a(o.root,1,chunkXETEMUIP_cjs.eh*4))return false;return true}function Do(e,t,n){if(n.fragmentBytes.byteLength>Ji)return {ok:false,reason:"invalidArgs",detail:"fragment-too-large"};let r=chunkXETEMUIP_cjs.Vb(n.fragmentBytes);if(!r.ok)return {ok:false,reason:"invalidArgs",detail:`fragment-read:${r.reason}`};let a=r.package;if(!Qi(a))return {ok:false,reason:"invalidArgs",detail:"fragment-over-budget"};let i=e.resolveStory(t);if(!i.ok)return {ok:false,reason:i.reason,...i.detail?{detail:i.detail}:{}};let{store:o,story:s}=i;if(o.compositionActive||e.compositionSessionOpen())return {ok:false,reason:"invalidArgs",detail:"ime-composition-active"};let l=e.currentPackage(),d=o.checkpoint(),c=o.historyDepth,u=0,m="";return chunkXETEMUIP_cjs.xa(e,()=>{let x=o.transact(P=>{for(let y of n.priorOps??[])if(!P.apply(y))return;let f=null,k=P.applyPackage(y=>(f=Mo(y,a,s.partName),f.ok?f.pkg:y)),p=f;if(!p||!p.ok){m=`fragment-merge:${p?p.reason:"no-merge"}`,P.apply({op:"insertText",paragraphId:"\0fragment-abort",offset:0,text:"x"});return}k&&(u=p.blocks.length,P.apply({op:"insertFragment",paragraphId:n.paragraphId,offset:n.offset,blocks:p.blocks,lastMarkCovered:n.lastMarkCovered}));},{story:s,...n.actorId?{actorId:n.actorId}:{}});return m.length>0?{ok:false,reason:"invalidArgs",detail:m}:x.ok?x.change?{ok:true,change:e.promoteStoryTransactionToPackageUnit(l,o,d,c),blockCount:u}:{ok:true,change:null,blockCount:u}:{ok:false,reason:x.reason,...x.detail?{detail:x.detail}:{}}},x=>chunkXETEMUIP_cjs.ya(x))}function Zi(e){if(!(e===null||e.start!==e.end))return e}var je={"text-local":0,"paragraph-local":1,"flow-structural":2,global:3};function es(e){return Object.freeze({parts:new Map([[e.name,e]]),partBytes:new Map,relationships:new Map,externalTargets:[],contentTypes:{defaults:new Map,overrides:new Map([[e.name.toLowerCase(),e.contentType]])},mainDocumentPart:e.name})}var Ve=class{current;storyPartName;rev=0;commitCounter=0;undoStack=[];redoStack=[];subscribers=new Set;historyLimit;settingsPartOverride;storyRef=null;composition=null;constructor(t,n,r={}){let a="root"in t,i=typeof n=="string"?n:void 0,o=typeof n=="object"&&n!==null?n:r;this.current=a?es(t):t,this.storyPartName=i??(a?t.name:t.mainDocumentPart),this.historyLimit=o.historyLimit??200,this.settingsPartOverride=o.settingsPart;}setStoryRef(t){this.storyRef=t;}get part(){let t=this.current.parts.get(this.storyPartName);if(!t)throw new Error(`story part missing: ${this.storyPartName}`);return t}get package(){return this.current}get revision(){return this.rev}get canUndo(){return this.undoStack.length>0}get canRedo(){return this.redoStack.length>0}get historyDepth(){return this.undoStack.length}get compositionActive(){return this.composition!==null}graftPackage(t){this.current=t(this.current);}replacePart(t){let n=this.current.parts.get(t.name);t!==n&&(this.current=chunkXETEMUIP_cjs.Xb(this.current,t),this.rev+=1);}checkpoint(){return {pkg:this.current,revision:this.rev,undoStack:this.undoStack.slice(),redoStack:this.redoStack.slice(),composition:this.composition?{entry:{...this.composition.entry},committed:this.composition.committed}:null}}restoreCheckpoint(t){this.current=t.pkg,this.rev=t.revision,this.undoStack.length=0,this.undoStack.push(...t.undoStack),this.redoStack.length=0,this.redoStack.push(...t.redoStack),this.composition=t.composition?{entry:{...t.composition.entry},committed:t.composition.committed}:null;}restoreHistoryStacks(t){this.undoStack.length=0,this.undoStack.push(...t.undoStack),this.redoStack.length=0,this.redoStack.push(...t.redoStack);}subscribe(t){return this.subscribers.add(t),()=>this.subscribers.delete(t)}transact(t,n={}){return chunkXETEMUIP_cjs.Db(n.actorId,()=>this.commitTransaction(t,n))}commitTransaction(t,n){let r=n.origin??chunkXETEMUIP_cjs.b.mutationHuman,a=this.current,i=this.rev,o=this.current,s=null,l=0,d=new Set,c=new Set,u=new Set,m=new Set,x=new Set,h=[],P=n.minimumImpact??"text-local",f=null,k=false,p=null,y=null,w=new Map,T=(A,B)=>{let L=chunkXETEMUIP_cjs.xg.get(A.op);if(L===void 0)return w.clear(),null;let X=`${B.name}\0${L}`,oe=w.get(X);oe||(oe={id:null},w.set(X,oe));let M=oe;return ()=>M.id??=chunkXETEMUIP_cjs.Ve(B)()},R=(A,B)=>{if(s)return false;let L=o.parts.get(A);if(!L)return s={reason:"unknown-part",detail:A},false;let X=chunkXETEMUIP_cjs.Ag(L,this.settingsPartOverride?.()??chunkXETEMUIP_cjs.pe(o),B);if(X)return s={reason:X},false;let oe=T(B,L),M=chunkXETEMUIP_cjs.bh(L,B,{deferValidation:true,...oe?{revisionIds:oe}:{}});if(!M.ok)return s={reason:M.reason,...M.detail?{detail:M.detail}:{}},false;if(o=chunkXETEMUIP_cjs.Xb(o,M.part),M.part===L&&M.effect.dirty.length===0&&M.effect.created.length===0&&M.effect.deleted.length===0&&M.effect.split===void 0&&(M.effect.splits===void 0||M.effect.splits.length===0)&&M.effect.join===void 0&&M.effect.caret===void 0)return true;d.add(A),l+=1;for(let J of M.effect.dirty)c.add(J);for(let J of M.effect.created)u.add(J);for(let J of M.effect.deleted)m.add(J);for(let J of M.effect.dependencyKeys)x.add(J);M.effect.split&&h.push({split:M.effect.split});for(let J of M.effect.splits??[])h.push({split:J});return M.effect.join&&h.push({join:M.effect.join}),je[M.effect.impact]>je[P]&&(P=M.effect.impact),M.effect.caret&&(y={paragraphId:M.effect.caret.paragraphId,start:0,end:0}),true};if(t({apply:A=>R(this.storyPartName,A),applyTo:(A,B)=>R(A,B),applyPackage:A=>{if(s)return false;w.clear();let B=A(o);if(B===o)return true;for(let[L,X]of B.parts)o.parts.get(L)!==X&&d.add(L);return o=B,l+=1,je["flow-structural"]>je[P]&&(P="flow-structural"),true},selectionBefore:A=>{f=A;},selectionAfter:A=>{k=true,p=A;}}),s){let A=s;return {ok:false,reason:A.reason,...A.detail?{detail:A.detail}:{}}}if(l===0)return {ok:true,change:null};let S=k?p:y,D=k?Zi(p):y??void 0;for(let A of d){let B=a.parts.get(A),L=o.parts.get(A);if(L===void 0)continue;let X=B?chunkXETEMUIP_cjs.ra(B,L):chunkXETEMUIP_cjs.ra(L,L);if(!X.ok)return {ok:false,reason:"tree-invariant",detail:JSON.stringify(X.issues)}}let W=chunkXETEMUIP_cjs.fc(o);return W.ok?((n.recordsHistory??(r!==chunkXETEMUIP_cjs.b.projection&&r!==chunkXETEMUIP_cjs.b.awareness))&&(this.composition?(this.composition.committed=true,this.composition={...this.composition,entry:{...this.composition.entry,selectionAfter:S}}):(this.pushUndo({pkg:a,revision:i,selectionBefore:f,selectionAfter:S}),this.redoStack.length=0)),this.current=o,this.rev+=1,n.story&&(this.storyRef=n.story),n.minimumImpact&&je[n.minimumImpact]>je[P]&&(P=n.minimumImpact),{ok:true,change:this.publish(r,i,{dirty:c,created:u,deleted:m,dependencyKeys:x,splitJoin:h,impact:P,caret:D},n.story??this.storyRef??void 0,n.actorId,n.operationId)}):{ok:false,reason:"package-invariant",detail:JSON.stringify(W.issues)}}beginComposition(t=null){this.composition||(this.composition={entry:{pkg:this.current,revision:this.rev,selectionBefore:t,selectionAfter:null},committed:false});}endComposition(){let t=this.composition;this.composition=null,!(!t||!t.committed)&&(this.pushUndo(t.entry),this.redoStack.length=0);}cancelComposition(){this.composition=null;}undo(){let t=this.undoStack.pop();if(!t)return null;let n=this.rev;return this.redoStack.push({pkg:this.current,revision:this.rev,selectionBefore:t.selectionBefore,selectionAfter:t.selectionAfter}),this.current=t.pkg,this.rev+=1,this.publish(chunkXETEMUIP_cjs.b.mutationUndo,n,null,this.storyRef??void 0)}redo(){let t=this.redoStack.pop();if(!t)return null;let n=this.rev;return this.undoStack.push({pkg:this.current,revision:this.rev,selectionBefore:t.selectionBefore,selectionAfter:t.selectionAfter}),this.current=t.pkg,this.rev+=1,this.publish(chunkXETEMUIP_cjs.b.mutationRedo,n,null,this.storyRef??void 0)}selectionForUndo(){return this.undoStack[this.undoStack.length-1]?.selectionBefore??null}selectionForRedo(){return this.redoStack[this.redoStack.length-1]?.selectionAfter??null}pushUndo(t){this.undoStack.push(t),this.undoStack.length>this.historyLimit&&this.undoStack.shift();}publish(t,n,r,a,i,o){this.commitCounter+=1;let s={change:"model-change",fromRevision:n,toRevision:this.rev,commitId:`commit-${this.commitCounter}`,origin:t,...i?{actorId:i}:{},...o?{operationId:o}:{},dirty:r?[...r.dirty]:[],created:r?[...r.created]:[],deleted:r?[...r.deleted]:[],splitJoin:r?r.splitJoin:[],dependencyKeys:r?[...r.dependencyKeys]:[],impact:r?r.impact:a?.kind==="headerFooter"?"global":"flow-structural",...r?.caret?{caret:r.caret}:{},...a?{story:a}:{}};for(let l of this.subscribers)l(s);return s}};function hn(e,t){return [...e.values()].map(n=>n.part).filter(n=>t.parts.has(n.name))}function Ao(e,t){return hn(e,t).map(n=>n.name).sort().join(",")}function _o(e,t,n){if(e.relationships!==t.relationships||e.contentTypes!==t.contentTypes||e.partBytes!==t.partBytes||e.externalTargets!==t.externalTargets||e.mainDocumentPart!==t.mainDocumentPart)return true;if(e.parts===t.parts)return false;if(e.parts.size!==t.parts.size)return true;for(let[r,a]of t.parts)if(r!==n&&e.parts.get(r)!==a)return true;return false}var Mt="http://schemas.openxmlformats.org/wordprocessingml/2006/main",ts="application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml";function We(e,t){for(let n of e.children)if(n.kind!=="textValue"&&n.namespaceUri===Mt&&n.localName===t)return n;return null}function Ct(e,t){return e.attributes.find(n=>n.namespaceUri===Mt&&n.localName===t)?.value}function ns(e){let t=Ct(e,"val");return t===void 0||t==="1"||t==="true"||t==="on"}function Fo(e,t){return e.kind==="textValue"?Object.freeze({...e,id:t()}):Object.freeze({...e,id:t(),children:e.children.map(n=>Fo(n,t))})}function rs(e){let t=chunkXETEMUIP_cjs.ta(`<w:styles xmlns:w="${Mt}"><w:style w:type="paragraph" w:styleId="ListParagraph"><w:pPr><w:contextualSpacing/></w:pPr></w:style></w:styles>`,{name:e.name,contentType:ts});if(!t.ok)return null;let n=We(t.part.root,"style"),r=n?We(n,"pPr"):null;return r?Fo(r,chunkXETEMUIP_cjs.Aa(e)):null}var Uo=["pStyle","keepNext","keepLines","pageBreakBefore","framePr","widowControl","numPr","suppressLineNumbers","pBdr","shd","tabs","suppressAutoHyphens","kinsoku","wordWrap","overflowPunct","topLinePunct","autoSpaceDE","autoSpaceDN","bidi","adjustRightInd","snapToGrid","spacing","ind","contextualSpacing","mirrorIndents","suppressOverlap","jc","textDirection","textAlignment","textboxTightWrap","outlineLvl","divId","cnfStyle","rPr","sectPr","pPrChange"];function os(e,t){let n=Uo.indexOf(t),r=0;return e.forEach((a,i)=>{if(a.kind==="textValue")return;let o=Uo.indexOf(a.localName);o!==-1&&o<=n&&(r=i+1);}),r}function Lo(e,t){let n=chunkXETEMUIP_cjs.wd(e);if(!n)return null;let r=null;for(let d of n.root.children)if(d.kind!=="textValue"&&d.namespaceUri===Mt&&d.localName==="style"&&Ct(d,"type")==="paragraph"&&Ct(d,"styleId")===t){r=d;break}if(!r)return null;let a=We(r,"name");if(a&&Ct(a,"val")?.trim().toLowerCase()!=="list paragraph"&&t!=="ListParagraph")return null;let i=rs(n);if(!i)return null;let o=We(i,"contextualSpacing");if(!o)return null;let s=We(r,"pPr"),l;if(s){let d=We(s,"contextualSpacing");if(d&&ns(d))return e;l=d?chunkXETEMUIP_cjs.Ha(n,d.id,o):chunkXETEMUIP_cjs.Ga(n,s.id,os(s.children,"contextualSpacing"),[o]);}else {let d=r.children.findIndex(c=>c.kind!=="textValue"&&["rPr","tblPr","tcPr","tblStylePr"].includes(c.localName));l=chunkXETEMUIP_cjs.Ga(n,r.id,d===-1?r.children.length:d,[i]);}return l.ok?Object.freeze({...e,parts:new Map([...e.parts,[n.name,l.part]])}):null}var jo="http://schemas.openxmlformats.org/package/2006/relationships",Vo="application/vnd.openxmlformats-package.relationships+xml",ss="http://schemas.openxmlformats.org/package/2006/content-types",$o="/[Content_Types].xml",Ke="/word/numbering.xml",Bo="http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering",st="application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml",ls=`<Override PartName="${Ke}" ContentType="${st}"/>`;function Dt(e){return `${e.ownerPart}\0${e.id}`}function Wo(e,t,n){let r=new Set(t.externalTargets.filter(s=>s.type===chunkXETEMUIP_cjs.Pa).map(Dt)),a=n.externalTargets.filter(s=>s.type===chunkXETEMUIP_cjs.Pa&&!r.has(Dt(s)));if(a.length===0)return e;let i=new Set(e.map(Dt)),o=a.filter(s=>!i.has(Dt(s)));return o.length===0?e:Object.freeze([...e,...o])}function Ko(e,t,n){let r=e.filter(a=>a.ownerPart===n||t.has(a.ownerPart));return r.length===e.length?e:Object.freeze(r)}function zo(e,t,n=[]){if(e===t)return e;let r=ds(e,t);return r=cs(r,t,n),r}function Go(e,t){let n=new Set;for(let a of e.externalTargets)a.type===chunkXETEMUIP_cjs.Pa&&a.ownerPart!==e.mainDocumentPart&&(e.parts.has(a.ownerPart)||t.has(a.ownerPart)||n.add(a.ownerPart));for(let a of e.parts.keys()){let i=fs(a);!i||i===e.mainDocumentPart||e.parts.has(i)||t.has(i)||e.externalTargets.some(o=>o.ownerPart===i)||n.add(i);}if(n.size===0)return e;let r=e;for(let a of n)r=gs(r,a);return r}function ds(e,t){let n=t.parts.get(Ke);if(!n)return e;let r=chunkXETEMUIP_cjs.Xb(e,n),a=(t.relationships.get(t.mainDocumentPart)??[]).find(o=>o.type===Bo),i=r.relationships.get(r.mainDocumentPart)??[];if(a&&!i.some(o=>o.type===Bo)&&!i.some(o=>o.id===a.id)){let o=us(r,{...a,ownerPart:r.mainDocumentPart});o&&(r=o);}if(r.contentTypes.overrides.get(chunkXETEMUIP_cjs.u(Ke))!==st){let o=hs(r);o&&(r=o);}return r}function cs(e,t,n){let r=n.filter(i=>i.type===chunkXETEMUIP_cjs.Pa);if(r.length===0)return e;let a=e;for(let i of r){let o=ms(e,t,i.ownerPart);if(!o||a.externalTargets.some(d=>d.ownerPart===o&&d.id===i.id)||new Set((a.relationships.get(o)??[]).map(d=>d.id)).has(i.id))continue;let l=ps(a,{ownerPart:o,id:i.id,type:chunkXETEMUIP_cjs.Pa,rawTarget:i.rawTarget,sinkSafe:i.sinkSafe},o);l&&(a=l);}return a}function ms(e,t,n){return n===t.mainDocumentPart?e.mainDocumentPart:typeof n!="string"||n.length===0?null:n}function us(e,t){let n=e.mainDocumentPart,r=yn(n),a=e.parts.get(r),i=chunkXETEMUIP_cjs.ta(`<Relationships xmlns="${jo}"><Relationship Id="${chunkXETEMUIP_cjs.P(t.id,"relationship id")}" Type="${chunkXETEMUIP_cjs.P(t.type,"relationship type")}" Target="${chunkXETEMUIP_cjs.P(t.rawTarget,"relationship target")}"/></Relationships>`,{name:r,contentType:Vo});if(!i.ok)return null;let o=e.relationships.get(n)??[];if(o.some(d=>d.id===t.id))return null;let s={...t,ownerPart:n,order:o.reduce((d,c)=>Math.max(d,c.order),-1)+1},l=new Map([...e.relationships,[n,[...o,s]]]);return a?Xo(e,a,i.part.root.children[0],l):Object.freeze({...e,parts:new Map([...e.parts,[r,i.part]]),relationships:l})}function ps(e,t,n=e.mainDocumentPart){let r=n;if(typeof r!="string"||r.length===0)return null;let a=yn(r),i=e.parts.get(a),o=chunkXETEMUIP_cjs.ta(`<Relationships xmlns="${jo}"><Relationship Id="${chunkXETEMUIP_cjs.P(t.id,"relationship id")}" Type="${chunkXETEMUIP_cjs.Pa}" Target="${chunkXETEMUIP_cjs.P(t.rawTarget,"relationship target")}" TargetMode="External"/></Relationships>`,{name:a,contentType:Vo});if(!o.ok)return null;let s=[...e.externalTargets,t];if(!i)return Object.freeze({...e,parts:new Map([...e.parts,[a,o.part]]),externalTargets:s});let l=Xo(e,i,o.part.root.children[0],e.relationships);return l?Object.freeze({...l,externalTargets:s}):null}function Xo(e,t,n,r){if(!n)return null;let a=chunkXETEMUIP_cjs.Aa(t),i=chunkXETEMUIP_cjs.Ga(t,t.root.id,t.root.children.length,[Yo(n,a)]);return i.ok?Object.freeze({...e,parts:new Map([...e.parts,[t.name,i.part]]),relationships:r}):null}function Yo(e,t){return e.kind==="textValue"?{...e,id:t()}:{...e,id:t(),children:e.children.map(n=>Yo(n,t))}}function yn(e){let t=e.lastIndexOf("/");return `${e.slice(0,t)}/_rels/${e.slice(t+1)}.rels`}function fs(e){let t=/^(.*)\/_rels\/([^/]+)\.rels$/.exec(e);if(!t)return null;let n=t[1],r=t[2];return n===""||r===""?null:`${n}/${r}`}function gs(e,t){let n=yn(t),r=new Map(e.parts);r.delete(n);let a=new Map(e.partBytes);a.delete(n);let i=new Map(e.relationships);i.delete(t);let o=Object.freeze(e.externalTargets.filter(s=>s.ownerPart!==t));return Object.freeze({...e,parts:r,partBytes:a,relationships:i,externalTargets:o})}function hs(e){let t=e.contentTypes.overrides.get(chunkXETEMUIP_cjs.u(Ke));if(t===st)return e;if(t!==void 0)return null;let n=e.partBytes.get($o);if(!n)return null;let r=fflate.strFromU8(n),a=Ho(r);if(!a)return null;let i=r.lastIndexOf(`</${a.rootName}>`);if(i===-1)return null;let o=r.slice(0,i)+ls+r.slice(i),s=Ho(o);if(!s||s.rootName!==a.rootName)return null;let l=[...a.children,qo("Override",{PartName:Ke,ContentType:st})];return s.children.length!==l.length||s.children.some((d,c)=>d!==l[c])?null:Object.freeze({...e,partBytes:new Map([...e.partBytes,[$o,fflate.strToU8(o)]]),contentTypes:Object.freeze({defaults:e.contentTypes.defaults,overrides:new Map([...e.contentTypes.overrides,[chunkXETEMUIP_cjs.u(Ke),st]])})})}function Ho(e){let t=chunkXETEMUIP_cjs.W(e);if(!t.ok)return null;let n=t.nodes.filter(s=>s.type==="element");if(n.length!==1)return null;let r=n[0],a=r.name.indexOf(":"),i=a===-1?"":r.name.slice(0,a);if(r.name.slice(a+1)!=="Types"||r.attributes[i?`xmlns:${i}`:"xmlns"]!==ss)return null;let o=[];for(let s of r.children)s.type==="element"&&o.push(qo(s.name,s.attributes));return {rootName:r.name,children:o}}function qo(e,t){let n=Object.entries(t).map(([r,a])=>`${r}=${a}`).sort();return [e,...n].join("")}var Jo=4e3,Qo=64;function Zo(e){return chunkXETEMUIP_cjs.Pe(e,"footnote")!==null||chunkXETEMUIP_cjs.Pe(e,"endnote")!==null}function ea(e,t,n,r){if(!Zo(e))return false;if(r.has(n.paragraphId))return true;r.add(n.paragraphId);let a=chunkXETEMUIP_cjs.Ca(t,n.paragraphId);return !a||a.kind!=="paragraph"?true:chunkXETEMUIP_cjs.He(a).some(i=>i.node.kind==="noteReference"&&i.start<n.end&&i.end>n.start)}function ta(e,t,n,r){if(!Zo(e))return false;if(r.has(n.blockId))return true;r.add(n.blockId);let a=chunkXETEMUIP_cjs.Ca(t,n.blockId);if(!a||a.kind==="textValue")return true;let i=0,o=(s,l)=>{if(i>=Jo||l>Qo)return true;if(i+=1,s.kind==="textValue")return false;if(s.kind==="paragraph")return chunkXETEMUIP_cjs.He(s).some(d=>d.node.kind==="noteReference");for(let d of s.children)if(o(d,l+1))return true;return false};return o(a,0)}function na(e,t,n){if(n.count>=Jo||t>Qo)return true;if(n.count+=1,e.kind==="textValue")return false;if(e.kind==="commentRangeStart"||e.kind==="commentRangeEnd"||e.kind==="commentReference")return true;for(let r of e.children)if(na(r,t+1,n))return true;return false}function ra(e,t,n,r){if(!chunkXETEMUIP_cjs.Rf(e))return false;let a=n.op==="deleteText"?n.paragraphId:n.blockId;if(r.has(a))return true;r.add(a);let i=chunkXETEMUIP_cjs.Ca(t,a);return !i||i.kind==="textValue"?true:na(i,0,{count:0})}var xn="http://schemas.openxmlformats.org/officeDocument/2006/relationships/header",kn="http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer";function oa(e,t){let r=(e.relationships.get(e.mainDocumentPart)??[]).find(a=>a.id===t);return r?r.type!==xn&&r.type!==kn?{ok:false,reason:"wrong-relationship-type",detail:r.type}:ys(e,r):{ok:false,reason:"dangling-relationship",detail:t}}function ys(e,t){let n=chunkXETEMUIP_cjs.E(t);if(n.mode==="External")return {ok:false,reason:"external-relationship",detail:t.id};if(!n.target.ok)return {ok:false,reason:"bad-relationship-target",detail:n.target.reason};let r=e.parts.get(n.target.partName);if(!r)return {ok:false,reason:"missing-part",detail:n.target.partName};let a=r.root.localName;return a!=="hdr"&&a!=="ftr"?{ok:false,reason:"not-a-story-part",detail:a||r.name}:{ok:true,partName:r.name,part:r}}function we(e,t){return t.compositionActive||e.compositionSessionOpen()?{ok:false,reason:"invalidArgs",detail:"ime-composition-active"}:null}function aa(e,t){let n=chunkXETEMUIP_cjs.Ca(e,t);return !n||n.kind!=="drawing"?null:n.children.find(a=>a.kind==="inlineDrawing"||a.kind==="anchoredDrawing")??null}function ia(e,t,n){let r=e.parts.get(t);if(!r)return null;let a=chunkXETEMUIP_cjs.Ca(r,n);return !a||a.kind!=="drawing"?null:chunkXETEMUIP_cjs.db(a,{ownerPartName:t,supportedMcRequires:chunkXETEMUIP_cjs._a,limits:chunkXETEMUIP_cjs.Za,resolveRelationship:chunkXETEMUIP_cjs.ab(e,t)})}function sa(e,t,n){let r=chunkXETEMUIP_cjs.F(e.relationships.get(t)??[],t,n);return r.mode==="internal"?r.partName:null}function ze(e,t,n,r){let a=e.resolveStory(t);if(!a.ok)return {ok:false,reason:a.reason,...a.detail?{detail:a.detail}:{}};let i=we(e,a.store);if(i)return i;let{store:o,story:s}=a;return chunkXETEMUIP_cjs.xa(e,()=>xs(e,o,s,n,r),l=>chunkXETEMUIP_cjs.ya(l))}function xs(e,t,n,r,a){let i=n.partName,o=e.currentPackage(),s=t.checkpoint(),l=t.historyDepth,d=null,c=false,u=false,m=t.transact(P=>{if(a?.commitGuard?.()===false){u=true;return}if(a?.expectedPackageRevision!==void 0&&e.packageRevision!==a.expectedPackageRevision){c=true;return}let f=r(P,i);if(f===null){P.apply({op:"insertText",paragraphId:"\0task12-abort",offset:0,text:"x"});return}d=f;},{story:n,...a?.actorId?{actorId:a.actorId}:{},...n.kind==="headerFooter"||n.kind==="notesPart"?{minimumImpact:"global"}:{}});if(u)return {ok:false,reason:"invalidArgs",detail:"stale drawing selection"};if(c)return {ok:false,reason:"invalidArgs",detail:"stale-package-epoch"};if(!m.ok)return {ok:false,reason:m.reason,...m.detail?{detail:m.detail}:{}};if(!m.change)return {ok:true,change:null};let x=m.change.created.find(P=>{let f=t.part;return chunkXETEMUIP_cjs.Ca(f,P)?.kind==="drawing"});return x&&(d=x),{ok:true,change:e.promoteStoryTransactionToPackageUnit(o,t,s,l),...d?{drawingNodeId:d}:{}}}function la(e,t,n){let r=e.parts.get(t);if(!r)return null;let a=aa(r,n);return a?chunkXETEMUIP_cjs.Ug(a):null}function Pn(e,t,n,r){let a=false;return e.applyPackage(i=>{let o=i.parts.get(t);if(!o)return i;let s=chunkXETEMUIP_cjs.Ca(o,n);if(!s||s.kind!=="drawing")return i;let l=aa(o,n);if(!l)return i;let d=chunkXETEMUIP_cjs.Vg(l,r),c=ks(s,d),u=chunkXETEMUIP_cjs.Ha(o,s.id,c,{deferValidation:true});return u.ok?(a=true,chunkXETEMUIP_cjs.Xb(i,u.part)):i}),a}function ks(e,t){return {...e,children:e.children.map(n=>n.id===t.id?t:n)}}async function da(e,t,n){let r=chunkXETEMUIP_cjs.Pb(n.widthPoints),a=chunkXETEMUIP_cjs.Pb(n.heightPoints);if(r===null||a===null)return {ok:false,reason:"invalidArgs",detail:"invalid-dimensions"};let i=e.resolveStory(t);if(!i.ok)return {ok:false,reason:i.reason,...i.detail?{detail:i.detail}:{}};let o=we(e,i.store);if(o)return o;let s=i.story.partName,l=await chunkXETEMUIP_cjs.Lb(n.decodePort,n.bytes,n.mime);if(!l.ok)return {ok:false,reason:"invalidArgs",detail:"invalid-image"};let d=l.bytes,c=chunkXETEMUIP_cjs.Nb(e.currentPackage(),s,{bytes:d,mime:n.mime});if(!c.ok)return {ok:false,reason:"invalidArgs",detail:c.reason==="invalid-image"?"invalid-image":c.reason};let u=c.partName,m=ze(e,t,(x,h)=>{let P=e.currentPackage(),f=chunkXETEMUIP_cjs.Nb(P,h,{bytes:d,mime:n.mime});if(!f.ok)return null;P=f.pkg,u=f.partName;let k;if(n.hyperlink){let y=chunkXETEMUIP_cjs.Ed(P,n.hyperlink,h);if(!y)return null;P=y.pkg,k=y.relationshipId;}if(!x.applyPackage(()=>P))return null;let p=chunkXETEMUIP_cjs.Qb({docPrId:f.docPrId,relationshipId:f.relationshipId,extentEmu:{cx:r,cy:a},...n.title!==void 0?{title:n.title}:{},...n.description!==void 0?{description:n.description}:{},...k?{hyperlinkRelationshipId:k}:{}});return x.apply({op:"insertDrawing",paragraphId:n.paragraphId,offset:n.offset,drawing:p,...n.revision?{revision:n.revision}:{}})?p.id:null},{expectedPackageRevision:n.expectedPackageRevision,...n.commitGuard?{commitGuard:n.commitGuard}:{},...n.actorId?{actorId:n.actorId}:{}});return m.ok?m.change?{...m,mediaPartName:u}:{ok:true,change:null,mediaPartName:u}:m}async function On(e,t,n,r,a,i,o){let s=e.resolveStory(t);if(!s.ok)return {ok:false,reason:s.reason,...s.detail?{detail:s.detail}:{}};let l=we(e,s.store);if(l)return l;let d=s.story.partName,c=await chunkXETEMUIP_cjs.Lb(i,r,a);if(!c.ok)return {ok:false,reason:"invalidArgs",detail:"invalid-image"};let u=c.bytes,m=chunkXETEMUIP_cjs.Nb(e.currentPackage(),d,{bytes:u,mime:a});return m.ok?ze(e,t,(x,h)=>{let P=e.currentPackage(),f=ia(P,d,n),k=f?.picture?.embeddedRelationshipId??null,p=f?.picture?.linkedRelationshipId??null,y=k??p;if(!y)return null;let w=k!==null?sa(P,d,k):null,T=P,R=chunkXETEMUIP_cjs.Nb(T,h,{bytes:u,mime:a});return !R.ok||(T=R.pkg,!x.applyPackage(()=>T))||!x.apply({op:"replaceDrawingResource",drawingNodeId:n,relationshipId:R.relationshipId})?null:(x.applyPackage(S=>chunkXETEMUIP_cjs.Sb(S,h,w,y)),n)},{expectedPackageRevision:o.expectedPackageRevision,...o.commitGuard?{commitGuard:o.commitGuard}:{},...o.actorId?{actorId:o.actorId}:{}}):{ok:false,reason:"invalidArgs",detail:m.reason==="invalid-image"?"invalid-image":m.reason}}function ca(e,t,n){let r=e.resolveStory(t);if(!r.ok)return {ok:false,reason:r.reason,...r.detail?{detail:r.detail}:{}};let a=we(e,r.store);if(a)return a;let i=r.story.partName,o=e.currentPackage(),s=ia(o,i,n);if(!s)return {ok:false,reason:"unknown-drawing"};let l=s.picture?.embeddedRelationshipId??null,d=s.picture?.linkedRelationshipId??null,c=l??d,u=l!==null?sa(o,i,l):null;return ze(e,t,(m,x)=>m.apply({op:"deleteDrawing",drawingNodeId:n})?(m.applyPackage(h=>chunkXETEMUIP_cjs.Sb(h,x,u,c)),n):null)}function Ps(e,t){let n=null,r=i=>{let o=false,s=false,l=(d,c)=>{if(o||d.kind==="textValue")return;if(d.id===t){o=true,s=c;return}let u=c||d.kind==="revisionDelete"||d.kind==="revisionMoveFrom";for(let m of d.children)l(m,u);};return l(i,false),s},a=i=>{if(!(n!==null||i.kind==="textValue")){if(i.kind==="paragraph"){let o=chunkXETEMUIP_cjs.Ie(i).spanOf(t);if(o!==null&&o.end>o.start){let s=chunkXETEMUIP_cjs.Ca(e,t);if(!s||s.kind!=="drawing"&&!chunkXETEMUIP_cjs.bb(s))return;n={paragraphId:i.id,start:o.start,end:o.end,alreadyDeleted:r(i)};}return}for(let o of i.children)a(o);}};return a(e.root),n}function ma(e,t,n,r){let a=e.resolveStory(t);if(!a.ok)return {ok:false,reason:a.reason,...a.detail?{detail:a.detail}:{}};let i=we(e,a.store);if(i)return i;let o=e.currentPackage().parts.get(a.story.partName);if(!o)return {ok:false,reason:"unknown-drawing"};let s=Ps(o,n);return s?s.alreadyDeleted?{ok:true,change:null}:ze(e,t,l=>l.apply({op:"deleteText",paragraphId:s.paragraphId,start:s.start,end:s.end,revision:r})?n:null):{ok:false,reason:"unknown-drawing"}}async function ua(e,t,n,r,a,i,o,s){let l=await chunkXETEMUIP_cjs.Tb(a,r,i,void 0,o);return l.ok?On(e,t,n,l.bytes,l.mime,o,{expectedPackageRevision:e.packageRevision,...s?{actorId:s}:{}}):{ok:false,reason:"invalidArgs",detail:`${l.reason}${l.detail?`:${l.detail}`:""}`}}function pa(e,t,n,r,a,i){let o=e.resolveStory(t);if(!o.ok)return {ok:false,reason:o.reason,...o.detail?{detail:o.detail}:{}};let s=we(e,o.store);return s||ze(e,t,(l,d)=>{let c=la(e.currentPackage(),d,n),u=null;if(i!==null){let x=chunkXETEMUIP_cjs.Ed(e.currentPackage(),i,d);if(!x||!l.applyPackage(()=>x.pkg))return null;u=x.relationshipId;}if(!l.apply({op:"setDrawingMetadata",drawingNodeId:n,title:r,description:a,...i===null?{hyperlink:null}:{}}))return null;if(i!==null&&u!==null){if(!Pn(l,d,n,u))return null}else if(i===null&&!Pn(l,d,n,null))return null;let m=false;return l.applyPackage(x=>{let h=chunkXETEMUIP_cjs.Gd(x,d,c);return h===null?(m=true,x):h}),m?null:n})}function fa(e,t,n){let r=e.resolveStory(t);if(!r.ok)return {ok:false,reason:r.reason,...r.detail?{detail:r.detail}:{}};let a=we(e,r.store);return a||ze(e,t,(i,o)=>{let s=la(e.currentPackage(),o,n.drawingNodeId),l=null;if(n.hyperlink!==null){let c=chunkXETEMUIP_cjs.Ed(e.currentPackage(),n.hyperlink,o);if(!c||!i.applyPackage(()=>c.pkg))return null;l=c.relationshipId;}for(let c of n.ops)if(!i.apply(c))return null;if(!Pn(i,o,n.drawingNodeId,n.hyperlink===null?null:l))return null;let d=false;return i.applyPackage(c=>{let u=chunkXETEMUIP_cjs.Gd(c,o,s);return u===null?(d=true,c):u}),d?null:n.drawingNodeId})}function Os(e,t){if(e===t)return true;if(e.byteLength!==t.byteLength)return false;for(let n=0;n<e.byteLength;n+=1)if(e[n]!==t[n])return false;return true}function ga(e,t){if(e===t)return true;if(e.size!==t.size)return false;for(let[n,r]of e)if(t.get(n)!==r)return false;return true}function Is(e,t){return e===t||e.ownerPart===t.ownerPart&&e.id===t.id&&e.type===t.type&&e.rawTarget===t.rawTarget&&e.targetMode===t.targetMode&&e.order===t.order}function Rs(e,t){if(e===t)return true;if(e.size!==t.size)return false;for(let[n,r]of e){let a=t.get(n);if(!a||a.length!==r.length||a!==r&&r.some((i,o)=>!Is(i,a[o])))return false}return true}function bs(e,t){return e===t?true:e.length!==t.length?false:e.every((n,r)=>{let a=t[r];return n===a||n.ownerPart===a.ownerPart&&n.id===a.id&&n.type===a.type&&n.rawTarget===a.rawTarget&&n.sinkSafe===a.sinkSafe})}function Ns(e,t){if(e===t)return true;if(e.size!==t.size)return false;for(let[n,r]of e){let a=t.get(n);if(!a||!Os(r,a))return false}return true}function vs(e,t){return e.contentTypes===t.contentTypes||ga(e.contentTypes.defaults,t.contentTypes.defaults)&&ga(e.contentTypes.overrides,t.contentTypes.overrides)}var At=Object.freeze({equal:true,dirty:Object.freeze([]),dependencyKeys:Object.freeze([]),impact:"global"}),_t=Object.freeze({equal:false,dirty:Object.freeze([]),dependencyKeys:Object.freeze([]),impact:"global"});function ha(e){for(let[t,n]of e)if(!chunkXETEMUIP_cjs.oa(t,n))return _t;return At}function Ss(e,t){if(e===t)return At;if(e.mainDocumentPart!==t.mainDocumentPart||e.parts.size!==t.parts.size||!Ns(e.partBytes,t.partBytes)||!Rs(e.relationships,t.relationships)||!bs(e.externalTargets,t.externalTargets)||!vs(e,t))return _t;let n=[];for(let[o,s]of e.parts){let l=t.parts.get(o);if(!l)return _t;s!==l&&n.push([s,l]);}if(n.length===0)return At;let[r,a]=n[0];if(n.length>1||r.name!==e.mainDocumentPart)return ha(n);let i=chunkXETEMUIP_cjs.pa(a.root,r.root);return i.undecided?ha(n):i.equal?At:!i.idsPreserved||i.reach==="outside-paragraph"||i.paragraphIds.length===0?_t:{equal:false,dirty:i.paragraphIds,dependencyKeys:[chunkXETEMUIP_cjs.g.story],impact:i.reach==="paragraph-text"?"text-local":"flow-structural"}}function In(e){return {ok:false,reason:"package-invariant",detail:e}}function Ts(e,t){if(!e.parts.get(e.mainDocumentPart))return In("no-main-document");for(let[r,a]of e.parts){let i=t?.parts.get(r);if(i===a)continue;let o=i?chunkXETEMUIP_cjs.ra(i,a):chunkXETEMUIP_cjs.qa(a);if(!o.ok)return In(`invalid-part:${r}:${o.issues[0]?.code??"invalid"}`)}let n=chunkXETEMUIP_cjs.fc(e);return n.ok?null:In(n.issues[0]?.code??"package-invariant")}function ya(e,t,n){let r=e.currentPackage(),a=Ss(t,r);if(a.equal)return {ok:true,change:null};let i=Ts(t,r);if(i)return i;let o=e.bodyStore().part.name,s=a.impact!=="global"&&t.mainDocumentPart===o;return chunkXETEMUIP_cjs.xa(e,()=>{let l=e.packageRevision;return e.installAuthoritativePackageSnapshot(t),{ok:true,change:e.publishStoryWrite({change:"model-change",fromRevision:l,toRevision:l+1,commitId:`pkg-remote-${l+1}`,origin:n.origin,...n.actorId?{actorId:n.actorId}:{},...n.operationId?{operationId:n.operationId}:{},dirty:s?a.dirty:[],created:[],deleted:[],splitJoin:[],dependencyKeys:s?a.dependencyKeys:[],impact:s?a.impact:"global",story:{kind:"body",partName:o}})}},()=>false)}function Pa(e,t,n,r){let a=[...t],i=new Set;for(let o of a)e.parts.has(o)&&i.add(o);for(let o of n)xa(o,a,i);for(let o of r)xa(o,a,i);return i}function Oa(e,t,n,r,a){let i=new Set(e);i.add(t),i.add(n);for(let o of r)ka(o,i);for(let o of a)ka(o,i);return i}function xa(e,t,n){if(e.kind==="story"){n.add(e.partName);return}for(let r of t)(e.before.parts.has(r)||e.after.parts.has(r))&&n.add(r);}function ka(e,t){if(e.kind==="story"){t.add(e.partName);return}for(let n of e.before.parts.keys())t.add(n);for(let n of e.after.parts.keys())t.add(n);}var Ia=new Set(["acceptRevision","rejectRevision","acceptAllRevisions","rejectAllRevisions"]),ws=new Set(["deleteTableRow","deleteTableColumn","removeContentControl","removeRepeatingSectionItem"]),Es=64,Ra=class{pkg;packageRev=0;body;stories=new Map;rIdToPartName=new Map;undoOrder=[];redoOrder=[];subscribers=new Set;historyLimit;maxEditableStoryParts;cascadeNoteReferences;lastChange=null;shellHyperlinks=Object.freeze([]);compositionSession=null;commitCounter=0;currentPackageMemo=null;constructor(t,n,r={}){this.pkg=chunkXETEMUIP_cjs.Xb(t,n),this.historyLimit=r.historyLimit??200,this.maxEditableStoryParts=r.maxEditableStoryParts??Es,this.cascadeNoteReferences=r.cascadeDeletedNoteReferences??chunkXETEMUIP_cjs.cf,this.body=new Ve(this.pkg,n.name,{historyLimit:this.historyLimit,settingsPart:()=>chunkXETEMUIP_cjs.pe(this.pkg)}),this.body.setStoryRef({kind:"body",partName:n.name});}get packageRevision(){return this.packageRev}get canUndo(){return this.undoOrder.length>0}get canRedo(){return this.redoOrder.length>0}get lastModelChange(){return this.lastChange}bodyStore(){return this.body}currentPackage(){let t=this.currentPackageMemo;if(t&&t.pkg===this.pkg&&t.bodyPart===this.body.part){let a=0,i=true;for(let o of this.stories.values()){if(t.storyParts[a]!==o.part){i=false;break}a+=1;}if(i&&a===t.storyParts.length)return t.result}let n=chunkXETEMUIP_cjs.Xb(this.pkg,this.body.part),r=[];for(let a of this.stories.values())r.push(a.part),this.pkg.parts.has(a.part.name)&&(n=chunkXETEMUIP_cjs.Xb(n,a.part));return this.currentPackageMemo={pkg:this.pkg,bodyPart:this.body.part,storyParts:r,result:n},n}subscribe(t){return this.subscribers.add(t),()=>this.subscribers.delete(t)}resolveStory(t){return t.kind==="body"?{ok:true,story:{kind:"body",partName:this.body.part.name},store:this.body}:t.kind==="notesPart"?t.noteKind!=="footnote"&&t.noteKind!=="endnote"?{ok:false,reason:"unknown-scope",detail:String(t.noteKind)}:this.openNotesPartStore(t.noteKind):t.kind!=="headerFooter"||typeof t.rId!="string"||t.rId.length===0?{ok:false,reason:"unknown-scope",detail:String(t.kind)}:this.openHeaderFooterStore(t.rId)}partFor(t){let n=this.resolveStory(t);return n.ok?n.store.part:null}revisionFor(t){let n=this.resolveStory(t);return n.ok?n.store.revision:null}transact(t,n,r={}){return chunkXETEMUIP_cjs.xa(this,()=>this.commitStoryTransaction(t,n,r),chunkXETEMUIP_cjs.ya)}commitStoryTransaction(t,n,r={}){let a=this.resolveStory(t);if(!a.ok)return {ok:false,reason:a.reason,...a.detail?{detail:a.detail}:{}};let{store:i,story:o}=a,s=this.currentPackage(),l=i.historyDepth,d=i.compositionActive,c=i.checkpoint(),u=false,m=new Set,x=false,h=new Set,P=false,f,k=false;i.graftPackage(()=>this.currentPackage());let p=i.transact(T=>{n({...T,applyTo:(R,S)=>{let D=T.applyTo(R,S);return D&&R!==o.partName&&(k=true),D},applyPackage:R=>T.applyPackage(S=>{let D=R(S);return D!==S&&!k&&(k=_o(S,D,o.partName)),D}),apply:R=>(R.op==="setListNumbering"&&R.numId!==null&&(P=true),R.op==="setParagraphProperties"&&(f??=R.properties.find(S=>S.localName==="pStyle")?.attributes?.val),u||(R.op==="deleteText"&&ea(this.pkg,i.part,R,m)||R.op==="deleteBlock"&&ta(this.pkg,i.part,R,m)||Ia.has(R.op))&&(u=true),x||(R.op==="deleteText"||R.op==="deleteBlock"?x=ra(this.pkg,i.part,R,h):(Ia.has(R.op)||ws.has(R.op))&&(x=true)),T.apply(R)),selectionBefore:R=>T.selectionBefore(R),selectionAfter:R=>T.selectionAfter(R)});},{...r,story:o,...o.kind==="headerFooter"||o.kind==="notesPart"?{minimumImpact:"global"}:{}});if(!p.ok)return {ok:false,reason:p.reason,...p.detail?{detail:p.detail}:{}};this.syncPackageFromStore(i);let y=false;if(p.change&&k&&(this.installPackageSnapshotInternal(i.package),d?this.compositionSession&&(this.compositionSession.packageWideEffects=true):i.restoreHistoryStacks(c),y=true),P&&f){let T=Lo(this.pkg,f);T&&this.replacePackageShell(T);}let w=false;if(p.change&&u){let T=this.currentPackage(),R=this.cascadeNoteReferences(s,T);if(R===null)return i.restoreCheckpoint(c),this.installPackageSnapshotInternal(s),{ok:false,reason:"invalidArgs",detail:"note-cascade-failed"};R!==T&&(this.installPackageSnapshotInternal(R),d?this.compositionSession&&(this.compositionSession.packageWideEffects=true):i.restoreHistoryStacks(c),w=true);}if(p.change&&x){let T=this.currentPackage(),R=chunkXETEMUIP_cjs.Vf(s,T,{storyPartName:o.partName});if(R===null)return i.restoreCheckpoint(c),this.installPackageSnapshotInternal(s),{ok:false,reason:"invalidArgs",detail:"comment-cascade-failed"};R!==T&&(this.installPackageSnapshotInternal(R),d?this.compositionSession&&(this.compositionSession.packageWideEffects=true):i.restoreHistoryStacks(c),w=true);}if(p.change){this.packageRev+=1;let T=w||y;!d&&r.recordsHistory!==false&&(i.historyDepth>l||T)&&(T?this.pushUndoPointer({kind:"package",before:s,after:this.currentPackage()}):this.pushUndoPointer({kind:"story",partName:o.partName,story:o}));let R=T?this.publishSynthetic(p.change.origin,"global",o,p.change.created):p.change;return T||this.publish(R),{ok:true,change:R}}return {ok:true,change:p.change}}compositionSessionOpen(){return this.compositionSession!==null}beginComposition(t,n=null){let r=this.resolveStory(t);return !r.ok||this.compositionSession&&this.compositionSession.partName!==r.story.partName&&(this.endComposition(),r=this.resolveStory(t),!r.ok)?false:(this.compositionSession||(this.compositionSession={partName:r.story.partName,beforePackage:this.currentPackage(),storyCheckpoint:r.store.checkpoint(),packageWideEffects:false}),r.store.beginComposition(n),true)}endComposition(){let t=this.compositionSession;if(this.compositionSession=null,!t){this.body.endComposition();return}let n=t.partName===this.body.part.name?this.body:this.stories.get(t.partName);if(!n)return;let r=n.historyDepth;if(n.endComposition(),t.packageWideEffects){n.restoreHistoryStacks(t.storyCheckpoint),this.syncPackageFromStore(n),this.pushUndoPointer({kind:"package",before:t.beforePackage,after:this.currentPackage()});return}if(n.historyDepth>r){let a=t.partName===this.body.part.name?{kind:"body",partName:t.partName}:this.storyRefForPart(t.partName);a&&this.pushUndoPointer({kind:"story",partName:t.partName,story:a});}this.syncPackageFromStore(n);}cancelComposition(){let t=this.compositionSession;if(this.compositionSession=null,!t){this.body.cancelComposition();return}let n=t.partName===this.body.part.name?this.body:this.stories.get(t.partName);if(t.packageWideEffects){n&&n.restoreCheckpoint(t.storyCheckpoint),this.installPackageSnapshotInternal(t.beforePackage),this.packageRev+=1;let r=t.partName===this.body.part.name?{kind:"body",partName:t.partName}:this.storyRefForPart(t.partName);this.publishSynthetic(chunkXETEMUIP_cjs.b.mutationHuman,"global",r??{kind:"body",partName:this.body.part.name},[]);return}n?.cancelComposition();}applyLifecycleOp(t){return chunkXETEMUIP_cjs.xa(this,()=>this.commitLifecycleOp(t),chunkXETEMUIP_cjs.ya)}commitLifecycleOp(t){let n=this.currentPackage();if(chunkXETEMUIP_cjs.af(t)){let o=chunkXETEMUIP_cjs.bf(n,t);if(!o.ok)return {ok:false,reason:o.reason,...o.detail?{detail:o.detail}:{}};if(o.package===n)return {ok:true,change:null};this.installPackageSnapshotInternal(o.package),this.pushUndoPointer({kind:"package",before:n,after:o.package}),this.packageRev+=1;let s={kind:"body",partName:this.body.part.name},l=this.publishSynthetic(chunkXETEMUIP_cjs.b.mutationHuman,o.impact,s,o.createdPartName?[o.createdPartName]:[]);return this.evictUnreachableStories(),{ok:true,change:l}}if(!chunkXETEMUIP_cjs.Hd(t))return {ok:false,reason:"invalidArgs",detail:"not-lifecycle-op"};let r=chunkXETEMUIP_cjs.Id(n,t);if(!r.ok)return {ok:false,reason:r.reason,...r.detail?{detail:r.detail}:{}};this.installPackageSnapshotInternal(r.package),this.pushUndoPointer({kind:"package",before:n,after:r.package}),this.packageRev+=1;let a={kind:"body",partName:this.body.part.name},i=this.publishSynthetic(chunkXETEMUIP_cjs.b.mutationHuman,r.impact,a,r.createdPartName?[r.createdPartName]:[]);return this.evictUnreachableStories(),{ok:true,change:i}}undo(){let t=this.undoOrder.pop();if(!t)return null;if(t.kind==="package"){this.installPackageSnapshotInternal(t.before),this.redoOrder.push(t),this.packageRev+=1;let a=this.publishSynthetic(chunkXETEMUIP_cjs.b.mutationUndo,"global",{kind:"body",partName:this.body.part.name},[]);return this.evictUnreachableStories(),a}let n=t.partName===this.body.part.name?this.body:this.stories.get(t.partName);if(!n)return null;let r=n.undo();return r?(this.redoOrder.push(t),this.syncPackageFromStore(n),this.packageRev+=1,this.publish(r),this.evictUnreachableStories(),r):null}redo(){let t=this.redoOrder.pop();if(!t)return null;if(t.kind==="package"){this.installPackageSnapshotInternal(t.after),this.undoOrder.push(t),this.packageRev+=1;let a=this.publishSynthetic(chunkXETEMUIP_cjs.b.mutationRedo,"global",{kind:"body",partName:this.body.part.name},[]);return this.evictUnreachableStories(),a}let n=t.partName===this.body.part.name?this.body:this.stories.get(t.partName);if(!n)return null;let r=n.redo();return r?(this.undoOrder.push(t),this.syncPackageFromStore(n),this.packageRev+=1,this.publish(r),this.evictUnreachableStories(),r):null}selectionForUndo(){let t=this.undoOrder[this.undoOrder.length-1];return !t||t.kind==="package"?null:(t.partName===this.body.part.name?this.body:this.stories.get(t.partName))?.selectionForUndo()??null}selectionForRedo(){let t=this.redoOrder[this.redoOrder.length-1];return !t||t.kind==="package"?null:(t.partName===this.body.part.name?this.body:this.stories.get(t.partName))?.selectionForRedo()??null}openStoryParts(){return hn(this.stories,this.pkg)}openedStoryCount(){return 1+this.stories.size}openStoryToken(){return Ao(this.stories,this.pkg)}insertImage(t,n){return da(this,t,n)}applyFragmentPaste(t,n){return Do(this,t,n)}replaceImage(t,n,r,a,i,o){return On(this,t,n,r,a,i,o)}deleteImage(t,n){return ca(this,t,n)}deleteImageTracked(t,n,r){return ma(this,t,n,r)}embedExternalImage(t,n,r,a,i,o,s){return ua(this,t,n,r,a,i,o,s)}setDrawingMetadataWithHyperlink(t,n,r,a,i){return pa(this,t,n,r,a,i)}applyImageProperties(t,n){return fa(this,t,n)}promoteStoryTransactionToPackageUnit(t,n,r,a){this.installPackageSnapshotInternal(n.package),n.historyDepth>a&&n.restoreHistoryStacks(r),this.pushUndoPointer({kind:"package",before:t,after:this.currentPackage()}),this.packageRev+=1;let i=n.part.name===this.body.part.name?{kind:"body",partName:n.part.name}:this.storyRefForPart(n.part.name);return this.publishSynthetic(chunkXETEMUIP_cjs.b.mutationHuman,i?.kind==="headerFooter"?"global":"flow-structural",i??{kind:"body",partName:this.body.part.name},[])}publishStoryWrite(t){return t?(this.packageRev+=1,this.publish(t),t):null}adoptPackageUnit(t){let n=this.currentPackage();t!==n&&this.pushUndoPointer({kind:"package",before:t,after:n});}installPackageSnapshot(t){this.installPackageSnapshotInternal(t);}installAuthoritativePackageSnapshot(t){this.installPackageSnapshotInternal(t,false);}publishRemotePackage(t,n){return ya(this,t,n)}replacePackageShell(t){this.shellHyperlinks=Wo(this.shellHyperlinks,this.pkg,t);let n=t;n=chunkXETEMUIP_cjs.Xb(n,this.body.part);for(let r of this.stories.values())t.parts.has(r.part.name)&&(n=chunkXETEMUIP_cjs.Xb(n,r.part));this.pkg=n;}installPackageSnapshotInternal(t,n=true){let r=n?zo(t,this.pkg,this.shellHyperlinks):t,a=r.parts.get(r.mainDocumentPart);if(!a)return;this.body.replacePart(a);for(let[o,s]of this.stories){let l=r.parts.get(o);l&&s.replacePart(l);}this.rIdToPartName.clear();let i=r.relationships.get(r.mainDocumentPart)??[];for(let o of i){if(o.type!==xn&&o.type!==kn)continue;let s=chunkXETEMUIP_cjs.E(o);s.mode!=="Internal"||!s.target.ok||this.stories.has(s.target.partName)&&r.parts.has(s.target.partName)&&this.rIdToPartName.set(o.id,s.target.partName);}this.pkg=r,this.pkg=chunkXETEMUIP_cjs.Xb(this.pkg,this.body.part);for(let o of this.stories.values())this.pkg.parts.has(o.part.name)&&(this.pkg=chunkXETEMUIP_cjs.Xb(this.pkg,o.part));}openNotesPartStore(t){let n=chunkXETEMUIP_cjs.Pe(this.currentPackage(),t);if(!n)return {ok:false,reason:"missing-part",detail:t};let r=this.stories.get(n.name);if(r)return {ok:true,story:{kind:"notesPart",partName:n.name,noteKind:t},store:r};if(this.openedStoryCount()>=this.maxEditableStoryParts&&this.evictUnreachableStories(),this.openedStoryCount()>=this.maxEditableStoryParts)return {ok:false,reason:"too-many-story-stores",detail:String(this.maxEditableStoryParts)};let a=chunkXETEMUIP_cjs.Bb(n),i=new Ve(a,{historyLimit:this.historyLimit,settingsPart:()=>chunkXETEMUIP_cjs.pe(this.pkg)}),o={kind:"notesPart",partName:a.name,noteKind:t};return i.setStoryRef(o),this.stories.set(a.name,i),a!==n&&(this.pkg=chunkXETEMUIP_cjs.Xb(this.pkg,a)),{ok:true,story:o,store:i}}openHeaderFooterStore(t){let n=this.rIdToPartName.get(t);if(n){let l=this.stories.get(n);if(l)return {ok:true,story:{kind:"headerFooter",partName:n,rId:t},store:l}}let r=oa(this.currentPackage(),t);if(!r.ok)return r;let a=this.stories.get(r.partName);if(a)return this.rIdToPartName.set(t,r.partName),{ok:true,story:{kind:"headerFooter",partName:r.partName,rId:t},store:a};if(this.openedStoryCount()>=this.maxEditableStoryParts&&this.evictUnreachableStories(),this.openedStoryCount()>=this.maxEditableStoryParts)return {ok:false,reason:"too-many-story-stores",detail:String(this.maxEditableStoryParts)};let i=chunkXETEMUIP_cjs.Bb(r.part),o=new Ve(i,{historyLimit:this.historyLimit,settingsPart:()=>chunkXETEMUIP_cjs.pe(this.pkg)}),s={kind:"headerFooter",partName:i.name,rId:t};return o.setStoryRef(s),this.stories.set(i.name,o),this.rIdToPartName.set(t,i.name),i!==r.part&&(this.pkg=chunkXETEMUIP_cjs.Xb(this.pkg,i)),{ok:true,story:s,store:o}}storyRefForPart(t){if(t===this.body.part.name)return {kind:"body",partName:t};for(let[r,a]of this.rIdToPartName)if(a===t)return {kind:"headerFooter",partName:t,rId:r};let n=this.currentPackage().parts.get(t);return n?.root.localName==="footnotes"?{kind:"notesPart",partName:t,noteKind:"footnote"}:n?.root.localName==="endnotes"?{kind:"notesPart",partName:t,noteKind:"endnote"}:null}syncPackageFromStore(t){this.pkg=chunkXETEMUIP_cjs.Xb(this.pkg,t.part);}pushUndoPointer(t){this.undoOrder.push(t),this.redoOrder.length=0,this.undoOrder.length>this.historyLimit&&this.undoOrder.shift(),this.evictUnreachableStories();}evictUnreachableStories(){let t=Pa(this.pkg,this.stories.keys(),this.undoOrder,this.redoOrder);for(let[a]of [...this.stories])if(!t.has(a)){this.stories.delete(a);for(let[i,o]of [...this.rIdToPartName])o===a&&this.rIdToPartName.delete(i);}let n=Oa(t,this.pkg.mainDocumentPart,this.body.part.name,this.undoOrder,this.redoOrder),r=Go(this.pkg,n);r!==this.pkg&&(this.pkg=r),this.shellHyperlinks=Ko(this.shellHyperlinks,n,this.pkg.mainDocumentPart);}publish(t){this.lastChange=t;for(let n of this.subscribers)n(t);}publishSynthetic(t,n,r,a){this.commitCounter+=1;let i=this.packageRev-1,o={change:"model-change",fromRevision:i<0?0:i,toRevision:this.packageRev,commitId:`pkg-commit-${this.commitCounter}`,origin:t,dirty:[],created:[...a],deleted:[],splitJoin:[],dependencyKeys:[],impact:n,story:r};return this.publish(o),o}};function Cs(e,t,n){for(let r of e.attributes)if(r.localName===n&&r.namespaceUri===t)return r.value}function ba(e,t){if(!e){let o=chunkXETEMUIP_cjs.Eb(t);return o?chunkXETEMUIP_cjs.Fb(new Set,o,chunkXETEMUIP_cjs.Cb):"0"}let n=-1,r=new Set,a=o=>{if(o.kind!=="textValue"){if(o.kind==="comment"){let s=Cs(o,chunkXETEMUIP_cjs.ca,"id");if(s!==void 0&&/^\d{1,10}$/.test(s)){let l=Number(s);Number.isSafeInteger(l)&&l<=chunkXETEMUIP_cjs.Cb&&(r.add(String(l)),l>n&&(n=l));}}for(let s of o.children)a(s);}};a(e.root);let i=chunkXETEMUIP_cjs.Eb(t);return i?chunkXETEMUIP_cjs.Fb(r,i,chunkXETEMUIP_cjs.Cb):String(n+1)}var Ms=256,Ds=65535,Na=64;function Ut(e,t){return e.length>t}function va(e){return typeof e!="string"||e.trim().length===0?"invalid-author":Ut(e,Ms)?"resource-limit":chunkXETEMUIP_cjs.O(e)?null:"invalid-author"}function Sa(e){return typeof e!="string"||e.length===0?"invalid-text":Ut(e,Ds)?"resource-limit":chunkXETEMUIP_cjs.O(e)?null:"invalid-text"}function Rn(e){if(typeof e!="string")return {ok:false,rejection:"invalid-date"};let t=e.trim();if(Ut(t,Na))return {ok:false,rejection:"resource-limit"};if(!chunkXETEMUIP_cjs.O(t))return {ok:false,rejection:"invalid-date"};let n=chunkXETEMUIP_cjs.Be(t);return n===null?{ok:false,rejection:"invalid-date"}:Ut(n,Na)?{ok:false,rejection:"resource-limit"}:{ok:true,value:n}}function Sm(e){if(e===void 0)return null;let t=Rn(e);return t.ok?null:t.rejection}function bn(e){switch(e){case "invalid-author":return "invalid-author";case "invalid-text":return "invalid-text";case "invalid-date":return "invalid-property-value";case "resource-limit":return "resource-limit"}}function Ta(e,t){if(e.kind==="textValue")return e;let n=t.get(e.id);if(n!==void 0)return n;let r=false,a=[];for(let i of e.children){let o=Ta(i,t);o!==i&&(r=true),a.push(o);}return r?{...e,children:a}:e}function Us(e,t,n){let r=Ta(e.root,t);if(r.kind==="textValue")return {ok:false,issues:[{code:"known-node-invariant",path:e.root.id,nodeId:e.root.id}]};let a=n===null?r:{...r,namespaceBindings:[...r.namespaceBindings,{prefix:n,namespaceUri:chunkXETEMUIP_cjs.fa}]};return chunkXETEMUIP_cjs.Ha(e,e.root.id,a,{deferValidation:true})}function wa(e,t,n){let r=new Map;for(let i of t){if(i.stampParagraph===null)continue;let o=r.get(i.commentsPartName);o||(o=new Map,r.set(i.commentsPartName,o)),o.set(i.stampParagraph.id,{paragraph:i.stampParagraph,paraId:i.paraId});}let a=e;for(let[i,o]of r){let s=a.parts.get(i);if(!s)return null;let l=chunkXETEMUIP_cjs.zb(s.root),d=l??"w14",c=new Map;for(let m of o.values())c.set(m.paragraph.id,n(m.paragraph,m.paraId,d));let u=Us(s,c,l===null?d:null);if(!u.ok)return null;a=chunkXETEMUIP_cjs.Xb(a,u.part);}return a}function Ea(e,t,n){let r=e.root.children.map(a=>a.kind==="textValue"?a:t.get(a.id)??a);return chunkXETEMUIP_cjs.Fa(e,e.root.id,[...r,...n],{deferValidation:true})}var Da="/word/comments.xml",Aa="/word/commentsExtended.xml",wn="application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml",En="application/vnd.openxmlformats-officedocument.wordprocessingml.commentsExtended+xml",Fs=[En,"application/vnd.ms-word.commentsExtended+xml"],_a="http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments",Cn="http://schemas.microsoft.com/office/2011/relationships/commentsExtended",Ie="http://schemas.microsoft.com/office/word/2012/wordml";function dt(e,t,n){for(let r of e.attributes)if(r.localName===n&&r.namespaceUri===t)return r.value}function Ge(e,t){return {kind:"genericExtension",namespaceUri:chunkXETEMUIP_cjs.ca,localName:e,prefix:"w",value:t}}function ke(e,t,n,r,a,i,o,s=[]){return {id:e,kind:t,namespaceUri:n,localName:a,prefix:r,namespaceBindings:s,attributes:i,children:o}}function Ua(e,t,n,r,a){let i=t===e.mainDocumentPart?[t]:[t,e.mainDocumentPart];for(let o of i)for(let s of chunkXETEMUIP_cjs.Zb(e,o)){if(s.type!==n)continue;let l=chunkXETEMUIP_cjs.w(o,s.rawTarget);if(!l.ok)continue;if(!e.parts.has(l.partName))return l.partName;let d=chunkXETEMUIP_cjs._b(e,l.partName);if(d!==null&&(typeof r=="string"?d===r:r.includes(d)))return l.partName}return a}function Nn(e,t,n){let r=e.mainDocumentPart;for(let i of chunkXETEMUIP_cjs.Zb(e,r)){if(i.type!==t)continue;let o=chunkXETEMUIP_cjs.w(r,i.rawTarget);if(o.ok&&o.partName===n)return e}let a=chunkXETEMUIP_cjs.cc(e,r);return chunkXETEMUIP_cjs.dc(a,r,t,chunkXETEMUIP_cjs.fg(r,n)).pkg}function Mn(e,t){return Ua(e,t,_a,wn,Da)}function Fa(e,t){let n=chunkXETEMUIP_cjs.ff(e,t),r=chunkXETEMUIP_cjs.gf(e,t,n).extended;return r!==null?r:Ua(e,t,Cn,Fs,Aa)}function Ca(e){let t=new Set;for(let n of e.parts.values())for(let r of chunkXETEMUIP_cjs.yb(n.root))t.add(r);return t}function Ls(e,t){if(!e)return null;let n=null,r=a=>{if(!(n!==null||a.kind==="textValue")){if(a.kind==="comment"&&dt(a,chunkXETEMUIP_cjs.ca,"id")===t){for(let i=a.children.length-1;i>=0;i-=1){let o=a.children[i];if(o.kind!=="paragraph")continue;let s=dt(o,chunkXETEMUIP_cjs.fa,"paraId");s!==void 0&&chunkXETEMUIP_cjs.ub(s)&&(n=s.toUpperCase());return}return}for(let i of a.children)r(i);}};return r(e.root),n}function $s(e,t){if(!e)return null;let n=null,r=a=>{if(!(n!==null||a.kind==="textValue")){if(a.kind==="comment"&&dt(a,chunkXETEMUIP_cjs.ca,"id")===t){for(let i=a.children.length-1;i>=0;i-=1){let o=a.children[i];if(o.kind==="paragraph"){n=o;return}}return}for(let i of a.children)r(i);}};return r(e.root),n}function La(e){let t=chunkXETEMUIP_cjs.zb(e.root);if(t!==null)return {part:e,prefix:t};let n={...e.root,namespaceBindings:[...e.root.namespaceBindings,{prefix:"w14",namespaceUri:chunkXETEMUIP_cjs.fa}]},r=chunkXETEMUIP_cjs.Ha(e,e.root.id,n,{deferValidation:true});return r.ok?{part:r.part,prefix:"w14"}:(chunkXETEMUIP_cjs.Ea(e.root,n),{part:{...e,root:n},prefix:"w14"})}function $a(e,t,n){return ke(e.id,"paragraph",e.namespaceUri,e.prefix??"w",e.localName,[...e.attributes.filter(r=>!(r.namespaceUri===chunkXETEMUIP_cjs.fa&&r.localName==="paraId")),{kind:"genericExtension",namespaceUri:chunkXETEMUIP_cjs.fa,localName:"paraId",prefix:n,value:t}],e.children,e.namespaceBindings)}function Bs(e,t,n,r){let a=e.parts.get(t);if(!a)return e;let i=La(a),o=chunkXETEMUIP_cjs.Ca(i.part,n);if(!o||o.kind!=="paragraph")return chunkXETEMUIP_cjs.Xb(e,i.part);let s=chunkXETEMUIP_cjs.Ha(i.part,o.id,$a(o,r,i.prefix),{deferValidation:true});return chunkXETEMUIP_cjs.Xb(e,s.ok?s.part:i.part)}function Hs(e,t,n,r){let a=`${Da}#comment-${e}`,i=n.text!==n.text.trim(),o=ke(`${a}.t`,"text",chunkXETEMUIP_cjs.ca,"w","t",i?[{kind:"xmlSpace",namespaceUri:chunkXETEMUIP_cjs.da,localName:"space",prefix:"xml",value:"preserve"}]:[],[{id:`${a}.tv`,kind:"textValue",value:n.text}]),s=ke(`${a}.rPr`,"runProperties",chunkXETEMUIP_cjs.ca,"w","rPr",[],[ke(`${a}.rStyle`,"generic",chunkXETEMUIP_cjs.ca,"w","rStyle",[Ge("val","CommentReference")],[])]),l=ke(`${a}.r`,"run",chunkXETEMUIP_cjs.ca,"w","r",[],[s,o]),d=ke(`${a}.pPr`,"paragraphProperties",chunkXETEMUIP_cjs.ca,"w","pPr",[],[ke(`${a}.pStyle`,"generic",chunkXETEMUIP_cjs.ca,"w","pStyle",[Ge("val","CommentText")],[])]),c=ke(`${a}.p`,"paragraph",chunkXETEMUIP_cjs.ca,"w","p",[{kind:"genericExtension",namespaceUri:chunkXETEMUIP_cjs.fa,localName:"paraId",prefix:r,value:t}],[d,l]);return ke(a,"comment",chunkXETEMUIP_cjs.ca,"w","comment",[Ge("id",e),Ge("author",n.author),...n.initials===void 0?[]:[Ge("initials",n.initials)],...n.date===void 0?[]:[Ge("date",n.date)]],[c])}function vn(e,t){let n=chunkXETEMUIP_cjs.ta(t,{name:e,contentType:"application/xml"});return n.ok?n.part.root:null}function Ba(e,t){for(let k of [va(t.author),Sa(t.text)])if(k)return {ok:false,reason:bn(k)};let n;if(t.date!==void 0){let k=Rn(t.date);if(!k.ok)return {ok:false,reason:bn(k.rejection)};n=k.value;}let r={...t,...n===void 0?{}:{date:n}},a=e.package,i=e.part.name,o=Mn(a,i),s=Fa(a,i),l=a.parts.get(o),d=ba(l,r.actorId),c=chunkXETEMUIP_cjs.xb(`${o}#${d}`,Ca(a)),u=t.replyToCommentId===void 0?null:Ls(l,t.replyToCommentId),m=t.replyToCommentId!==void 0&&u===null?$s(l,t.replyToCommentId):null;if(t.replyToCommentId!==void 0&&u===null&&!m)return {ok:false,reason:"unknown-revision"};let x=m?chunkXETEMUIP_cjs.xb(`${o}#parent-${t.replyToCommentId}`,new Set([...Ca(a),c])):null,h=u??x,P=t.anchor.endParagraphId??t.anchor.paragraphId,f=e.transact(k=>{k.applyPackage(p=>{let y=p.parts.has(o)?p:(()=>{let w=vn(o,`<w:comments xmlns:w="${chunkXETEMUIP_cjs.ca}"/>`);return w?chunkXETEMUIP_cjs.ec(p,o,w,wn):null})();return y===null?p:Nn(y,_a,o)}),m&&x&&k.applyPackage(p=>Bs(p,o,m.id,x)),k.applyPackage(p=>{let y=p.parts.get(o);if(!y)return p;let w=La(y),T=chunkXETEMUIP_cjs.Ga(w.part,w.part.root.id,w.part.root.children.length,[Hs(d,c,r,w.prefix)],{deferValidation:true});return T.ok?chunkXETEMUIP_cjs.Xb(p,T.part):p}),h!==null&&(k.applyPackage(p=>{let y=p.parts.has(s)?p:(()=>{let w=vn(s,`<w15:commentsEx xmlns:w15="${Ie}"/>`);return w?chunkXETEMUIP_cjs.ec(p,s,w,En):null})();return y===null?p:Nn(y,Cn,s)}),k.applyPackage(p=>{let y=p.parts.get(s);if(!y)return p;let T=[...js(y).has(h.toUpperCase())?[]:[Tn(`${s}#ex-${h}`,h,void 0,false)],Tn(`${s}#ex-${c}`,c,h,false)],R=chunkXETEMUIP_cjs.Ga(y,y.root.id,y.root.children.length,T,{deferValidation:true});return R.ok?chunkXETEMUIP_cjs.Xb(p,R.part):p})),k.applyTo(i,{op:"insertCommentMarker",paragraphId:P,offset:t.anchor.end,commentId:d,marker:"reference"}),k.applyTo(i,{op:"insertCommentMarker",paragraphId:P,offset:t.anchor.end,commentId:d,marker:"end"}),k.applyTo(i,{op:"insertCommentMarker",paragraphId:t.anchor.paragraphId,offset:t.anchor.start,commentId:d,marker:"start"});},r.actorId===void 0?{}:{actorId:r.actorId});return f.ok?{ok:true,commentId:d,change:f.change}:{ok:false,reason:f.reason}}function Sn(e){for(let t=e.children.length-1;t>=0;t-=1){let n=e.children[t];if(n.kind==="paragraph")return n}return null}function Ma(e){let t=Sn(e);if(!t)return null;let n=dt(t,chunkXETEMUIP_cjs.fa,"paraId");return n!==void 0&&chunkXETEMUIP_cjs.ub(n)?n.toUpperCase():null}function js(e){let t=new Map;if(!e)return t;let n=r=>{if(r.kind!=="textValue"){if(r.namespaceUri===Ie&&r.localName==="commentEx"){let a=dt(r,Ie,"paraId");a!==void 0&&chunkXETEMUIP_cjs.ub(a)&&t.set(a.toUpperCase(),r);}for(let a of r.children)n(a);}};return n(e.root),t}function lt(e,t){return {kind:"genericExtension",namespaceUri:Ie,localName:e,prefix:"w15",value:t}}function Vs(e,t){return {id:e.id,kind:"generic",namespaceUri:e.namespaceUri,localName:e.localName,...e.prefix===void 0?{}:{prefix:e.prefix},namespaceBindings:e.namespaceBindings,attributes:t,children:e.children}}function Ws(e,t,n){let r=[],a=false,i=false;for(let o of e.attributes){if(o.namespaceUri===Ie&&o.localName==="done"){a=true,r.push({kind:"genericExtension",namespaceUri:o.namespaceUri,localName:o.localName,...o.prefix===void 0?{}:{prefix:o.prefix},value:n?"1":"0"});continue}o.namespaceUri===Ie&&o.localName==="paraIdParent"&&(i=true),r.push(o);}return !i&&t!==void 0&&r.push(lt("paraIdParent",t)),a||r.push(lt("done",n?"1":"0")),Vs(e,r)}function Tn(e,t,n,r){return {id:e,kind:"generic",namespaceUri:Ie,localName:"commentEx",prefix:"w15",namespaceBindings:[],attributes:[lt("paraId",t),...n===void 0?[]:[lt("paraIdParent",n)],lt("done",r?"1":"0")],children:[]}}function Ha(e,t,n){return Ks(e,t,n,chunkXETEMUIP_cjs.ef())}function Ks(e,t,n,r){let a=e.package,i=e.part.name;if(chunkXETEMUIP_cjs.ff(a,i)===null)return {ok:false,reason:"unknown-comment"};let s=chunkXETEMUIP_cjs.if(a,t,{storyPartName:i},r);if(!s.ok)return {ok:false,reason:"unknown-comment"};let l=chunkXETEMUIP_cjs.hf(a,r);if(l.truncated||r.truncated)return {ok:false,reason:"unknown-comment"};let d=l.used,c=new Map,u=[];for(let P of s.ids){let f=s.records.get(P);if(!f)return {ok:false,reason:"unknown-comment"};if(!Sn(f.node))return {ok:false,reason:"unknown-comment"};let p=Ma(f.node),y=p??chunkXETEMUIP_cjs.xb(`${f.partName}#done-${P}`,d);p===null&&d.add(y),c.set(P,y);}for(let P of s.ids){let f=s.records.get(P),k=Sn(f.node),p=c.get(P),y=Ma(f.node),w=s.parentCommentIdByChildId.get(P),T=s.parentParaIdByCommentId.get(P)??(w===void 0?void 0:c.get(w)),R=s.commentExByParaId.get(p);u.push({paraId:p,stampParagraph:y===null?k:null,commentsPartName:f.partName,parentParaId:T,existing:R?.node,existingParentParaId:R?.parentParaId,existingDone:R?.done??false});}if(u.length===0)return {ok:false,reason:"unknown-comment"};if(u.every(P=>P.existingDone===n))return {ok:true,changed:false,change:null};let m=s.extendedPartName??Aa,x=s.extendedPartName===null,h=e.transact(P=>{P.applyPackage(f=>{let k=wa(f,u,$a);if(k===null)return f;let p=k;if(!p.parts.has(m)){let S=vn(m,`<w15:commentsEx xmlns:w15="${Ie}"/>`);if(!S)return f;let D=chunkXETEMUIP_cjs.ec(p,m,S,En);p=x?Nn(D,Cn,m):D;}let y=p.parts.get(m);if(!y)return f;let w=new Map,T=[];for(let S of u){let D=S.existingParentParaId??S.parentParaId;S.existing?w.set(S.existing.id,Ws(S.existing,D,n)):T.push(Tn(`${m}#done-${S.paraId}`,S.paraId,D,n));}let R=Ea(y,w,T);return R.ok?chunkXETEMUIP_cjs.Xb(p,R.part):f});});return h.ok?{ok:true,changed:true,change:h.change}:{ok:false,reason:h.reason}}function Ym(e,t){let n=Mn(e,t);return e.parts.has(n)&&chunkXETEMUIP_cjs._b(e,n)===wn}function qm(e,t){return Mn(e,t)}function Jm(e,t){return Fa(e,t)}var ja={kind:"body"};function ru(e,t,n=ja){let r=n.kind==="body"?null:e.resolveStory(n),a=r?.ok?r.store:e.bodyStore(),i=e.currentPackage(),o=a.checkpoint();return a.graftPackage(()=>e.currentPackage()),chunkXETEMUIP_cjs.xa(e,()=>{let s=Ba(a,t);return s.ok&&(a.restoreHistoryStacks(o),e.replacePackageShell(a.package),e.adoptPackageUnit(i),e.publishStoryWrite(s.change)),s},s=>chunkXETEMUIP_cjs.ya(s))}function ou(e,t,n){let r=e.bodyStore(),a=e.currentPackage(),i=r.checkpoint();return r.graftPackage(()=>e.currentPackage()),chunkXETEMUIP_cjs.xa(e,()=>{let o=Ha(r,t,n);return !o.ok||!o.changed||(r.restoreHistoryStacks(i),e.replacePackageShell(r.package),e.adoptPackageUnit(a),e.publishStoryWrite(o.change)),o},o=>o.ok&&o.changed)}function au(e,t,n=ja,r){if(t.length===0)return false;let a=n.kind==="body"?e.bodyStore().part:e.partFor(n);if(!a)return false;let i={storyPartName:a.name,...r===void 0?{}:{noteId:r}},o=e.bodyStore(),s=e.currentPackage(),l=o.checkpoint();return o.graftPackage(()=>e.currentPackage()),chunkXETEMUIP_cjs.xa(e,()=>{let d=false,c=false,u=o.transact(m=>{m.applyPackage(x=>{let h=x;for(let P of t){let f=P.parentCommentId===void 0?chunkXETEMUIP_cjs.Tf(h,P.commentId,i):chunkXETEMUIP_cjs.Uf(h,P.commentId,P.parentCommentId,i);if(f===null)return d=true,x;c||=f!==h,h=f;}return h});});return d||!u.ok||!c?false:(o.restoreHistoryStacks(l),e.installPackageSnapshot(o.package),e.adoptPackageUnit(s),e.publishStoryWrite(u.change),true)},d=>d)}var zs=256*1024,Gs=4096;function Wa(e,t,n){let r=t.payload,a=e.part.name,i=n??a;if(r){if(r.data.length>zs)return {ok:false,reason:"payload-too-large",detail:"data"};if(r.label.length>Gs)return {ok:false,reason:"payload-too-large",detail:"label"}}let o=new Set(chunkXETEMUIP_cjs.xf(e.part.root).map(m=>m.node.id)),s=t.replaceControlId===void 0?[]:Ka(e,a,t.replaceControlId),l=null,d,c=e.transact(m=>{if(t.replaceControlId!==void 0){m.apply({op:"removeContentControl",controlId:t.replaceControlId,keepContent:false});for(let P of s)m.applyPackage(f=>chunkXETEMUIP_cjs.ng(f,P.partName,P.nodeId));}let x=t.replaceUntil;if(x!==void 0&&x<=t.offset){l="invalid-range",d="replaceUntil must be past offset";return}if(x!==void 0&&m.apply({op:"deleteText",paragraphId:t.paragraphId,start:t.offset,end:x}),!r){m.apply({op:"insertInlineContentControl",paragraphId:t.paragraphId,offset:t.offset,tag:t.tag,text:t.text,...t.alias===void 0?{}:{alias:t.alias},...t.lock===void 0?{}:{lock:t.lock}});return}let h=null;m.applyPackage(P=>{let f=chunkXETEMUIP_cjs.ig(P,i,r.namespaceUri,r.rootLocalName);if(!f.part)return l="store-not-authored",d=`no customXml store could be created for ${r.namespaceUri}. The namespace must be free of control characters and quotes, the root name must be an XML name, and a store this document already carries for that namespace must use the same root name (${r.rootLocalName})`,P;if(h=chunkXETEMUIP_cjs.sg(f.part,r.rootLocalName,r.nodeId),!h)return l="unaddressable-payload",d=`the node id ${JSON.stringify(r.nodeId)} or the namespace ${JSON.stringify(r.namespaceUri)} cannot be written into an XPath. Ids and root names must match [A-Za-z_][\\w.-]{0,127}; a namespace may not contain a quote, an angle bracket or an ampersand`,P;let k=chunkXETEMUIP_cjs.mg(f.pkg,f.part.partName,{id:r.nodeId,label:r.label,data:r.data});return chunkXETEMUIP_cjs.lg(k,f.part.partName,r.nodeId)?k:(l="store-not-authored",d="the payload node could not be written into the store",P)}),!(l!==null||!h)&&m.apply({op:"insertInlineContentControl",paragraphId:t.paragraphId,offset:t.offset,tag:t.tag,text:t.text,...t.alias===void 0?{}:{alias:t.alias},...t.lock===void 0?{}:{lock:t.lock},dataBinding:h});});if(l!==null)return {ok:false,reason:l,...d===void 0?{}:{detail:d}};if(!c.ok)return {ok:false,reason:c.reason,...c.detail===void 0?{}:{detail:c.detail}};let u=Xs(e,o);return {ok:true,change:c.change,...u===void 0?{}:{nodeId:u}}}function Xs(e,t){for(let n of chunkXETEMUIP_cjs.xf(e.part.root))if(!t.has(n.node.id))return n.node.id}function Ka(e,t,n){let r=chunkXETEMUIP_cjs.xf(e.part.root).find(i=>i.node.id===n);if(!r)return [];let a=[];for(let i of chunkXETEMUIP_cjs.gg(e.package,t)){let o=chunkXETEMUIP_cjs.vg(r.node,i.itemId);o!==null&&a.push({partName:i.partName,nodeId:o});}return a}function za(e,t){let n=e.part.name,r=Ka(e,n,t),a=e.transact(i=>{i.apply({op:"removeContentControl",controlId:t,keepContent:false});for(let o of r)i.applyPackage(s=>chunkXETEMUIP_cjs.ng(s,o.partName,o.nodeId));});return a.ok?{ok:true,change:a.change}:{ok:false,reason:a.reason,...a.detail===void 0?{}:{detail:a.detail}}}function mu(e,t,n){if(!e.parts.has(t)||n.length===0)return {ok:true,pkg:e,removed:[]};let r=e,a=[];for(let i of n){let o=chunkXETEMUIP_cjs.hg(r,t,i);if(!o)continue;let s=chunkXETEMUIP_cjs.ug(r,o.itemId),l=chunkXETEMUIP_cjs.og(r,o.partName,s);if(l.pkg===r&&chunkXETEMUIP_cjs.kg(r,o.partName).some(d=>!s.has(d.id)))return {ok:false,reason:`the payload store for ${i} refused the sweep`};r=l.pkg,a.push(...l.removed);}return {ok:true,pkg:r,removed:a}}var Va=new WeakMap;function Ys(e,t){let n=Va.get(e);n||(n=new Map,Va.set(e,n));let r=n.get(t);if(r)return r;let a=chunkXETEMUIP_cjs.gg(e,t).map(i=>({itemId:i.itemId,nodes:new Map(chunkXETEMUIP_cjs.kg(e,i.partName).map(o=>[o.id,o]))}));return n.set(t,a),a}function uu(e,t,n=t){let r=new Map,a=e.parts.get(t);if(!a)return r;let i=Ys(e,n);if(i.length===0)return r;for(let o of chunkXETEMUIP_cjs.xf(a.root))for(let s of i){let l=chunkXETEMUIP_cjs.vg(o.node,s.itemId);if(l===null)continue;let d=s.nodes.get(l);if(d){r.set(o.node.id,{nodeId:l,label:d.label,data:d.data});break}}return r}function pu(e,t,n){let r=new Map,a=chunkXETEMUIP_cjs.hg(e,t,n);if(!a)return r;for(let i of chunkXETEMUIP_cjs.kg(e,a.partName))r.set(i.id,{label:i.label,data:i.data});return r}var Ga={kind:"body"};function Xa(e,t,n){let r=t.kind==="body"?null:e.resolveStory(t),a=r?.ok?r.store:e.bodyStore(),i=e.currentPackage(),o=a.checkpoint();return a.graftPackage(()=>e.currentPackage()),chunkXETEMUIP_cjs.xa(e,()=>{let s=n(a);return s.ok&&(a.restoreHistoryStacks(o),e.replacePackageShell(a.package),e.adoptPackageUnit(i),e.publishStoryWrite(s.change)),s},s=>chunkXETEMUIP_cjs.ya(s))}function yu(e,t,n=Ga){return Xa(e,n,r=>Wa(r,t,e.bodyStore().part.name))}function xu(e,t,n=Ga){return Xa(e,n,r=>za(r,t))}var Xe="proposed";function qs(e,t){switch(e){case "revisionInsert":case "revisionMoveTo":return t!=="original";case "revisionDelete":case "revisionMoveFrom":return t!=="proposed";default:return false}}var Js=32;function Dn(e,t=Xe){let n=[];return ct(e.children,t,0,n),n}function An(e,t,n,r,a=Xe){let i=[];for(let o of Dn(e,a)){let s=t.get(o.id);if(!s||s.end<=s.start)continue;let l=Math.max(s.start,n),d=Math.min(s.end,r);l>=d||i.push({run:o,start:l,end:d});}return i}function ct(e,t,n,r){if(!(n>=Js)){for(let a of e)if(!(a.kind==="textValue"||a.kind==="paragraphProperties")){if(a.kind==="run"){r.push(a);continue}if(a.kind==="hyperlink"){ct(a.children,t,n+1,r);continue}if(chunkXETEMUIP_cjs.ja(a.kind)){if(!qs(a.kind,t))continue;ct(a.children,t,n+1,r);continue}if(chunkXETEMUIP_cjs.Pc(a)){ct(a.children,t,n+1,r);continue}if(chunkXETEMUIP_cjs.xe(a)){let i=chunkXETEMUIP_cjs.ye(a);i&&ct(i.children,t,n+1,r);continue}}}}var Qs=new Set(chunkXETEMUIP_cjs._e),Un=new Set(chunkXETEMUIP_cjs.Ze);function Eu(e){return Un.has(e)}function Ft(e,t,n){return !e||e.kind==="textValue"?void 0:e.children.find(a=>a.kind===t||a.kind==="generic"&&a.localName===n&&a.namespaceUri===chunkXETEMUIP_cjs.ca)}function Fn(e,t){if(!e||e.kind==="textValue")return [];let n=[];for(let r of e.children){if(r.kind==="textValue"||!t.has(r.localName))continue;let a=chunkXETEMUIP_cjs.J();for(let i of r.attributes)a[i.localName]=i.value;n.push(Object.keys(a).length>0?{localName:r.localName,attributes:a}:{localName:r.localName});}return n}function Cu(e,t){let n=chunkXETEMUIP_cjs.Ca(e,t);return Fn(Ft(n,"paragraphProperties","pPr"),Qs)}function Zs(e,t){let n=chunkXETEMUIP_cjs.Ca(e,t),r=Ft(n,"paragraphProperties","pPr");return Fn(Ft(r,"runProperties","rPr"),Un)}function Ya(e,t){let n=Array.isArray(t)?t:[t],r=new Set(n.map(i=>i.localName));return [...e.filter(i=>!r.has(i.localName)),...n]}var el=new Map([["ascii","asciiTheme"],["hAnsi","hAnsiTheme"],["eastAsia","eastAsiaTheme"],["cs","cstheme"]]);function tl(e,t){let n=e.find(a=>a.localName==="rFonts")?.attributes;if(!n)return t;let r={...n,...t.attributes??{}};for(let a of Object.keys(t.attributes??{})){let i=el.get(a);i&&delete r[i];}return {localName:"rFonts",attributes:r}}function Ln(e){let t=new Map;for(let n of chunkXETEMUIP_cjs.He(e)){let r=n.formatRunIds&&n.formatRunIds.length>0?n.formatRunIds:n.runId?[n.runId]:[];for(let a of r){let i=t.get(a);i?(i.start=Math.min(i.start,n.start),i.end=Math.max(i.end,n.end)):t.set(a,{start:n.start,end:n.end});}}return t}function nl(e){let t=new Set;for(let n of chunkXETEMUIP_cjs.He(e))if(n.formatRunIds)for(let r of n.formatRunIds)t.add(r);return t}function _n(e,t){if(t.localName==="rFonts")return tl(e,t);if(t.localName!=="u")return t;let n=e.find(r=>r.localName==="u")?.attributes;return n?{localName:"u",attributes:{...n,...t.attributes??{}}}:t}function Mu(e,t,n){let r=Zs(e,t),a=Array.isArray(n)?n:[n];return Ya(r,a.map(i=>_n(r,i)))}function rl(e,t){return Array.isArray(t)?t.map(n=>_n(e,n)):_n(e,t)}function Du(e,t,n,r,a,i=Xe){let o=chunkXETEMUIP_cjs.Ca(e,t);if(!o||o.kind!=="paragraph")return [];let s=[],l=nl(o);for(let d of An(o,Ln(o),n,r,i)){let c=Fn(Ft(d.run,"runProperties","rPr"),Un);s.push({start:d.start,end:d.end,properties:Ya(c,rl(c,a)),...l.has(d.run.id)?{targetRunIds:[d.run.id]}:{}});}return s}function Au(e,t,n,r,a=Xe){let i=chunkXETEMUIP_cjs.Ca(e,t);if(!i||i.kind!=="paragraph"||r<=n)return [];let o=[];for(let s of An(i,Ln(i),n,r,a)){let l=o[o.length-1];l&&s.start<=l.end?l.end=Math.max(l.end,s.end):o.push({start:s.start,end:s.end});}return o}function _u(e,t,n,r,a=Xe){let i=chunkXETEMUIP_cjs.Ca(e,t);if(!i||i.kind!=="paragraph")return [];let o=Ln(i),s=[];for(let l of Dn(i,a)){let d=o.get(l.id);if(!d||d.end<=d.start)continue;(r>n?Math.max(d.start,n)<Math.min(d.end,r):d.start<=n&&n<d.end)&&s.push(l);}return s}function $n(e){let t=Ja.get(e.root);if(t)return t;let n=new Map,r=o=>{let s=qa.get(o);if(s){for(let[d,c]of s)n.set(d,c);return}let l=new Map;al(o,l),qa.set(o,l);for(let[d,c]of l)n.set(d,c);},a=(o,s)=>{if(!(o.kind==="textValue"||s>64)){if(o.kind==="paragraph"){r(o);return}for(let l of o.children)a(l,s+1);}};a(e.root,0);let i=(o,s)=>{if(!(o.kind==="textValue"||s>64)){if(o.kind==="paragraph"){let l=Qa.get(o);if(!l){let d=[];Za(o,0,d),l=d,Qa.set(o,l);}for(let[d,c]of l)n.set(d,c);return}if(o.kind==="tableRow"){let l=Lt.get(o);l||(l=ei(o),Lt.set(o,l));for(let[d,c]of l)n.set(d,c);}for(let l of o.children)i(l,s+1);}};return i(e.root,0),Ja.set(e.root,n),n}function Za(e,t,n){if(!(e.kind==="textValue"||t>64)){if(e.kind==="tableRow"){let r=Lt.get(e);r||(r=ei(e),Lt.set(e,r));for(let a of r)n.push(a);}for(let r of e.children)Za(r,t+1,n);}}function ei(e){let t=null,n=(o,s)=>{if(!(t||o.kind==="textValue"||s>64)){if(o.kind==="paragraph"){t=o;return}for(let l of o.children)n(l,s+1);}};if(n(e,0),!t)return ol;let r={paragraphId:t.id,start:0,end:0},a=[],i=(o,s,l)=>{if(o.kind==="textValue"||l>64||o.kind==="paragraph")return;let d=s==="trPr"&&(o.localName==="ins"||o.localName==="del"),c=s==="tcPr"&&(o.localName==="cellIns"||o.localName==="cellDel");(d||c)&&a.push([o.id,r]);for(let u of o.children)i(u,o.localName,l+1);};return i(e,void 0,0),a}var ol=[],qa=new WeakMap,Ja=chunkXETEMUIP_cjs.Mf(8),Lt=new WeakMap,Qa=new WeakMap;function al(e,t){let n=chunkXETEMUIP_cjs.Ie(e),r=(o,s,l,d)=>{if(!(o.kind==="textValue"||d>64)){t.set(o.id,{paragraphId:e.id,start:s,end:l});for(let c of o.children)r(c,s,l,d+1);}},a=(o,s)=>{if(o.kind==="textValue"||s>64)return;let l=n.spanOf(o);if(o.kind==="run"){if(!l)return;t.set(o.id,{paragraphId:e.id,start:l.start,end:l.end});for(let d of o.children)d.kind==="runProperties"&&r(d,l.start,l.end,s+1);return}l&&t.set(o.id,{paragraphId:e.id,start:l.start,end:l.end});for(let d of o.children)a(d,s+1);};for(let o of e.children)o.kind!=="paragraphProperties"&&a(o,0);let i=e.children.find(o=>o.kind==="paragraphProperties");i&&r(i,n.length,n.length,0);}function Bu(e){return `${e.kind}-${e.id}`}function ni(e){return e.kind==="revision"?e.ranges:e.range?[e.range]:[]}function il(e){return ni(e)[0]??null}function Bn(e,t){let n=il(e);if(!n)return Number.MAX_SAFE_INTEGER;let r=t.get(n.start.paragraphId);return r===void 0?Number.MAX_SAFE_INTEGER:r*1e6+Math.min(n.start.offset,999999)}function sl(e,t){let n=t.get(e.start.paragraphId),r=t.get(e.end.paragraphId);return n===void 0||r===void 0?Number.MAX_SAFE_INTEGER:(r-n)*1e6+(e.end.offset-e.start.offset)}var ll=0,dl=1,cl=2;function ml(e,t,n){let r=n.get(t.paragraphId),a=n.get(e.start.paragraphId),i=n.get(e.end.paragraphId);return r===void 0||a===void 0||i===void 0||r<a||r>i||r===a&&t.offset<e.start.offset||r===i&&t.offset>e.end.offset?null:a===i&&e.start.offset===e.end.offset?ll:r===i&&t.offset===e.end.offset?cl:dl}function ul(e,t,n){let r=null;for(let a of ni(e)){let i=ml(a,t,n);if(i===null)continue;let o=sl(a,n);(r===null||i<r.grip||i===r.grip&&o<r.width)&&(r={grip:i,width:o});}return r}var ti={comment:0,custom:1,revision:2};function pl(e,t,n){let r=[];for(let a of e){let i=ul(a,t,n);i!==null&&r.push({item:a,grip:i.grip,width:i.width});}return r.sort((a,i)=>a.grip!==i.grip?a.grip-i.grip:a.width!==i.width?a.width-i.width:a.item.kind!==i.item.kind?ti[a.item.kind]-ti[i.item.kind]:a.item.kind==="revision"&&i.item.kind==="revision"?i.item.nesting-a.item.nesting:0).map(a=>a.item)}function Hu(e,t,n){let a=pl(e,t,n).filter(i=>!(i.kind==="comment"&&i.resolved))[0];return a?a.kind==="comment"?ri(e,a):a:null}function ju(e,t){return ri(e,t)}function ri(e,t){let n=new Map,r=new Map;for(let o of e)o.kind==="comment"?n.set(o.id,o):o.kind==="revision"&&r.set(o.id,o);let a=new Set([t.id]),i=t;for(;i.parentId!==void 0;){let o=n.get(i.parentId);if(!o||a.has(o.id))break;a.add(o.id),i=o;}if(i.parentRevisionId!==void 0){let o=r.get(i.parentRevisionId);if(o)return o}return i}var fl={ins:"insert",del:"delete",moveFrom:"moveFrom",moveTo:"moveTo"};function Qu(e){let t=[],n=r=>{if(r.kind==="textValue"){t.push(r.value);return}for(let a of r.children)n(a);};for(let r of e.blocks)n(r);return t.join("")}function Zu(e){if(e.initials&&e.initials.trim().length>0)return e.initials.trim();let t=e.author.trim().split(/\s+/).filter(Boolean);return t.length===0?"?":t.slice(0,2).map(n=>n[0].toUpperCase()).join("")}function $t(e,t){for(let n of e.attributes)if(n.localName===t&&n.namespaceUri===chunkXETEMUIP_cjs.ca)return n.value}function mt(e){if(e.kind==="textValue")return e.value;if(e.kind==="tab")return " ";if(e.kind==="hardBreak")return chunkXETEMUIP_cjs.Fc(e);if(chunkXETEMUIP_cjs.Nc(e))return "";let t="";for(let n of e.children)t+=mt(n);return t}function Hn(e){return `${e.id}\0${e.author}\0${e.date??""}`}var gl={revisionInsert:"insert",revisionDelete:"delete",revisionMoveFrom:"moveFrom",revisionMoveTo:"moveTo"};function hl(e){let t=e.root.kind!=="paragraph";if(t){let r=oi.get(e.root);if(r&&r.name===e.name)return r.items}let n=yl(e);return t&&oi.set(e.root,{name:e.name,items:n}),n}var oi=chunkXETEMUIP_cjs.Mf(8);function yl(e){let t=chunkXETEMUIP_cjs.yg(e);if(t.length===0)return [];let n=$n(e),r=new Map;for(let i of t){let o=$t(i.node,"id");if(o===void 0)continue;let s=$t(i.node,"author")??"",l=$t(i.node,"author")===void 0,d=$t(i.node,"date"),c=d===void 0?{id:o,author:s}:{id:o,author:s,date:d},u=i.propertyChange?"format":i.paragraphMark?"paragraphMark":gl[i.node.kind]??"structural",m=i.paragraphMark?fl[i.node.localName]:void 0,x=n.get(i.node.id),h=x?{partName:e.name,start:{paragraphId:x.paragraphId,offset:x.start},end:{paragraphId:x.paragraphId,offset:x.end}}:null,P=u==="structural"?`structural\0${Hn(c)}`:`${i.node.localName}\0${Hn(c)}`,f=r.get(P);if(f){h&&!f.ranges.some(k=>k.partName===h.partName&&k.start.paragraphId===h.start.paragraphId&&k.start.offset===h.start.offset&&k.end.paragraphId===h.end.paragraphId&&k.end.offset===h.end.offset)&&f.ranges.push(h),u!=="structural"&&f.revisionKind==="structural"&&(f.revisionKind=u),(u==="insert"&&f.revisionKind==="delete"||u==="delete"&&f.revisionKind==="insert"||f.revisionKind==="replace")&&(f.revisionKind="replace"),f.readOnly||=i.refused||l,i.nesting>f.nesting&&(f.nesting=i.nesting),u==="delete"||u==="moveFrom"?f.deletedText+=mt(i.node):u!=="format"&&u!=="paragraphMark"&&(f.text+=mt(i.node));continue}r.set(P,{address:c,revisionKind:u,...m?{markDirection:m}:{},author:s,...d===void 0?{}:{date:d},text:u==="format"||u==="paragraphMark"||u==="delete"||u==="moveFrom"?"":mt(i.node),deletedText:u==="delete"||u==="moveFrom"?mt(i.node):"",ranges:h?[h]:[],nesting:i.nesting,readOnly:i.refused||l});}let a=[...r.values()].map(i=>({kind:"revision",id:`${i.revisionKind}-${e.name}\0${Hn(i.address)}`,address:i.address,addresses:[i.address],revisionKind:i.revisionKind,...i.markDirection?{markDirection:i.markDirection}:{},author:i.author,...i.date===void 0?{}:{date:i.date},text:i.revisionKind==="replace"?i.text:i.text||i.deletedText,replacedText:i.revisionKind==="replace"?i.deletedText:"",ranges:i.ranges,nesting:i.nesting,readOnly:i.readOnly,replyIds:[]}));return xl(a,jn(e))}function xl(e,t){let n=kl(e),r=n.filter(l=>(l.revisionKind==="insert"||l.revisionKind==="delete")&&!l.readOnly&&l.ranges.length>0),a=new Set,i=new Map,o=new Map;for(let l of r){if(l.revisionKind!=="insert")continue;let d=l.ranges[0].start,c=`${d.paragraphId}\0${d.offset}`,u=o.get(c);u?u.push(l):o.set(c,[l]);}for(let l of r){if(l.revisionKind!=="delete"||a.has(l.id))continue;let d=l.ranges[l.ranges.length-1].end,c=o.get(`${d.paragraphId}\0${d.offset}`)??[],u=c.length>1?[...c].sort((m,x)=>(m.text.length>0?0:1)-(x.text.length>0?0:1)):c;for(let m of u){if(a.has(m.id)||m.author!==l.author)continue;a.add(l.id),a.add(m.id);let x=bl(l.ranges[0],m.ranges[0],t)?l:m,h=Rl(l.date,m.date);i.set(l.id,{...x,id:`replace-${l.id}-${m.id}`,revisionKind:"replace",...h===void 0?{}:{date:h},addresses:Il([...l.addresses,...m.addresses]),text:m.text,replacedText:l.text,ranges:[...l.ranges,...m.ranges],replacedRangeCount:l.ranges.length,readOnly:l.readOnly||m.readOnly});break}}let s=[];for(let l of n){let d=i.get(l.id);if(d){s.push(d);continue}a.has(l.id)||s.push(l);}return s}function kl(e){let t=e.filter(l=>(l.revisionKind==="insert"||l.revisionKind==="delete")&&!l.readOnly&&l.ranges.length>0);if(t.length<2)return e;let n=(l,d)=>`${l.revisionKind}\0${l.author}\0${d.paragraphId}\0${d.offset}`,r=new Map,a=new Set;for(let l of t)r.set(n(l,l.ranges[0].start),l),a.add(n(l,l.ranges[l.ranges.length-1].end));let i=new Set,o=new Map;for(let l of t){if(i.has(l.id)||a.has(n(l,l.ranges[0].start)))continue;let d=[l],c=l;for(;;){let u=r.get(n(c,c.ranges[c.ranges.length-1].end));if(!u||u===c||i.has(u.id))break;i.add(u.id),d.push(u),c=u;}d.length>1&&o.set(l.id,Pl(d));}if(o.size===0)return e;let s=[];for(let l of e)i.has(l.id)||s.push(o.get(l.id)??l);return s}function Pl(e){let t=e[0],n=[...t.addresses],r=[...t.ranges],a=t.text,i=t.date;for(let o of e.slice(1)){for(let s of o.addresses)n.some(l=>mi(l,s))||n.push(s);for(let s of o.ranges)r.push(s);a+=o.text,i=Ol(i,o.date);}return {...t,id:e.map(o=>o.id).join("+"),addresses:n,ranges:r,text:a,...i===void 0?{}:{date:i}}}function Ol(e,t){if(e===void 0)return t;if(t===void 0)return e;let n=Date.parse(e),r=Date.parse(t);return Number.isNaN(n)||Number.isNaN(r)?e:r>n?t:e}function Il(e){let t=[];for(let n of e)t.some(r=>mi(r,n))||t.push(n);return t}function mi(e,t){return e.id===t.id&&e.author===t.author&&(e.date??"")===(t.date??"")}function Rl(e,t){if(t===void 0)return e;if(e===void 0)return t;let n=Date.parse(e),r=Date.parse(t);return Number.isNaN(n)||Number.isNaN(r)?t:n>r?e:t}function bl(e,t,n){let r=n.get(e.start.paragraphId)??0,a=n.get(t.start.paragraphId)??0;return r!==a?r<a:e.start.offset<=t.start.offset}function Nl(e,t,n){let r=new Map(t.map(c=>[c.commentId,c])),a=new Map,i=new Map;for(let c of e)c.paraId&&a.set(c.paraId.toUpperCase(),c),i.set(c.id,c);let o=new Map,s=new Map;for(let c of e){let u=r.get(c.id);if(!u||u.orphaned||u.start.paragraphId===u.end.paragraphId&&u.start.offset===u.end.offset)continue;let m=`${u.start.paragraphId}:${u.start.offset}|${u.end.paragraphId}:${u.end.offset}`;o.has(m)?s.set(c.id,o.get(m)):o.set(m,c.id);}let l=new Map;for(let c of e){let u=c.paraId?n.get(c.paraId.toUpperCase()):void 0,m=u?.parentParaId?a.get(u.parentParaId):void 0,x=c.parentCommentId?i.get(c.parentCommentId):void 0,h=u===void 0?s.get(c.id):void 0,P=h?i.get(h):void 0,f=m??x??P;f&&f.id!==c.id&&l.set(c.id,f.id);}for(let c of [...l.keys()]){let u=new Set([c]),m=l.get(c);for(;m!==void 0;){if(u.has(m)){l.delete(c);break}u.add(m),m=l.get(m);}}let d=new Map;for(let[c,u]of l){let m=d.get(u);m?m.push(c):d.set(u,[c]);}return e.map(c=>{let u=r.get(c.id),m=c.paraId?n.get(c.paraId.toUpperCase()):void 0,x=l.get(c.id);return {kind:"comment",id:c.id,comment:c,range:u?{partName:u.partName,start:u.start,end:u.end}:null,resolved:m?.done??false,...x===void 0?{}:{parentId:x},replyIds:d.get(c.id)??[],orphaned:u===void 0||u.orphaned}})}function ep(e){let t=[e.storyPart],n=new Set([e.storyPart.name]);for(let d of e.furnitureParts??[])n.has(d.name)||(n.add(d.name),t.push(d));let r=e.commentsPart?chunkXETEMUIP_cjs.Pf(e.commentsPart):[],a=e.commentsExtendedPart?chunkXETEMUIP_cjs.Qf(e.commentsExtendedPart):new Map,i=[],o=[],s=t.length===1?jn(t[0]):new Map;for(let d of t){for(let m of hl(d))i.push(m);for(let m of chunkXETEMUIP_cjs.Of(d))o.push(m);if(t.length===1)continue;let c=s,u=c.size;for(let[m,x]of jn(d))c.has(m)||c.set(m,u+x);}return vl([...i,...Nl(r,o,a)]).sort((d,c)=>Bn(d,s)-Bn(c,s))}function ai(e){return `${e.partName}\0${e.start.paragraphId}:${e.start.offset}|${e.end.paragraphId}:${e.end.offset}`}function vl(e){let t=new Map;for(let o of e)if(o.kind==="revision")for(let s of o.ranges??[]){if(s.start.paragraphId===s.end.paragraphId&&s.start.offset===s.end.offset)continue;let l=ai(s),d=o.nesting??0,c=t.get(l);(c===void 0||d>c.nesting)&&t.set(l,{id:o.id,nesting:d});}let n=new Map;for(let o of e)o.kind==="comment"&&o.replyIds&&o.replyIds.length>0&&n.set(o.id,o.replyIds);let r=o=>{let s=[],l=new Set([o]),d=[...n.get(o)??[]];for(;d.length>0;){let c=d.shift();l.has(c)||(l.add(c),s.push(c),d.push(...n.get(c)??[]));}return s},a=new Map,i=new Map;for(let o of e){if(o.kind!=="comment"||o.parentId!==void 0||o.orphaned||!o.range)continue;let s=t.get(ai(o.range))?.id;if(s===void 0)continue;let l=[o.id,...r(o.id)];for(let c of l)i.set(c,s);let d=a.get(s);d?d.push(...l):a.set(s,l);}return e.map(o=>{if(o.kind==="revision"){let s=a.get(o.id)??[];return s.length===0&&(o.replyIds??[]).length===0?o:{...o,replyIds:s}}if(o.kind==="comment"){let s=i.get(o.id);if(s===void 0){if(o.parentRevisionId===void 0)return o;let{parentRevisionId:l,...d}=o;return d}return o.parentRevisionId===s?o:{...o,parentRevisionId:s}}return o})}function jn(e){let t=ii.get(e.root);if(t)return t;let n=new Map,r=(a,i)=>{if(!(a.kind==="textValue"||i>64)){if(a.kind==="paragraph"){n.has(a.id)||n.set(a.id,n.size);return}if(a.kind==="table"){let o=ci.get(a);if(!o){let s=[],l=(d,c)=>{if(!(d.kind==="textValue"||c>64)){if(d.kind==="paragraph"){s.push(d.id);return}for(let u of d.children)l(u,c+1);}};for(let d of a.children)l(d,0);o=s,ci.set(a,o);}for(let s of o)n.has(s)||n.set(s,n.size);return}for(let o of a.children)r(o,i+1);}};return r(e.root,0),ii.set(e.root,n),n}var ii=chunkXETEMUIP_cjs.Mf(8);function tp(e){let t=di.get(e.root);if(t)return t;let n=new Map;for(let r of ui(e.root,0))n.has(r)||n.set(r,n.size);return di.set(e.root,n),n}var si=Object.freeze([]),li=new WeakMap;function ui(e,t){if(e.kind==="textValue"||t>64)return si;let n=li.get(e);if(n&&n.depth===t)return n.ids;let r=null;e.kind==="paragraph"&&(r??=[]).push(e.id);for(let i of e.children){let o=ui(i,t+1);if(o.length!==0){r??=[];for(let s of o)r.push(s);}}let a=r??si;return li.set(e,{depth:t,ids:a}),a}var di=chunkXETEMUIP_cjs.Mf(8),ci=new WeakMap;var op=256,ap=2e3,pi=/[\p{L}\p{N}_]/u;function fi(e){let t=e.toLowerCase();if(t.length===e.length)return t;let n="";for(let r=0;r<e.length;r+=1){let a=e[r],i=a.toLowerCase();n+=i.length===1?i:a;}return n}function Sl(e,t,n){let r=t>0?e[t-1]:void 0,a=n<e.length?e[n]:void 0;return !(r!==void 0&&pi.test(r)||a!==void 0&&pi.test(a))}function Tl(e){return typeof e=="string"&&e.length>0&&e.length<=256}function ip(e,t,n,r={}){let a={matches:[],truncated:false};if(!Tl(t)||e.length===0||n<=0)return a;let i=r.matchCase===true,o=r.wholeWord===true,s=i?t:fi(t),l=i?e:fi(e),d=Math.max(0,r.from??0),c=Math.min(e.length,r.to??e.length),u=[],m=l.indexOf(s,d);for(;m>=0;){let x=m+s.length;if(x>c)return {matches:u,truncated:false};if(!o||Sl(e,m,x)){if(u.length>=n)return {matches:u,truncated:true};u.push({start:m,length:s.length});}m=l.indexOf(s,x);}return {matches:u,truncated:false}}
|
|
2
|
-
exports.$=yu;exports.A=Od;exports.Aa=Hu;exports.B=Mo;exports.Ba=ju;exports.C=Ji;exports.Ca=Qu;exports.D=Do;exports.Da=Zu;exports.E=Ve;exports.Ea=hl;exports.F=Es;exports.Fa=Nl;exports.G=Ra;exports.Ga=ep;exports.H=va;exports.Ha=vl;exports.I=Sa;exports.Ia=jn;exports.J=Rn;exports.Ja=tp;exports.K=Sm;exports.Ka=op;exports.L=ba;exports.La=ap;exports.M=Ba;exports.Ma=fi;exports.N=Ha;exports.Na=Sl;exports.O=Ym;exports.Oa=Tl;exports.P=qm;exports.Pa=ip;exports.Q=Jm;exports.R=ru;exports.S=ou;exports.T=au;exports.U=zs;exports.V=Gs;exports.W=Wa;exports.X=za;exports.Y=mu;exports.Z=uu;exports._=pu;exports.a=td;exports.aa=xu;exports.b=nd;exports.ba=Xe;exports.c=rd;exports.ca=Dn;exports.d=od;exports.da=An;exports.e=ad;exports.ea=Qs;exports.f=id;exports.fa=Un;exports.g=Ai;exports.ga=Eu;exports.h=_i;exports.ha=Ft;exports.i=sd;exports.ia=Fn;exports.j=ld;exports.ja=Cu;exports.k=dd;exports.ka=Zs;exports.l=Be;exports.la=Ya;exports.m=cd;exports.ma=tl;exports.n=md;exports.na=Ln;exports.o=ud;exports.oa=nl;exports.p=ye;exports.pa=_n;exports.q=xo;exports.qa=Mu;exports.r=pd;exports.ra=Du;exports.s=fd;exports.sa=Au;exports.t=gd;exports.ta=_u;exports.u=hd;exports.ua=$n;exports.v=ji;exports.va=Bu;exports.w=yd;exports.wa=ni;exports.x=xd;exports.xa=il;exports.y=kd;exports.ya=Bn;exports.z=Pd;exports.za=pl;
|